Rename Resized to Configured and expose state#2929
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.
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.
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.
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.
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.
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.
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.
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.
|
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 <mads@marquart.dk>
Co-authored-by: Mads Marquart <mads@marquart.dk>
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.mdif knowledge of this change could be valuable to users