diff -Nru evince-3.10.0/debian/changelog evince-3.10.0/debian/changelog --- evince-3.10.0/debian/changelog 2013-10-08 15:21:13.000000000 -0400 +++ evince-3.10.0/debian/changelog 2013-11-14 09:35:18.000000000 -0500 @@ -1,3 +1,11 @@ +evince (3.10.0-0ubuntu2.1~md1) saucy; urgency=low + + * debian/patches/ubuntu_unity_menubar.patch: add back traditional menus + when being used under Unity, to be consistent with other applications + and to make the HUD work properly. (LP: #1131664) + + -- Marc Deslauriers Wed, 13 Nov 2013 16:47:41 -0500 + evince (3.10.0-0ubuntu2) saucy; urgency=low * debian/apparmor-profile: Update evince profiles diff -Nru evince-3.10.0/debian/patches/series evince-3.10.0/debian/patches/series --- evince-3.10.0/debian/patches/series 2013-09-30 07:47:38.000000000 -0400 +++ evince-3.10.0/debian/patches/series 2013-11-14 09:30:55.000000000 -0500 @@ -1,3 +1,4 @@ 11_grip_gestures.patch CVE-2013-3718.patch +ubuntu_unity_menubar.patch diff -Nru evince-3.10.0/debian/patches/ubuntu_unity_menubar.patch evince-3.10.0/debian/patches/ubuntu_unity_menubar.patch --- evince-3.10.0/debian/patches/ubuntu_unity_menubar.patch 1969-12-31 19:00:00.000000000 -0500 +++ evince-3.10.0/debian/patches/ubuntu_unity_menubar.patch 2013-11-14 09:35:56.000000000 -0500 @@ -0,0 +1,295 @@ +Description: add back traditional menus when being used under Unity, to be + consistent with other applications and to make the HUD work properly. + Based on work done by bluedxca93. Basically reverts the following upstream + commits, along with a few other changes: + https://git.gnome.org/browse/evince/commit/?id=d372faec45a6366fcd23b48d7c9fa61576dbb4f8 + https://git.gnome.org/browse/evince/commit/?id=bf8703face715b27c49ed816e482ce888221ea64 + https://git.gnome.org/browse/evince/commit/?id=6c0b4f8562046dbbe2aeb25e87b243282ebb83a2 + https://git.gnome.org/browse/evince/commit/?id=6652414e6e3688184ae89591f73646034c53e2ce +Author: Marc Deslauriers +Bug-Ubuntu: https://bugs.launchpad.net/ayatana-design/+bug/1131664 +Forwarded: No, Ubuntu specific. + +Index: evince-3.10.0/shell/ev-window.c +=================================================================== +--- evince-3.10.0.orig/shell/ev-window.c 2013-11-14 08:44:24.821645153 -0500 ++++ evince-3.10.0/shell/ev-window.c 2013-11-14 08:49:17.653654326 -0500 +@@ -108,12 +108,13 @@ + } EvWindowPageMode; + + typedef enum { +- EV_CHROME_TOOLBAR = 1 << 0, +- EV_CHROME_FINDBAR = 1 << 1, +- EV_CHROME_RAISE_TOOLBAR = 1 << 2, +- EV_CHROME_FULLSCREEN_TOOLBAR = 1 << 3, +- EV_CHROME_SIDEBAR = 1 << 4, +- EV_CHROME_NORMAL = EV_CHROME_TOOLBAR | EV_CHROME_SIDEBAR ++ EV_CHROME_MENUBAR = 1 << 0, ++ EV_CHROME_TOOLBAR = 1 << 1, ++ EV_CHROME_FINDBAR = 1 << 2, ++ EV_CHROME_RAISE_TOOLBAR = 1 << 3, ++ EV_CHROME_FULLSCREEN_TOOLBAR = 1 << 4, ++ EV_CHROME_SIDEBAR = 1 << 5, ++ EV_CHROME_NORMAL = EV_CHROME_MENUBAR | EV_CHROME_TOOLBAR | EV_CHROME_SIDEBAR + } EvChrome; + + typedef enum { +@@ -127,6 +128,7 @@ + EvChrome chrome; + + GtkWidget *main_box; ++ GtkWidget *menubar; + GtkWidget *toolbar; + GtkWidget *hpaned; + GtkWidget *view_box; +@@ -480,6 +486,8 @@ + ev_window_set_action_sensitive (ev_window, "ViewContinuous", has_pages); + ev_window_set_action_sensitive (ev_window, "ViewDual", has_pages); + ev_window_set_action_sensitive (ev_window, "ViewDualOddLeft", has_pages); ++ ev_window_set_action_sensitive (ev_window, "FitPage", has_pages); ++ ev_window_set_action_sensitive (ev_window, "FitWidth", has_pages); + ev_window_set_action_sensitive (ev_window, "ViewReload", has_pages); + ev_window_set_action_sensitive (ev_window, "ViewAutoscroll", has_pages); + ev_window_set_action_sensitive (ev_window, "ViewInvertedColors", has_pages); +@@ -576,16 +584,22 @@ + update_chrome_visibility (EvWindow *window) + { + EvWindowPrivate *priv = window->priv; +- gboolean toolbar, findbar, sidebar; +- gboolean presentation; ++ gboolean menubar, toolbar, findbar, sidebar; ++ gboolean fullscreen_mode, presentation, fullscreen, unity; + + presentation = EV_WINDOW_IS_PRESENTATION (window); ++ fullscreen = ev_document_model_get_fullscreen (priv->model); ++ fullscreen_mode = fullscreen || presentation; ++ unity = (g_getenv ("XDG_CURRENT_DESKTOP") != 0 && ++ strcmp (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0); + ++ menubar = (priv->chrome & EV_CHROME_MENUBAR) != 0 && !fullscreen_mode && unity; + toolbar = ((priv->chrome & EV_CHROME_TOOLBAR) != 0 || + (priv->chrome & EV_CHROME_RAISE_TOOLBAR) != 0) && !presentation; + findbar = (priv->chrome & EV_CHROME_FINDBAR) != 0; + sidebar = (priv->chrome & EV_CHROME_SIDEBAR) != 0 && priv->document && !presentation; + ++ set_widget_visibility (priv->menubar, menubar); + set_widget_visibility (priv->toolbar, toolbar); + set_widget_visibility (priv->find_bar, findbar); + set_widget_visibility (priv->sidebar, sidebar); +@@ -2745,6 +2759,13 @@ + action_name, + GTK_UI_MANAGER_MENUITEM, + FALSE); ++ gtk_ui_manager_add_ui (ev_window->priv->ui_manager, ++ ev_window->priv->recent_ui_id, ++ "/MainMenu/FileMenu/RecentFilesMenu", ++ label, ++ action_name, ++ GTK_UI_MANAGER_MENUITEM, ++ FALSE); + g_free (action_name); + g_free (label); + if (icon != NULL) +@@ -4257,7 +4278,7 @@ + window->priv->toolbar, + FALSE, TRUE, 0); + gtk_box_reorder_child (GTK_BOX (window->priv->main_box), +- window->priv->toolbar, 0); ++ window->priv->toolbar, 1); + g_object_unref (window->priv->toolbar); + + g_object_ref (window->priv->main_box); +@@ -4278,6 +4299,8 @@ + ev_document_model_set_fullscreen (window->priv->model, FALSE); + ev_window_update_fullscreen_action (window); + ++ update_chrome_visibility (window); ++ + gdk_window_remove_filter (NULL, (GdkFilterFunc)fullscreen_event_filter_func, window); + + if (unfullscreen_window) +@@ -4743,6 +4766,13 @@ + gtk_action_get_name (action), + GTK_UI_MANAGER_MENUITEM, + FALSE); ++ gtk_ui_manager_add_ui (window->priv->ui_manager, ++ window->priv->bookmarks_ui_id, ++ "/MainMenu/BookmarksMenu/BookmarksItems", ++ gtk_action_get_label (action), ++ gtk_action_get_name (action), ++ GTK_UI_MANAGER_MENUITEM, ++ FALSE); + + g_object_unref (action); + } +@@ -4779,6 +4809,14 @@ + } + + static void ++ev_window_cmd_help_contents (GtkAction *action, EvWindow *ev_window) ++{ ++ ev_application_show_help (EV_APP, ++ gtk_window_get_screen (GTK_WINDOW (ev_window)), ++ NULL); ++} ++ ++static void + ev_window_cmd_leave_fullscreen (GtkAction *action, EvWindow *window) + { + ev_window_stop_fullscreen (window, TRUE); +@@ -6010,7 +6048,12 @@ + + /* Normal items */ + static const GtkActionEntry entries[] = { ++ { "File", NULL, N_("_File") }, ++ { "Edit", NULL, N_("_Edit") }, ++ { "View", NULL, N_("_View") }, ++ { "Go", NULL, N_("_Go") }, + { "Bookmarks", NULL, N_("_Bookmarks") }, ++ { "Help", NULL, N_("_Help") }, + { "RecentFiles", NULL, N_("_Recent") }, + + /* File menu */ +@@ -6086,6 +6129,10 @@ + N_("Add a bookmark for the current page"), + G_CALLBACK (ev_window_cmd_bookmarks_add) }, + ++ /* Help menu */ ++ { "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1", NULL, ++ G_CALLBACK (ev_window_cmd_help_contents) }, ++ + { "HelpAbout", GTK_STOCK_ABOUT, N_("_About"), NULL, NULL, + G_CALLBACK (ev_window_cmd_help_about) }, + +@@ -7281,6 +7328,7 @@ + GtkCssProvider *css_provider; + GError *error = NULL; + GtkWidget *sidebar_widget; ++ GtkWidget *menuitem; + GtkWidget *overlay; + GObject *mpkeys; + guint page_cache_mb; +@@ -7413,6 +7461,18 @@ + G_CALLBACK (ev_window_setup_recent), + ev_window); + ++ ev_window->priv->menubar = ++ gtk_ui_manager_get_widget (ev_window->priv->ui_manager, ++ "/MainMenu"); ++ gtk_box_pack_start (GTK_BOX (ev_window->priv->main_box), ++ ev_window->priv->menubar, ++ FALSE, FALSE, 0); ++ menuitem = gtk_ui_manager_get_widget (ev_window->priv->ui_manager, ++ "/MainMenu/EditMenu/EditRotateLeftMenu"); ++ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE); ++ menuitem = gtk_ui_manager_get_widget (ev_window->priv->ui_manager, ++ "/MainMenu/EditMenu/EditRotateRightMenu"); ++ gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (menuitem), TRUE); + ev_window->priv->toolbar = ev_toolbar_new (ev_window); + gtk_widget_set_no_show_all (ev_window->priv->toolbar, TRUE); + gtk_widget_set_halign (ev_window->priv->toolbar, GTK_ALIGN_FILL); +@@ -7753,7 +7813,6 @@ + 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.10.0/shell/evince-ui.xml +=================================================================== +--- evince-3.10.0.orig/shell/evince-ui.xml 2013-11-14 08:44:24.821645153 -0500 ++++ evince-3.10.0/shell/evince-ui.xml 2013-11-14 08:44:24.813645153 -0500 +@@ -1,4 +1,76 @@ + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +Index: evince-3.10.0/shell/ev-application.c +=================================================================== +--- evince-3.10.0.orig/shell/ev-application.c 2013-11-14 08:44:24.821645153 -0500 ++++ evince-3.10.0/shell/ev-application.c 2013-11-14 08:44:24.813645153 -0500 +@@ -1040,6 +1040,11 @@ + + G_APPLICATION_CLASS (ev_application_parent_class)->startup (gapplication); + ++ if (g_getenv ("XDG_CURRENT_DESKTOP") != 0 && ++ strcmp (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0) { ++ return; ++ } ++ + g_action_map_add_action_entries (G_ACTION_MAP (application), + app_menu_actions, G_N_ELEMENTS (app_menu_actions), + application);