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

Set _NET_FRAME_EXTENTS based on border width #5384

Conversation

SimonBrandner
Copy link

Fixes #4292


209577166-bf5a934e-62c2-44ee-842f-aa90c3aff352
209577183-7475224e-bac0-41bf-ba7e-611da3cacdc5
209569688-53c8bed3-0023-4b28-baf9-499501261e68
209569716-877721a2-4977-4746-b248-12bb1e20ab1d


While this doesn't work perfectly in the tabbed layout, I think it still does much better than the broken thing we have now

I attempted to make the tabbed layout look nicer but I don't know how to actually do that, to be honest


Would this solution be acceptable?

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
@SimonBrandner
Copy link
Author

Hello, this PR hasn't received any review yet, is there a reason for that? Is there anything I could do to move it forward?

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.

Thank you for your PR and sorry for the delayed review.

  • Please update the release-notes/changes/ folder with a short description of what changed
  • Some tests here would be beneficial
  • We should figure out a way to improve the tabbed situation. I played with your patch and it seems that if I set a custom border (e.g. border pixel 50) to a window and then make it tabbed the frame extents are still reporting 50 even though the tabbed container has different borders

@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 Jun 24, 2023
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
@SimonBrandner
Copy link
Author

Hello again, I currently don't have the bandwidth to finish the two remaining tasks here, sorry - I would either suggest that someone takes over or the PR is merged as is (if that is something acceptable)

@orestisfl orestisfl added stale Issue or PR has become stale and will be closed soon and removed waiting Waiting for feedback/changes from the author of the issue/PR. Make sure to notify us with a comment. labels Jul 24, 2023
@MrFox131
Copy link

MrFox131 commented Oct 8, 2023

Any chance this will be merged ever?

@orestisfl
Copy link
Member

Sure, if somebody picks up the PR and addresses the problem with the tabbed/stacked windows. Since this has been stale for a while I am going to close it for now but please, do open up a follow up if you are interested.

@orestisfl orestisfl closed this Oct 8, 2023
@MrFox131
Copy link

MrFox131 commented Oct 8, 2023

Sure, if somebody picks up the PR and addresses the problem with the tabbed/stacked windows. Since this has been stale for a while I am going to close it for now but please, do open up a follow up if you are interested.

I'm very and very interested. But i'm afraid i don't have enough experience in such a big applications on C, and linux under-the-hood things. But I'm experienced developer in other directions. So if you could give me a list of links that would help further my understanding of the current architecture of the repository, and clarify what tests I would like to see, I would be happy to try to look into this issue. I’ve been looking for a long time for an open source project that I could join as a contributor on an ongoing basis. Perhaps this will be the first step)

P.S. I'm too tired to translate from my native language, so there may be mistakes, I apologize for that

@MrFox131
Copy link

MrFox131 commented Oct 8, 2023

@SimonBrandner I forked repo and installed patched version and cannot clearly understand where is the issue with tabbed mode.My flow is as follows:

  1. Opened 2 terminals in horizontal split
  2. i3-msg border pixel 10
  3. Changed layout to tabbed.
    I cannot see any border width changes due to this layout change. And of course xprops responds with still right _NET_FRAME_EXTENTS 10, 10, 10, 10

@SimonBrandner
Copy link
Author

Could you share a screenshot please?

@MrFox131
Copy link

MrFox131 commented Oct 8, 2023

@orestisfl

@SimonBrandner, sorry btw. I used your handle in my last comment by accident, i meant orestifl
image
image
image
image

  1. Just my default splith two alacritty terminals
  2. Set left one to 15 pixels border. xprop output provided. Do not look at not rounded borders, 15 is just bigger than my picom config roundness
  3. Left terminal xprop output after $mod+w for tabbed layout
  4. Right terminal xprop output after $mod+w for tabbed layout

Yes, it's ugly with such a big border size and frame closing by its body top border, but all borders and _NET_FRAME_EXTENTS are in sync

@MrFox131
Copy link

MrFox131 commented Oct 11, 2023

Any updates? @orestisfl

I have a lot of work to do next week. If possible, I would like to have time to make my contribution to the development of my favorite tiling manager before this moment, so any comments about tests and inconsistency of frame width in props and i3 state would be appreciated

UPD: No need in comments about tests. Nailed it

@MrFox131
Copy link

@orestisfl It would be great to get some additional info about this pr. Waiting for the answer

@SolsticeSpectrum
Copy link

I've been using this for several days now and it works flawlessly and it also looks awesome, I don't use titlebars so I don't care if it has issues. Anyway there is a small issue with Steam and Nautilus (didn't find it in any other app yet)

image
image
As you can see Nautilus and Steam adds a border to compensate for the rounded corner which looks bad

Other apps work flawlessly, even apps running inside wine/Proton have corner radius applied correctly, this just shows how stable this PR is.

You should reopen this PR and continue the work, it works perfectly fine expect Nautilus and Steam

@ahfriedman
Copy link

I'm also seeing what the previous comments have mentioned wherein the windows in tabbed/stacked mode are rounded, and the tabs themselves are not as shown in the following screenshots (which, to me, seems fine and a big improvement).

Screenshot_2023-12-29-12-15-27_1920x1080
Screenshot_2023-12-29-12-16-18_1920x1080

Re: the problem with Nautilus., If I understand correctly, I don't think that this is the fault of Nautilus, but instead the GTK theme. Prior to trying this patch, I noticed similar borders and disabled them via the GTK theme. I can try to dig up and send resources related to that if you are interested; however, for now, here's a screenshot of Nautilus running with this patch without such bars showing up.

Screenshot_2023-12-29-12-18-59_1920x1080

The one thing; however, I did notice is that sometimes with picom, when a single window takes up the whole screen, the borders appear to be the color of the background application (as shown in the following screenshots). This, however, could be a quirk of my setup.

Screenshot_2023-12-29-12-23-20_1920x1080
Screenshot_2023-12-29-12-23-39_1920x1080

@SolsticeSpectrum
Copy link

@ahfriedman I don't have the same issue of single app casting different color, maybe it's a setting in i3 config? Try tinkering with bolder colors, there are several active, inactive, focused etc.

Could you send the fix for Nautilus?

And the rounded title bar doesn't irritate me as I don't use them anyway, other than that I've been running this patch for over a month and didn't find any issues other than the one with tabbed and that's basically it

@ahfriedman
Copy link

Oh awesome! As it seems then that those bugs are resolved, I'd offer to try to help out writing the test cases needed to move the PR forward (after all, there are a few other simple features I'd be interested in trying to add to i3 as well), but having not contributed to i3 before, I'd have to look into how to go about that and see what's needed before committing.

@DarkReaper231 Here's what I've found works for nautilus and other gtk apps. As it is tangential, I have it in a spoiler:

GTK App Border Fix

Per https://github.com/i3/i3/issues/1655, I found that editing ~/.config/gtk-3.0/gtk.css and adding the following removed the duplicate border. You may, however, have to relog/restart for the changes to take effect.

.window-frame {
  box-shadow: 0 0 0 0;
  margin: 0;
}

window decoration {
  margin: 0;
  padding: 0;
  border: none;
}

@SolsticeSpectrum
Copy link

@ahfriedman unfortunately the fix didn't help, but I think I found the reason
image
the border isn't acutally a border, it's the resize handle, when I hover my cursor over it, a resize cursor appears, this is obviously useless in i3

@SolsticeSpectrum
Copy link

@ahfriedman I fixed it with some more CSS, specifically:

window.solid-csd {
  padding: 0;  /* removes the padding */
  border: none;  /* removes the border */
  box-shadow: none;  /* removes the double border */
}

@MrFox131
Copy link

MrFox131 commented Mar 7, 2024

Any updates on this pr? If I can help, just give me kinda "task") I'm newbie in contribution to opensource and need some guidance, but certainly can help

@sigprof
Copy link

sigprof commented Mar 10, 2024

I made a different PR for this (#5944) which actually sets the _NET_FRAME_EXTENTS values to match the decoration sizes used by i3, so that things like title bars and custom border sizes are handled correctly. The problem with stacked/tabbed containers looks unsolvable though (at least without some major changes in the way how i3 draws decorations for such containers).

@ahfriedman
Copy link

To follow up on my above comment, the issue with the borders changing color when a single app is full screen has to do with enabling smart_borders. Not sure if the change in #5944 would help address it (or if it's just part of how i3 functions in general—its been a bit too long since I've been on the release branch for me to remember).

With respect to the window decorations in stacked/tabbed mode, while I don't think its a huge deal as is, for my own setup, I decided to create a fork which allows me to only draw borders on the bottom of decorations. Its something that I'd wanted to do anyhow (eg, just being able to either specify a single color for all four sides as is or the ability to specify a color for top, bottom, left, and right—much as we can in css); however, I think it works nicely with the rounded corners setup. Given i3 is in the state of fix bugs over introduce new features, I don't imagine that a PR which introduces the ability to more granularly config borders would be accepted; however, if people are interested, I'd be happy to work on a PR which does that properly (as opposed to my fork which currently hardcodes how to draw the borders). In either case, I thought I'd throw the idea out there in case anyone else is looking at this PR and would like a similar setup.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue or PR has become stale and will be closed soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set _NET_FRAME_EXTENTS
6 participants