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 745118 - window-wayland: Set transient and window type on manage() for popups
window-wayland: Set transient and window type on manage() for popups
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 738366 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-02-24 20:07 UTC by Rui Matos
Modified: 2015-05-04 17:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland-surface: Keep a reference to a popup's parent surface (2.86 KB, patch)
2015-02-24 20:07 UTC, Rui Matos
committed Details | Review
window-wayland: Set transient and window type on manage() for popups (1.90 KB, patch)
2015-02-24 20:07 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2015-02-24 20:07:33 UTC
Something I noticed while looking at bug 745064
Comment 1 Rui Matos 2015-02-24 20:07:37 UTC
Created attachment 297818 [details] [review]
wayland-surface: Keep a reference to a popup's parent surface

This will allows us to access the parent while constructing the
MetaWindow.
Comment 2 Rui Matos 2015-02-24 20:07:42 UTC
Created attachment 297819 [details] [review]
window-wayland: Set transient and window type on manage() for popups

Doing this on manage() allows the common MetaWindow initialization to
do the right thing for popups like setting skip_taskbar and
skip_pager.

In particular this avoids gnome-shell's app tracker to create a new
ShellApp instance for every popup.
Comment 3 Jonas Ådahl 2015-02-25 06:08:32 UTC
Review of attachment 297818 [details] [review]:

::: src/wayland/meta-wayland-surface.c
@@ +1056,3 @@
+  surface->popup.parent = NULL;
+
+  destroy_window (surface);

Don't really need to destroy the window here, as we just killed the client with the above wl_resource_post_error (which is a good catch on its own btw, we didn't detect when the top level surface was destroyed with active popups before) so everything will be cleaned up anyway.
Comment 4 Jasper St. Pierre (not reading bugmail) 2015-02-25 06:10:01 UTC
Setting the transient / type *should* work at any time, so this shouldn't change behavior, just clean it up slightly.
Comment 5 Rui Matos 2015-02-25 10:58:01 UTC
(In reply to Jasper St. Pierre from comment #4)
> Setting the transient / type *should* work at any time, so this shouldn't
> change behavior, just clean it up slightly.

Yes, I never said it didn't work. This is an optimization, if you will, which avoids doing extra work in gnome-shell's app tracker (and possibly elsewhere?)
Comment 6 Jasper St. Pierre (not reading bugmail) 2015-02-25 16:41:01 UTC
OK, I just wanted to make sure it didn't fix the bug you mentioned in the description. Both are fine in that case.
Comment 7 Rui Matos 2015-02-25 17:28:52 UTC
Ok, pushing with the destroy_window() since the
handle_popup_destroyed() below also calls it while arguably not
needing to either. I can't see how it could hurt anyway so let's keep
it consistent.

Attachment 297818 [details] pushed as 59f348e - wayland-surface: Keep a reference to a popup's parent surface
Attachment 297819 [details] pushed as 438410c - window-wayland: Set transient and window type on manage() for popups
Comment 8 Jonas Ådahl 2015-02-26 01:17:51 UTC
(In reply to Rui Matos from comment #7)
> Ok, pushing with the destroy_window() since the
> handle_popup_destroyed() below also calls it while arguably not
> needing to either. I can't see how it could hurt anyway so let's keep
> it consistent.

In handle_popup_destroyed() it is actually needed because the compositor may dismiss a whole popup chain, and should not need to wait for wl_surface.destroy or xdg_popup.destroy to destroy the window.

> 
> Attachment 297818 [details] pushed as 59f348e - wayland-surface: Keep a
> reference to a popup's parent surface
> Attachment 297819 [details] pushed as 438410c - window-wayland: Set
> transient and window type on manage() for popups
Comment 9 Rui Matos 2015-05-04 17:19:26 UTC
*** Bug 738366 has been marked as a duplicate of this bug. ***