Slow GTK programs start on OpenBox

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Blue

Slow GTK programs start on OpenBox

Post by Blue »

Hi there,

I'm currently making a custom OpenBox setup that I'd like to use as my main DE, but I'm experiencing a really annoying bug.
The first time I start any GTK-based application like Firefox or Nemo on OpenBox (ie. first run after computer start), it takes 20~30 seconds to load, which is really long compared to the rest of my system.

Other applications doesn't have this problem, and next runs of the GTK-based programs also works well. Everything works normally on Cinnamon.

As far as I can tell, I'd say there are some libraries I'm missing to launch, but I didn't manage to find them on this distro.

Thanks in advance,
Blue :)
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
thx-1138
Level 8
Level 8
Posts: 2092
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Slow GTK programs start on OpenBox

Post by thx-1138 »

I haven't ever set up Openbox from scratch myself, however if i am to make somewhat a quick guess in the wild,
i'd say it's quite likely that you might have not set up openbox to also launch a dbus session:
https://wiki.gentoo.org/wiki/Openbox#Starting
https://wiki.parabola.nu/Openbox#Openbo ... d-alone_WM

If you indeed have set it more or less as per above, I'd still be inclined to believe it's somehow dbus services' related:
try to first check the .xsession-errors file and / or furthermore maybe run strace,
in order to see what the GTK apps in question try open, but somehow fail / time out etc...
Chances are that when the app starts up, a specific dbus service either isn't found to be already enabled,
or, as you said, it's package possibly not installed at all (eg. accessibility-related / at-spi ones come quickly to mind).
Blue

Re: Slow GTK programs start on OpenBox

Post by Blue »

Hi, here's the content of my autostart script, located at ~/.config/openbox/autostart.sh.
I just added the first line, but it doesn't seem to solve the problem:

Code: Select all

dbus-launch --sh-syntax --exit-with-session &
hsetroot -solid "#000000" &
nitrogen --restore &
tint2 -c /home/thibaut/.config/tint2/storm-side.tint2rc &
(sleep 1 && tint2 -c /home/thibaut/.config/tint2/clock.tint2rc) &
(sleep 1 && xcompmgr) &
volti &
Could you give any instructions on using strace ?
Last edited by Blue on Sun Mar 10, 2019 6:26 am, edited 1 time in total.
Blue

Re: Slow GTK programs start on OpenBox

Post by Blue »

I did some search based on what you said about DBus, and added the following lines into my autostart, which slightly improved the things:

Code: Select all

if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
       eval `dbus-launch --sh-syntax --exit-with-session`
fi
However, Firefox still takes 15 seconds to load. Uh, I guess I'll have to blame it for being too heavy... Still, why does it only do this on first run ?
Last edited by Blue on Sun Mar 10, 2019 6:27 am, edited 1 time in total.
User avatar
thx-1138
Level 8
Level 8
Posts: 2092
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Slow GTK programs start on OpenBox

Post by thx-1138 »

Blue: applications get cached in memory, so that execution is faster the next time they're run.
If you run sudo sysctl vm.drop_caches=3 (under whatever desktop configuration),
you'll find that the next time you'll start an application, it will take way much longer to do so.

What came to mind in the first place above was more or less something among those lines.
Similar issues with running window managers instead of full-blown desktops: 1, 2, 3...

Other than that - i'm the least qualified person to advise / guide you through this
(the 'haven't ever set up Openbox from scratch myself' part...) :-)
Hopefully someone familiar with such will help you figuring it out...
Blue

Re: Slow GTK programs start on OpenBox

Post by Blue »

Ok, I'll take a look at this.
However, if someone accustomed to Openbox could guide me trough the process, it would be really great :wink:
Locked

Return to “Software & Applications”