davatorium / rofi

Rofi: A window switcher, application launcher and dmenu replacement
https://davatorium.github.io/rofi/
Other
13.05k stars 608 forks source link

[BUG] window mode: cannot close selected window (2bwm) #1639

Closed vredesbyyrd closed 2 years ago

vredesbyyrd commented 2 years ago

Rofi version (rofi -v)

Version: 1.7.3-72-g3376db96 (makepkg)

Configuration

https://gist.github.com/vredesbyyrd/a02576e569d4b4247f6e909b00029dd7

Launch command

rofi -show window

Step to reproduce

Expected behavior

selected window will close

Actual behavior

selected window remains open

Additional information

Hi,

Unfortunately in 2bwm we are unable to close windows with rofi window mode. My best guess is since 2bwm has not fully implemented EWMH, it uses ICCCM to close windows. EDIT: actually it looks like 2bwm is falling back to using xcb_kill_client. note, I'm really in over my head, so take everything I say with a grain of salt.

skippy-xd (a window expose like tool) has an config option to define which method to close windows: icccm close function, which works in 2bwm.

Having a config option for this is rather clunky imo, but maybe rofi could fallback to trying icccm if it detects the wm is not fully EWMH compliant? Most of this over my head, i'm just looking at the code to try and grasp whats potentially going on. And I would file a bug with 2bwm but it does not have an open issue tracker.

Currently I am doing -window-command "xdotool windowclose {window}" as a workaround, but the close-on-delete: false; config option sounds really useful.

Thanks for your time.

DaveDavenport commented 2 years ago

Wouldn't it be better to fix this in 2bwm so it implements ewmh, instead of adding a hackish workaround for it in rofi? Not sure why this is a rofi bug? this looks more like a feature request.

(rofi uses ewmh to detect the WM, not even sure that will work then with 2bwm?

xcb_ewmh_set_wm_name(ewmh, screen->root, 4, "2bwm"); that should work,

DaveDavenport commented 2 years ago

And I would file a bug with 2bwm but it does not have an open issue tracker.

Therefor it is a rofi bug? I don't follow.

DaveDavenport commented 2 years ago

My reply might sound a bit negative, apologies. I will accept a patch that implements an exception for 2bwm, we have more workarounds for odd wm's. I don't run it myself, so it might be easier if a user of it makes the patch.

DaveDavenport commented 2 years ago

https://github.com/davatorium/rofi/blob/next/source/xcb.c#L1440 here we check what window manager we run, and we set a bitmask with what work-around to apply.

vredesbyyrd commented 2 years ago

My reply might sound a bit negative, apologies. I will accept a patch that implements an exception for 2bwm, we have more workarounds for odd wm's. I don't run it myself, so it might be easier if a user of it makes the patch.

No, slowing down and thinking about - your right. I should have labeled this feature request and it makes more sense to resolve on the wm side.

First, I'll see if I can figured it out in 2bwm. I'll close this.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.