+/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
+
+ grab.c for the Openbox window manager
+ Copyright (c) 2003 Ben Jansens
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ See the COPYING file for a copy of the GNU General Public License.
+*/
+
+#include "grab.h"
#include "openbox.h"
#include "event.h"
#include "xerror.h"
+#include "screen.h"
#include <glib.h>
#include <X11/Xlib.h>
if (grab) {
if (pgrabs++ == 0)
- ret = XGrabPointer(ob_display, RootWindow(ob_display, ob_screen),
+ ret = XGrabPointer(ob_display, screen_support_win,
False, GRAB_PTR_MASK, GrabModeAsync,
GrabModeAsync, FALSE,
ob_cursor(cur), event_lasttime) == Success;
return ret;
}
-int grab_server(gboolean grab)
+gint grab_server(gboolean grab)
{
static guint sgrabs = 0;
if (grab) {
return sgrabs;
}
-void grab_startup()
+void grab_startup(gboolean reconfig)
{
guint i = 0;
+ if (reconfig) return;
+
mask_list[i++] = 0;
mask_list[i++] = LockMask;
mask_list[i++] = NumLockMask;
g_assert(i == MASK_LIST_SIZE);
}
-void grab_shutdown()
+void grab_shutdown(gboolean reconfig)
{
+ if (reconfig) return;
+
while (grab_keyboard(FALSE));
while (grab_pointer(FALSE, OB_CURSOR_NONE));
while (grab_pointer_window(FALSE, OB_CURSOR_NONE, None));