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 668908 - Allow buttons to switch assigned monitor
Allow buttons to switch assigned monitor
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: wacom
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-01-28 12:54 UTC by Bastien Nocera
Modified: 2012-08-21 15:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (2.78 KB, patch)
2012-06-28 14:41 UTC, Olivier Fourdan
none Details | Review
Updated patch (2.91 KB, patch)
2012-07-03 11:26 UTC, Olivier Fourdan
none Details | Review
Updated patch without the need for the patch from bug 679062 (2.33 KB, patch)
2012-08-21 12:40 UTC, Olivier Fourdan
accepted-commit_now Details | Review
Updated patch (4.93 KB, patch)
2012-08-21 14:22 UTC, Olivier Fourdan
none Details | Review

Description Bastien Nocera 2012-01-28 12:54:10 UTC
From http://www.youtube.com/watch?v=607uIdBmozU&feature=youtu.be

"
Will be also a support for the Dual screen( 'monitor 1' 'monitor 2' button)?
"
Comment 1 Olivier Fourdan 2012-06-28 14:41:13 UTC
Created attachment 217528 [details] [review]
Proposed patch

Patch to implement the feature in gnome-settigns-daemon (applies to g-s-d)

This patch goes on top of the patch for OSD window, ie bug 676170
Comment 2 Olivier Fourdan 2012-07-03 11:26:15 UTC
Created attachment 217923 [details] [review]
Updated patch

Updated patch after commit ecb0e2d0 (bug 668547) and new patch for bug 679062
Comment 3 Bastien Nocera 2012-08-21 09:38:48 UTC
Is that blocking on bug 679062 or is it ready to go in for GNOME 3.6?
Comment 4 Olivier Fourdan 2012-08-21 12:38:33 UTC
(In reply to comment #3)
> Is that blocking on bug 679062 or is it ready to go in for GNOME 3.6?

2 different functionalities, it's just that the code shares the same portion so the patch depends on the patch from bug 679062 but that's not a real dependency.

Will post an updated patch without the need for the patch from bug 679062
Comment 5 Olivier Fourdan 2012-08-21 12:40:16 UTC
Created attachment 221986 [details] [review]
Updated patch without the need for the patch from bug 679062

That patch should apply cleanly on current got head.
Comment 6 Bastien Nocera 2012-08-21 13:04:27 UTC
Review of attachment 221986 [details] [review]:

Looks good apart from the current_monitor calculation.

::: plugins/wacom/gsd-wacom-manager.c
@@ +1070,3 @@
+		return;
+
+	current_monitor = gsd_wacom_device_get_display_monitor (device);

You should probably check for -1 as the current_monitor, otherwise you'll go:
-1 (first monitor)
0 (first monitor)
1 (second monitor)
etc.

@@ +1072,3 @@
+	current_monitor = gsd_wacom_device_get_display_monitor (device);
+
+	if (++current_monitor >= n_monitors)

Can you do the increment and the comparison separately please?
Comment 7 Olivier Fourdan 2012-08-21 13:07:43 UTC
(In reply to comment #6)
> Review of attachment 221986 [details] [review]:
> 
> Looks good apart from the current_monitor calculation.
> 
> ::: plugins/wacom/gsd-wacom-manager.c
> @@ +1070,3 @@
> +        return;
> +
> +    current_monitor = gsd_wacom_device_get_display_monitor (device);
> 
> You should probably check for -1 as the current_monitor, otherwise you'll go:
> -1 (first monitor)
> 0 (first monitor)
> 1 (second monitor)

No, this is on purpose. -1 does not mean the first monitor but entire screen, so do:
 -1 (all screen)
  0 (first monitor)
  1 (second monitor)
  and so on

That's how the Windows impl works iirc.

> @@ +1072,3 @@
> +    current_monitor = gsd_wacom_device_get_display_monitor (device);
> +
> +    if (++current_monitor >= n_monitors)
> 
> Can you do the increment and the comparison separately please?

OK, will do.
Comment 8 Olivier Fourdan 2012-08-21 14:22:28 UTC
Created attachment 222004 [details] [review]
Updated patch

Adds a define for "-1" which means "entire screen, all monitors" and do the do the increment and the comparison separately as per review (comment #6)
Comment 9 Olivier Fourdan 2012-08-21 15:30:53 UTC
Patch pushed to git