-
Notifications
You must be signed in to change notification settings - Fork 199
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
feat: add wm-toggle-pause
command
#828
Conversation
Ay this is super cool 👌 Thanks for putting together the IPC side of it as well. A downside with returning early in all these platform events is that state will be out of sync on resume. Like say a monitor was unplugged, the WM would still think it has all its monitors. Perhaps it'd be better to instead skip redraws if the WM is paused: // wm.rs - https://github.com/glzr-io/glazewm/blob/940bb4cc474898aa3b1ffda2f29720e37bb7a16c/packages/wm/src/wm.rs#L128
..
if state.is_paused {
platform_sync(state, config)?;
} and then also disable keyboard/mouse listener on pause: // main.rs - https://github.com/glzr-io/glazewm/blob/940bb4cc474898aa3b1ffda2f29720e37bb7a16c/packages/wm/src/main.rs#L162
..
if matches!(
wm_event,
WmEvent::UserConfigChanged { .. }
| WmEvent::BindingModesChanged { .. }
| WmEvent::PauseChanged { .. }
) {
event_listener.update(
&config,
&wm.state.binding_modes,
is_paused
);
} |
Hi @lars-berger, My new implementation to block mouse events goes probably into the right direction. But there is one problem with blocking key events: The keybinding to unpause won't be recognized as well. However, I went forward and implemented something: |
I finished & tested the implementation! |
Done. glazewm-js: glzr-io/glazewm-js#15 |
wm-toggle-pause
command
All merged now! Thanks for getting it all nicely integrated with the NPM library + zebar as well 🙌 Found a couple minor things while testing it out more thoroughly #870. Also did a super nitpicky rename to Thanks again for the massive help on this ❤️ |
🎉 This PR is included in version 3.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
I actually had used I think right now we sometimes have still Thank you for finishing this up and sorry for missing the resize & IPC events! |
This is my try to implement the pause command I proposed in #825.
Basically, this adds the command
wm-toggle-pause
which pauses glazewm from managing windows.Feedback is very welcome. This is my first contribution to glazewm and I'm not too familiar with the codebase yet.