summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-21 17:17:19 +0000
committerDana Jansens <danakj@orodu.net>2003-09-21 17:17:19 +0000
commit32047fd66c796fe837168ce2ac6677aa0d2b20b4 (patch)
tree7fd1ce89fbb717af1a0e48ccfbe5636cd84d05be
parent087ea0e5cb678d6a2339992c56f83482273fa7d6 (diff)
export if the keyboard and pointer are currently grabbed or not
-rw-r--r--openbox/grab.c15
-rw-r--r--openbox/grab.h3
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);