Expose if the tablet mode switch is available
ClosedPublic

Authored by mart on Jan 17 2018, 12:24 PM.

Details

Summary

expose in the libinput wrapper a property that tells whether
a tablet mode switch input device is present on the machine,
expose it trough dbus

Test Plan

still not complete, I need a way to either access the connection
from TabletModeManager or setting to TabletModeManager from input.cpp

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Jan 17 2018, 12:24 PM
Restricted Application added a project: KWin. · View Herald TranscriptJan 17 2018, 12:24 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
mart requested review of this revision.Jan 17 2018, 12:24 PM
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 17 2018, 12:24 PM

In terms of goals, is this interface:

  1. about exposing the raw switch data that we have from libinput
  1. trying to be a canonical source of what mode a device is in from all information available (which currently happens to be the libinput switch)
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 17 2018, 2:30 PM
mart added a comment.Jan 17 2018, 3:45 PM
  1. trying to be a canonical source of what mode a device is in from all information available (which currently happens to be the libinput switch)

more 2) , happens to be libinput, but the apps shouldn't care

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 17 2018, 3:45 PM
mart added a comment.Jan 17 2018, 3:47 PM

api-wise on the dbus side, could also be done that the interface being there means the switch is possible, otherwise doesn't get registered/destroyed

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 17 2018, 3:47 PM
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 17 2018, 4:57 PM
graesslin added inline comments.
tabletmodemanager.cpp
94

Impossible! That's violating the layering. KWin core does not depend or interact with libinput for our overall sanity.

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 18 2018, 5:52 PM
mart added inline comments.Jan 19 2018, 9:49 AM
tabletmodemanager.cpp
94

I tought as much, but would be possible then to expose the property in an abstract way from the core for this to read?
maybe something along the lines of
input()->capabilities()->hasTouch()
input()->capabilities()->hasTabletModeSwitch()
and so on?

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 19 2018, 9:49 AM
mart added inline comments.Jan 19 2018, 9:50 AM
tabletmodemanager.cpp
94

which, would make sense api-wise even if something different than libinput was used underneath

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 19 2018, 9:50 AM
graesslin added inline comments.Jan 19 2018, 8:07 PM
tabletmodemanager.cpp
94

makes sense. VirtualKeyboard also accesses the information through input

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 19 2018, 8:07 PM
mart added inline comments.Jan 20 2018, 9:32 AM
tabletmodemanager.cpp
94

ok, i'll try to add an api for that in thir rr then

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 20 2018, 9:32 AM
mart updated this revision to Diff 25763.Jan 22 2018, 3:20 PM
  • wire up tabletModeAvailable
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 22 2018, 3:20 PM
graesslin added inline comments.Jan 22 2018, 7:08 PM
input.cpp
1897

false

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 22 2018, 7:08 PM
mart updated this revision to Diff 25794.Jan 23 2018, 9:49 AM
  • fix logic
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 23 2018, 9:49 AM
mart marked an inline comment as done.Jan 23 2018, 11:09 AM
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 23 2018, 11:09 AM
graesslin added inline comments.Jan 23 2018, 3:48 PM
tabletmodemanager.cpp
87–96

is this method still needed?

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 23 2018, 3:48 PM
mart added inline comments.Jan 23 2018, 4:34 PM
tabletmodemanager.cpp
87–96

yes, the point is to expose it to applications (on plasma i wouldn't want a "show this only in tablet mode" option visible (or at least, enabled) if the hardware doesn't support tablet mode at all

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 23 2018, 4:34 PM
graesslin added inline comments.Jan 23 2018, 5:15 PM
tabletmodemanager.cpp
87–96

I meant the method setTabletModeAvailable, your reply seems to be for isTabletModeAvailable?

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 23 2018, 5:15 PM
mart updated this revision to Diff 25865.Jan 24 2018, 10:37 AM
  • Merge branch 'master' into phab/tabletModeSupported
  • remove unneeded method
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 24 2018, 10:37 AM
mart marked 3 inline comments as done.Jan 24 2018, 10:38 AM
mart added inline comments.
tabletmodemanager.cpp
87–96

sorry, i misunderstood, indeed that's not needed anymore, removing

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 24 2018, 10:38 AM
mart marked an inline comment as done.Jan 24 2018, 10:38 AM
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 24 2018, 10:38 AM
mart retitled this revision from [WIP]expose if the tablet mode switch is available to Expose if the tablet mode switch is available.Jan 24 2018, 10:38 AM
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 24 2018, 10:38 AM
graesslin accepted this revision.Jan 24 2018, 4:37 PM
This revision is now accepted and ready to land.Jan 24 2018, 4:37 PM
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptJan 24 2018, 4:37 PM
This revision was automatically updated to reflect the committed changes.
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJan 25 2018, 11:46 AM