-
Notifications
You must be signed in to change notification settings - Fork 799
Set _NET_FRAME_EXTENTS according to the actual decoration size
#5944
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
Conversation
Use `con_border_style_rect(con)` to retrieve the decoration size (that function takes lots of special cases due to `hide_edge_borders`, border style and width customizations, etc. into account), then massage the result into the form suitable for `_NET_FRAME_EXTENTS`. Signed-off-by: Sergey Vlasov <[email protected]>
Signed-off-by: Sergey Vlasov <[email protected]>
|
Can we accept this? This is actually perfect. |
|
This looks good to me, I would love to see this merged! |
ghost
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tried this and it finally fixes my picom and i3 border problem.
waiting for this to get merged...
|
This appears to fix the issue with smart borders I'd noticed in the prior PR #5384 (comment). With respect to tabbed/stacked in my opinion, this all makes me think that the solution is just getting picom to allow one to specify the radius of each corner (that way, we could just specify that the I3 frame only gets rounded on the top) such as in these PRs/Issues yshui/picom#918 yshui/picom#564. That said, I'm also using a fork of i3 where I only have indicators rendered on the bottom, so having indicators work perfectly is less of a concern for me, personally |
|
This would be so great if it gets merged. |
orestisfl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not perfect for stacked/tabbed but we are technically not lying so I am willing to merge this. However, it still needs tests.
|
I have been using this patch for some months now to correct display issues of unmanaged windows in a Java software called "Trader Workstation" by Interactive Brokers. It doesn't fix all corner cases, compare the handling in https://github.com/qtile/qtile/blob/master/libqtile/layout/floating.py#L255 If there is an unofficial patch for that, too, I would gladly test. Thank you. |
|
Started adding some tests. @sigprof feel free to contribute to them otherwise I'll add more when I have the time. |
|
What about this code? Lines 817 to 847 in b933998
Should it be updated to match the extents calculation introduced in this PR? |
|
The problem with the In order to handle |
Inspired by #5384, but instead of just using the border width, this PR reports the actual frame extents for the window, which may also include the title bar (for floating windows and tiled windows in plain split containers, but not for tiled windows in stacked/tabbed containers).
The existing
con_border_style_rect()function should already handle all configuration options which can affect the decoration sizes (if it does not, that would also show up in other places); its result just needs to be converted into the format used by the_NET_FRAME_EXTENTSproperty.This PR fixes #4292 probably in the best way possible (the reported
_NET_FRAME_EXTENTSvalues should always match the actual sizes of window frame elements which are actually drawn into the X11 frame window into which the client window is reparented). The only really problematic case is with the stacked/tabbed containers, for which the title bar is actually drawn into a completely separate window, therefore the title bar size cannot be reported in_NET_FRAME_EXTENTS(actually I tried to calculate the size of those decorations and add it to the top decoration size, but that did not change the behavior ofpicom).Large screenshots here (3840×2160)
Example of configuration with

hide_edge_borders smart— a single window does not have borders, so only the top frame size is non-zero:but multiple windows have borders:

Changing border width works too (although with

border normal 8you can see that the top border overlaps the title text, because on the i3 side that border does not really exists, andpicomjust draws it over; also the pixel sizes reported byxpropandxwininfoare not identical to what is specified in i3, because I use 168 dpi on this system, therefore 4 px in the i3 config = 7 dpx):Handling of tabbed containers is less perfect though. Here is a single tabbed container with

hide_edge_borders smart, so it does not really have a border — note that all frame extents are zero, and the titlebar is rounded separately (although it could easily be excluded from rounding, that does not really help much):Once the border actually appears, you may notice that the top part of the

picomborder actually gets drawn over the top part of the window, partially obscuring the top line in this terminal (picomdoes not mind that the top frame size is reported as 0):Some examples of floating windows (no major problems there):

Options like

hide_edge_borders bothwork too when gaps are removed (although the resulting behavior withpicomis probably not very useful — the rounded border gets drawn only if all of the left, bottom and right borders are present):The same with

border pixel 8(note that windows with only the top border hidden still get the rounded border treatment bypicom, but the border overlaps the top part of the window):