GNOME Bugzilla – Bug 774333
Some Wine games start out minimized
Last modified: 2016-11-15 17:41:22 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.
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.
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
(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.
Attachment 339703 [details] pushed as be5c2eb - x11: Unminimize windows with initial IconicState if first known on MapRequest