gdkwindow: Specify some invariants for cursors

Cursors should not be on a different display than their window /
device, as that would break Wayland.
This commit is contained in:
Jasper St. Pierre 2014-10-27 21:18:15 -07:00
parent 168a49426e
commit 52e3b88382

View File

@ -6015,6 +6015,9 @@ gdk_window_set_cursor_internal (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
g_assert (gdk_window_get_display (window) == gdk_device_get_display (device));
g_assert (!cursor || gdk_window_get_display (window) == gdk_cursor_get_display (cursor));
if (window->window_type == GDK_WINDOW_ROOT ||
window->window_type == GDK_WINDOW_FOREIGN)
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_device_cursor (window, device, cursor);