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

7,502

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

Share:
7,502

Related videos on Youtube

dataconsumer
Author by

dataconsumer

Updated on September 18, 2022

Comments

  • dataconsumer
    dataconsumer almost 2 years

    Let me preface this by saying I'm new to Linux, but I'm willing to try anything you wizards can conjure up (preferably a keyboard shortcut though)!

    When I use Evince 3.10.3 in full screen mode I'm greeted with this nice-looking, but semi-annoying toolbar that takes up some of my screen real estate at the top...:

    That Beautiful Toolbar That's Getting in My Way...

    In the Evince documentation I see that the section on the Toolbar says to Show, hide, or edit the toolbar; when I go to the page all I see is a layout of the corresponding functions of the toolbar, but no information is given as to how I can hide the toolbar:

    Okay, This Looks Good! Wait, Where's The Tip & Trick?!

    How do I hide the toolbar in Evince version 3.10.3, or a version that includes this similar setup with the toolbar?

    P.S. Sometimes the toolbar magically fades away. I just want a way to invoke this behavior on demand. Thanks!

    • Sergiy Kolodyazhnyy
      Sergiy Kolodyazhnyy over 9 years
      have you tried F5 , which is presentation mode ? there's no toolbar there
    • dataconsumer
      dataconsumer over 9 years
      I have tried F5, which does remove the toolbar, but unfortunately zooming is disabled in presentation mode as well. I want to be able to zoom to page-width.
    • Admin
      Admin almost 9 years
      there is similar post asked in earlier release as well, except without any workaround.
    • Wilf
      Wilf over 8 years
      The toolbar 'magically fades away' when the mouse is not near it. As you are using Gnome you can use the Pixel Saver or Maximus two extensions to hide the titlebars of most apps, like Chrome does (sort of). Also, what theme are you using :)
  • Alexx Roche
    Alexx Roche over 6 years
    Very nice work around
  • aplaice
    aplaice over 6 years
    For ease of application, both full patches are here: gist.github.com/aplaice/5b2b75c410ee32ad57335466713b75e8
  • Ashok Koyi
    Ashok Koyi almost 6 years
    But the problem is you can have full width in presentation mode. The characters look so small
  • karel
    karel almost 6 years
    Presentation mode looks nice for viewing the digital booklets that come with albums downloaded from iTunes or 7digital.
  • aplaice
    aplaice over 3 years
    For later versions of Evince, it seems that Reinis Danne (the original author of the patch described in this answer) has a soft fork of Evince allowing toggling of toolbars here, but I haven't tested it yet.