[gnome-software/gnome-3-20] Do not use the header bar on Unity



commit f3fc2c2bcc992b6d60a0f43777abbda680328278
Author: Richard Hughes <richard hughsie com>
Date:   Thu Apr 7 15:22:11 2016 +0100

    Do not use the header bar on Unity
    
    Based on a patch by Robert Ancell, many thanks.

 src/gs-shell.c |   12 ++++++++----
 src/gs-utils.h |    2 ++
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 5f92ba0..73319a8 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -707,10 +707,14 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
 
        /* fix up the header bar */
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "header"));
-       g_object_ref (widget);
-       gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (widget)), widget);
-       gtk_window_set_titlebar (GTK_WINDOW (priv->main_window), widget);
-       g_object_unref (widget);
+       if (gs_utils_is_current_desktop ("Unity")) {
+               gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (widget), "");
+       } else {
+               g_object_ref (widget);
+               gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (widget)), widget);
+               gtk_window_set_titlebar (GTK_WINDOW (priv->main_window), widget);
+               g_object_unref (widget);
+       }
 
        /* global keynav */
        g_signal_connect_after (priv->main_window, "key_press_event",
diff --git a/src/gs-utils.h b/src/gs-utils.h
index a0e4c94..e743f17 100644
--- a/src/gs-utils.h
+++ b/src/gs-utils.h
@@ -66,6 +66,8 @@ gchar         *gs_utils_get_user_hash         (GError         **error);
 GPermission    *gs_utils_get_permission        (const gchar    *id);
 gboolean        gs_utils_is_current_desktop    (const gchar    *name);
 
+gboolean        gs_utils_is_current_desktop    (const gchar    *name);
+
 G_END_DECLS
 
 #endif /* __GS_UTILS_H */


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