Xfce Forum

Sub domains
 

You are not logged in.

#1 2015-08-20 15:31:29

justasug
Member
Registered: 2014-11-09
Posts: 8

[Solved] Thunar opening files - Environment variables

I'm trying to disable GTK overlay scrollbars. Exporting GTK_OVERLAY_SCROLLING=0 as an environment variable does the trick and I get the old scrollbars back. The problem is that it doesn't seem to work when I open files from Thunar. For example: opening a file via a terminal by doing gedit path/to/file.txt works. Opening the same file through Thunar makes the overlay scrollbars appear again.

How does Thunar open files? Does it take the environment variable into account?

Additional info: I'm using Thunar outside of Xfce. The environment variable is exported through my window manager's (Openbox) environment file and it's definitely set (printenv | grep OVERLAY confirms it).

EDIT: It's not a Thunar issue. A workaround is posted below if anyone needs it. I guess it's a problem on Gedit's end.

EDIT 2: I have finally figured this out. Opening a text file with Gedit from Thunar starts Gedit via DBus activation. The overlay env. variable is indeed set for my session, but too late. Dbus sources the variables at startup and mine, including the overlay one, were set after that (via Openbox's environment file).

There are multiple ways to fix this. Editing Gedit's .desktop file by changing DBusActivatable to false works specifically for Gedit. Running

dbus-update-activation-environment --systemd --all

to make DBus aware of the new ones seems to be the best way.

Last edited by justasug (2016-03-05 18:04:42)

Offline

#2 2015-08-20 20:00:46

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,023

Re: [Solved] Thunar opening files - Environment variables

Not sure whats happening on your system (have never really used openbox) but on mine, exporting "GTK_OVERLAY_SCROLLING=0" in my ~/.bashrc file allows me to manually start gedit and/or run it through thunar with the overlay bars disabled. I can't seem to replicate this problem on a pure Xfce install (Arch Linux).


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2015-08-21 14:10:18

justasug
Member
Registered: 2014-11-09
Posts: 8

Re: [Solved] Thunar opening files - Environment variables

I just tested it from a full Xfce session (also on Arch Linux) by using .bashrc to export the environment variable. Same results, the "overlay" scrollbars are still there.
Are you starting Xfce with a display manager or manually with startx and an .xinitrc file? I disabled LightDM and started Xfce/Openbox with startx. To my surprise it worked this time. Regardless whether it's exported through .bashrc or through Openbox's environment file.

For the other situation, when it's started by LightDM, I found out that doing one of these seems to fix it:
- Exporting the environment variable in /etc/environment or .xprofile
- Adding this line to a file sourced on startup:

gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.UpdateActivationEnvironment '{"GTK_OVERLAY_SCROLLING": "0"}'

I guess this is a LightDM issue/bug. Same thing with SDDM (another display manager). I assume it's not display manager related after all.
A little more of testing revealed that it's only affecting Gedit. Other GTK3 applications behave properly and use the old, non-overlay scrollbars. Thunar had nothing to do with it.

A proper fix and the reason why this was happening is explained in the OP.

Last edited by justasug (2016-03-05 18:06:24)

Offline

#4 2015-08-21 16:32:37

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,023

Re: [Solved] Thunar opening files - Environment variables

Interesting finding. And odd that it works like that.
I don't use a DM so I start with "startx" and an .xinitrc file.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB