How do I hide the Toolbar in Evince Full Screen Mode?

Solution 1:

The short answer is, you can't.

Evince 3.4.0 (on 12.04) had the option to hide the toolbar from the menu View > Toolbar then select Fullscreen from the menu or via F11 key will hide the toolbar in fullscreen mode.

Apparently, this feature has been removed from newer version of Evince and it has been reported as bug on launchpad and in mailing list as well.

Perhaps this might be fixed with newer version, but who knows.

Immediate workarounds would be either:

  • using window manager as suggested by @zarnaik
  • use other PDF viewer such as MuPDF, etc.

I have used MuPDF on Xubuntu 14.04, and it seems to achieve what you want: no toolbar and able to zoom to any width, while viewing in fullscreen.

Solution 2:

I came across the exact same problem you did. I have not been able to sucessfully hide the toolbar, though I have come up with a way to emulate the behaviour.

I simply maximise the evince window. Then using keyboard shortcuts Alt + Space to open up the window context menu.

resize

Follow this by z to select resiz̲e in the menu (in English, may differ depending on language used). Once in resize-mode you should be able to use the arrow key Up to enlarge the window. You simply elongate it until both menu and toolbar are "outside" of the screen.

Alternatively, you simply drag down the window a little and lengthen it as needed. then drag it back up.

It may be possible that evince appears under any dock or task bar you have running, this can be fixed by setting the window layer to always on top.

always on top

I am not familiar with the dock/task bar you use, so results may vary. Let me know if it works out for you. (I use openbox with tint2 dock)

Solution 3:

Hiding the toolbar is not possible in evince either in Ubuntu 14.04 or 16.04, nor in upstream/vanilla evince (unmodified by Ubuntu), though if you're desperate, you can patch the source and recompile.

In vanilla evince, in full-screen mode, the toolbar autohides, which is somewhat helpful, if not entirely sufficient (semi-intelligent behaviour never does exactly what you desire, plus it would be very convenient to be able to hide the toolbar not in full-screen mode as well — arguably that is when the screen-space savings are particularly important).

Unfortunately, for evince as packaged in Ubuntu (14.04 and 16.04), even that is not possible. It seems that the (otherwise very useful) Ubuntu-specific patches returning a normal menu-bar and normal location of the toolbar, break the auto-hiding behaviour, exacerbating the problem.

Bug reports

The relevant bugs (ubuntu-specific and upstream) are here:

https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1522527

https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1409291

https://bugzilla.gnome.org/show_bug.cgi?id=714996

Patches

Working patches were provided (by Reinis Danne) in the GNOME bug report, but they were not accepted. Direct links for 3.12, the contemporary master branch and 3.14.

Luckily, these patches can still be manually applied (copy-pasting the code) to evince 3.18, as found in Ubuntu 16.04. Applying them directly with patch appears not to work, probably due to slight changes in the surrounding code.

To get the source:

apt-get source evince
cd evince-3.18.2/

If this doesn't work, uncomment the deb-src lines in /etc/apt/sources.list.

Apply the following patch (adapted from the ones provided by Reinis Danne, linked above and provided here for completeness):

--- a/shell/ev-application.c    2018-01-02 23:00:00.502095551 +0100
+++ b/shell/ev-application.c    2018-01-03 23:15:00.713553169 +0100
@@ -1059,9 +1059,24 @@
 }

 static void
+app_toggle_toolbar_cb (GSimpleAction *action,
+                       GVariant      *parameter,
+                       gpointer       user_data)
+{
+        EvApplication *application = user_data;
+        EvWindow      *window      = EV_WINDOW (gtk_application_get_active_window (GTK_APPLICATION (application)));
+        GActionMap    *action_map  = G_ACTION_MAP (window);
+        GAction       *gaction     = g_action_map_lookup_action (action_map, "toggle-toolbar");
+
+        g_action_activate (gaction, NULL);
+}
+
+
+static void
 ev_application_startup (GApplication *gapplication)
 {
         const GActionEntry app_menu_actions[] = {
+       { "toggle-toolbar", app_toggle_toolbar_cb, NULL, NULL, NULL },
        { "new",  app_new_cb, NULL, NULL, NULL },
                 { "help", app_help_cb, NULL, NULL, NULL },
                 { "about", app_about_cb, NULL, NULL, NULL }
@@ -1095,6 +1110,7 @@
           "win.caret-navigation",       "F7", NULL,
           "win.zoom-in",                "plus", "<Ctrl>plus", "KP_Add", "<Ctrl>KP_Add", "equal", "<Ctrl>equal", NULL,
           "win.zoom-out",               "minus", "<Ctrl>minus", "KP_Subtract", "<Ctrl>KP_Subtract", NULL,
+          "win.toggle-toolbar",         "<Ctrl>H", NULL,
           "win.show-side-pane",         "F9", NULL,
           "win.fullscreen",             "F11", NULL,
           "win.presentation",           "F5", NULL,
--- a/shell/ev-window.c 2018-01-02 23:00:00.502095551 +0100
+++ b/shell/ev-window.c 2018-01-02 23:14:36.995706943 +0100
@@ -4907,6 +4907,27 @@
 }

 static void
+ev_window_view_cmd_toggle_toolbar (GSimpleAction *action,
+                                   GVariant      *state,
+                                   gpointer       user_data)
+{
+        EvWindow        *ev_window = user_data;
+        EvWindowPrivate *priv      = ev_window->priv;
+
+        gboolean toolbar;
+        gboolean presentation;
+
+        presentation = EV_WINDOW_IS_PRESENTATION (ev_window);
+
+        toolbar = ((priv->chrome & EV_CHROME_TOOLBAR) != 0  ||
+                   (priv->chrome & EV_CHROME_RAISE_TOOLBAR) != 0) && !presentation;
+
+        update_chrome_flag (ev_window, EV_CHROME_TOOLBAR, !toolbar);
+
+        set_widget_visibility (priv->toolbar, !toolbar);
+}
+
+static void
 ev_window_view_cmd_toggle_sidebar (GSimpleAction *action,
                   GVariant      *state,
                   gpointer       user_data)
@@ -5697,6 +5718,7 @@
    { "continuous", NULL, NULL, "true", ev_window_cmd_continuous },
    { "dual-page", NULL, NULL, "false", ev_window_cmd_dual },
    { "dual-odd-left", NULL, NULL, "false", ev_window_cmd_dual_odd_pages_left },
+   { "toggle-toolbar", NULL, NULL, "true", ev_window_view_cmd_toggle_toolbar },
    { "show-side-pane", NULL, NULL, "false", ev_window_view_cmd_toggle_sidebar },
    { "inverted-colors", NULL, NULL, "false", ev_window_cmd_view_inverted_colors },
    { "fullscreen", NULL, NULL, "false", ev_window_cmd_view_fullscreen },
--- a/shell/evince-menus.ui 2018-01-02 23:00:00.502095551 +0100
+++ b/shell/evince-menus.ui 2018-01-03 23:16:02.969635772 +0100
@@ -21,6 +21,12 @@
   <menu id="appmenu">
     <section>
       <item>
+        <attribute name="label" translatable="yes">_Toggle toolbar</attribute>
+        <attribute name="action">app.toggle-toolbar</attribute>
+        <attribute name="accel">&lt;Primary&gt;H</attribute>
+      </item>
+    </section>    <section>
+      <item>
         <attribute name="label" translatable="yes">_New Window</attribute>
         <attribute name="action">app.new</attribute>
       </item>
@@ -41,6 +47,10 @@
   <menu id="view-menu">
     <section>
       <item>
+        <attribute name="label" translatable="yes">_Toolbar</attribute>
+   <attribute name="action">win.toggle-toolbar</attribute>
+      </item>
+      <item>
         <attribute name="label" translatable="yes">_Continuous</attribute>
         <attribute name="action">win.continuous</attribute>
       </item>

with patch -p1 < name_of_patch_file.patch or using quilt (and ideally read the patch before/after applying it — it's actually quite comprehensible, especially in context).

Finally, compile evince with the standard ./configure; make; sudo make install to install the patched evince to /usr/local/. To install elsewhere, for example to avoid having to use sudo, use ./configure --prefix=/full/path/to/alternative/location/.

The patched evince will have the option of hiding the toolbar with Ctrl+h. The menu-bar will not be hidden, which may or may not be what you want.

Hiding the menu-bar

In addition to the above patch, you would need to add:

gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (ev_window), !toolbar);

to the end of the definition of ev_window_view_cmd_toggle_toolbar in shell/ev-window.c and change:

gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (window), !presentation);

to:

gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (window), !presentation && toolbar);

in the definition of update_chrome_visibility, also in shell/ev-window.c.

Security

I'd also recommend adding a /etc/apparmor.d/usr.local.bin.evince apparmor profile based on usr.bin.evince and subscribing to the Ubuntu security notices, since you won't be receiving security fixes to your version of evince. Alternatively, you might consider using something like apt-src.

Solution 4:

I am using maximus without title bar everywhere.

I solved zoom issue with magnifier in accessibility option. Shortcut: Alt+Scroll