Allow the user to rearm OpenGLIsUnsafe KWIn autocrash protection

Review Request #101061 - Created April 8, 2011 and submitted - Latest diff uploaded

Information
Thomas L├╝bking
kde-workspace
master
250865
Reviewers
kwin
- 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)
Loading...