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

feat(i3wm): rounded corners #5686

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open

feat(i3wm): rounded corners #5686

wants to merge 1 commit into from

Conversation

jbenden
Copy link

@jbenden jbenden commented Sep 24, 2023

Revives patch set to implement rounded corners!

This should be the minimum needed; whereas, previous PRs included miscellaneous changes related to other repo/sites.

See: #5410
See: #5429

Copy link
Member

@orestisfl orestisfl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test failures need to be investigated and we would preferably need new tests

@orestisfl orestisfl added the waiting Waiting for feedback/changes from the author of the issue/PR. Make sure to notify us with a comment. label Sep 25, 2023
@jbenden
Copy link
Author

jbenden commented Sep 25, 2023

For some reason, I am completely unable to locally run the test-suite; so I must use CI to assist. I will solve as many test-case failures as I can.

@jbenden
Copy link
Author

jbenden commented Sep 25, 2023

I got the tests all working locally, so hopefully all is well now.

I could use ideas on a test-case to write for this... I am not sure how to check for a graphical change, with the existing test-suite.w

@jbenden jbenden force-pushed the round-windows branch 2 times, most recently from 87aeca2 to f5bca9c Compare September 25, 2023 17:12
src/con.c Outdated Show resolved Hide resolved
src/x.c Outdated Show resolved Hide resolved
src/x.c Show resolved Hide resolved
@jbenden jbenden force-pushed the round-windows branch 3 times, most recently from ec45e3e to eec2b96 Compare September 25, 2023 18:26
@jbenden
Copy link
Author

jbenden commented Sep 25, 2023

QA test fail; but when commenting out a region within src/con.c the environment again looks acceptable. Current patch includes the commented out region.

src/x.c Outdated Show resolved Hide resolved
@@ -809,4 +809,7 @@ struct Con {

/* The colormap for this con if a custom one is used. */
xcb_colormap_t colormap;

/* Border radius specified in pixel units */
uint32_t border_radius;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are already saving this in the container, I would add a corresponding command as well to change the radius, for consistency with the border directive/command

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't want a command, then I wouldn't save it in the Con level at all, since it means that the setting is not updated when changing and reloading configuration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orestisfl I have pushed a new patchset that includes a command, exports into JSON tree, and has a small unit-test to ensure values did pass around correctly.

Copy link
Member

@orestisfl orestisfl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

A 1-pixel rounder border corner is not very smooth in the corner, for example in this image you can see the background blending in the border.

border_radius 10
gaps inner 20
border pixel 1

@jbenden
Copy link
Author

jbenden commented Sep 25, 2023

Hi @orestisfl !

With regards to the single pixel border: I think both items are handled completely different, and incompatibly so.

The corner radius modification is accomplished by means of a mask applied to the viewing window.

This means the code that draws this border would also need to drawing arcs on the corners of containers/windows...

Thoughts, comments, suggestions are welcomed!

@orestisfl
Copy link
Member

Okay, so the option is practically incompatible with window borders? That seems like a serious limitation.

@georglauterbach
Copy link

I'm not familiar with i3wm code, but I'm good at C. If you need my assistance, please ping me and I will try to help 😌

@okraits
Copy link
Contributor

okraits commented Sep 26, 2023

Okay, so the option is practically incompatible with window borders? That seems like a serious limitation.

I already asked that some time ago and didn't get an answer: #5410 (comment)
This doesn't look good IMO.

@jbenden
Copy link
Author

jbenden commented Sep 26, 2023

This is not possible using the API's available from X11. An OpenGL-style mask is simply applied to the viewable region.

But if a requirement, then all border graphics must be drawn in software.

@jbenden jbenden force-pushed the round-windows branch 3 times, most recently from d56aca5 to f028e4d Compare September 26, 2023 20:55
@orestisfl
Copy link
Member

I'll need to invest more time to understand the underlying issue but I'll say as a general statement that I will not merge something that is incompatible with a very basic feature of i3. We have made very explicit that we focus on bug-fixing instead of new features (#5410 (comment)) and commiting something that is already not working bug-free goes against that.

The corner radius modification is accomplished by means of a mask applied to the viewing window.

Do you mean that the mask cannot be applied to border + window at the same time?

But if a requirement, then all border graphics must be drawn in software.

What exactly do you mean here?

@jbenden
Copy link
Author

jbenden commented Sep 30, 2023

Hi @orestisfl !

You might be right about not accepting new features!

The current implementation uses features of X11 to "cookie-cut" the windows rounded. It easy to do (with xcb) and hardware assisted. However; borders are NOT possible with it. It is VERY stable patch, though!!! I've used it for some time now, happily and w/o a border applied. :)

I wrote a quick new drawing code for rounded rectangle; but cannot figure out how to apply it above the incoming frames from the application drawing.

Thoughts, comments, suggestions are welcomed!

@georglauterbach
Copy link

@orestisfl what's the state of this now? will this be merged?

@orestisfl
Copy link
Member

@orestisfl what's the state of this now? will this be merged?

I think this is currently blocked because of #5686 (review)

@georglauterbach
Copy link

Ah, I see, thanks for the update.

I wrote a quick new drawing code for rounded rectangle; but cannot figure out how to apply it above the incoming frames from the application drawing.

@jbenden do you need my help with that? I don't know the i3 code at all, but when 4 eyes are looking at the problem, we may figure something out.

@jbenden jbenden force-pushed the round-windows branch 3 times, most recently from 7a62436 to 2cd81ed Compare February 17, 2024 21:58
Signed-off-by: Joseph Benden <joe@benden.us>
Copy link
Member

@orestisfl orestisfl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also seems to break border colors for me

before
screenshot-2024-02-22T11:24:46 CET

after
screenshot-2024-02-22T11:24:22 CET

if you can't reproduce I can provide an MRE. But in general it seems that this approach has a lot of conflicts with borders?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Waiting for feedback/changes from the author of the issue/PR. Make sure to notify us with a comment.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants