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

no border patch causes weird gimp interaction #379

Open
Zerogaku opened this issue Oct 21, 2023 · 8 comments
Open

no border patch causes weird gimp interaction #379

Zerogaku opened this issue Oct 21, 2023 · 8 comments

Comments

@Zerogaku
Copy link

hi this is a pretty specific and unimportant issue but, when having gimp open on a separate empty tag and swapping to it, the tag displays the same content as the previous tag. Gimp is present just can't display correctly, only when closing and opening it again, or opening it on a tag that has 1 or more windows, this happens when a compositor is enabled for some reason, i've tried both xcompmgr and picom, the issue only goes away when no border patch is disabled. is there a fix for this?

gimp opens in tag 5:
image

swap to tag 5 to find gimp "invisible":
image

when trying to interact with the gimp window
image

@bakkeby
Copy link
Owner

bakkeby commented Oct 22, 2023

Maybe.

Could you try with these changes?

diff --git a/dwm.c b/dwm.c
index 7497c65..20b9a7a 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1455,6 +1455,35 @@ configure(Client *c)
        ce.width = c->w;
        ce.height = c->h;
        ce.border_width = c->bw;
+       #if NOBORDER_PATCH
+       if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
+               #if MONOCLE_LAYOUT
+               || &monocle == c->mon->lt[c->mon->sellt]->arrange
+               #endif // MONOCLE_LAYOUT
+               #if DECK_LAYOUT
+               || (&deck == c->mon->lt[c->mon->sellt]->arrange &&
+                       c->mon->nmaster == 0)
+               #endif // DECK_LAYOUT
+               #if FLEXTILE_DELUXE_LAYOUT
+               || (&flextile == c->mon->lt[c->mon->sellt]->arrange && (
+                       (c->mon->ltaxis[LAYOUT] == NO_SPLIT &&
+                        c->mon->ltaxis[MASTER] == MONOCLE) ||
+                       (c->mon->ltaxis[STACK] == MONOCLE &&
+                        c->mon->nmaster == 0)))
+               #endif //FLEXTILE_DELUXE_LAYOUT
+               )
+               #if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH
+               && (c->fakefullscreen == 1 || !c->isfullscreen)
+               #else
+               && !c->isfullscreen
+               #endif // FAKEFULLSCREEN_CLIENT_PATCH
+               && !c->isfloating
+               && c->mon->lt[c->mon->sellt]->arrange) {
+               ce.width += c->bw * 2;
+               ce.height += c->bw * 2;
+               ce.border_width = 0;
+       }
+       #endif // NOBORDER_PATCH
        ce.above = None;
        ce.override_redirect = False;
        XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);

The idea is that the same changes that are applied in resizeclient must also be applied in configure.

@Zerogaku
Copy link
Author

Zerogaku commented Oct 22, 2023

Thanks adding that fixed it. Krita also seemed to have that very same issue and it got fixed as well (i guess for any apps that show a splash screen first) just curious what does the function configure do?

@Zerogaku
Copy link
Author

Zerogaku commented Oct 22, 2023

Ah i've noticed a small side affect, it trims the edges of the windows

krita:
image
image

Gimp:
image

Emacs:
image

the fix seems to be switching to another tag and switching back (doesn't work all the time)

this is how i positioned the code:

	ce.x = c->x;
	ce.y = c->y;
	ce.width = c->w;
	ce.height = c->h;
	ce.border_width = c->bw;
        ce.height = c->h;
	ce.border_width = c->bw;
        if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next))
                || &monocle == c->mon->lt[c->mon->sellt]->arrange
                || (&deck == c->mon->lt[c->mon->sellt]->arrange &&
                        c->mon->nmaster == 0)
                )
                && !c->isfullscreen
                && !c->isfloating
                && c->mon->lt[c->mon->sellt]->arrange) {
                ce.width += c->bw * 2;
                ce.height += c->bw * 2;
                ce.border_width = 0;
        }
	ce.above = None;
	ce.override_redirect = False;
	XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce);

@bakkeby
Copy link
Owner

bakkeby commented Oct 23, 2023

Hi @Zerogaku,

can you try removing these two lines:

                ce.width += c->bw * 2;
                ce.height += c->bw * 2;

I see that the border width is already added to c->w and c->h in the resizeclient function.

@Zerogaku
Copy link
Author

Hi @Zerogaku,

can you try removing these two lines:

                ce.width += c->bw * 2;
                ce.height += c->bw * 2;

I see that the border width is already added to c->w and c->h in the resizeclient function.

unfortunately this causes the initial problem to return
image
image

@bakkeby
Copy link
Owner

bakkeby commented Oct 23, 2023

OK, thanks for checking. Sounds like it may be a picom issue, what version are you using?

@Zerogaku
Copy link
Author

the picom version is vgit-751f3 which i believe is the latest version, but this issue also occurs with xcompmgr so this might be a generic compositor issue or dwm

@bakkeby
Copy link
Owner

bakkeby commented Oct 23, 2023

To be fair the noborder patch is notorious for creating weird side effects.

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