On Windows, Unset maximized when transforming window (#1014)

* Unset maximized when functionally transforming window

* Add docs

* Fix compile issues
This commit is contained in:
Osspial 2019-08-26 22:07:15 -04:00 committed by GitHub
parent 0b497b62d8
commit b03e589987
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 2 deletions

View file

@ -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 `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 Windows, unset `maximized` when manually changing the window's position or size.
# 0.20.0 Alpha 1 (2019-06-21)

View file

@ -212,6 +212,15 @@ impl Window {
pub fn set_outer_position(&self, logical_position: LogicalPosition) {
let dpi_factor = self.hidpi_factor();
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);
}
@ -287,6 +296,15 @@ impl Window {
pub fn set_inner_size(&self, logical_size: LogicalSize) {
let dpi_factor = self.hidpi_factor();
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);
}

View file

@ -413,7 +413,8 @@ impl 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
///
@ -443,7 +444,8 @@ impl 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
///