padgettr / rfm

Simple file manager for dwm
Other
11 stars 2 forks source link

start rfm in current graphic context? #6

Open guyuming76 opened 1 year ago

guyuming76 commented 1 year ago

i usually have DWL (wayland) and DWM(xorg) started on different tty.

but when i run rfm in DWM, it will show in DWL. I can fix it by running rfm with

GDK_BACKEND=x11 rfm

I had seen this behavior in many other applications.

But, is it possible make starting rfm on current display the default behavior?

I find these: https://docs.gtk.org/gdk3/class.AppLaunchContext.html https://docs.gtk.org/gio/method.AppLaunchContext.get_display.html

, but not sure whether this is relevant, and don't know how to use it in rfm

padgettr commented 1 year ago

I have never run Wayland and X together like that, so have not come across this. It must be to do with the order that gtk tries backends. You could try using: GDK_BACKEND=help rfm To list available backends. If Wayland come first in the list, this means that Wayland is tried first. There might be a way of handling backend from code, but I don't know what it is, you could have a look at this page: https://jan.newmarch.name/Wayland/GTK/

Other options would be to set GDK_BACKEND in the dwm X session, or set it when calling rfm from config.h (either with code or exec through sh), or use a wrapper script to set it, e.g. xrfm.sh. I think setting it for whole X would be best if other gtk apps have the same behaviour.

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: guyuming @.> Sent: Monday, May 1, 2023 9:23:23 AM To: padgettr/rfm @.> Cc: Subscribed @.***> Subject: [padgettr/rfm] start rfm in current graphic context? (Issue #6)

i usually have DWL (wayland) and DWM(xorg) started on different tty.

but when i run rfm in DWM, it will show in DWL. I can fix it by running rfm with

GDK_BACKEND=x11 rfm

I had seen this behavior in many other applications.

But, is it possible make starting rfm on current display the default behavior?

I find this: https://docs.gtk.org/gdk3/class.AppLaunchContext.html , but not sure if this is relevant, and don't know how to use it in rfm

— Reply to this email directly, view it on GitHubhttps://github.com/padgettr/rfm/issues/6, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB25FQ53E3ZXWIHMXOUS4JLXD5XHXANCNFSM6AAAAAAXRRXZIU. You are receiving this because you are subscribed to this thread.Message ID: @.***>

guyuming76 commented 1 year ago

@padgettr , thanks! adding export GDK_BACKEND=x11 in .xinitrc for dwm is a good workaround for me. I usually have one DWL instance and one DWM instance, now rfm window won't appear in other display server.