summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-03-31 15:36:44 +0200
committerCarlos Soriano <csoriano@gnome.org>2016-04-06 10:58:22 +0200
commit65af02447e42807e6939ff31839d64e2f1a7ad49 (patch)
treece46f43bad2862303c3773b8ecb14bbee882f386
parent80f6591658c3247e81cdfab93acd9708a441137e (diff)
downloadnautilus-65af02447e42807e6939ff31839d64e2f1a7ad49.tar.gz
toolbar: use widget visibility instead of desktop special casing
We need to avoid showing the operations popover in the desktop, or basically in any window that has the disable-chrome property set. We can check inside the toolbar if the toolbar itself is hidden in order to know whether it makes sense to show the operations popover. In this way we don't relay in special casing subclasses of the window.
-rw-r--r--src/nautilus-toolbar.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index ac4221f97..657a308bc 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -30,7 +30,6 @@
#include "nautilus-window.h"
#include "nautilus-progress-info-widget.h"
#include "nautilus-application.h"
-#include "nautilus-desktop-window.h"
#include <libnautilus-private/nautilus-global-preferences.h>
#include <libnautilus-private/nautilus-ui-utilities.h>
@@ -600,8 +599,11 @@ update_operations (NautilusToolbar *self)
TRUE);
gtk_widget_queue_draw (self->priv->operations_icon);
- /* Show the popover at start to increase visibility */
- if (!NAUTILUS_IS_DESKTOP_WINDOW (self->priv->window)) {
+ /* Show the popover at start to increase visibility.
+ * Check whether the toolbar is visible or not before showing the
+ * popover. This can happens if the window has the disables-chrome
+ * property set. */
+ if (gtk_widget_get_visible (GTK_WIDGET (self))) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->priv->operations_button),
TRUE);
}