-
Notifications
You must be signed in to change notification settings - Fork 929
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
Rename Resized
to Configured
and expose state
#2929
base: master
Are you sure you want to change the base?
Conversation
I'm not quite sure how to approach other states, like wayland has for example Should we really abuse the |
For the atom changes we need to listen to |
Yeah, I've read it, but I'm not sure whether we really need to, due to a fact that The question is whether the |
|
||
bitflags::bitflags! { | ||
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
pub struct WindowState: u32 { |
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 don't think a bit flag is appropriate here, since the states are mutually exclusive, are they not?
Perhaps an enum like this is better (names up for bikeshedding):
enum WindowFrameState {
Fullscreen, // Possibly containing `Fullscreen`?
Maximized,
Minimized,
Normal,
}
And given that we now have this enum, perhaps we can unify it with setting the window (frame) state? So e.g. window set_frame_state(WindowFrameState::Maximized)
instead of window.set_maximized(true)
?
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.
The state might not be mutually exclusive in the future, at least If I expose more stuff from Wayland it won't be.
I don't think we should change the functions, because fullscreen is attached to the particular monitor. At least for now I'd keep it the way it is.
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.
The state might not be mutually exclusive in the future, at least If I expose more stuff from Wayland it won't be.
Maybe we should figure this out when we get there, even on Wayland the current states are mutually exclusive, so maybe additional states for Wayland should be dealt with in a different way while allowing states that are mutually exclusive to stay that way.
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.
They are tiled
states, saying that some edge of the window is being tiled, it's basically the same as maximized.
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 don't know what tiled
is, but what does "basically the same" mean? Is it mutually exclusive or not?
At least on other backends it is mutually exclusive, right?
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.
They are not, you can have them attached to any state, you can have 4 of them at the same time, etc.
Tiled means that your window is, well, tiled to some screen edge or just generally tiled.
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.
Wow, that's really strange.
Wouldn't this completely change the meaning of what's exposed here? Like it doesn't make the API really cross-platform because the meaning is so different.
In any case, if it's not mutually exclusive, we can leave it as is.
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.
Web is implemented.
I noticed that the fullscreen API we use has some compatibility issues with Safari, even before this PR. I will open an issue and address this afterwards.
EDIT: #2935.
Rebased (and added some fixes to Web). |
Rebased #2926 on top of this. |
Notify clients about the window state changes, most underlying systems do change the window states. Fixes rust-windowing#2334.
Co-authored-by: Mads Marquart <[email protected]>
Co-authored-by: Mads Marquart <[email protected]>
78b60a7
to
b5f670c
Compare
Rebased on a bunch of churn in Web. |
Notify clients about the window state changes, most underlying systems do change the window states.
Fixes #2334.
CHANGELOG.md
if knowledge of this change could be valuable to users