mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 14:51:30 +11:00
On Windows, Unset maximized when transforming window (#1014)
* Unset maximized when functionally transforming window * Add docs * Fix compile issues
This commit is contained in:
parent
0b497b62d8
commit
b03e589987
|
@ -51,6 +51,7 @@ and `WindowEvent::HoveredFile`.
|
||||||
- On Windows, fix the trail effect happening on transparent decorated windows. Borderless (or un-decorated) windows were not affected.
|
- On Windows, fix the trail effect happening on transparent decorated windows. Borderless (or un-decorated) windows were not affected.
|
||||||
- On Windows, fix `with_maximized` not properly setting window size to entire window.
|
- On Windows, fix `with_maximized` not properly setting window size to entire window.
|
||||||
- On macOS, change `WindowExtMacOS::request_user_attention()` to take an `enum` instead of a `bool`.
|
- On macOS, change `WindowExtMacOS::request_user_attention()` to take an `enum` instead of a `bool`.
|
||||||
|
- On Windows, unset `maximized` when manually changing the window's position or size.
|
||||||
|
|
||||||
# 0.20.0 Alpha 1 (2019-06-21)
|
# 0.20.0 Alpha 1 (2019-06-21)
|
||||||
|
|
||||||
|
|
|
@ -212,6 +212,15 @@ impl Window {
|
||||||
pub fn set_outer_position(&self, logical_position: LogicalPosition) {
|
pub fn set_outer_position(&self, logical_position: LogicalPosition) {
|
||||||
let dpi_factor = self.hidpi_factor();
|
let dpi_factor = self.hidpi_factor();
|
||||||
let (x, y) = logical_position.to_physical(dpi_factor).into();
|
let (x, y) = logical_position.to_physical(dpi_factor).into();
|
||||||
|
|
||||||
|
let window_state = Arc::clone(&self.window_state);
|
||||||
|
let window = self.window.clone();
|
||||||
|
self.thread_executor.execute_in_thread(move || {
|
||||||
|
WindowState::set_window_flags(window_state.lock(), window.0, |f| {
|
||||||
|
f.set(WindowFlags::MAXIMIZED, false)
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
self.set_position_physical(x, y);
|
self.set_position_physical(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,6 +296,15 @@ impl Window {
|
||||||
pub fn set_inner_size(&self, logical_size: LogicalSize) {
|
pub fn set_inner_size(&self, logical_size: LogicalSize) {
|
||||||
let dpi_factor = self.hidpi_factor();
|
let dpi_factor = self.hidpi_factor();
|
||||||
let (width, height) = logical_size.to_physical(dpi_factor).into();
|
let (width, height) = logical_size.to_physical(dpi_factor).into();
|
||||||
|
|
||||||
|
let window_state = Arc::clone(&self.window_state);
|
||||||
|
let window = self.window.clone();
|
||||||
|
self.thread_executor.execute_in_thread(move || {
|
||||||
|
WindowState::set_window_flags(window_state.lock(), window.0, |f| {
|
||||||
|
f.set(WindowFlags::MAXIMIZED, false)
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
self.set_inner_size_physical(width, height);
|
self.set_inner_size_physical(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -413,7 +413,8 @@ impl Window {
|
||||||
|
|
||||||
/// Modifies the position of the window.
|
/// Modifies the position of the window.
|
||||||
///
|
///
|
||||||
/// See `outer_position` for more information about the coordinates.
|
/// See `outer_position` for more information about the coordinates. This automatically un-maximizes the
|
||||||
|
/// window if it's maximized.
|
||||||
///
|
///
|
||||||
/// ## Platform-specific
|
/// ## Platform-specific
|
||||||
///
|
///
|
||||||
|
@ -443,7 +444,8 @@ impl Window {
|
||||||
|
|
||||||
/// Modifies the inner size of the window.
|
/// Modifies the inner size of the window.
|
||||||
///
|
///
|
||||||
/// See `inner_size` for more information about the values.
|
/// See `inner_size` for more information about the values. This automatically un-maximizes the
|
||||||
|
/// window if it's maximized.
|
||||||
///
|
///
|
||||||
/// ## Platform-specific
|
/// ## Platform-specific
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue