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 710373 - Switch to monitor should only toggle between monitors
Switch to monitor should only toggle between monitors
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Wacom
3.10.x
Other Linux
: Normal enhancement
: ---
Assigned To: Carlos Garnacho
Control-Center Maintainers
Depends on: 712664
Blocks:
 
 
Reported: 2013-10-17 10:42 UTC by Jakub Steiner
Modified: 2013-11-20 19:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wacom: Show OSD when remapping device to a monitor through the pad bindings (12.88 KB, patch)
2013-11-15 17:13 UTC, Carlos Garnacho
rejected Details | Review
wacom: Skip GSD_WACOM_SET_ALL_MONITORS on the switch monitor pad action (1.20 KB, patch)
2013-11-15 17:14 UTC, Carlos Garnacho
needs-work Details | Review
Include an icon in the OSD too (13.14 KB, patch)
2013-11-15 17:30 UTC, Carlos Garnacho
rejected Details | Review
common: Add GsdShellProxy (11.05 KB, patch)
2013-11-19 12:21 UTC, Carlos Garnacho
needs-work Details | Review
media-keys: Use GsdShellProxy (7.80 KB, patch)
2013-11-19 12:22 UTC, Carlos Garnacho
reviewed Details | Review
wacom: Show OSD when remapping device to a monitor through the pad bindings (3.44 KB, patch)
2013-11-19 12:22 UTC, Carlos Garnacho
reviewed Details | Review
wacom: Skip GSD_WACOM_SET_ALL_MONITORS on the switch monitor pad action (1.07 KB, patch)
2013-11-19 12:22 UTC, Carlos Garnacho
committed Details | Review
main: Generate org.gnome.Shell proxy (6.85 KB, patch)
2013-11-20 16:13 UTC, Carlos Garnacho
committed Details | Review
common: Add helper function to GsdShell (4.67 KB, patch)
2013-11-20 16:13 UTC, Carlos Garnacho
committed Details | Review
media-keys: Use GsdShell proxy (9.67 KB, patch)
2013-11-20 16:13 UTC, Carlos Garnacho
committed Details | Review
wacom: Show OSD when remapping device to a monitor through the pad bindings (3.08 KB, patch)
2013-11-20 16:13 UTC, Carlos Garnacho
committed Details | Review

Description Jakub Steiner 2013-10-17 10:42:00 UTC
The switch now includes the composite area of all displays now. After extensive use I can say it's almost always in the way and renders the quick switch shortcut less efficient. We should only toggle phyiscal displays with this.

Maybe a short 500ms OSD indication of the target display would be helpful too. I'd use input-tablet-symbolic along with 'Wacom XY mapped here' label.
Comment 1 Bastien Nocera 2013-11-12 16:19:11 UTC
The first part would be modifying switch_monitor() in gsd-wacom-manager.c.

The OSD would need to use gnome-shell's showOSD method (it's already used in the media-keys plugin at least).
Comment 2 Carlos Garnacho 2013-11-15 17:13:41 UTC
Created attachment 259927 [details] [review]
wacom: Show OSD when remapping device to a monitor through the pad bindings

This helps having a clue of which monitor got mapped to the device, other than
waving the pen to check where the pointer ends up. Now an small, short-timed
OSD pops up on the monitor that got mapped to the device.
Comment 3 Carlos Garnacho 2013-11-15 17:14:31 UTC
Created attachment 259928 [details] [review]
wacom: Skip GSD_WACOM_SET_ALL_MONITORS on the switch monitor pad action

Having an intermediate setting where the tablet is mapped to all monitors
comes up as a bit unintuitive, specially on 2 monitor setups, where one
click is required to switch to the other monitor, but then 2 clicks are
required to switch back.
Comment 4 Carlos Garnacho 2013-11-15 17:30:56 UTC
Created attachment 259930 [details] [review]
Include an icon in the OSD too
Comment 5 Bastien Nocera 2013-11-15 17:35:46 UTC
Review of attachment 259927 [details] [review]:

No. The OSD needs to use the showOSD() D-Bus API from gnome-shell, as mentioned in the bug earlier.

That might need to be extended to allow showing the OSD on a particular monitor though.
Comment 6 Bastien Nocera 2013-11-15 17:37:33 UTC
Review of attachment 259928 [details] [review]:

::: plugins/wacom/gsd-wacom-manager.c
@@ +1348,2 @@
 	/* Select next monitor */
+        current_monitor = (current_monitor + 1) % n_monitors;

I prefer the more readable original.

- current_monitor = GSD_WACOM_SET_ALL_MONITORS;
+ current_monitor = 0;
Comment 7 Bastien Nocera 2013-11-15 17:39:24 UTC
Review of attachment 259930 [details] [review]:

As per original review.
Comment 8 Carlos Garnacho 2013-11-15 18:44:36 UTC
(In reply to comment #5)
> Review of attachment 259927 [details] [review]:
> 
> No. The OSD needs to use the showOSD() D-Bus API from gnome-shell, as mentioned
> in the bug earlier.
> 
> That might need to be extended to allow showing the OSD on a particular monitor
> though.

Yes, that's partly why I took this way, it struck me as rarely useful to have per monitor OSDs there. Besides, keeping the obscured parts close to a corner sounded like a plus to me in this context. I'm playing now with the gnome-shell OSD though
Comment 9 Bastien Nocera 2013-11-15 19:30:55 UTC
(In reply to comment #8)
> (In reply to comment #5)
> > Review of attachment 259927 [details] [review] [details]:
> > 
> > No. The OSD needs to use the showOSD() D-Bus API from gnome-shell, as mentioned
> > in the bug earlier.
> > 
> > That might need to be extended to allow showing the OSD on a particular monitor
> > though.
> 
> Yes, that's partly why I took this way, it struck me as rarely useful to have
> per monitor OSDs there. Besides, keeping the obscured parts close to a corner
> sounded like a plus to me in this context. I'm playing now with the gnome-shell
> OSD though

The problem being that all the other OSDs use gnome-shell, which can make sure that the OSDs are themed similarly, and don't overlap each other (hides the previous one for example). We used to have OSDs client side, we don't anymore.
Comment 10 Carlos Garnacho 2013-11-19 12:21:00 UTC
Created attachment 260230 [details] [review]
common: Add GsdShellProxy

This is an object that abstracts communication with gnome-shell, also provides
methods for the currently used actions in g-s-d.
Comment 11 Carlos Garnacho 2013-11-19 12:22:10 UTC
Created attachment 260231 [details] [review]
media-keys: Use GsdShellProxy

All communication with the shell now goes through this object, both
for OSDs and requesting focus on the shell search entry.
Comment 12 Carlos Garnacho 2013-11-19 12:22:17 UTC
Created attachment 260232 [details] [review]
wacom: Show OSD when remapping device to a monitor through the pad bindings

This helps having a clue of which monitor got mapped to the device, other than
waving the pen to check where the pointer ends up. Now gnome-shell is requested
to show an OSD on the monitor the device gets mapped to.
Comment 13 Carlos Garnacho 2013-11-19 12:22:24 UTC
Created attachment 260233 [details] [review]
wacom: Skip GSD_WACOM_SET_ALL_MONITORS on the switch monitor pad action

Having an intermediate setting where the tablet is mapped to all monitors
comes up as a bit unintuitive, specially on 2 monitor setups, where one
click is required to switch to the other monitor, but then 2 clicks are
required to switch back.
Comment 14 Carlos Garnacho 2013-11-19 12:36:24 UTC
I've filed bug #712664 to gnome-shell, in order to add a "monitor" setting to ShowOSD, that patch would be needed too in order to have the OSD shown on the right monitor.

One thing worth pointing out in this new patch for the wacom plugin is that only the device name is requested to be shown on the OSD, tablet names are usually already long enough to trigger ellipsizing, so any extra translatable text will be likely either not shown, or will push the device name out of the visible text. 

With pretty vanilla font sizes, I do see strings like "Wacom Bamboo 16..." or "Wacom Intuos 5S...", so there's enough provided context, unless someone has two too similar tablets I guess, but it's the user who's physically pressing the button anyway...
Comment 15 Bastien Nocera 2013-11-19 15:08:18 UTC
Review of attachment 260230 [details] [review]:

gnome-settings-daemon/* already contains wrappers for the shell's screensaver proxy, and gnome-session. The wrapper should probably be added there instead.
And gdbus-codegen :)
Comment 16 Bastien Nocera 2013-11-19 15:11:01 UTC
Review of attachment 260231 [details] [review]:

That looks fine pending the wrapper changes.
Comment 17 Bastien Nocera 2013-11-19 15:12:47 UTC
Review of attachment 260232 [details] [review]:

Looks fine, pending the proxy changes.

::: plugins/wacom/gsd-wacom-manager.c
@@ +1368,3 @@
+
+        monitor_num = gsd_wacom_device_get_display_monitor (device);
+        screen = gdk_screen_get_default ();

Assign screen after the monitor_num check, it might be unused.
Comment 18 Bastien Nocera 2013-11-19 15:14:35 UTC
Review of attachment 260233 [details] [review]:

Looks good!

s/specially/especially/
Comment 19 Carlos Garnacho 2013-11-20 16:10:06 UTC
Comment on attachment 260233 [details] [review]
wacom: Skip GSD_WACOM_SET_ALL_MONITORS on the switch monitor pad action

Committed with the log typo change
Comment 20 Carlos Garnacho 2013-11-20 16:13:27 UTC
Created attachment 260334 [details] [review]
main: Generate org.gnome.Shell proxy

This will be used across multiple plugins, so put it together with
the screensaver and session proxies.
Comment 21 Carlos Garnacho 2013-11-20 16:13:31 UTC
Created attachment 260335 [details] [review]
common: Add helper function to GsdShell

Currently only one helper function is provided to interface with ShowOSD, it
takes care of creating the GVariant with all provided arguments.
Comment 22 Carlos Garnacho 2013-11-20 16:13:36 UTC
Created attachment 260336 [details] [review]
media-keys: Use GsdShell proxy

All communication with the shell now goes through this object, both
for OSDs and requesting focus on the shell search entry. One notable
change is that ownership of the shell DBus name is now tracked through
GsdShell::g-name-owner.
Comment 23 Carlos Garnacho 2013-11-20 16:13:40 UTC
Created attachment 260337 [details] [review]
wacom: Show OSD when remapping device to a monitor through the pad bindings

This helps having a clue of which monitor got mapped to the device, other than
waving the pen to check where the pointer ends up. Now gnome-shell is requested
to show an OSD on the monitor the device gets mapped to.
Comment 24 Bastien Nocera 2013-11-20 17:18:55 UTC
Review of attachment 260334 [details] [review]:

Looks good otherwise.

::: gnome-settings-daemon/gnome-settings-bus.c
@@ +95,3 @@
+gnome_settings_bus_get_shell_proxy (void)
+{
+        static GsdShell *shell_proxy;

Assign to NULL (even if the compiler already does that for us).

::: gnome-settings-daemon/org.gnome.Shell.xml
@@ +29,3 @@
+  -->
+  <interface name="org.gnome.Shell">
+    <method name="Eval">

I would remove all the functions that we don't actually use. Might not be many...
Comment 25 Bastien Nocera 2013-11-20 17:19:51 UTC
Review of attachment 260335 [details] [review]:

Looks good.
Comment 26 Bastien Nocera 2013-11-20 17:26:18 UTC
Review of attachment 260336 [details] [review]:

Looks fine.
Comment 27 Bastien Nocera 2013-11-20 17:27:49 UTC
Review of attachment 260337 [details] [review]:

Looks fine otherwise.

::: plugins/wacom/gsd-wacom-manager.c
@@ +1372,3 @@
+        gint monitor_num;
+
+        if (manager->priv->shell_proxy == NULL)

Check that after the conditional that exit this function?
Comment 28 Carlos Garnacho 2013-11-20 19:34:24 UTC
I've applied those last suggestions and pushed to master