diff options
author | Tim Janik <timj@src.gnome.org> | 1998-01-21 08:35:37 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-01-21 08:35:37 +0000 |
commit | 5e517e426c744d2dff04a3eeaf5fa55df8bad3a1 (patch) | |
tree | 2be6ba4c21bcf6fea072dcff8fce04d4a68860c3 /gdk | |
parent | 325dc92ad470909fba60584f844498bcb40dd9ae (diff) | |
download | gtk+-5e517e426c744d2dff04a3eeaf5fa55df8bad3a1.tar.gz |
new function gdk_pointer_is_grabbed(). extremely simple ;)
-timj
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdk.c | 32 | ||||
-rw-r--r-- | gdk/gdk.h | 2 | ||||
-rw-r--r-- | gdk/x11/gdkmain-x11.c | 32 |
3 files changed, 62 insertions, 4 deletions
@@ -204,6 +204,9 @@ static GdkWindow *button_window[2]; /* The last 2 windows to rec */ static guint button_number[2]; /* The last 2 buttons to be pressed. */ +static gboolean pointer_is_grabbed = FALSE; /* Boolean value of wether the there is + * an active x pointer grab in effect + */ #ifdef USE_XIM static gint xim_using; /* using XIM Protocol if TRUE */ @@ -1272,7 +1275,7 @@ gdk_pointer_grab (GdkWindow * window, time); else return_val = Success;; - + if (return_val == Success) return_val = XGrabPointer (window_private->xdisplay, xwindow, @@ -1282,7 +1285,10 @@ gdk_pointer_grab (GdkWindow * window, xconfine_to, xcursor, time); - + + if (return_val == GrabSuccess) + pointer_is_grabbed = TRUE; + return return_val; } @@ -1308,6 +1314,28 @@ gdk_pointer_ungrab (guint32 time) gdk_input_vtable.ungrab_pointer (time); XUngrabPointer (gdk_display, time); + pointer_is_grabbed = FALSE; +} + +/* + *-------------------------------------------------------------- + * gdk_pointer_is_grabbed + * + * Tell wether there is an active x pointer grab in effect + * + * Arguments: + * + * Results: + * + * Side effects: + * + *-------------------------------------------------------------- + */ + +gint +gdk_pointer_is_grabbed (void) +{ + return pointer_is_grabbed; } /* @@ -81,6 +81,8 @@ gint gdk_keyboard_grab (GdkWindow * window, guint32 time); void gdk_keyboard_ungrab (guint32 time); +gint gdk_pointer_is_grabbed (void); + gint gdk_screen_width (void); gint gdk_screen_height (void); diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index 6ab60dc600..5e1351ebf1 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -204,6 +204,9 @@ static GdkWindow *button_window[2]; /* The last 2 windows to rec */ static guint button_number[2]; /* The last 2 buttons to be pressed. */ +static gboolean pointer_is_grabbed = FALSE; /* Boolean value of wether the there is + * an active x pointer grab in effect + */ #ifdef USE_XIM static gint xim_using; /* using XIM Protocol if TRUE */ @@ -1272,7 +1275,7 @@ gdk_pointer_grab (GdkWindow * window, time); else return_val = Success;; - + if (return_val == Success) return_val = XGrabPointer (window_private->xdisplay, xwindow, @@ -1282,7 +1285,10 @@ gdk_pointer_grab (GdkWindow * window, xconfine_to, xcursor, time); - + + if (return_val == GrabSuccess) + pointer_is_grabbed = TRUE; + return return_val; } @@ -1308,6 +1314,28 @@ gdk_pointer_ungrab (guint32 time) gdk_input_vtable.ungrab_pointer (time); XUngrabPointer (gdk_display, time); + pointer_is_grabbed = FALSE; +} + +/* + *-------------------------------------------------------------- + * gdk_pointer_is_grabbed + * + * Tell wether there is an active x pointer grab in effect + * + * Arguments: + * + * Results: + * + * Side effects: + * + *-------------------------------------------------------------- + */ + +gint +gdk_pointer_is_grabbed (void) +{ + return pointer_is_grabbed; } /* |