summaryrefslogtreecommitdiff
path: root/src/nautilus-toolbar.c
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-03-31 15:36:44 +0200
committerCarlos Soriano <csoriano@gnome.org>2016-04-14 10:35:16 +0200
commit1863c30f978a6ebaa4985eeb81d36d33993c5579 (patch)
tree3183de1c39c9fe2070f184386bcd3cb237202073 /src/nautilus-toolbar.c
parentcc31a95fd8411ec495e3a4c62e0788c50535e3ec (diff)
downloadnautilus-1863c30f978a6ebaa4985eeb81d36d33993c5579.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. https://bugzilla.gnome.org/show_bug.cgi?id=712620
Diffstat (limited to 'src/nautilus-toolbar.c')
-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);
}