summaryrefslogtreecommitdiff
path: root/src/bindings.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-24 09:25:03 +0000
committerDana Jansens <danakj@orodu.net>2003-01-24 09:25:03 +0000
commit084d6f4e42396a5d2baf72877b5abf3ae6fef7be (patch)
tree26e017f1eee3c248b89151897d5faa7cd3df65cf /src/bindings.cc
parent91c7e5c378b1a639c6f5383915ed68b36b7735d4 (diff)
some intermediate stage. stacked focus cycling is very broken. dont try it. going to have to change how the python stuff works i think!
Diffstat (limited to 'src/bindings.cc')
-rw-r--r--src/bindings.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/bindings.cc b/src/bindings.cc
index c5a9f896..aa9c288d 100644
--- a/src/bindings.cc
+++ b/src/bindings.cc
@@ -372,15 +372,21 @@ void Bindings::grabKeys(bool grab)
}
-bool Bindings::grabKeyboard(PyObject *callback)
+bool Bindings::grabKeyboard(int screen, PyObject *callback)
{
assert(callback);
if (_keybgrab_callback) return false; // already grabbed
+
+ int i;
+ for (i = 0; i < openbox->screenCount(); ++i)
+ if (openbox->screen(screen)->number() == screen)
+ break;
+ if (i >= openbox->screenCount())
+ return false; // couldn't find the screen.. it's not managed
- int screen = openbox->screen(0)->number();
- Window root = otk::display->screenInfo(screen)->rootWindow();
+ Window root = otk::display->screenInfo(i)->rootWindow();
if (XGrabKeyboard(**otk::display, root, false, GrabModeAsync,
- GrabModeAsync, CurrentTime))
+ GrabModeSync, CurrentTime))
return false;
printf("****GRABBED****\n");
_keybgrab_callback = callback;
@@ -563,7 +569,7 @@ void Bindings::grabButtons(bool grab, Client *client)
void Bindings::fireButton(MouseData *data)
{
if (data->context == MC_Window) {
- // Replay the event, so it goes to the client, and ungrab the device.
+ // Replay the event, so it goes to the client
XAllowEvents(**otk::display, ReplayPointer, data->time);
}