Allow the user to rearm OpenGLIsUnsafe KWIn autocrash protection
Review Request #101061 - Created April 8, 2011 and submitted
- Allow the user to rearm OpenGLIsUnsafe KWIn autocrash protection - Add a usable "doesn't work why" info - WARN! the user about clicking the rearm button. - Merge "OpenGLIsUnsafe" and "CheckIsSafe" (they did the same for the compositor and the active screen edges), picking the less generic term. - Move the entire checking into CompositingPrefs, which now knows that "openGLIsBroken()" and doesn't require external protection for "detect()" About distinguishing between "crashes kwin" and "crashes X11": I'm not even sure whether this makes sense (if the user has a new driver he may want to rearm things, expecting that X11 won't crash again - maybe because we told him so...) or it's worth it but a possible way to do it could be to a) make OpenGLIsUnsafe a tenary setting (0,1,2) b) add a parameter to the kwin binary (eg. "--checkBrokenGL") c) initially set OpenGLIsUnsafe = 2; and launch "kwin --checkBrokenGL" d) have "kwin --checkBrokenGL" sleep a short time, then check the value and if it's "2" (because kwin/compositing kcm crashed) set it down to "1" e) => OpenGLIsUnsafe == 2 means that we successfully killed X11 with glXQuery() ...
Yes, i broke my driver (interesting sidenote: "int n = 0; int m = 1/n; n = m;" does not crash your code, gcc is a little smarter than this ;-) and tried to - set the opengl backend (crash) a) rearm (crash), then fix my driver and rearm (works) b) change to XRender, change back to GL (get a warning, reamr, crash), then fix my driver, change to GL and rearm (works)
Very good idea. I was thinking about the same last week. The UI currently has a problem: The text does not adjust to the layout. Very noticable when resizing the systemsettings window. What might work better: have you ever seen the Akonadi configuration interfaces when Akonadi is not running? They put a nice overlay blocking everything over the UI, an error icon, "Akonadi is not running" and a button to enable. I think we could do the same with the explanation message, a button to re-enable and one to switch to XRender. In general I think we should get input from kde-usability on that one. If you agree I would send a mail to them. Btw I tried it and desktop effects did not start because it was on enabled state. But I think if it crashes, we set enabled to false?
I think we should remove that instead of commenting out
We should get some feedback from usability team. I fear this is too techy and too much information and becomes a click through. Maybe just something like: "KWin recognized that your graphics driver is unstable and has deactivated desktop effects. Reenabling might lead to data loss!"
The button looks strange with that much text. Just an idea: use the "bomb" icon on the button and do something like KMail 2 did in the first alpha state. They replaced the "OK" by "Lose data". What I would like is a "I know what I'm doing" button, but again I think we need input from usability team.
Review request changed
Pimp UI, shorter strings, one-line button, "i'm not stupid" checkbox
Revision 2 (+339 -53)
I just tried it and it allways starts with the rearm screen and the setting OpenGLIsUnsafe is written to the file even if it was not. Some test code still included? Apart from that I like it and please commit before hard freeze