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 690087 - shell: Allow using the back button on a mouse to go to the home page
shell: Allow using the back button on a mouse to go to the home page
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: shell
unspecified
Other All
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-12 10:06 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-03-26 14:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell: Allow using the back button on a mouse to go to the home page (1.57 KB, patch)
2012-12-12 10:06 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
shell: Allow using the back button on a mouse to go to the home page (1.59 KB, patch)
2012-12-14 07:09 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-12-12 10:06:39 UTC
See patch. This is a small hidden feature that I find useful.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-12-12 10:06:41 UTC
Created attachment 231332 [details] [review]
shell: Allow using the back button on a mouse to go to the home page

Just a tiny hidden feature that I've wanted for a while.
Comment 2 Bastien Nocera 2012-12-12 11:58:44 UTC
Review of attachment 231332 [details] [review]:

::: shell/gnome-control-center.c
@@ +1234,3 @@
+  /* back button */
+  if (event->button == 8)
+    shell_show_overview_page (self);

Your compiler should have shown you a warning here.
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-12-14 07:09:04 UTC
Created attachment 231540 [details] [review]
shell: Allow using the back button on a mouse to go to the home page

Just a tiny hidden feature that I've wanted for a while.



Gah. I have no idea how that slipped by.
Comment 4 Bastien Nocera 2012-12-14 10:47:24 UTC
Review of attachment 231540 [details] [review]:

::: shell/gnome-control-center.c
@@ +1234,3 @@
+{
+  /* back button */
+  if (event->button == 8)

Use a #define for the mouse button, eg. MOUSE_BUTTON_BACK

@@ +1236,3 @@
+  if (event->button == 8)
+    shell_show_overview_page (self);
+  return TRUE;

I don't think you really tested this. You're eating *all* the mouse release events.

@@ +1437,3 @@
   g_signal_connect_after (priv->window, "key_press_event",
                           G_CALLBACK (window_key_press_event), self);
+  g_signal_connect (priv->window, "button-release-event",

Any reason for the release button being used instead of the press button?
Otherwise you need to trace the origin of the mouse button with things such as enter/leave pairs, etc. Not as simple as key handling.
Comment 5 Jeremy Bicha 2013-01-17 06:45:12 UTC
If we're going to recognize the "back" button on a mouse as a shortcut to show the Settings overview, shouldn't we also accept Alt+Left and XF86Back for this?
Comment 6 Bastien Nocera 2013-01-17 06:52:57 UTC
(In reply to comment #5)
> If we're going to recognize the "back" button on a mouse as a shortcut to show
> the Settings overview, shouldn't we also accept Alt+Left and XF86Back for this?

Like in bug 691601 you mean? :)
Comment 7 Jeremy Bicha 2013-01-17 07:02:31 UTC
(In reply to comment #6)
> > If we're going to recognize the "back" button on a mouse as a shortcut to show
> > the Settings overview, shouldn't we also accept Alt+Left and XF86Back for this?
> 
> Like in bug 691601 you mean? :)

OK, can we get Alt+Left too? Thanks!
Comment 8 Bastien Nocera 2013-01-17 07:26:25 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > > If we're going to recognize the "back" button on a mouse as a shortcut to show
> > > the Settings overview, shouldn't we also accept Alt+Left and XF86Back for this?
> > 
> > Like in bug 691601 you mean? :)
> 
> OK, can we get Alt+Left too? Thanks!

In bug 681653 comment 7 I explained why we should use it.
At least not until we get navigation in the control-center shell (bug 643322)
Comment 9 Bastien Nocera 2013-03-26 14:49:02 UTC
Committed a fixed version of this to master. Note that some widget are
eating the mouse events when they shouldn't, see bug 696640.