Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOBORDER patch behaves incorrectly when used with SWALLOW patch #430

Closed
mohammad-amin-khajeh opened this issue Jul 14, 2024 · 2 comments
Closed

Comments

@mohammad-amin-khajeh
Copy link

mohammad-amin-khajeh commented Jul 14, 2024

Steps to reproduce issue 1:

  • Run a command from the terminal which swallows the terminal and replaces it
  • Borders are shown even though there's only one window on the tag(either when after launching the "swallower" window or restoring the swallowed terminal)

Expected behavior:

  • Window borders are still hidden is shown because there is one window on the tag

Steps to reproduce issue 2:

  • Open nsxiv as fullscreen from the terminal with the SWALLOW patch
  • Nsxiv is not fullscreen and the window borders are shown(again)

Expected behavior:

  • Nsxiv starts fullscreen and no window border is shown

My specs:

  • Distro: arch linux
  • Dwm version: latest version of flexipatch

My patches:

BAR_LTSYMBOL_PATCH 1
BAR_STATUS_PATCH 1
BAR_SYSTRAY_PATCH 1
BAR_TAGS_PATCH 1
BAR_WINTITLE_PATCH 1
BAR_HIDEVACANTTAGS_PATCH 1
BAR_PADDING_VANITYGAPS_PATCH 1
BAR_PADDING_SMART_PATCH 1
BAR_STATUSPADDING_PATCH 1
ALWAYSCENTER_PATCH 1
AUTOSTART_PATCH 1
BIDI_PATCH 1
CENTER_TRANSIENT_WINDOWS_PATCH 1
CFACTS_PATCH 1
CYCLELAYOUTS_PATCH 1
FOCUSDIR_PATCH 1
FULLSCREEN_PATCH 1
NOBORDER_PATCH 1
NO_TRANSPARENT_BORDERS_PATCH 1
ON_EMPTY_KEYS_PATCH 1
PERTAG_PATCH 1
PLACEDIR_PATCH 1
RESTARTSIG_PATCH 1
RIODRAW_PATCH 1
SAVEFLOATS_PATCH 1
SEAMLESS_RESTART_PATCH 1
SELFRESTART_PATCH 1
STACKER_PATCH 1
SWALLOW_PATCH 1
SWAPFOCUS_PATCH 1
TOGGLEFULLSCREEN_PATCH 1
TOGGLELAYOUT_PATCH 1
TOGGLETAG_PATCH 1
VANITYGAPS_PATCH 1
VIEWONTAG_PATCH 1
WARP_PATCH 1
XRDB_PATCH 1
TILE_LAYOUT 1
MONOCLE_LAYOUT 1

Here's a video demonstrating the issues:

obs.2024-07-14.07-52-20.mp4
@bakkeby
Copy link
Owner

bakkeby commented Jul 14, 2024

Out of the 300 or so patches for dwm the noborder patch is the one that introduces the most obscure issues across the board and in general it is best avoided.

I pushed a compatibility fix for swallow + noborder. I suppose arguably it might be better not to fix this as realistically you would run into this issue (as well as many others) if you were to build up your own dwm from scratch using standalone patches only.

For Issue 2 you said that the expected behaviour is that nsxiv starts fullscreen and no window border is shown.

I think what is the expected behaviour in this case is that the new window ends up in the same location and have the same size as the terminal window that started it (as per swallow logic).

At least the swallow patch does not consider that special case.

The way that I have this implemented in my own build is that I just disallow swallowing for windows that start in fullscreen, e.g. something like this:

diff --git a/dwm.c b/dwm.c
index 198b77b..91a8a48 100644
--- a/dwm.c
+++ b/dwm.c
@@ -2615,8 +2615,10 @@ manage(Window w, XWindowAttributes *wa)
        }
        #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH

-       if (getatomprop(c, netatom[NetWMState], XA_ATOM) == netatom[NetWMFullscreen])
+       if (getatomprop(c, netatom[NetWMState], XA_ATOM) == netatom[NetWMFullscreen]) {
                setfullscreen(c, 1);
+               term = NULL; /* do not allow terminals to be swallowed by windows that start in fullscreen */
+       }

        XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
        grabbuttons(c, 0);

@mohammad-amin-khajeh
Copy link
Author

Great it's perfect now!
As for the nsxiv issue I decided to just do RULE(.class = "Nsxiv", .noswallow = 1) since most of the times I start nsxiv in fullscreen anyway.
Anyways thank you I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants