Commit f8b017fa authored by Benjamin Otte's avatar Benjamin Otte

x11: Simplify code for single-screen case

parent b3158686
......@@ -450,7 +450,7 @@ gdk_x11_device_core_window_at_position (GdkDevice *device,
}
else
{
gint i, screens, width, height;
gint width, height;
GList *toplevels, *list;
Window pointer_window, root, child;
int rootx = -1, rooty = -1;
......@@ -459,11 +459,7 @@ gdk_x11_device_core_window_at_position (GdkDevice *device,
/* FIXME: untrusted clients case not multidevice-safe */
pointer_window = None;
screens = gdk_display_get_n_screens (display);
for (i = 0; i < screens; ++i)
{
screen = gdk_display_get_screen (display, i);
screen = gdk_display_get_screen (display, 0);
toplevels = gdk_screen_get_toplevel_windows (screen);
for (list = toplevels; list != NULL; list = g_list_next (list))
{
......@@ -508,9 +504,6 @@ gdk_x11_device_core_window_at_position (GdkDevice *device,
}
g_list_free (toplevels);
if (pointer_window != None)
break;
}
xwindow = pointer_window;
}
......
......@@ -512,17 +512,14 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
}
else
{
gint i, screens, width, height;
gint width, height;
GList *toplevels, *list;
Window pointer_window, root, child;
/* FIXME: untrusted clients case not multidevice-safe */
pointer_window = None;
screens = gdk_display_get_n_screens (display);
for (i = 0; i < screens; ++i)
{
screen = gdk_display_get_screen (display, i);
screen = gdk_display_get_screen (display, 0);
toplevels = gdk_screen_get_toplevel_windows (screen);
for (list = toplevels; list != NULL; list = g_list_next (list))
{
......@@ -578,7 +575,6 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
break;
}
}
}
g_list_free (toplevels);
if (pointer_window != None)
......
......@@ -478,12 +478,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
if (xevent->type == DestroyNotify && !is_substructure)
{
int i, n;
n = gdk_display_get_n_screens (display);
for (i = 0; i < n; i++)
{
screen = gdk_display_get_screen (display, i);
screen = GDK_X11_DISPLAY (display)->screen;
x11_screen = GDK_X11_SCREEN (screen);
if (x11_screen->wmspec_check_window == xevent->xdestroywindow.window)
......@@ -500,7 +495,6 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
goto done;
}
}
}
/* We do a "manual" conversion of the XEvent to a
* GdkEvent. The structures are mostly the same so
......
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