summaryrefslogtreecommitdiff
path: root/src/totem-sidebar.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2012-04-18 17:34:12 +0100
committerBastien Nocera <hadess@hadess.net>2012-04-18 17:34:12 +0100
commit883f12cfcb38906b2f36a3638d4062740cea08f2 (patch)
tree04c8884bd6f3312e965f4caa60348b9eb276c7cd /src/totem-sidebar.c
parent1491a764d59aefdc50904f2f28f30be63b43f2c3 (diff)
downloadtotem-883f12cfcb38906b2f36a3638d4062740cea08f2.tar.gz
main: Make "Esc" give away focus on sidebar button too
https://bugzilla.gnome.org/show_bug.cgi?id=629252
Diffstat (limited to 'src/totem-sidebar.c')
-rw-r--r--src/totem-sidebar.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/totem-sidebar.c b/src/totem-sidebar.c
index ff48d582d..cfc1a5d3b 100644
--- a/src/totem-sidebar.c
+++ b/src/totem-sidebar.c
@@ -107,16 +107,19 @@ has_popup (void)
gboolean
totem_sidebar_is_focused (Totem *totem, gboolean *handles_kbd)
{
- GtkWidget *focused;
+ GtkWidget *focused, *sidebar_button;
if (handles_kbd != NULL)
*handles_kbd = has_popup ();
focused = gtk_window_get_focus (GTK_WINDOW (totem->win));
- if (focused != NULL && gtk_widget_is_ancestor
- (focused, GTK_WIDGET (totem->sidebar)) != FALSE) {
+ if (focused == NULL)
+ return FALSE;
+ if (gtk_widget_is_ancestor (focused, GTK_WIDGET (totem->sidebar)) != FALSE)
+ return TRUE;
+ sidebar_button = GTK_WIDGET (gtk_builder_get_object (totem->xml, "tmw_sidebar_button_hbox"));
+ if (gtk_widget_is_ancestor (focused, sidebar_button) != FALSE)
return TRUE;
- }
return FALSE;
}