-
-
Notifications
You must be signed in to change notification settings - Fork 696
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
On implementing output profiles for wayland. #3645
Comments
I've looked a bit more at how screens are used in qtile internally. If I understand correctly, it works in several stages:
Please correct me if I'm wrong. EDIT: From what I can tell, screens have to be configured in the order in which the physical outputs are enumerated by the backend. If not, they will refer to wrong outputs. Now I also understand why my displays sometimes did switch bar and position - the enumeration order of the physical devices was unstable. So I guess |
I'm open to the idea, but want to cover all other options (i.e. via external tools) before committing to have anything within the backend.
The user doesn't need to manually do anything besides defining the number of With that being the case, is it possible to attain the desired setup for most reasonable output configurations that one might have through regular usage, just with careful ordering of |
A fair decision. I'm not sure how it would turn out in the end, but "profiles" really sounds like a lot more than it would actually be in terms of code. The crucial difference is to replace the ordered matching of outputs to screens with a function that assigns each output exactly one screen, but depending on the available outputs. It might even remove the need for the virtual_screens variable, except when you want to support combining screens.
Not initially i suppose. Yet I'm not sure whether this is sufficient to configure multiple different setups correctly. A lot of people plug in beamers temporarily, or dock their laptop at home. I would love to be able to have a different layout optimized to each scenario. Some common ones that come to mind are:
All of the scenarios I listed require only 2 screens to be defined - but each screen definition would contain different bars and maybe wallpapers. What is the intended way to do this with the current configuration? The second problem arises when outputs are reordered. Plugging in my display port adapter makes my external display the first display, which is different from what I want when using a beamer. The third problem that I see is splitting just the external work screen into two virtual sub-screens. I understand that defining Using profiles seems like a much more intuitive fit for this problem, all of this would become fairly trivial. The correct profile is matched automatically, and each output can define the screens that it needs. The widescreen monitor can define two virtual screens. Although I know I'm biased. Therefore, I'd like to know how qtile currently intends to solve these problems. Maybe there is a better way that I cannot see right now. I'm currently missing some insights into how qtile is supposed to be used in that case, so I really depend on your expert opinion. EDIT 1: added paragraph about reordering screens |
Ah ok I think I missed the point a bit here. While we can specify control more 'low-level' settings of outputs individually with things like kanshi, the point is that the primary output may change depending on connected outputs and importantly we want to configure our If that is the case, would this really be Wayland exclusive? Some aspects will be (scaling), but the problem as posed above also applies to x11, right? |
No not wayland exclusive, I misjudged that initially. I previously thought it would be hard to do for X11, but I noticed that qtile already has compatible abstractions over outputs in both backends. The only thing that would be wayland exclusive is that output scalings would be ignored on X11. Pretty sure it's impossible to do properly there. |
OK cool, I think that will make things easier to implement. I think you've made a pretty solid case so I'd be happy to have a solution in qtile :) Currently I don't know how feasible it is but if we can continue to just use |
Great ❤️, I'll begin working on it when we've ironed out the details.
I would add a parameter to the outputs in the draft syntax to specify a screen for each output. This would default to profiles = [
# widescreen 3440x1440 example
Profile([
Output(identifier="eDP-1", subscreens=[
Screen(x=0, y=0, w=1720, h=1440), Screen(x=1720, y=0, w=1720, h=1440)])
# TODO: how to handle dynamic screen sizes for e.g. beamers? allow specifying percentages? or allow specifying a lambda?
Output(identifier="LVDS", enable=False) # default: subscreens=[Screen()]
]),
] I was thinking of reusing the Screen mostly as-is, but to more specifically have it refer to virtual screens. By default each output has one virtual screen fully covering it.
I'm honestly struggling to see how this would integrate well with the existing API. Can you provide a short example how you'd expect to use this? Maybe that clears things up for me. If screens match outputs instead of the other way around, I currently imagine it being quite the hassle to implement output profiles, as it would make all the logic backwards. You'd effectively have to duplicate the profiles logic into every screen. Imagine a
Plus a second screen for the opposite case. (Have an internal bar in those cases, and none otherwise). Now To keep backwards-compatibility, we could definitely have the current PS: Just to clarify how the backend works: What would happen currently, if two outputs (backend outputs, not screens) were assigned overlapping positions? e.g. two outputs of same size, both positioned at 0,0. Will this currently mirror the rendered content? |
Regarding configuration I would propose an alternative: |
I think such a behaviour wouldn't be incompatible with the original proposal. We have the As for this feature @oddlama, I think it would be easier (for me and perhaps others who might like a say in how this would work out) if we had a working draft. There are many bugs and tasks (like the wlroots 0.16 update) that I've directed my focus towards, but I also don't want this to get too lost. I'm hesitant to ask you to implement something that we might change, but I think it would be easier than discussing ideas without the code to represent them, which we might then change anyway once we get the implementation together. So it's up to you, but perhaps you'd be open to submitted a draft PR to discuss it further? It might even be helpful for us to merge a working solution but keep it experimental and/or undocumented until we and others use it for a while to get it to maturity. Thoughts? |
If done correctly, we could have optional support for advanced matching and configuration directly in the profiles. I'm sure we can get manual logic to work with the original syntax while keeping the default plug-and-play behavior.
Definitely! In the meantime I've teamed up with @clotodex so maybe we can get something working. But due to some other stuff that I have to do until March I can't give any guarantees about the timeline at this point. I certainly haven't forgotten about this.
Sure thing! While there are a lot of things that prevent a "proper" implementation from the beginning (mostly stuff dealing with effective resolution, screens and fake screens), I could certainly do the matching part first which shouldn't be too invasive while already providing a huge benefit. This would mean an eventual update after that might break configs for the initial draft, but I guess as long as it's tagged as experimental this wouldn't be a problem. Publishing an experimental feature might also help us to get some external feedback before finalizing anything. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
@m-col or @elParaguayo please mark as non-stale :) This depends a lot on #3985 and we will continue working on it then. The design was already discussed and we are waiting with the implementation. |
This issue is stale because it has been open 90 days with no activity. Remove the |
Will check it out when I find time, now that wlroots16 is merged |
This issue is stale because it has been open 90 days with no activity. Remove the |
With wlroots16 this is not as crucial to a lot of bugs anymore. |
The issue:
Currently, an external program (kanshi) is needed to configure displays on qtile with wayland, which should technically be a part of the compositor. I would love to provide a PR for this, I've already successfully tested some of the ideas I have. But before implementing anything of larger scale, I'd like to discuss my approach here to ensure we all agree on a reasonable solution.
Summary
For those unfamiliar with kanshi, it is a tool similar to autorandr on X11, but dead-simple: You first define several profiles. Each profile can assign configuration to outputs (enable, mode, position, scaling). Whenever outputs change, the best-matching profile is activated and outputs are configured accordingly. Sway has a similar built-in mechanism for output configuration.
Also closely related to this proposal is a feature that has already been asked for in #3389; Sway automatically scales HiDPI displays to 2 without requiring any configuration, and qtile could do the same for convenience. It's basically a default scaling that can be overwritten by using output profiles.
I've seen that qtile already has bindings to all necessary wayland protocol extensions that are necessary to replace kanshi completely, without much effort. So to solve both of this, I'd suggest the following:
Open Problems
If I understand qtile's
Screen
s correctly, they map to physical outputs in a 1:1 fashion. Yet I struggle to understand how you currently ensure that certain screens always map to specific outputs. Imagine a laptop with an optional second HDMI display. Depending on the output configuration, users may want the Bar on the internal screen (e.g. beamer connected) or on the external screen (docking station connected). How is this done currently?This would be solved by not having a global
screens = [...]
configuration, but instead by assigning the screens in the matched profile. So I can have a bar on the internal screen in profile 1 and no bar in profile 2. This is IMO much more intuitive and more. (Or maybe I don't understand Screens in their current form).I'm also not sure how to address mirroring and more complex configurations. See swaywm/sway#1666 for examples.
Profile Syntax
Similar to kanshi, I'd introduce a list of profiles which will be matched from top to bottom.
Ideally, scale, position and other properties would allow dynamic configuration. But I'd regard that as a secondary issue for now. For example:
Additional thoughts
This change would definitely be wayland exclusive. I have no interest in implementing this for X11, and don't even think it's possible to do properly. Scaling support is almost nonexistent on X11 anyway, and the standard way to apply display configuration is xrandr.
Required:
The text was updated successfully, but these errors were encountered: