Skip to content

use 4 windows for drawing --line mode=edge borders#423

Merged
N-R-K merged 1 commit intomasterfrom
wind
Mar 5, 2026
Merged

use 4 windows for drawing --line mode=edge borders#423
N-R-K merged 1 commit intomasterfrom
wind

Conversation

@N-R-K
Copy link
Collaborator

@N-R-K N-R-K commented Mar 4, 2026

this uses similar approach to selx by using 4 windows to draw the border. using XShape extension does not work well with compositors but the 4 window method works fine.

Fixes: #76

@N-R-K
Copy link
Collaborator Author

N-R-K commented Mar 4, 2026

@daltomi should this be a new mode or should it just replace the existing "edge" mode?

@daltomi
Copy link
Collaborator

daltomi commented Mar 4, 2026

I vote to replace edge mode with this.
edge mode has issues with some composers when shadows are activated.

The only thing that needs fixing is the following. When I have opacity enabled in the compositor, you can see the windows merging in the upper left corner.
bitmap

Captura desde 2026-03-04 19-37-01

I fixed it quickly with the next patch, but if you have another idea, that would be great!

diff --git a/src/selection_wind.c b/src/selection_wind.c
index 2f568d9..eb0f75a 100644
--- a/src/selection_wind.c
+++ b/src/selection_wind.c
@@ -85,7 +85,7 @@ void selectionWindDraw(void)
     struct SelectionWind *const pw = &sel->wind;
 
     XRectangle rects[4] = {
-        { sel->rect.x, sel->rect.y, opt.lineWidth, sel->rect.h }, // left
+        { sel->rect.x, sel->rect.y+opt.lineWidth, opt.lineWidth, sel->rect.h - opt.lineWidth }, // left
         { sel->rect.x, sel->rect.y, sel->rect.w, opt.lineWidth }, // top
         // right
         { sel->rect.x + sel->rect.w, sel->rect.y, opt.lineWidth, sel->rect.h },

@N-R-K
Copy link
Collaborator Author

N-R-K commented Mar 4, 2026

I vote to replace edge mode with this.

Done.

When I have opacity enabled in the compositor, you can see the windows merging in the upper left corner.

Applied your fix as well.

@N-R-K N-R-K marked this pull request as ready for review March 4, 2026 23:58
@N-R-K N-R-K changed the title [WIP]: add --line mode=wind use 4 windows for drawing --line mode=edge borders Mar 4, 2026
@daltomi
Copy link
Collaborator

daltomi commented Mar 5, 2026

It looks good to me; I don't see anything else I'd change. Thank you.

this uses similar approach to selx by using 4 windows to draw
the border. using XShape extension does not work well with
compositors but the 4 window method works fine.

Fixes: #76
@N-R-K N-R-K merged commit 597d026 into master Mar 5, 2026
15 of 16 checks passed
@N-R-K N-R-K deleted the wind branch March 5, 2026 17:23
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

Successfully merging this pull request may close these issues.

--line mode=edge issues with Compositing Window Managers

2 participants