32

I am having problems with some programs when using overlay-scrollbars, mainly Code::Blocks and Eclipse.

I've found several ways of disabling the overlay scrollbars completely, for all applications, but I like them and I don't want to do this.

Is there a way to blacklist only this applications from using the new scrollbars?

7 Answers 7

31

I am going to answer my own question. Thanks to the user "SevenMachines" in ubuntuforums, I've found a way to disable overlay scrollbars for a specific application. I did a shell script with the following (for eclipse, for example):

#!/bin/sh
LIBOVERLAY_SCROLLBAR=0 eclipse

Then, make it executable, and using the "Menu editor", changed eclipse to point to the script.

3
  • I can confirm this works and is awesome! Apr 29, 2011 at 14:15
  • Worked beautifully for me too. Kind of annoying that you have to do it though... Apr 29, 2011 at 15:17
  • This is a fantastic solution, thank you! It allowed me to troubleshoot some of the problems I had with overlay scrollbars and Inkscape. Mar 27, 2013 at 2:13
18

Alternatively, in your .bashrc add the following

alias eclipse="LIBOVERLAY_SCROLLBAR=0 eclipse"

In fact, you may also want to add UBUNTU_MENUPROXY=0 so unity menus work properly with eclipse, so that becomes:

alias eclipse="UBUNTU_MENUPROXY=0 LIBOVERLAY_SCROLLBAR=0 eclipse"

[Note: that this will only take effect once you restart your bash shell]

1
  • Take note that do source .bashrc to apply without restarting May 7, 2017 at 10:15
18

You could edit the .desktop File like this:

cp /usr/share/applications/eclipse.desktop ~/.local/share/applications/

...then put...

env LIBOVERLAY_SCROLLBAR=0

to the Exec Field that the file looks afterwards like this:

[Desktop Entry]
Categories=Development;IDE;Java;
Comment=Eclipse Integrated Development Environment
Exec=env LIBOVERLAY_SCROLLBAR=0 eclipse
Icon=eclipse
Name=Eclipse
Terminal=false
Type=Application

I use the unity-launcher-editor to easily change this via a GUI.

2
  • 3
    i think this is a very good solution to the problem as it leaves the installation of eclipse untouched and doesn't require you to write additional scripts and stuff... thx!
    – xmoex
    May 1, 2012 at 8:20
  • Unfortunately this doesn't work here with Eclipse 2021-09 on Kubuntu 20.04. The line is Exec=env LIBOVERLAY_SCROLLBAR=0 GTK_IM_MODULE=ibus /home/geri/eclipse/jee-2021-09/eclipse/eclipse, I closed Eclipse, started it from the .desktop but the floating scroll bars are still there. It works for the system itself after doing this: webupd8.org/2011/04/how-to-disable-overlay-scrollbars-in.html. Nov 3, 2021 at 12:20
10

/usr/bin/eclipse is a start script by itself. You can edit this in a text editor and add the following lines (the same as mentioned in other answers), below the line GDK_NATIVE_WINDOWS=true.

export UBUNTU_MENUPROXY=0
export LIBOVERLAY_SCROLLBAR=0
5

A more generic alternative to the above answers would be this simple script that I called "regular-scrollbars":

#!/bin/sh
LIBOVERLAY_SCROLLBAR=0 "$1"

Save that someplace on your path, and then you can use the menu editor to add "regular-scrollbars" before any command you want (as long as it only has one argument - try "$@" if you think you'll need more than one).

This means you won't have to make a new script for any other programs you want to revert to the old scrollbars.

I really like the bashrc alias example too though, you could probably make it more generic by providing a list of programs you want to revert and having bashrc loop over them, adding the aliases.

1

I have got the following working in Ubuntu 14.04 with Eclipse Mars 4.5.2, thanks to http://osdir.com/ml/ubuntu-bugs/2015-05/msg10672.html

$ more ~/.local/share/applications/eclipse.desktop
[Desktop Entry]
Type=Application
Name=Eclipse
Comment=Eclipse Integrated Development Environment
Icon=/opt/eclipse/icon.xpm
Exec=env LIBOVERLAY_SCROLLBAR=0 SWT_GTK3=0 /opt/eclipse/eclipse
Terminal=false
Categories=Development;IDE;Java;
0

For the specific issue of overlay scrollbars in Eclipse, I was able to get them working properly by following the instructions in this blog post and a related Ubuntu question.

You edit the eclipse launch script.

sudo gedit /usr/bin/eclipse

And comment out an environment variable that is working around some old bugs that are supposedly now fixed.

#export GDK_NATIVE_WINDOWS=true

The next time I launched Eclipse, the scroll bars worked.

1
  • Don't do that! Editing files under /usr/bin/ is bad as they're solely managed by dpkg. They will be overwritten without any noticed upon the next (security) update of the package they belong to. Jul 21, 2016 at 21:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .