http://bugs.winehq.org/show_bug.cgi?id=19376
Summary: Suspend kwin's compositing when starting a 3D application Product: Wine Version: unspecified Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: kde@martin-graesslin.com
KDE bug https://bugs.kde.org/show_bug.cgi?id=198744 illustrates that some graphics card drivers are still not able to support 3D applications in a composited environment correctly. This seems to be a stronger problem for wine applications (at least in the bug report).
KWin supports suspending compositing via a dbus interface (http://websvn.kde.org/*checkout*/trunk/KDE/kdebase/workspace/kwin/org.kde.KW...). You can basically check if compositing is active, suspend it when the app is started and resume when the app is closed. This is for example done by KDE's powermanagement daemon.
As a shell script it looks like that: composited='qdbus org.kde.kwin /KWin compositingActive' if $composited; then qdbus org.kde.kwin /KWin toggleCompositing; fi wine blablabla if $composited; then qdbus org.kde.kwin /KWin toggleCompositing; fi
I basically wish with this enhancement report that you add support for suspending KWin's compositing on an application basis in wine. It shouldn't be for every app and it shouldn't be activated in general but the user should have the possibility to just say that one specified app should suspend compositing.
http://bugs.winehq.org/show_bug.cgi?id=19376
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |WONTFIX
--- Comment #1 from Austin English austinenglish@gmail.com 2009-07-19 15:54:48 --- If a user wishes to disable 3d compositing with a shell script, there's nothing stopping them from doing so. Wine, however, has no business doing this for users.
http://bugs.winehq.org/show_bug.cgi?id=19376
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #2 from Austin English austinenglish@gmail.com 2009-07-19 15:56:02 --- Closing.
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #3 from Martin Gräßlin kde@martin-graesslin.com 2009-07-19 16:14:30 --- Perhaps I have not really stated exactly what I wish.
First of all I want to say that I am a kwin developer and not just a user. I reported this wish as I think it makes sense to add this support to wine and given the bug reports we have in kwin.
I do not want you to add that pasted scriptlet. I would like you to give the user the possibility to say that an app should be started with compositing disabled and that wine will just call the dbus interface.
Of course the user could use an own script. But how many users are able to run that script or are able to find it. This is definately a case of providing a good user experience and making the free desktop better. When running an app with compositing enabled and it is broken how can a user know that it is caused by the combination of compositing and the OpenGL game and how should he know that it is possible to script kwin in that way?
If you still have questions please ask. You are also welcome to join us in #kwin and discuss the problem directly.
////////////////////////////// OT - personal note: I am rather disappointed by the speed you just closed that feature request. It looks like you don't care about requests made by other projects. I opened this request so that wine can provide a better user experience. If wine is not interested in a good user experience this might change the way I handle wine specific bugs reported against kwin :-(
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #4 from Henri Verbeet hverbeet@gmail.com 2009-07-19 16:16:06 --- (In reply to comment #1)
If a user wishes to disable 3d compositing with a shell script, there's nothing stopping them from doing so. Wine, however, has no business doing this for users.
Not entirely, there's DwmEnableComposition() and DwmIsCompositionEnabled() in dwmapi. I think it would make sense for Wine to at least properly implement those.
As for actually disabling compositing for D3D applications, I'm not sure how this is handled on Windows for pre-Vista applications, but applications that are aware of it usually disable it themselves.
http://bugs.winehq.org/show_bug.cgi?id=19376
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |UNCONFIRMED Resolution|WONTFIX |
--- Comment #5 from Austin English austinenglish@gmail.com 2009-07-19 17:41:00 --- Reopening, per Henri.
Martin, apologies, misunderstood you.
Still not sure how exactly you'd like wine to let users choose this...do other composition tools have similar capabilities to disable (e.g., compiz)?
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #6 from Vitaliy Margolen vitaliy@kievinfo.com 2009-07-19 18:39:57 --- Since KDE guys says that compositing will break any 3D app, then it makes sense to just disable compositing on any 3d initialization (read on each Wine start). Since that's done automatically.
If that's what you want, sure it can be implemented. Of course a better way would be fixing kwin's compositing...
http://bugs.winehq.org/show_bug.cgi?id=19376
Lucas Murray lmurray@undefinedfire.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lmurray@undefinedfire.com
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #7 from Lucas Murray lmurray@undefinedfire.com 2009-07-19 20:57:25 --- (In reply to comment #6)
If that's what you want, sure it can be implemented. Of course a better way would be fixing kwin's compositing...
It's not KWin's compositing that's the problem, it's both the compositing idea in general and the quality of the graphics drivers that are currently available to us.
When compositing is enabled there will ALWAYS be a speed penalty due to the extra redirection that needs to be done and it doesn't matter how fast the graphics card is or how well the driver is optimized it will always be the case. This is the primary reason why those DWM calls exist.
On Linux we have an extra problem: Our graphics drivers have not been optimized as far as humanly possible unlike those on other operating systems. Due to this when compositing is enabled we get both a larger performance hit and redirection problems such as those found in the KDE/Compiz trackers.
As the window manager has no way of knowing if an application is running a 3D context and as graphics drivers will take a very long time to fix completely implementing this in WINE will allow the user to easily get faster applications without the need of externally writing scripts for every single one.
http://bugs.winehq.org/show_bug.cgi?id=19376
Michal Svoboda pht@spatium.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |pht@spatium.org
--- Comment #8 from Michal Svoboda pht@spatium.org 2009-07-19 23:25:19 --- I don't like where this is going.
I certainly wouldn't want any program, including wine, to *automatically* mess with my desktop settings, which includes, but is not limited to, compositing. And I wouldn't like a windows application to be able to do it either. I kinda like the fact that in wine, the windows applications are confined to their own world and can not dictate anything beyond it in contrast to the "please close every other application while this is running" principle they are used to.
So if anything please make this optional and/or per-application configurable but always let the user have the final say. Also note that enabling compositing is a quite slow operation and might not always succeed.
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #9 from Martin Gräßlin kde@martin-graesslin.com 2009-07-20 03:40:59 --- (In reply to comment #6)
Since KDE guys says that compositing will break any 3D app, then it makes sense to just disable compositing on any 3d initialization (read on each Wine start). Since that's done automatically.
Actually it is more complex than that. Lucas mentioned already most of the problems: drivers. We currently have the situation that for example nvidia driver works quite good, while fglrx seems to be broken. The free drivers are more difficult. Some are working, some not. Here we will probably see much improvements thanks to DRI2 and Gallium.
So the decision to disable compositing automatically whenever a 3D app is started would be too strict. It really much depends on the use case. Let's say for a simple 3D application which just rotates a small cube disabling compositing would be wrong while for a complex 3D game, which is run in fullscreen it's the right thing to do.
I am not really familiar with Windows APIs so I don't know if you have a way to recognize if that is a complex game running or a small simple app.
do other composition tools have similar capabilities to disable (e.g., compiz)?
Compiz currently does not yet support non-composited window management, but their upcomming release 0.9 will support non-composited window management. I don't know if they will support a similar functionality.
The third window manager which is probably interesting in this context is Mutter and I have no idea what exactly they support and what not.
I certainly wouldn't want any program, including wine, to *automatically* mess with my desktop settings, which includes, but is not limited to, compositing.
This has nothing to do with "messing" around with desktop settings. KWin offers the dbus methods exactly for that: temporarily suspend compositing for applications which work better without compositing. When the application ends it will just resume compositing so everything is fine. Just as a note: kwin will post a notification that compositing has been suspended by an external app and the user has the possibility to resume compositing by * using the shortcut alt+shift+f12 * use the button "resume compositing" in effects kcm * use the toggle compositing plasmoid (in the state in svn playground, not the one on kde-look) * restarting the session (no setting is stored)
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #10 from Henri Verbeet hverbeet@gmail.com 2009-07-20 04:15:41 --- (In reply to comment #4)
As for actually disabling compositing for D3D applications, I'm not sure how this is handled on Windows for pre-Vista applications, but applications that are aware of it usually disable it themselves.
For the record, I checked, and Vista has a "Disable desktop composition" option on its compatibility tab for shortcuts. That's probably enough to argue for a similar option in winecfg. The first step towards implementing this should be implementing the relevant parts of dwmapi.
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #11 from Alexandre Julliard julliard@winehq.org 2009-07-20 04:21:30 --- This would need some standard API, we can't add window manager specific dbus messages for every wm out there. Also 'toggle' is clearly not the right function to export, it would need some sort of suspend/resume with a counter.
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #12 from Michal Svoboda pht@spatium.org 2009-07-20 11:10:28 --- (In reply to comment #9)
I certainly wouldn't want any program, including wine, to *automatically* mess with my desktop settings, which includes, but is not limited to, compositing.
This has nothing to do with "messing" around with desktop settings. KWin offers the dbus methods exactly for that: temporarily suspend compositing for applications which work better without compositing. When the application ends it will just resume compositing so everything is fine. Just as a note: kwin will post a notification that compositing has been suspended by an external app and the user has the possibility to resume compositing by
- using the shortcut alt+shift+f12
- use the button "resume compositing" in effects kcm
- use the toggle compositing plasmoid (in the state in svn playground, not the
one on kde-look)
- restarting the session (no setting is stored)
I can already see myself fighting with an app that does not want to give up on disabling compositing. Please make this option so that it is configurable whether wine honors such a request or not.
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #13 from Martin Gräßlin kde@martin-graesslin.com 2009-07-20 12:20:02 --- (In reply to comment #12)
I can already see myself fighting with an app that does not want to give up on disabling compositing. Please make this option so that it is configurable whether wine honors such a request or not.
I can only speak for kwin, but in the end it's the window manager which decides to honour a request or not. And in case of kwin it will always be configurable. I provided several examples when the user's choice would be more powerful than the applications one.
(In reply to comment #11)
This would need some standard API, we can't add window manager specific dbus
messages for every wm out there. We discussed it briefly on IRC and had the idea that a window can set an atom like for example _NET_WM_DISABLE_CM to indicate that compositing should be disabled while the window is alive. This has of course to be discussed with the other parties and "standardized" via freedesktop.org NETWM specification.
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #14 from Michal Svoboda pht@spatium.org 2009-07-20 12:32:10 ---
I provided several examples when the user's choice would be more powerful than the applications one.
You didn't. You only provided examples of how the user can _revert_ the system to its original state after the application decides to "mess with it". That's very different.
http://bugs.winehq.org/show_bug.cgi?id=19376
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source
--- Comment #15 from Austin English austinenglish@gmail.com 2010-07-23 15:20:23 --- Still present.
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #16 from Martin Gräßlin mgraesslin@kde.org 2011-04-04 14:40:45 CDT --- We finally added proper support to allow applications to block compositing. This will first become available with KDE Plasma Workspaces in version 4.7 to be released in summer this year.
We would love to see Wine making use of the new X property to tell KWin (and hopefully soon other compositors) to completely block compositing. This might be a good way to implement the existing DWM call from Windows.
We are going to try to get the new property as an addition to the NETWM spec and to make it cross-desktop.
A reference implementation can be found in KDELibs commit 7cd28e48:
https://projects.kde.org/projects/kde/kdelibs/repository/revisions/7cd28e48a...
Feel free to copy the code. In case of any question, please do not hesistate to ask, we are willing to provide you all the help you need.
Cheers Martin Gräßlin KWin Maintainer
http://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #17 from Henri Verbeet hverbeet@gmail.com 2011-04-22 11:56:37 CDT --- That should probably work for suspending compositing. I think we can support that, provided it's standardized. However, as you can probably imagine, dwmapi involves a bit more than that. Did http://lists.freedesktop.org/archives/compiz/2010-August/003432.html ever go anywhere?
http://bugs.winehq.org/show_bug.cgi?id=19376
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |alexhultman@gmail.com
--- Comment #18 from Alexandre Julliard julliard@winehq.org 2011-12-18 03:56:35 CST --- *** Bug 29371 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=19376
Sven Arvidsson sa@whiz.se changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sa@whiz.se
https://bugs.winehq.org/show_bug.cgi?id=19376
--- Comment #19 from Ken Sharp imwellcushtymelike@gmail.com --- Is this still an issue in Wine 1.7.45 or later?
https://bugs.winehq.org/show_bug.cgi?id=19376
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |stefan@codeweavers.com, | |super_man@post.com
https://bugs.winehq.org/show_bug.cgi?id=19376
Stefan Dösinger stefandoesinger@gmx.at changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|stefan@codeweavers.com |stefandoesinger@gmx.at
https://bugs.winehq.org/show_bug.cgi?id=19376
Sven Arvidsson sa@whiz.se changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|sa@whiz.se |