After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771098 - Show OSD on tablet mode switches
Show OSD on tablet mode switches
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2016-09-09 04:41 UTC by Peter Hutterer
Modified: 2017-02-10 23:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
clutter: Add current group mode on pad events (6.34 KB, patch)
2016-12-28 11:53 UTC, Carlos Garnacho
committed Details | Review
clutter: Add functions to find out mode switch buttons, and their group (5.55 KB, patch)
2016-12-28 11:53 UTC, Carlos Garnacho
committed Details | Review
clutter: Add function to find out the number of modes for a pad group (4.69 KB, patch)
2016-12-28 11:53 UTC, Carlos Garnacho
committed Details | Review
backends: Have meta_input_settings_handle_pad_button() take an event (4.42 KB, patch)
2016-12-28 11:53 UTC, Carlos Garnacho
committed Details | Review
wayland: Clean up MetaWaylandTabletPadGroup (4.64 KB, patch)
2016-12-28 11:53 UTC, Carlos Garnacho
committed Details | Review
core: Add MetaDisplay::show-osd signal (4.93 KB, patch)
2016-12-28 11:53 UTC, Carlos Garnacho
committed Details | Review
backends: Add action label to mode switch buttons (1.43 KB, patch)
2016-12-28 11:53 UTC, Carlos Garnacho
committed Details | Review
backends: Notify tablet mapping changes in the UI (2.09 KB, patch)
2016-12-28 11:53 UTC, Carlos Garnacho
committed Details | Review
wayland: Notify tablet mode switches (1.71 KB, patch)
2016-12-28 11:54 UTC, Carlos Garnacho
committed Details | Review
windowManager: Handle MetaDisplay::show-osd signal (1.16 KB, patch)
2016-12-28 11:54 UTC, Carlos Garnacho
committed Details | Review

Description Peter Hutterer 2016-09-09 04:41:14 UTC
The Wacom Cintiq 22HD doesn't have LEDs to indicate the current mode and this may be true of future devices (we don't have official confirmation). For those devices (possibly all device?) gsd should show an OSD whenever the mode switches.

Possible mockup by jimmac:
https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/tablets/mode-switching-osd.png
Comment 1 Carlos Garnacho 2016-12-28 11:50:17 UTC
Moving this to mutter/gnome-shell, since most of the tablet magic is there now.
Comment 2 Carlos Garnacho 2016-12-28 11:53:15 UTC
Created attachment 342523 [details] [review]
clutter: Add current group mode on pad events

This info can be obtained here right away, so we don't need
backend-dependent paths in the upper layers.
Comment 3 Carlos Garnacho 2016-12-28 11:53:20 UTC
Created attachment 342524 [details] [review]
clutter: Add functions to find out mode switch buttons, and their group

This is done in the upper layers through backend-dependent ways, seems
better to let ClutterInputDevice provide this information.
Comment 4 Carlos Garnacho 2016-12-28 11:53:26 UTC
Created attachment 342525 [details] [review]
clutter: Add function to find out the number of modes for a pad group

This is obtained in backend-dependent ways in the upper layers, seems
better to let ClutterInputDevice provide this information.
Comment 5 Carlos Garnacho 2016-12-28 11:53:32 UTC
Created attachment 342526 [details] [review]
backends: Have meta_input_settings_handle_pad_button() take an event

As all the relevant backends are expected to provide
ClutterPadButtonEvents, it makes no sense to split the information,
plus all other event fields are now available and might be needed
in the future.
Comment 6 Carlos Garnacho 2016-12-28 11:53:37 UTC
Created attachment 342527 [details] [review]
wayland: Clean up MetaWaylandTabletPadGroup

Using the clutter counterparts, some backend-specific code can be removed
from here.
Comment 7 Carlos Garnacho 2016-12-28 11:53:42 UTC
Created attachment 342528 [details] [review]
core: Add MetaDisplay::show-osd signal

And add specific private methods to notify about tablet mapping and mode
switches. The signal allows the mutter side to trigger OSDs in a generic
way.
Comment 8 Carlos Garnacho 2016-12-28 11:53:48 UTC
Created attachment 342529 [details] [review]
backends: Add action label to mode switch buttons
Comment 9 Carlos Garnacho 2016-12-28 11:53:55 UTC
Created attachment 342530 [details] [review]
backends: Notify tablet mapping changes in the UI

This takes over the older code in g-s-d.
Comment 10 Carlos Garnacho 2016-12-28 11:54:00 UTC
Created attachment 342531 [details] [review]
wayland: Notify tablet mode switches

This will show a fancy OSD so the change is immediately visible.
Comment 11 Carlos Garnacho 2016-12-28 11:54:47 UTC
Created attachment 342532 [details] [review]
windowManager: Handle MetaDisplay::show-osd signal

Propagate as-is to the OsdWindowManager.
Comment 12 Peter Hutterer 2017-01-03 01:40:23 UTC
Review of attachment 342523 [details] [review]:

straightforward patch, looks good to me.
Comment 13 Peter Hutterer 2017-01-03 01:45:03 UTC
Review of attachment 342524 [details] [review]:

also straightforward, looks good to me.
Comment 14 Peter Hutterer 2017-01-03 01:46:06 UTC
Review of attachment 342525 [details] [review]:

lgtm
Comment 15 Peter Hutterer 2017-01-03 01:54:27 UTC
Review of attachment 342526 [details] [review]:

yep
Comment 16 Peter Hutterer 2017-01-03 01:59:08 UTC
Review of attachment 342527 [details] [review]:

nod
Comment 17 Peter Hutterer 2017-01-03 02:09:09 UTC
Review of attachment 342528 [details] [review]:

using more context than I'm familiar with but looks good
Comment 18 Peter Hutterer 2017-01-03 02:10:49 UTC
Review of attachment 342529 [details] [review]:

not sure that comment is sufficient for translators, but otherwise LGTM
Comment 19 Peter Hutterer 2017-01-03 02:13:36 UTC
Review of attachment 342530 [details] [review]:

ack
Comment 20 Peter Hutterer 2017-01-03 02:16:47 UTC
Review of attachment 342531 [details] [review]:

yay!
Comment 21 Peter Hutterer 2017-01-03 02:17:47 UTC
Review of attachment 342532 [details] [review]:

sorry, don't know enough about the context of this one
Comment 22 Florian Müllner 2017-02-10 17:22:05 UTC
Review of attachment 342532 [details] [review]:

::: js/ui/windowManager.js
@@ +923,3 @@
+        global.display.connect('show-osd', Lang.bind(this, function (display, message, iconName, monitorIndex) {
+            let icon = Gio.Icon.new_for_string(iconName);
+            Main.osdWindowManager.show(monitorIndex, icon, message, null);

It's a bit odd to have signal and method take the same parameters, but in reverse order. I'd also go with "label" instead of "message" to make it clear that the string is supposed to be short.
Comment 23 Carlos Garnacho 2017-02-10 22:48:05 UTC
(In reply to Florian Müllner from comment #22)
> Review of attachment 342532 [details] [review] [review]:
> 
> ::: js/ui/windowManager.js
> @@ +923,3 @@
> +        global.display.connect('show-osd', Lang.bind(this, function
> (display, message, iconName, monitorIndex) {
> +            let icon = Gio.Icon.new_for_string(iconName);
> +            Main.osdWindowManager.show(monitorIndex, icon, message, null);
> 
> It's a bit odd to have signal and method take the same parameters, but in
> reverse order. I'd also go with "label" instead of "message" to make it
> clear that the string is supposed to be short.

Indeed, I made the argument order match on the mutter side and renamed the variable.
Comment 24 Carlos Garnacho 2017-02-10 22:51:56 UTC
Attachment 342523 [details] pushed as 8bcdf9b - clutter: Add current group mode on pad events
Attachment 342524 [details] pushed as 9d38ffa - clutter: Add functions to find out mode switch buttons, and their group
Attachment 342525 [details] pushed as d6fc41b - clutter: Add function to find out the number of modes for a pad group
Attachment 342526 [details] pushed as fff7da2 - backends: Have meta_input_settings_handle_pad_button() take an event
Attachment 342527 [details] pushed as 5af848d - wayland: Clean up MetaWaylandTabletPadGroup
Attachment 342528 [details] pushed as 07ce981 - core: Add MetaDisplay::show-osd signal
Attachment 342529 [details] pushed as efd9d46 - backends: Add action label to mode switch buttons
Attachment 342530 [details] pushed as ff453c1 - backends: Notify tablet mapping changes in the UI
Attachment 342531 [details] pushed as 7e3fbfb - wayland: Notify tablet mode switches
Comment 25 Carlos Garnacho 2017-02-10 23:07:23 UTC
Attachment 342532 [details] pushed as c3cdbd0 - windowManager: Handle MetaDisplay::show-osd signal