bakkeby / patches

Collection of patches for dwm, st and dmenu
285 stars 30 forks source link

how to make windowrolerule patch working together with focusedontop patch? #62

Closed adetabrani closed 1 year ago

adetabrani commented 1 year ago

Recently I added a patch focusedontop and windowrollerule with the expectation that the Firefox popup window (e.g: bookmark manager) can switch focus with the main Firefox window, for more details you can see the following video.

The results were not as expected, popup firefox window still can't switch focus behind main firefox window

simplescreenrecorder.webm

bakkeby commented 1 year ago

For me the firefox bookmark manager shows up with:

It also starts tiled for me as I don't have any rules for that.

Do you have a client rule for this window and do you also have alwaysontop = 1 for that?

adetabrani commented 1 year ago

1689470219_Jul16_08:16:59

yes, you can check it in the following image, maybe there is something wrong in my rule implementation?

bakkeby commented 1 year ago

If you set alwaysontop = 0 then it should work as you expect as the window won't be moved on top of others.

adetabrani commented 1 year ago

If you set alwaysontop = 0 then it should work as you expect as the window won't be moved on top of others.

still not working :(

bakkeby commented 1 year ago

Well that should be it really. I tried patching a bare dwm with the windowrolerule and the focusedontop patch, and setting up a rule for the "Organizer" to make it floating and I can change focus between the two windows as expected and the focused one will be on top.

This leads to general debugging questions such as:

In this scenario it could also be that the bookmark manager sends through a _NET_WM_STATE_ABOVE client message and becomes on top that way, but I don't see that happening in my case.

In your recording I noticed that on the first tag, where you demonstrate this with Inkscape being in the foreground, that the layout here is the floating layout. The behaviour you are demonstrating is what I would expect from a dwm without the focusedontop patch. The focusedontop patch intentionally skips the restack call in focusstack because the stacking order has been changed in focus and I believe that results in a bug when using floating layout. Since you do not have that bug I am thinking that you either do not have the patch or it is disabled in config.

adetabrani commented 1 year ago

noted, I've applied this patch and didn't get any errors while building, but maybe because too many patches I applied before made unexpected bugs appear, for now I will try to re-patch dan close the issue, maybe there is something I missed, thanks for the feedback

adetabrani commented 1 year ago

hi bakkeby, I've found an issue where the focusedontop patch doesn't work, the problem is in the function call to "arrange(selmon);" inside the function "focus(Client *c)"

  1. previously I applied the noborder patch with modifications for unselected clients on this link and I found the solution in the code you shared in the first comment section, but here I get a bug when I open a program that I have a rule for in my config.h file that assigns a specific tag to the program,in that section someone solved the problem by adding "arrange(selmon);" and problem is solved.
  2. it looks like the warp patch also can't work together with focusedontop patch, the warp function only works when opening a new window, the rest of the warp function doesn't work when switching focus. This bug can be solved if add "arrange(selmon);"

The conclusion is focusedontop patch works if the "arrange(selmon);" are removed, but on the other hand if I remove it then I will experience bugs in points 1 and 2. Is it possible to make the patches work with each other (at least warp with focusedontop)?

bakkeby commented 1 year ago

Yes it is not great. The focusedontop patch will need a complete rewrite to address these issues.

bakkeby commented 1 year ago

I added https://github.com/bakkeby/patches/blob/master/dwm/dwm-focusedontop-6.4.diff which should work better in all aspects. I don't include the window type rule change, but that can be added separately if need be.

adetabrani commented 1 year ago

working perfectly, thanks for the help

adetabrani commented 1 year ago

simplescreenrecorder.webm

Hi Bakkeby, recently i used dunst, here i noticed that dunst window is overlapping with another window, for that i tried to update the last focusedontop patch by adding wintype functionality, i think it works but when i try to focus the window which is below the window zoom position, there is still overlap.

is there still a shortage in adding code for the wintype function? you can check it on my repo here

bakkeby commented 1 year ago

The dunst notification window is not managed by the window manager so there is not much you can do about that I recon.

adetabrani commented 1 year ago

😭 whereas I would like the dust window to stay on top of other windows when I focus on any window. Thanks for the feedback

adetabrani commented 1 year ago

this behavior can be got when i use patch focusedontop 6.3 but i will re-experience bugs related to warp and noborder if i apply it

adetabrani commented 1 year ago

closed for this issue, I've used cursorwarp patch instead of warp patch for feature compatibility reasons