gdkevents-x11: look up the atom of a window manager hint once, not once per supported hint

This commit is contained in:
Daemonratte 2026-10-16 14:25:08 +02:00
commit 3124dc081b
No known key found for this signature in database

View file

@ -2888,6 +2888,7 @@ gdk_x11_screen_supports_net_wm_hint (GdkScreen *screen,
GdkScreenX11 *screen_x11;
NetWmSupportedAtoms *supported_atoms;
GdkDisplay *display;
Atom atom;
g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
@ -2939,13 +2940,12 @@ gdk_x11_screen_supports_net_wm_hint (GdkScreen *screen,
if (supported_atoms->atoms == NULL)
return FALSE;
i = 0;
while (i < supported_atoms->n_atoms)
{
if (supported_atoms->atoms[i] == gdk_x11_atom_to_xatom_for_display (display, property))
return TRUE;
atom = gdk_x11_atom_to_xatom_for_display (display, property);
++i;
for (i = 0; i < supported_atoms->n_atoms; i++)
{
if (supported_atoms->atoms[i] == atom)
return TRUE;
}
return FALSE;