Use QScreen to monitor screen geometry changes
ClosedPublic

Authored by valeriymalov on Aug 15 2017, 9:08 PM.

Details

Summary

TabletDaemon now sets up connections between signals for added, removed,
resized or rotated screens and TabletHandler
TabletHandler now calls mapTabletToCurrentScreenSpace for all screen
geometry changes, not just rotation
Remove rotation tracking code from Xlib and XCB implementations of
X11EventNotifier
Use dbgWacom in TabletFinder
Log logics behind applied mappings in XinputAdaptor

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 15 2017, 9:08 PM
rempt edited edge metadata.Aug 16 2017, 8:14 AM

It looks all good to me, but I've got a problem... After some updates, I have trouble actually testing the wacomtablet kcm if I've built it myself. I haven't figured out why yet.

  • add forgotten call to monitorAllScreensGeometry()
  • translate rest of the qDebug() users to dbgWacom
xuetianweng requested changes to this revision.Nov 3 2017, 5:29 PM

Sorry for being lazy to review this.
I noticed that there's no devicePixelRatio in your code change so I think there's a problem in hidpi.
AFAIK, QScreen returns size after scaled with hidpi. You need to restore it to make it work on hidpi correctly.

This revision now requires changes to proceed.Nov 3 2017, 5:29 PM

I haven't really touched mapTabletToCurrentScreenSpace function in this patch, it still gets geometry from X11Info class and the geometry returned by QScreen events is actually unused for now (see TabletHandler::onScreenGeometryChanged).
It's sub-optimal, but changing mapTabletToCurrentScreenSpace to handle new per-screen geometry doesn't seem trivial right now, and the main purpose of this patch is just to trigger tablet re-mapping on geometry change (which may happen on login when KScreen applies user settings).

xuetianweng added inline comments.Nov 4 2017, 9:50 PM
src/kded/tablethandler.cpp
233

Then I would prefer you omit the geom argument here (signal slot will still work if argument is omitted.)

So we can avoid to use the scaled geom when some one thinks it's a good idea to use it. Or at least write some comment here.

  • remove geometry arg from onScreenGeometryChanged slot
valeriymalov marked an inline comment as done.Nov 5 2017, 12:02 AM
xuetianweng accepted this revision.Nov 5 2017, 2:58 AM
This revision is now accepted and ready to land.Nov 5 2017, 2:58 AM
This revision was automatically updated to reflect the committed changes.