-
Notifications
You must be signed in to change notification settings - Fork 185
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
Update workspaces on screen change #1058
base: main
Are you sure you want to change the base?
Conversation
Nice find! |
Yes.
Something I haven't thought about yet, but yes, this is important. For some time now, I thought about maybe doing some hooks for after-initial-startup and similar for quite some time now. |
I just had a bunch of crazy ideas, but I haven't had any looks at the code at all, so no idea, if those are even remotely feasible:
|
… a test: New events: ScreenUpdate and ScreenDelete are now being emited when the layout changes (update includes create) Renamed initial_events to event_queue to avoid confusion Moved workspace-determining code from initial_events() to screen_crate_handler(), this is core; not display-server territory Added test for current workspace-id assignment scheme to verify the new code
r#"Leftwm does not support more than one output per crtc (if that is even possible to have). | ||
LeftWM will only apply changes to the first output. | ||
If you are seing this error, please create an issue on our GitHub page and it will be resolved."# |
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.
@VuiMuich @hertg what do you think about that?
I have tried some things, but I haven't goten xrandr yet to put both of my monitors (outputs) on one crtc. It is possible to return a Vec<Screen>
here, but I don't think this kind of exotic configuration even exists (if possible). I've added this error to indicate an issue. This is not fatal at all, you will just have to SoftReload like before to reset the configuration.
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 have to admit that I'm a bit too out of the loop to actually understand what you mean by outputs and crtc. But I like your thinking ahead and very verbose log message. I fully approve of, and appreciate your approach.
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 am still trying to understand that myself. I haven't found no real documentation on the internal XRandR API whatsoever. I just try to get together what I can.
I think there are the output, the crtc and the screen. The screen is everything covered by the DISPLAY
env variable, whilst the output corresponds to a hardware monitor and the crtc is basically the virtual representation of the output.
EDIT: e.g. So the output sets the resolution and the crtc the position on the screen
I have this feature at a working state now, but of course there is still some stuff to do, as most themes will not work with this. For now this is working:tm:, you can check it out if you want and make a few tests yourself. It's now time to discuss how to implement the theme update hooks (breaking or not!). I'll be waiting 'til after #1000 anyways to not make merge conflicts for that beast. Btw, rerun the test ci please, that didn't fail because of me. |
triggered a re-run, it went through now |
I just updated this branch in case anyone wants to test it (I didn't yet and don't exactly expect this to behave after a 3.5k line diff merge). It's still not finished but should work for now by calling the |
Update: After short testing I noticed two issues:
|
Description
Update workspace configuration on
XRRCrtcChangeNotifyEvent
s from Xrandr (When anything of the monitor configuration gets changed).State of draft
XRRCrtcChangeNotifyEvent
s from xlib EventsDetails about
XRRCrtcChangeNotifyEvent
From my research, a crtc is a virtual output that gets rendered by X11, whilst an output is a reference to the actual monitor (or similar, I am not really sure about that). The screen is the entire rendered area, i.e. everything covered by the DISPLAY env variable.
An
XRRCrtcChangeNotifyEvent
gets emitted, when one of said crtc's is changed. So for example, when a output is disabled, is moved, or the resolution changes. It also gets emitted for crtc that automatically move in place for the disabled crtc/output (beacause one crtc must always be atx:0, y:0
).Type of change
Checklist:
make test-full
locally with no errors or warnings reportedNote: To fully reproduce CI checks, you will need to run
make test-full-nix
. Usually, this is not neccesary.