r53551 - in /desktop/unstable/evince/debian: changelog patches/series patches/traditional_menu_bar.patch patches/unity_normal_titlebar.patch

jbicha at users.alioth.debian.org jbicha at users.alioth.debian.org
Thu Sep 7 02:29:41 UTC 2017


Author: jbicha
Date: Thu Sep  7 02:29:41 2017
New Revision: 53551

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=53551
Log:
Add patches from Ubuntu to show traditional menu bar outside GNOME

Added:
    desktop/unstable/evince/debian/patches/traditional_menu_bar.patch
    desktop/unstable/evince/debian/patches/unity_normal_titlebar.patch
Modified:
    desktop/unstable/evince/debian/changelog
    desktop/unstable/evince/debian/patches/series

Modified: desktop/unstable/evince/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/evince/debian/changelog?rev=53551&op=diff
==============================================================================
--- desktop/unstable/evince/debian/changelog	[utf-8] (original)
+++ desktop/unstable/evince/debian/changelog	[utf-8] Thu Sep  7 02:29:41 2017
@@ -2,6 +2,9 @@
 
   * New upstream release
   * debian/libevdocument3-4.symbols: add new symbols
+  * Add patches from Ubuntu to show traditional menu bar outside GNOME:
+    - traditional_menu_bar.patch
+    - unity_normal_titlebar.patch
 
  -- Jeremy Bicha <jbicha at debian.org>  Wed, 06 Sep 2017 07:54:48 -0400
 

Modified: desktop/unstable/evince/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/evince/debian/patches/series?rev=53551&op=diff
==============================================================================
--- desktop/unstable/evince/debian/patches/series	[utf-8] (original)
+++ desktop/unstable/evince/debian/patches/series	[utf-8] Thu Sep  7 02:29:41 2017
@@ -1 +1,3 @@
 01_nautilus_extension_path.patch
+traditional_menu_bar.patch
+unity_normal_titlebar.patch

Added: desktop/unstable/evince/debian/patches/traditional_menu_bar.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/evince/debian/patches/traditional_menu_bar.patch?rev=53551&op=file
==============================================================================
--- desktop/unstable/evince/debian/patches/traditional_menu_bar.patch	(added)
+++ desktop/unstable/evince/debian/patches/traditional_menu_bar.patch	[utf-8] Thu Sep  7 02:29:41 2017
@@ -0,0 +1,393 @@
+From 8b2440b23466b2b9e30a92122b4ed9496484ae54 Mon Sep 17 00:00:00 2001
+From: Lars Uebernickel <lars.uebernickel at canonical.com>
+Date: Thu, 30 Jan 2014 15:13:38 +0100
+Subject: Add traditional menu bar
+
+This menu bar will only be shown when the desktop requests this through
+the gtk-shell-shows-app-menu and gtk-shell-shows-menubar settings.
+
+The view and action menus are hidden when the menubar is shown.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=736419
+
+Index: evince-3.22.1/shell/ev-application.c
+===================================================================
+--- evince-3.22.1.orig/shell/ev-application.c
++++ evince-3.22.1/shell/ev-application.c
+@@ -44,12 +44,15 @@
+ #include "ev-media-player-keys.h"
+ #endif /* ENABLE_DBUS */
+ 
++extern gboolean in_desktop (const gchar *name);
++
+ struct _EvApplication {
+ 	GtkApplication base_instance;
+ 
+ 	gchar *uri;
+ 
+ 	gchar *dot_dir;
++	GMenu *bookmarks_menu;
+ 
+ #ifdef ENABLE_DBUS
+         EvEvinceApplication *skeleton;
+@@ -1040,6 +1043,26 @@ app_about_cb (GSimpleAction *action,
+ }
+ 
+ static void
++ev_application_update_bookmarks_menu (EvApplication *application)
++{
++        GtkWindow *window;
++
++        /* The bookmarks menu has two sections: the first one contains
++         * the "Add Bookmark" menu item and the second one is filled
++         * with the active window's bookmarks.
++         */
++
++        if (g_menu_model_get_n_items (G_MENU_MODEL (application->bookmarks_menu)) == 2)
++                g_menu_remove (application->bookmarks_menu, 1);
++
++        window = gtk_application_get_active_window (GTK_APPLICATION (application));
++        if (window) {
++                g_menu_append_section (application->bookmarks_menu, NULL,
++                                       ev_window_get_bookmarks_menu (EV_WINDOW (window)));
++        }
++}
++
++static void
+ ev_application_startup (GApplication *gapplication)
+ {
+         const GActionEntry app_menu_actions[] = {
+@@ -1099,6 +1122,25 @@ ev_application_startup (GApplication *ga
+                                          app_menu_actions, G_N_ELEMENTS (app_menu_actions),
+                                          application);
+ 
++        if (!in_desktop ("GNOME")) {
++                GtkBuilder *builder;
++                GError *error = NULL;
++
++                builder = gtk_builder_new ();
++                gtk_builder_add_from_resource (builder, "/org/gnome/evince/gtk/traditional-menus.ui", &error);
++                g_assert_no_error (error);
++
++                gtk_application_set_app_menu (GTK_APPLICATION (application), NULL);
++                gtk_application_set_menubar (GTK_APPLICATION (application),
++                                             G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
++
++                application->bookmarks_menu = G_MENU (gtk_builder_get_object (builder, "bookmarks"));
++                g_signal_connect_swapped (application, "notify::active-window",
++                                          G_CALLBACK (ev_application_update_bookmarks_menu), application);
++                ev_application_update_bookmarks_menu (application);
++                g_object_unref (builder);
++        }
++
+         for (it = action_accels; it[0]; it += g_strv_length ((gchar **)it) + 1)
+                 gtk_application_set_accels_for_action (GTK_APPLICATION (application), it[0], &it[1]);
+ }
+Index: evince-3.22.1/shell/ev-application.h
+===================================================================
+--- evince-3.22.1.orig/shell/ev-application.h
++++ evince-3.22.1/shell/ev-application.h
+@@ -75,6 +75,8 @@ void              ev_application_show_he
+                                                       GdkScreen       *screen,
+                                                       const char      *topic);
+ 
++gboolean          ev_application_has_traditional_menus (EvApplication *application);
++
+ G_END_DECLS
+ 
+ #endif /* !EV_APPLICATION_H */
+Index: evince-3.22.1/shell/evince.gresource.xml.in
+===================================================================
+--- evince-3.22.1.orig/shell/evince.gresource.xml.in
++++ evince-3.22.1/shell/evince.gresource.xml.in
+@@ -21,5 +21,6 @@
+     <file alias="ui/evince.css" compressed="true">@EVINCE_CSS@</file>
+     <file alias="ui/thumbnail-frame.png" compressed="true">thumbnail-frame.png</file>
+     <file alias="gtk/menus.ui" compressed="true" preprocess="xml-stripblanks">evince-menus.ui</file>
++    <file alias="gtk/traditional-menus.ui" compressed="true" preprocess="xml-stripblanks">traditional-menus.ui</file>
+   </gresource>
+ </gresources>
+Index: evince-3.22.1/shell/ev-window.c
+===================================================================
+--- evince-3.22.1.orig/shell/ev-window.c
++++ evince-3.22.1/shell/ev-window.c
+@@ -634,6 +634,8 @@ update_chrome_visibility (EvWindow *wind
+ 
+ 	set_widget_visibility (priv->toolbar, toolbar);
+ 	set_widget_visibility (priv->sidebar, sidebar);
++
++	gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (window), !presentation);
+ }
+ 
+ static void
+@@ -7075,7 +7077,6 @@ ev_window_new (void)
+ 	ev_window = GTK_WIDGET (g_object_new (EV_TYPE_WINDOW,
+ 					      "type", GTK_WINDOW_TOPLEVEL,
+                                               "application", g_application_get_default (),
+-					      "show-menubar", FALSE,
+ 					      NULL));
+ 
+ 	return ev_window;
+Index: evince-3.22.1/shell/Makefile.am
+===================================================================
+--- evince-3.22.1.orig/shell/Makefile.am
++++ evince-3.22.1/shell/Makefile.am
+@@ -174,7 +174,8 @@ EXTRA_DIST = \
+ 	evince-icon.rc \
+ 	evince.gresource.xml.in \
+ 	ev-gdbus.xml \
+-	ev-daemon-gdbus.xml
++	ev-daemon-gdbus.xml \
++	traditional-menus.ui
+ 
+ GRESOURCE_XML_IN_FILES = evince.gresource.xml.in
+ GRESOURCE_XML_FILE = $(GRESOURCE_XML_IN_FILES:.xml.in=.xml)
+Index: evince-3.22.1/shell/traditional-menus.ui
+===================================================================
+--- /dev/null
++++ evince-3.22.1/shell/traditional-menus.ui
+@@ -0,0 +1,234 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!--
++  Copyright © 2014 Canonical Ltd.
++
++  This program is free software; you can redistribute it and/or modify
++  it under the terms of the GNU General Public License as published by
++  the Free Software Foundation; either version 3, or (at your option)
++  any later version.
++
++  This program is distributed in the hope conf it will be useful,
++  but WITHOUT ANY WARRANTY; without even the implied warranty of
++  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++  GNU General Public License for more details.
++
++  You should have received a copy of the GNU General Public License
++  along with this program; if not, write to the Free Software
++  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++  Author: Lars Uebernickel <lars.uebernickel at canonical.com>
++-->
++<interface>
++  <menu id="menubar">
++    <submenu>
++      <attribute name="label" translatable="yes">_File</attribute>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Open…</attribute>
++          <attribute name="action">win.open</attribute>
++          <attribute name="accel"><Ctrl>O</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Op_en a Copy</attribute>
++          <attribute name="action">win.open-copy</attribute>
++          <attribute name="accel"><Ctrl>N</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Save a Copy…</attribute>
++          <attribute name="action">win.save-copy</attribute>
++          <attribute name="accel"><Ctrl>S</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Send _To…</attribute>
++          <attribute name="action">win.send-to</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Open Containing _Folder</attribute>
++          <attribute name="action">win.open-containing-folder</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Print…</attribute>
++          <attribute name="action">win.print</attribute>
++          <attribute name="accel"><Ctrl>P</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">P_roperties…</attribute>
++          <attribute name="action">win.show-properties</attribute>
++          <attribute name="accel"><Alt>Return</attribute>
++        </item>
++      </section>
++      <item>
++        <link name="section" id="recent">
++        </link>
++      </item>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Close</attribute>
++          <attribute name="action">win.close</attribute>
++          <attribute name="accel"><Ctrl>W</attribute>
++        </item>
++      </section>
++    </submenu>
++    <submenu>
++      <attribute name="label" translatable="yes">_Edit</attribute>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Copy</attribute>
++          <attribute name="action">win.copy</attribute>
++          <attribute name="accel"><Ctrl>C</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Select _All</attribute>
++          <attribute name="action">win.select-all</attribute>
++          <attribute name="accel"><Ctrl>A</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Find</attribute>
++          <attribute name="action">win.find</attribute>
++          <attribute name="accel"><Ctrl>F</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">Rotate _Left</attribute>
++          <attribute name="action">win.rotate-left</attribute>
++          <attribute name="accel"><Ctrl>Left</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Rotate _Right</attribute>
++          <attribute name="action">win.rotate-right</attribute>
++          <attribute name="accel"><Ctrl>Right</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">Save Current Settings as _Default</attribute>
++          <attribute name="action">win.save-settings</attribute>
++          <attribute name="accel"><Ctrl>T</attribute>
++        </item>
++      </section>
++    </submenu>
++    <submenu>
++      <attribute name="label" translatable="yes">_View</attribute>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Continuous</attribute>
++          <attribute name="action">win.continuous</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Dual</attribute>
++          <attribute name="action">win.dual-page</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">Side _Pane</attribute>
++          <attribute name="action">win.show-side-pane</attribute>
++          <attribute name="accel">F9</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Fullscreen</attribute>
++          <attribute name="action">win.fullscreen</attribute>
++          <attribute name="accel">F11</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Pre_sentation</attribute>
++          <attribute name="action">win.presentation</attribute>
++          <attribute name="accel">F5</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">Zoom _In</attribute>
++          <attribute name="action">win.zoom-in</attribute>
++          <attribute name="accel"><Ctrl>plus</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">Zoom _Out</attribute>
++          <attribute name="action">win.zoom-out</attribute>
++          <attribute name="accel"><Ctrl>minus</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Odd Pages Left</attribute>
++          <attribute name="action">win.dual-odd-left</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Inverted Colors</attribute>
++          <attribute name="action">win.inverted-colors</attribute>
++          <attribute name="accel"><Ctrl>I</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Reload</attribute>
++          <attribute name="action">win.reload</attribute>
++          <attribute name="accel"><Ctrl>R</attribute>
++        </item>
++      </section>
++    </submenu>
++    <submenu>
++      <attribute name="label" translatable="yes">_Go</attribute>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Previous Page</attribute>
++          <attribute name="action">win.go-previous-page</attribute>
++          <attribute name="accel">p</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Next Page</attribute>
++          <attribute name="action">win.go-next-page</attribute>
++          <attribute name="accel">n</attribute>
++        </item>
++      </section>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_First Page</attribute>
++          <attribute name="action">win.go-first-page</attribute>
++          <attribute name="accel"><Ctrl>Home</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Last Page</attribute>
++          <attribute name="action">win.go-last-page</attribute>
++          <attribute name="accel"><Ctrl>End</attribute>
++        </item>
++      </section>
++    </submenu>
++    <submenu id="bookmarks">
++        <attribute name="label" translatable="yes">_Bookmarks</attribute>
++        <section>
++          <item>
++            <attribute name="label" translatable="yes">_Add Bookmark</attribute>
++            <attribute name="action">win.add-bookmark</attribute>
++          </item>
++        </section>
++    </submenu>
++    <submenu>
++      <attribute name="label" translatable="yes">_Help</attribute>
++      <section>
++        <item>
++          <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
++          <attribute name="action">win.show-help-overlay</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_Help</attribute>
++          <attribute name="action">app.help</attribute>
++          <attribute name="accel">F1</attribute>
++        </item>
++        <item>
++          <attribute name="label" translatable="yes">_About</attribute>
++          <attribute name="action">app.about</attribute>
++        </item>
++      </section>
++    </submenu>
++  </menu>
++</interface>
+Index: evince-3.22.1/po/POTFILES.in
+===================================================================
+--- evince-3.22.1.orig/po/POTFILES.in
++++ evince-3.22.1/po/POTFILES.in
+@@ -65,4 +65,5 @@ shell/ev-zoom-action.c
+ shell/main.c
+ [type: gettext/glade]shell/evince-menus.ui
+ [type: gettext/glade]shell/help-overlay.ui
++[type: gettext/glade]shell/traditional-menus.ui
+ evince.appdata.xml.in

Added: desktop/unstable/evince/debian/patches/unity_normal_titlebar.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/evince/debian/patches/unity_normal_titlebar.patch?rev=53551&op=file
==============================================================================
--- desktop/unstable/evince/debian/patches/unity_normal_titlebar.patch	(added)
+++ desktop/unstable/evince/debian/patches/unity_normal_titlebar.patch	[utf-8] Thu Sep  7 02:29:41 2017
@@ -0,0 +1,100 @@
+# Description: use GtkHeaderBar as decoration only under gnome-shell
+# Reported as a wishlist on https://bugzilla.gnome.org/show_bug.cgi?id=736420
+# The solution should probably be different from the getenv one though
+Index: evince-3.22.1/shell/ev-window.c
+===================================================================
+--- evince-3.22.1.orig/shell/ev-window.c
++++ evince-3.22.1/shell/ev-window.c
+@@ -100,6 +100,8 @@
+ #include <X11/extensions/XInput2.h>
+ #endif
+ 
++extern gboolean in_desktop (const gchar *name);
++
+ typedef enum {
+ 	PAGE_MODE_DOCUMENT,
+ 	PAGE_MODE_PASSWORD
+@@ -6732,8 +6734,16 @@ ev_window_init (EvWindow *ev_window)
+ 
+ 	ev_window->priv->toolbar = ev_toolbar_new (ev_window);
+ 	gtk_widget_set_no_show_all (ev_window->priv->toolbar, TRUE);
+-	gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (ev_window->priv->toolbar), TRUE);
+-	gtk_window_set_titlebar (GTK_WINDOW (ev_window), ev_window->priv->toolbar);
++	if (in_desktop ("GNOME")) {
++		gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (ev_window->priv->toolbar), TRUE);
++		gtk_window_set_titlebar (GTK_WINDOW (ev_window), ev_window->priv->toolbar);
++		gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (ev_window->priv->toolbar)), "toolbar");
++	}
++	else {
++		gtk_box_pack_start (GTK_BOX (ev_window->priv->main_box),
++					ev_window->priv->toolbar,
++					FALSE, TRUE, 0);
++	}
+ 	gtk_widget_show (ev_window->priv->toolbar);
+ 
+ 	/* Window title */
+Index: evince-3.22.1/shell/ev-window-title.c
+===================================================================
+--- evince-3.22.1.orig/shell/ev-window-title.c
++++ evince-3.22.1/shell/ev-window-title.c
+@@ -29,6 +29,8 @@
+ #define EV_BACKEND_PS  "PSDocument"
+ #define EV_BACKEND_PDF "PdfDocument"
+ 
++gboolean in_desktop (const gchar *name);
++
+ typedef struct
+ {
+ 	const gchar *backend;
+@@ -105,6 +107,30 @@ ev_window_title_sanitize_title (EvWindow
+ 	}
+ }
+ 
++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;
++}
++
++
+ static void
+ ev_window_title_update (EvWindowTitle *window_title)
+ {
+@@ -142,7 +168,8 @@ ev_window_title_update (EvWindowTitle *w
+ 	switch (window_title->type) {
+ 	case EV_WINDOW_TITLE_DOCUMENT:
+ 		gtk_window_set_title (window, title);
+-		if (title_header && subtitle) {
++		if (title_header && subtitle && 
++		    in_desktop ("GNOME")) {
+ 			gtk_header_bar_set_title (toolbar, title_header);
+ 			gtk_header_bar_set_subtitle (toolbar, subtitle);
+ 		}
+@@ -154,8 +181,10 @@ ev_window_title_update (EvWindowTitle *w
+ 		gtk_window_set_title (window, password_title);
+ 		g_free (password_title);
+ 
++		if (in_desktop ("GNOME")) {
+                 gtk_header_bar_set_title (toolbar, _("Password Required"));
+                 gtk_header_bar_set_subtitle (toolbar, title);
++        	}
+         }
+ 		break;
+         case EV_WINDOW_TITLE_RECENT:




More information about the pkg-gnome-commits mailing list