diff -Nru file-roller-3.24.1/debian/changelog file-roller-3.24.1/debian/changelog --- file-roller-3.24.1/debian/changelog 2017-04-29 16:03:32.000000000 +0000 +++ file-roller-3.24.1/debian/changelog 2017-05-18 15:15:01.000000000 +0000 @@ -1,3 +1,10 @@ +file-roller (3.24.1-0ubuntu2) UNRELEASED; urgency=medium + + * debian/patches/bz_unity_headerbar.patch: + - use headerbar in toolbar-mode in Unity (LP: #1689239) + + -- Marco Trevisan (TreviƱo) Thu, 18 May 2017 15:15:01 +0000 + file-roller (3.24.1-0ubuntu1) artful; urgency=medium * New upstream release diff -Nru file-roller-3.24.1/debian/patches/bz_unity_headerbar.patch file-roller-3.24.1/debian/patches/bz_unity_headerbar.patch --- file-roller-3.24.1/debian/patches/bz_unity_headerbar.patch 2017-04-29 16:03:32.000000000 +0000 +++ file-roller-3.24.1/debian/patches/bz_unity_headerbar.patch 2017-05-18 15:13:59.000000000 +0000 @@ -20,10 +20,10 @@ create mode 100644 src/desktop.c create mode 100644 src/desktop.h -Index: file-roller-3.20.2/src/Makefile.am +Index: file-roller-3.24.1/src/Makefile.am =================================================================== ---- file-roller-3.20.2.orig/src/Makefile.am -+++ file-roller-3.20.2/src/Makefile.am +--- file-roller-3.24.1.orig/src/Makefile.am ++++ file-roller-3.24.1/src/Makefile.am @@ -154,6 +154,8 @@ COMMON_SOURCES = \ preferences.h \ rar-utils.c \ @@ -33,10 +33,10 @@ typedefs.h \ $(MKDTEMP_FILES) \ $(BUILT_SOURCES) -Index: file-roller-3.20.2/src/desktop.c +Index: file-roller-3.24.1/src/desktop.c =================================================================== --- /dev/null -+++ file-roller-3.20.2/src/desktop.c ++++ file-roller-3.24.1/src/desktop.c @@ -0,0 +1,26 @@ +#include +#include @@ -64,10 +64,10 @@ + + return in_list; +} -Index: file-roller-3.20.2/src/desktop.h +Index: file-roller-3.24.1/src/desktop.h =================================================================== --- /dev/null -+++ file-roller-3.20.2/src/desktop.h ++++ file-roller-3.24.1/src/desktop.h @@ -0,0 +1,8 @@ +#ifndef _DESKTOP_H +#define _DESKTOP_H @@ -77,11 +77,11 @@ +gboolean in_desktop (const gchar *name); + +#endif /* _DESKTOP_H */ -Index: file-roller-3.20.2/src/fr-window.c +Index: file-roller-3.24.1/src/fr-window.c =================================================================== ---- file-roller-3.20.2.orig/src/fr-window.c -+++ file-roller-3.20.2/src/fr-window.c -@@ -56,6 +56,7 @@ +--- file-roller-3.24.1.orig/src/fr-window.c ++++ file-roller-3.24.1/src/fr-window.c +@@ -59,6 +59,7 @@ #include "gtk-utils.h" #include "open-file.h" #include "typedefs.h" @@ -89,7 +89,7 @@ #define LAST_OUTPUT_SCHEMA_NAME "LastOutput" #define MAX_HISTORY_LEN 5 -@@ -1959,7 +1960,8 @@ fr_window_set_title (FrWindow *window, +@@ -1974,7 +1975,8 @@ fr_window_set_title (FrWindow *window, const char *title) { gtk_window_set_title (GTK_WINDOW (window), title); @@ -99,7 +99,7 @@ } -@@ -5755,8 +5757,13 @@ fr_window_construct (FrWindow *window) +@@ -5775,8 +5777,16 @@ fr_window_construct (FrWindow *window) window->priv->headerbar = gtk_header_bar_new (); gtk_widget_show (window->priv->headerbar); @@ -110,15 +110,18 @@ + gtk_window_set_titlebar (GTK_WINDOW (window), window->priv->headerbar); + } + else { ++ GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (window->priv->headerbar)); ++ gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TITLEBAR); ++ gtk_style_context_add_class (context, GTK_STYLE_CLASS_PRIMARY_TOOLBAR); + fr_window_attach (FR_WINDOW (window), window->priv->headerbar, FR_WINDOW_AREA_MENUBAR); + } /* header bar buttons */ -Index: file-roller-3.20.2/src/fr-location-bar.c +Index: file-roller-3.24.1/src/fr-location-bar.c =================================================================== ---- file-roller-3.20.2.orig/src/fr-location-bar.c -+++ file-roller-3.20.2/src/fr-location-bar.c +--- file-roller-3.24.1.orig/src/fr-location-bar.c ++++ file-roller-3.24.1/src/fr-location-bar.c @@ -91,14 +91,18 @@ fr_location_bar_init (FrLocationBar *sel style_context = gtk_widget_get_style_context (GTK_WIDGET (self)); diff -Nru file-roller-3.24.1/debian/patches/bz_unity_headerbar.patch~ file-roller-3.24.1/debian/patches/bz_unity_headerbar.patch~ --- file-roller-3.24.1/debian/patches/bz_unity_headerbar.patch~ 1970-01-01 00:00:00.000000000 +0000 +++ file-roller-3.24.1/debian/patches/bz_unity_headerbar.patch~ 2017-04-29 16:03:32.000000000 +0000 @@ -0,0 +1,146 @@ +From c5ea020f84ac495f335b19f960dcbd8f2305d493 Mon Sep 17 00:00:00 2001 +From: Robert Ancell +Date: Mon, 20 Oct 2014 16:02:31 -0400 +Subject: [PATCH] Don't use GtkHeaderBar in Unity + +When running in Unity, File Roller looks out of place due to the use of the +GtkHeaderBar. If we place the GtkHeaderBar where a traditional toolbar would +be and use the window manager decorations it fits in better. + +https://bugzilla.gnome.org/show_bug.cgi?id=739596 +--- + src/Makefile.am | 2 ++ + src/desktop.c | 24 ++++++++++++++++++++++++ + src/desktop.h | 8 ++++++++ + src/dlg-add.c | 7 +++++-- + src/fr-file-selector-dialog.c | 3 ++- + src/fr-new-archive-dialog.c | 3 ++- + src/fr-window.c | 15 +++++++++++---- + 7 files changed, 54 insertions(+), 8 deletions(-) + create mode 100644 src/desktop.c + create mode 100644 src/desktop.h + +Index: file-roller-3.20.2/src/Makefile.am +=================================================================== +--- file-roller-3.20.2.orig/src/Makefile.am ++++ file-roller-3.20.2/src/Makefile.am +@@ -154,6 +154,8 @@ COMMON_SOURCES = \ + preferences.h \ + rar-utils.c \ + rar-utils.h \ ++ desktop.c \ ++ desktop.h \ + typedefs.h \ + $(MKDTEMP_FILES) \ + $(BUILT_SOURCES) +Index: file-roller-3.20.2/src/desktop.c +=================================================================== +--- /dev/null ++++ file-roller-3.20.2/src/desktop.c +@@ -0,0 +1,26 @@ ++#include ++#include ++#include "desktop.h" ++ ++gboolean ++in_desktop (const gchar *name) ++{ ++ const gchar *desktop_name_list; ++ gchar **names; ++ gboolean in_list = FALSE; ++ gint i; ++ ++ desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP"); ++ if (!desktop_name_list) ++ return FALSE; ++ ++ names = g_strsplit (desktop_name_list, ":", -1); ++ for (i = 0; names[i] && !in_list; i++) ++ if (strcmp (names[i], name) == 0) { ++ in_list = TRUE; ++ break; ++ } ++ g_strfreev (names); ++ ++ return in_list; ++} +Index: file-roller-3.20.2/src/desktop.h +=================================================================== +--- /dev/null ++++ file-roller-3.20.2/src/desktop.h +@@ -0,0 +1,8 @@ ++#ifndef _DESKTOP_H ++#define _DESKTOP_H ++ ++#include ++ ++gboolean in_desktop (const gchar *name); ++ ++#endif /* _DESKTOP_H */ +Index: file-roller-3.20.2/src/fr-window.c +=================================================================== +--- file-roller-3.20.2.orig/src/fr-window.c ++++ file-roller-3.20.2/src/fr-window.c +@@ -56,6 +56,7 @@ + #include "gtk-utils.h" + #include "open-file.h" + #include "typedefs.h" ++#include "desktop.h" + + #define LAST_OUTPUT_SCHEMA_NAME "LastOutput" + #define MAX_HISTORY_LEN 5 +@@ -1959,7 +1960,8 @@ fr_window_set_title (FrWindow *window, + const char *title) + { + gtk_window_set_title (GTK_WINDOW (window), title); +- gtk_header_bar_set_title (GTK_HEADER_BAR (window->priv->headerbar), title); ++ if (in_desktop ("GNOME")) ++ gtk_header_bar_set_title (GTK_HEADER_BAR (window->priv->headerbar), title); + } + + +@@ -5755,8 +5757,13 @@ fr_window_construct (FrWindow *window) + + window->priv->headerbar = gtk_header_bar_new (); + gtk_widget_show (window->priv->headerbar); +- gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (window->priv->headerbar), TRUE); +- gtk_window_set_titlebar (GTK_WINDOW (window), window->priv->headerbar); ++ if (in_desktop ("GNOME")) { ++ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (window->priv->headerbar), TRUE); ++ gtk_window_set_titlebar (GTK_WINDOW (window), window->priv->headerbar); ++ } ++ else { ++ fr_window_attach (FR_WINDOW (window), window->priv->headerbar, FR_WINDOW_AREA_MENUBAR); ++ } + + /* header bar buttons */ + +Index: file-roller-3.20.2/src/fr-location-bar.c +=================================================================== +--- file-roller-3.20.2.orig/src/fr-location-bar.c ++++ file-roller-3.20.2/src/fr-location-bar.c +@@ -91,14 +91,18 @@ fr_location_bar_init (FrLocationBar *sel + + style_context = gtk_widget_get_style_context (GTK_WIDGET (self)); + gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_TOOLBAR); +- gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_PRIMARY_TOOLBAR); + gtk_style_context_add_class (style_context, "location-bar"); + +- css_provider = gtk_css_provider_new (); +- gtk_css_provider_load_from_data (css_provider, css, -1, NULL); +- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), +- GTK_STYLE_PROVIDER (css_provider), +- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); ++ if (in_desktop("GNOME")) { ++ gtk_style_context_add_class (style_context, ++ GTK_STYLE_CLASS_PRIMARY_TOOLBAR); ++ ++ css_provider = gtk_css_provider_new (); ++ gtk_css_provider_load_from_data (css_provider, css, -1, NULL); ++ gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), ++ GTK_STYLE_PROVIDER (css_provider), ++ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); ++ } + } + +