mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-06 00:30:08 +00:00
Fix performance issue with find_native_sibling_above
It keep recursing a lot, unnecessary
This commit is contained in:
parent
b298ebc415
commit
e718893611
@ -693,8 +693,8 @@ _gdk_window_update_size (GdkWindow *window)
|
||||
* If child is NULL, find lowest native window in parent.
|
||||
*/
|
||||
static GdkWindowObject *
|
||||
find_native_sibling_above (GdkWindowObject *parent,
|
||||
GdkWindowObject *child)
|
||||
find_native_sibling_above_helper (GdkWindowObject *parent,
|
||||
GdkWindowObject *child)
|
||||
{
|
||||
GdkWindowObject *w;
|
||||
GList *l;
|
||||
@ -714,12 +714,27 @@ find_native_sibling_above (GdkWindowObject *parent,
|
||||
|
||||
if (gdk_window_has_impl (w))
|
||||
return w;
|
||||
|
||||
w = find_native_sibling_above (w, NULL);
|
||||
|
||||
g_assert (parent != w);
|
||||
w = find_native_sibling_above_helper (w, NULL);
|
||||
if (w)
|
||||
return w;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static GdkWindowObject *
|
||||
find_native_sibling_above (GdkWindowObject *parent,
|
||||
GdkWindowObject *child)
|
||||
{
|
||||
GdkWindowObject *w;
|
||||
|
||||
w = find_native_sibling_above_helper (parent, child);
|
||||
if (w)
|
||||
return w;
|
||||
|
||||
if (gdk_window_has_impl (parent))
|
||||
return NULL;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user