Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-11-19 03:56:13

vx
Member
Registered: 2021-11-19
Posts: 2

[SOLVED] How to prevent Thunar dbus communication?

Hello

From what I gathered, Thunar uses dbus to find existing processes of itself, passes the window control to it and then terminates itself as a process, leaving the window to be managed by the "daemon" (I use quotes, because it doesn't have to be a daemon to behave like one, just like when you just start Thunar).

So just like in the topic, how to stop Thunar from looking up its own instances in the system, or is it impossible in the principle?

Basically, I need separate Thunar process (in my case, it's a subprocess), or at least one that won't kill itself when spawned while Thunar "daemon" is already running.
I figured already that there is no configuration that would force such behavior, thus I thought it would be possible to stop it from discovering existing instance. I kinda don't want to tinker with source code too, thus looking for alternative solutions.

As a note: I have very basic understanding of dbus (at most dbusctl as of now) and service setup. Thunar version: 4.16.8, Linux distribution: ParrotOS (debian fork)

Can I ask for any ideas?

PS: I also thought of finding out and using window ID of the window that subprocess creates, but it will create specific race condition, and the code of my script will heavily increase in complexity and size, thus I'd like to avoid this option.

Last edited by vx (2021-11-19 14:50:50)

Offline

#2 2021-11-19 06:30:09

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: [SOLVED] How to prevent Thunar dbus communication?

Hello and welcome.

I'm no dbus expert myself, but as I understand it, if you run thunar with dbus-launch ("dbus-launch thunar") it will create a new mini-message bus for each thunar instance and keep the individual processes separated in that "ps -ef | grep thunar" will show each instance as a separate process.


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 2021-11-19 14:51:23

vx
Member
Registered: 2021-11-19
Posts: 2

Re: [SOLVED] How to prevent Thunar dbus communication?

Yes, thank you, that indeed is what I was looking for, it starts entirely separate process which seems to do the trick. But new problem popped up, thunar launched this way has like 10s delay before window shows up. This seems like Thunar's problem, since process itself shows up immediately after using dbus-launch.

Anyhow, I'll work on it now, I marked the question as solved, many thanks again smile


EDIT: It seems that packages xdg-desktop-portal and xdg-desktop-portal-gtk were the culprits, gtk-based applications seem to have problems when launched as dbus sessions, with removal of aforementioned packages everything works nice and dandy!

EDIT2: Very important note for people finding this thread: do not use dbus-launch, it will create a session, but won't remove it even after program, the launcher called, exits and will be left hanging in the process tree, effectively accumulating every time dbus-launch is called (it's in the documentation anyway, in the NOTE section). dbus-run-session is the correct answer to this case, as it will close the created session (i.e. kill the dbus process) after quitting (in my case closing Thunar).

Last edited by vx (2021-11-19 18:19:12)

Offline

Board footer

Powered by FluxBB