From 32047fd66c796fe837168ce2ac6677aa0d2b20b4 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 21 Sep 2003 17:17:19 +0000 Subject: [PATCH] export if the keyboard and pointer are currently grabbed or not --- openbox/grab.c | 15 ++++++++++++--- openbox/grab.h | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/openbox/grab.c b/openbox/grab.c index de2efd9a..a53fe5e8 100644 --- a/openbox/grab.c +++ b/openbox/grab.c @@ -32,10 +32,21 @@ /*! A list of all possible combinations of keyboard lock masks */ static unsigned int mask_list[MASK_LIST_SIZE]; +static guint kgrabs = 0; +static guint pgrabs = 0; + +gboolean grab_on_keyboard() +{ + return kgrabs > 0; +} + +gboolean grab_on_pointer() +{ + return pgrabs > 0; +} gboolean grab_keyboard(gboolean grab) { - static guint kgrabs = 0; gboolean ret = FALSE; if (grab) { @@ -56,7 +67,6 @@ gboolean grab_keyboard(gboolean grab) gboolean grab_pointer(gboolean grab, ObCursor cur) { - static guint pgrabs = 0; gboolean ret = FALSE; if (grab) { @@ -77,7 +87,6 @@ gboolean grab_pointer(gboolean grab, ObCursor cur) gboolean grab_pointer_window(gboolean grab, ObCursor cur, Window win) { - static guint pgrabs = 0; gboolean ret = FALSE; if (grab) { diff --git a/openbox/grab.h b/openbox/grab.h index 5803463a..a84f0825 100644 --- a/openbox/grab.h +++ b/openbox/grab.h @@ -32,6 +32,9 @@ gboolean grab_pointer(gboolean grab, ObCursor cur); gboolean grab_pointer_window(gboolean grab, ObCursor cur, Window win); gint grab_server(gboolean grab); +gboolean grab_on_keyboard(); +gboolean grab_on_pointer(); + void grab_button(guint button, guint state, Window win, guint mask); void grab_button_full(guint button, guint state, Window win, guint mask, int pointer_mode, ObCursor cursor); -- 2.45.2