After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774330 - Possible warnings around meta_display_(un)register_x_window if user time window is reused
Possible warnings around meta_display_(un)register_x_window if user time wind...
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-11-12 16:39 UTC by Carlos Garnacho
Modified: 2016-11-15 16:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
x11: Double check whether the user time window was previously used (1.88 KB, patch)
2016-11-12 16:40 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2016-11-12 16:39:46 UTC
Trying the Steam client under Wine on gnome-shell, I see that moving the pointer around to get menus popped up trigger warnings around meta_display_(un)register_x_window.

AFAICS this is because wine reuses the same X window as NET_WM_USER_TIME_WINDOW across different toplevels, if another toplevel registers the same window before a previous toplevel gave it up, the hack in reload_net_wm_user_time_window() to register the window in the XIDs hashtable so we get property changes will find the window is already registered by the previous toplevel, so the window will fail to be registered a second time.

And this will also trigger warnings when unregistering the window, because we now have two MetaWindows with it as the user time window, but it's just being registered with one.

So in order to complete the hack, it seems we need to look up whether the user time window was previously used by someone else, and unregister + unset from the previous owner, so it can be registered successfully.

Patch coming.
Comment 1 Carlos Garnacho 2016-11-12 16:40:42 UTC
Created attachment 339700 [details] [review]
x11: Double check whether the user time window was previously used

Some applications like Wine may choose to juggle the same user time
window across different toplevels, in that case we receive warnings
when trying to register the window a second time, leading to wrong
accounting.

If the window was already used as the user time window for another
toplevel, unset it from the previous MetaWindow owner, and unregister
so the registration with the new MetaWindow is successful.
Comment 2 Rui Matos 2016-11-15 16:20:16 UTC
Review of attachment 339700 [details] [review]:

looks good
Comment 3 Carlos Garnacho 2016-11-15 16:38:50 UTC
Cheers :). Pushed to master.

Attachment 339700 [details] pushed as ae73e9d - x11: Double check whether the user time window was previously used