[totem/wip/hadess/ctrl-w-back] main: Make Ctrl+W go back before exiting
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/wip/hadess/ctrl-w-back] main: Make Ctrl+W go back before exiting
- Date: Wed, 13 Feb 2019 16:06:35 +0000 (UTC)
commit edc6b6fd229c7d7463fb599ed06d4896002c9224
Author: Bastien Nocera <hadess hadess net>
Date: Wed Feb 13 17:02:39 2019 +0100
main: Make Ctrl+W go back before exiting
Make Ctrl+W the equivalent to pressing the back button, to return to the
content view from the player, or go "up" in the navigation. Ctrl+W will
still close the application when back isn't shown anymore.
Closes: #280
README | 2 ++
src/totem-object.c | 22 +++++++++++++---------
2 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/README b/README
index 21c980dfb..a578b33e9 100644
--- a/README
+++ b/README
@@ -32,6 +32,8 @@ Ctrl+H:
Undocumented shortcuts:
Ctrl+Q:
Quit
+Ctrl+W:
+ Press back button/Quit
Mouse button 1 double-click:
Toggle full screen
Middle mouse button click:
diff --git a/src/totem-object.c b/src/totem-object.c
index bd5025d4a..34a51cce7 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3275,13 +3275,6 @@ totem_object_handle_key_press (TotemObject *totem, GdkEventKey *event)
case GDK_KEY_AudioStop:
totem_object_pause (totem);
break;
- case GDK_KEY_w:
- case GDK_KEY_W:
- if (mask == GDK_CONTROL_MASK)
- totem_object_exit (totem);
- else
- retval = FALSE;
- break;
case GDK_KEY_q:
case GDK_KEY_Q:
totem_object_exit (totem);
@@ -3489,6 +3482,19 @@ window_key_press_event_cb (GtkWidget *win, GdkEventKey *event, TotemObject *tote
return totem_object_handle_key_press (totem, event);
}
+ /* Handle back/quit */
+ if (event->state & GDK_CONTROL_MASK &&
+ event->type == GDK_KEY_PRESS &&
+ (event->keyval == GDK_KEY_W ||
+ event->keyval == GDK_KEY_w)) {
+ if (totem_grilo_get_show_back_button (TOTEM_GRILO (totem->grilo)) ||
+ g_str_equal (totem_object_get_main_page (totem), "player"))
+ back_button_clicked_cb (NULL, totem);
+ else
+ totem_object_exit (totem);
+ return FALSE;
+ }
+
/* Check whether we're in the player panel */
if (!g_str_equal (totem_object_get_main_page (totem), "player"))
return FALSE;
@@ -3507,8 +3513,6 @@ window_key_press_event_cb (GtkWidget *win, GdkEventKey *event, TotemObject *tote
case GDK_KEY_l:
case GDK_KEY_q:
case GDK_KEY_Q:
- case GDK_KEY_w:
- case GDK_KEY_W:
case GDK_KEY_Right:
case GDK_KEY_Left:
case GDK_KEY_plus:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]