[totem/gnome-3-4] main: Make "Esc" give away focus on sidebar button too



commit d4657a7679e53c6e9ff42d07cbf2cd7c66b46397
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Apr 18 17:34:12 2012 +0100

    main: Make "Esc" give away focus on sidebar button too
    
    https://bugzilla.gnome.org/show_bug.cgi?id=629252

 src/totem-sidebar.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/totem-sidebar.c b/src/totem-sidebar.c
index ff48d58..cfc1a5d 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;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]