Use output names instead of screen indices
ClosedPublic

Authored by valeriymalov on Feb 3 2018, 4:59 PM.

Details

Summary

Screen index as an identificator can be pretty unreliable, since it can
change during the runtime (e.g. on login when kscreen applies primary
screen setting)

Use output name (e.g. HDMI-0) everywhere instead

ScreenMap: use raw ScreenSpace strings as mapping keys
ScreenSpace: introduce method next() that cycles through screen spaces
(monitors and whole desktop)
TabletAreaSelectionController: store ScreenSpace instead of index
X11Info: add helper functions to navigate through screens
TabletDaemon: remove outdated FIXME comments

Test Plan

the usual see if there aren't any regressions in saving/restoring settings
inclduing Ctrl+Meta+1/2/F/M hotkeys that cycle through screens
initially old mapping settings are going to be lost
since map0/map1/etc. aren't valid screenspaces anymore

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 requested review of this revision.Feb 3 2018, 4:59 PM
valeriymalov created this revision.
fvogt added inline comments.Feb 3 2018, 5:22 PM
src/common/screenspace.cpp
130–138

I understand what it does, but IMO it could use an explanatory comment here.

150

Unnecessary return?

src/kcmodule/areaselectionwidget.cpp
252–254

You could use find here and dereference. Saves one lookup in the common case.

474

You could pass areas by const&.

valeriymalov marked 4 inline comments as done.
  • Requested fixes
fvogt resigned from this revision.Feb 5 2018, 8:41 AM

Looks good to me code-wise but I can't test it, I either have multiple monitors available or a graphics tablet, but not both.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 9 2018, 5:12 PM
This revision was automatically updated to reflect the committed changes.