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 774333 - Some Wine games start out minimized
Some Wine games start out minimized
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 17:21 UTC by Carlos Garnacho
Modified: 2016-11-15 17:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
x11: Unminimize windows with initial IconicState if first known on MapRequest (2.70 KB, patch)
2016-11-12 17:22 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2016-11-12 17:21:58 UTC
Testing Xwayland pointer locking/confinement on Wine games, I found that some games would start up minimized, although this also happens on X11.

What it seems to happen is that:
1) Wine sets up initial IconicState on the window, presumably because WS_MINIMIZE was requested in win32 api
2) The app requests being mapped soon after
3) The toplevel window is first known by mutter when dealing with the MapRequest event
4) At this point it's seen with iconic initial state, and is thus minimized
5) The map request handling code only bothers unminimizing in the else branch, that is, if the window was earlier known. This makes the window go minimized after the MapRequest event.

What I *think* should happen is that the MapRequest code goes through the unminimize path even if the window is first known here, and indeed seems to fix the cases I've seen. I'm attaching a patch for this.
Comment 1 Carlos Garnacho 2016-11-12 17:22:37 UTC
Created attachment 339703 [details] [review]
x11: Unminimize windows with initial IconicState if first known on MapRequest

In that case, the MetaWindow is created, but it should also be unminimized
to satisfy the MapRequest triggered by the client, otherwise these would
stay minimized until they're shown explicitly by the user.
Comment 2 Rui Matos 2016-11-15 16:53:23 UTC
Review of attachment 339703 [details] [review]:

other than that, looks good

::: src/x11/events.c
@@ +1385,3 @@
+                    window->desc, window->mapped, window->minimized);
+
+      if (window->minimized)

meta_window_x11_new() might still fail though, so this needs to check if window != NULL
Comment 3 Carlos Garnacho 2016-11-15 17:22:29 UTC
(In reply to Rui Matos from comment #2)
> Review of attachment 339703 [details] [review] [review]:
> 
> other than that, looks good
> 
> ::: src/x11/events.c
> @@ +1385,3 @@
> +                    window->desc, window->mapped, window->minimized);
> +
> +      if (window->minimized)
> 
> meta_window_x11_new() might still fail though, so this needs to check if
> window != NULL

Uh, failed to notice that :). Well spotted, will push after fixing.
Comment 4 Carlos Garnacho 2016-11-15 17:41:18 UTC
Attachment 339703 [details] pushed as be5c2eb - x11: Unminimize windows with initial IconicState if first known on MapRequest