Commit 4c69dabb authored by Matthias Clasen's avatar Matthias Clasen

Don't return GDK_GRAB_SUCCESS on failure

That seems ... counterproductive.
parent d1dcac85
......@@ -1291,8 +1291,8 @@ gdk_device_grab (GdkDevice *device,
GdkGrabStatus res;
GdkWindow *native;
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_SUCCESS);
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_SUCCESS);
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_FAILED);
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
native = gdk_window_get_toplevel (window);
......
......@@ -310,6 +310,7 @@ typedef enum
* @GDK_GRAB_NOT_VIEWABLE: the grab window or the @confine_to window are not
* viewable.
* @GDK_GRAB_FROZEN: the resource is frozen by an active grab of another client.
* @GDK_GRAB_FAILED: the grab failed for some other reason.
*
* Returned by gdk_device_grab(), gdk_pointer_grab() and gdk_keyboard_grab() to
* indicate success or the reason for the failure of the grab attempt.
......@@ -320,7 +321,8 @@ typedef enum
GDK_GRAB_ALREADY_GRABBED = 1,
GDK_GRAB_INVALID_TIME = 2,
GDK_GRAB_NOT_VIEWABLE = 3,
GDK_GRAB_FROZEN = 4
GDK_GRAB_FROZEN = 4,
GDK_GRAB_FAILED = 5
} GdkGrabStatus;
/**
......
......@@ -8000,9 +8000,9 @@ gdk_pointer_grab (GdkWindow * window,
gulong serial;
GList *devices, *dev;
g_return_val_if_fail (window != NULL, 0);
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), 0);
g_return_val_if_fail (window != NULL, GDK_GRAB_FAILED);
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), GDK_GRAB_FAILED);
/* We need a native window for confine to to work, ensure we have one */
if (confine_to)
......@@ -8112,7 +8112,7 @@ gdk_keyboard_grab (GdkWindow *window,
gulong serial;
GList *devices, *dev;
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
/* Non-viewable client side window => fail */
if (!_gdk_window_has_impl (window) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment