Avoid crashing kded on wayland session
ClosedPublic

Authored by valeriymalov on Aug 2 2017, 2:12 PM.

Details

Summary

check if we're running under X11 before making some X11 calls
remove unused Wacom::X11Info methods
use QScreen in X11Info::getScreenRotation instead of Xrandr
fix X-KDE-Library in wacomtablet.desktop
BUG: 369199

Diff Detail

Repository
R530 Wacom tablet support
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
valeriymalov created this revision.Aug 2 2017, 2:12 PM

Since those class are called "X11....", can you avoid using those class in the caller instead of make themselves check the platform?

If you don't want to use QX11Info in the caller, you may replace isPlatformX11 by platformName == "xcb" (which is the implementation of isPlatformX11).

xuetianweng requested changes to this revision.Nov 3 2017, 5:33 PM
This revision now requires changes to proceed.Nov 3 2017, 5:33 PM
  • Move QX11Info calls outside of x11 modules
xuetianweng added inline comments.Nov 4 2017, 9:44 PM
src/kded/tabletfinder.cpp
88

Since we only have one backend here, I would write:

if (!QX11Info::isPlatformX11()) {

return false;

}

X11TabletFinder x11tabletFinder;
.....

Otherwise if there's any X11 call in X11TabletFinder's constructor, it would still cause problem.

Or you can wrap all the code in the if, but I prefer the former one for now since it has less indention.

if (QX11Info::isPlatformX11()) {

X11TabletFinder       x11tabletFinder;
.....

}

valeriymalov marked an inline comment as done.
  • move platform check higher
xuetianweng accepted this revision.Nov 5 2017, 2:59 AM
This revision is now accepted and ready to land.Nov 5 2017, 2:59 AM
This revision was automatically updated to reflect the committed changes.