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 660847 - Track new _NET_WM atom to unredirect windows (esp. games in Wine)
Track new _NET_WM atom to unredirect windows (esp. games in Wine)
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
3.2.x
Other Linux
: Normal major
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-04 01:09 UTC by Diego Escalante Urrelo (not reading bugmail)
Modified: 2014-12-29 03:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Diego Escalante Urrelo (not reading bugmail) 2011-10-04 01:09:33 UTC
When running Warcraft3 (fact: using its opengl mode) under wine I get very bad regressions on performance when using gnome-shell 3.2.0

In the past, performance was almost the same as with metacity, but now it's really bad, on unscientific terms... "half of it"?

I recall reading lots of mentions to changes to speedup fullscren opengl apps, so I thought this is reasonably an unintended regression. Happy to test, but I'm clueless about where this work was done, if it was.

Major because it's a performance regression, not because I really like Warcraft :^)
Comment 1 Sven Arvidsson 2012-01-07 15:05:42 UTC
Bug 647455 could probably be marked as a duplicate of this one. Technically I think this bug belongs to Mutter, not g-s.

Warcraft3, and a lot of other Wine game,s suffers a great deal from this bug. gnome-shell will happily use 100% CPU resulting in terrible lag.

This problem can be worked around by using winecfg and in the Graphics tab unchecking "Allow the window manager to control the windows". By unchecking this option CPU usage of g-s drops down to normal background levels. This does not work with all games though, in some cases it will result in keyboard input being sent to some other application.

Not all Wine games are affected by this bug, for example Bioshock and Call of Duty 4 seems to work fine.

An uneducated guess is that whatever heuristic g-s/Mutter uses to detect and unredirect fullscreen apps has a bug? There's also some comments in this Wine bug about inoperabilites between Wine and Mutter but I'm not sure what to make of it: http://bugs.winehq.org/show_bug.cgi?id=29371
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-01-07 20:22:19 UTC
What version of mutter are you using?
Comment 3 Sven Arvidsson 2012-01-07 20:33:56 UTC
I'm using 3.2.1
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-01-07 21:18:55 UTC
We only try to unredirect override-windows. See bug #597014 for the initial rationale. Unfortunately, it seems that wine only creates an override-redirect window when the "managed" option ("Allow the window manager to control the windows") is enabled:

    http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/winex11.drv/window.c#l299

The proper way to fix this would be to add a new standardized atom saying that a window should be unredirected.
Comment 5 Sven Arvidsson 2012-01-07 22:01:16 UTC
Thanks for the explanation! So it seems that the KDE devs have already suggested and implemented something like that: http://bugs.winehq.org/show_bug.cgi?id=19376#c16

(Funny that some games seems immune to this, even though their window isn't set as override-redirect according to xwininfo...)

Anyway, maybe this bug can be retitled to track the support of such an atom to Mutter?
Comment 6 Sven Arvidsson 2012-01-09 15:08:05 UTC
Just in case others with the same problem finds this bug report. The change to Mutter to unredirect all fullscreen windows is really small:

--- mutter-3.2.1.orig/src/compositor/meta-window-actor.c
+++ mutter-3.2.1/src/compositor/meta-window-actor.c
@@ -1219,7 +1219,7 @@ meta_window_actor_should_unredirect (Met
   MetaScreen *screen = meta_window_get_screen (metaWindow);
   MetaWindowActorPrivate *priv = self->priv;
 
-  if (meta_window_is_override_redirect (metaWindow) && priv->opacity == 0xff && !priv->argb32)
+  if (priv->opacity == 0xff && !priv->argb32)
     {
       int screen_width, screen_height;
       MetaRectangle window_rect;
Comment 7 Sven Arvidsson 2012-07-20 21:05:24 UTC
I don't really know what has changed, but in GNOME 3.4, this doesn't seem to be a problem any longer. There doesn't seem to be a big performance penalty when running games, be it fullscreen or in a window. 

Even Warcraft 3 which was particularly bad in previous versions behave very well now.
Comment 8 Jasper St. Pierre (not reading bugmail) 2014-12-29 03:26:03 UTC
We implemented unredirection.