-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Moving lxqt-config-monitor to KScreen #502
Comments
I'd suggest that you talk to @selairi before going further in case he is doing the same thing.
|
Some extra notes I forgot.
I think KScreen actually solves this. |
So My proposal, is there something missing on kscreen that is neede any I will do the code and push for review in KDE, if necessary, otherwise I Helio On Mon, Feb 16, 2015, 03:34 Jerome Leclanche [email protected]
|
An API to get/set gamma would be nice. |
Can it recognize unique setups based on monitors` models and/or serial numbers? |
Hi, KScreen dev here ;) I'm really glad that KScreen found it's use outside KDE, and I've got a few comments (or rather observations) related to our past experience with working with screen management...
I'm fine with implementing this in KScreen. I actually had to check if we even have this option in KDE...and found that we don't, or it's very well hidden :)
What we do in KScreen KCM (the UI for KScreen in KDE) is that we actually hide the refresh rate combobox into "Advanced options" and always default to "Auto" value. Users rarely need to change that and "the higher the better" is usually the right heuristics to figure the right refresh rate automatically :) In the general UI we only show slider to change resolution. In XRandR, certain modes are marked as "preferred" - those are usually monitor's native modes (mode = resolution + refresh rate - you can have multiple modes with the same resolution, but different refresh rate). When user chooses a resolution which is in the preferred modes list, the "Auto" refresh rate refers to the preferred mode with such resolution. When users chooses a resolution which is not "preferred", we fallback to choosing the highest refresh rate as the "Auto" value. Finally, this can be implemented rather easily through model + QSortFilterProxy, or, since the amount of modes is usually reasonably small, it's possible to just iterate over all the modes when users changes resolution and extract the list of refresh rates from all modes with matching resolution. When applying, you just iterate over the modes again and find the one with matching res and refresh rate. IIRC this is how we do it right now in KScreen, mostly because I'm being lazy to write the model ;-)
The first versions of KScreen did not have any "Unify" button - to clone screens, you had to drag one screen in the UI on top of the other. Although this seemed logical and easily discoverable to me, turned out I couldn't be more wrong. Users struggled to discover this "feature" and complained constantly, which forced us to actually have a "Unify" button in the UI.
If you are using QML, you can probably steal most of our code from KScreen KCM. It's ugly, dirty, but it works :) Or let me know when you write it yourself, I'll happily steal it from you into KScreen :-)
Note that you won't ever get rid of the flicker - sometimes it's necessary to turn off all screens and re-enable them again one by one (for instance when you run out of CRTCs or don't have any free compatible CRTCs left). Finally, there are currently couple bugs in Qt 5 that are hitting us hard, so just that you know: QTBUG-42985 - all Qt 5 apps crash when there are no screens available (during reconfiguration for instance, as explained above). Secondly there's QTBUG-40207 - Qt polling hardware on start & on every screen change. This is superslow in XRandR (the call can take up to two seconds or even more, depends on HW and drivers), so it blocks event loop of all Qt apps for considerable amount of time and hogs X server. I'm planning to hack on that a bit inside Qt ;) Regarding Wayland support: in Wayland screens are managed by compositor, so in order for KScreen to be able to talk to compositor, a new protocol has to be defined. I talked about this briefly with some people - the current situation being that Wayland devs don't really want screen management to be part of the main protocol (it should have only rudimentary informations about screens, I guess more or less what's exposed by QScreen in Qt right now), which I agree with. I talked with GNOME people and they don't feel real need for cross-desktop standardized Wayland protocol for full-scaled screen management, which I also kinda agree with. So for Wayland support the current plan is that we will have backend that will be able to speak to KWin through our own Wayland protocol extension for screen management. Of course for that we first need to sit down with KWin devs and discuss how/what to do. I assume LxQt is using KWin as WM/compositor (sorry, I don't really know :)), so you would get Wayland support in KScreen for free. If inter-operability with alternative compositors is desirable and interesting enough, I think it would be great to sit down with other WM/DE devs and figure out some common protocol that would make everyone happy...unfortunately this is a very low-priority issue for me right now most due to lack of time :( If anyone is interested, feel free to contact me :) |
We want to be WM-independent as much as possible. While I don't specifically want something like xrandr to be part of wayland itself, it is a huge mistake imo not to make a proper standardized dbus API for the needs of common mortals... Duplicating all this for every WM? Spare me, please :/ |
So there's two parts to screen management. The first part is what we currently do: an interface to manage screens. @danvratil What would you think about a separation of concerns? Currently you have a kded kscreen daemon for that last part. I'm not entirely sure it needs to be that involved. I actually think this functionality should be (mostly) in xorg as it is so maybe it doesn't even need to know about different backends and such. It would just be a small daemon that watches over hardware events and:
This only needs to know when a screen device becomes available/unavailable and whenever screen configuration has changed (so that it can save the difference somewhere). How much is needed for that? If we can do something that doesn't even link to libkscreen, it could be entirely cross-desktop. |
My daemon becomes less dirty and more feature-rich. https://github.com/Vladimir-csp/rerandr3
|
I mean rerandr3 is the right concept but I don't think it's the right application, since it depends on the xrandr command line. |
I'm writing it for personal use anyway. Just offering it for concept testing. |
@Vladimir-csp I didn't mean to be snarky. I love that you're working on it :) |
I pushed my work on the switch-to-kscreen branch.
This is what it looks like now: It's not perfect yet. I still have some size adjustment issues and the x/y positioning spinboxes are still a bit too confusing to my taste. I'd also like to add icons to the output list on the left (I don't know how, and I don't have the graphics available - @intialonso ping?). The apply button should also grey itself off when there is no change to apply. Also note that actually applying settings doesn't work, so don't use this and expect it to work just yet ;) |
BTW, I need more human-readable names as well for the outputs. @danvratil any advice? |
Looks great! "this screen extends..." and "this screen clones" could be rearranged into streamlined action: This screen [ is the reference | clones | extends to right | extends to left | extends above | extends below | has custom position ] [ $other_screen_selector] |
I considered that. I'm not sure it's less confusing though. It also makes an unsafe assumption l18n-wise regarding positioning of the text. Anything that removes extraneous options is good in my book, as long as users immediately find what they're looking for. If I'm removing "unify all outputs" and the quick clone setting, cloning needs to be immediate to find. Regarding layout preview.. I don't know. A serious one would have to have a full 2d plane so there's no way that would fit anywhere on that page. We could have a Preview button. But all this raises the question whether it's needed at all. Maybe if I hear more support for it. |
Humour this: What happens when you set Screen 1 to extend right of Screen 2, then you go set Screen 2 to extend right of Screen 1? |
As a thought, we could reuse the concept of a primary display. So we remove the "Make this the primary display" checkbox, we then have: [This screen is my primary display] 1 would give no further UI elements. |
Why should there be a difference between clone and overlay? |
I was also referring to a generic situation: if you disable something, it is better to temporary preserve framebuffer size, and then update it when the whole change is applied. |
Hello,
Could you be so kind to send me your xrandr command? Maybe, I can try to I was not thinkinkg of changing the lxqt-config-monitor backend to Kscreen. I agree with PCMan that xrandr is a good way. It's lightweight and Sorry, but I couldn't answer you sooner. Thanks. |
I starting to study switch-to-kscreen I started some changes in the interface (xrandr based), but I stop. I El 17/02/15 a las 14:38, Jerome Leclanche escribió:
|
Suggestions: Other config tools use LxQt::ConfigDialog. Maybe lxqt-config-monitor should use it too. I could implement it. In order to do this, it is necessary to add a method to replace "Reset button" by "Apply button" to LxQt::ConfigDialog class. A Cancel dialog is needed. I can write it as well. Finally, I have some problems with git. If I try to clone with:
it works. But when I try to list branches, only master branch is listed. And I can not swicth to "swicth-to-kscreen" branch. ¿¿¿??? |
What did you try? Everything seems to work correctly here:
|
Solved (I will never write code after midnight). Sorry I will start to write some changes in a few days. Thanks 2015-04-27 8:22 GMT+02:00, palinek [email protected]:
|
@selairi looking forward to seeing your PRs. |
I have just uploaded some changes to switch-to-kscreen branch at lxde/lxqt-config.
I have written a first implementation of the screen daemon. It only runs lxqt-config-monitor when you connect a new screen. Updated version of libkscreen is needed. It needs some testing... |
@selairi I like that UI a lot more than the previous one. Can you change "Always be joined" to |
Can you change "Always be joined" to `Keep monitors attached`?
Done, I will upload in next commit. I'm writing a monitor daemon.
|
@selairi Is the kscreen stuff functional? if it is, it should land now, we're nearing the release. |
Kscreen config-monitor is functional. One user has reported a system El 24/10/15 a las 06:54, Jerome Leclanche escribió:
|
Fixed! |
I think, 'Always be joined' and 'Keep monitors attached' or 'Unify' are all confusing. Why not simply use, 'Keep desktop clone', etc? |
TLDR: I've been working all night on moving lxqt-config-monitor to the KScreen framework. These are my notes.
I was playing with my laptop and xrandr and I had to add a custom mode through the xrandr command line. I then noticed lxqt-config-monitor couldn't pick it up as it expects a resolution when in fact it's getting a mode name. I tried to look at fixing it but discovered that the code is an absolute mess. The entire thing relies on parsing xrandr command line output in --verbose mode. It's incredibly nasty.
Fortunately the KDE folks have an excellent KScreen framework. It has virtually zero dependency and has support for pluggable backends. This is necessary if we're ever going to move to wayland; although we have a concept of a backend in lxqt-config-monitor right now, the entire thing relies on passing string data around which is a huge no-no.
The main KScreen dev is also wonderfully responsive.
We have to do some user-facing changes though. This isn't just switching one backend for another.
Also: Right now, the save button writes an autostart file to start xrandr with the given config; something we're inheriting from lxrandr. Not only are the paths hardcoded etc but it's also not the expected behaviour from the user at all. It will result in flicker at login time and there's no way to ever know this is why.
I'll push some branched work at some point this week. Anyone interested in helping with this?
The text was updated successfully, but these errors were encountered: