mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 13:31:29 +11:00
Add is_resizable
and is_decorated
on Wayland
This commit brings `is_resizable` and `is_decorated`. Since the client is responsible for both of them, they could be tracked without deep syncing with server.
This commit is contained in:
parent
ab1f636960
commit
e8d910ffd3
|
@ -58,6 +58,12 @@ pub struct Window {
|
||||||
|
|
||||||
/// Requests that SCTK window should perform.
|
/// Requests that SCTK window should perform.
|
||||||
window_requests: Arc<Mutex<Vec<WindowRequest>>>,
|
window_requests: Arc<Mutex<Vec<WindowRequest>>>,
|
||||||
|
|
||||||
|
/// Whether the window is resizeable.
|
||||||
|
resizeable: AtomicBool,
|
||||||
|
|
||||||
|
/// Whether the window is decorated.
|
||||||
|
decorated: AtomicBool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Window {
|
impl Window {
|
||||||
|
@ -248,6 +254,8 @@ impl Window {
|
||||||
fullscreen,
|
fullscreen,
|
||||||
maximized,
|
maximized,
|
||||||
windowing_features,
|
windowing_features,
|
||||||
|
resizeable: AtomicBool::new(attributes.resizable),
|
||||||
|
decorated: AtomicBool::new(attributes.decorations),
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(window)
|
Ok(window)
|
||||||
|
@ -338,12 +346,13 @@ impl Window {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_resizable(&self, resizable: bool) {
|
pub fn set_resizable(&self, resizable: bool) {
|
||||||
|
self.resizeable.store(resizable, Ordering::Relaxed);
|
||||||
self.send_request(WindowRequest::Resizeable(resizable));
|
self.send_request(WindowRequest::Resizeable(resizable));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_resizable(&self) -> bool {
|
pub fn is_resizable(&self) -> bool {
|
||||||
true
|
self.resizeable.load(Ordering::Relaxed)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -355,12 +364,13 @@ impl Window {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_decorations(&self, decorate: bool) {
|
pub fn set_decorations(&self, decorate: bool) {
|
||||||
|
self.decorated.store(decorate, Ordering::Relaxed);
|
||||||
self.send_request(WindowRequest::Decorate(decorate));
|
self.send_request(WindowRequest::Decorate(decorate));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_decorated(&self) -> bool {
|
pub fn is_decorated(&self) -> bool {
|
||||||
true
|
self.decorated.load(Ordering::Relaxed)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -686,7 +686,7 @@ impl Window {
|
||||||
///
|
///
|
||||||
/// ## Platform-specific
|
/// ## Platform-specific
|
||||||
///
|
///
|
||||||
/// - **Wayland / X11:** Not implemented.
|
/// - **X11:** Not implemented.
|
||||||
/// - **iOS / Android / Web:** Unsupported.
|
/// - **iOS / Android / Web:** Unsupported.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_resizable(&self) -> bool {
|
pub fn is_resizable(&self) -> bool {
|
||||||
|
@ -777,7 +777,7 @@ impl Window {
|
||||||
///
|
///
|
||||||
/// ## Platform-specific
|
/// ## Platform-specific
|
||||||
///
|
///
|
||||||
/// - **Wayland / X11:** Not implemented.
|
/// - **X11:** Not implemented.
|
||||||
/// - **iOS / Android / Web:** Unsupported.
|
/// - **iOS / Android / Web:** Unsupported.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_decorated(&self) -> bool {
|
pub fn is_decorated(&self) -> bool {
|
||||||
|
|
Loading…
Reference in a new issue