mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1ef1acfc0 | ||
|
|
040d3f5d8b | ||
|
|
ec393e4a90 |
@@ -1,5 +1,10 @@
|
||||
# Unreleased
|
||||
|
||||
# Version 0.16.2 (2018-07-07)
|
||||
|
||||
- On Windows, non-resizable windows now have the maximization button disabled. This is consistent with behavior on macOS and popular X11 WMs.
|
||||
- Corrected incorrect `unreachable!` usage when guessing the DPI factor with no detected monitors.
|
||||
|
||||
# Version 0.16.1 (2018-07-02)
|
||||
|
||||
- Added logging through `log`. Logging will become more extensive over time.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "winit"
|
||||
version = "0.16.1"
|
||||
version = "0.16.2"
|
||||
authors = ["The winit contributors, Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||
description = "Cross-platform window creation library."
|
||||
keywords = ["windowing"]
|
||||
@@ -57,5 +57,5 @@ features = [
|
||||
wayland-client = { version = "0.20.6", features = [ "dlopen", "egl", "cursor"] }
|
||||
smithay-client-toolkit = "0.2.2"
|
||||
x11-dl = "2.17.5"
|
||||
parking_lot = "0.5"
|
||||
parking_lot = "0.6"
|
||||
percent-encoding = "1.0"
|
||||
|
||||
@@ -102,7 +102,7 @@ impl UnownedWindow {
|
||||
.unwrap_or(1.0)
|
||||
})
|
||||
} else {
|
||||
unreachable!("There are no detected monitors, which should've already caused a panic.");
|
||||
return Err(OsError(format!("No monitors were detected.")));
|
||||
};
|
||||
|
||||
info!("Guessed window DPI factor: {}", dpi_factor);
|
||||
|
||||
@@ -33,6 +33,8 @@ use platform::platform::monitor::get_available_monitors;
|
||||
use platform::platform::raw_input::register_all_mice_and_keyboards_for_raw_input;
|
||||
use platform::platform::util;
|
||||
|
||||
const WS_RESIZABLE: DWORD = winuser::WS_SIZEBOX | winuser::WS_MAXIMIZEBOX;
|
||||
|
||||
/// The Win32 implementation of the main `Window` object.
|
||||
pub struct Window {
|
||||
/// Main handle for the window.
|
||||
@@ -294,9 +296,9 @@ impl Window {
|
||||
winuser::GetWindowLongW(self.window.0, winuser::GWL_STYLE)
|
||||
};
|
||||
if resizable {
|
||||
style |= winuser::WS_SIZEBOX as LONG;
|
||||
style |= WS_RESIZABLE as LONG;
|
||||
} else {
|
||||
style &= !winuser::WS_SIZEBOX as LONG;
|
||||
style &= !WS_RESIZABLE as LONG;
|
||||
}
|
||||
|
||||
unsafe {
|
||||
@@ -544,9 +546,9 @@ impl Window {
|
||||
let _ = Self::grab_cursor_inner(&window, false);
|
||||
|
||||
if resizable {
|
||||
style |= winuser::WS_SIZEBOX as LONG;
|
||||
style |= WS_RESIZABLE as LONG;
|
||||
} else {
|
||||
style &= !winuser::WS_SIZEBOX as LONG;
|
||||
style &= !WS_RESIZABLE as LONG;
|
||||
}
|
||||
winuser::SetWindowLongW(window.0, winuser::GWL_STYLE, style);
|
||||
winuser::SetWindowLongW(window.0, winuser::GWL_EXSTYLE, ex_style);
|
||||
@@ -870,7 +872,7 @@ unsafe fn init(
|
||||
}
|
||||
dpi_factor
|
||||
} else {
|
||||
unreachable!("There are no detected monitors, which should've already caused a panic.");
|
||||
return Err(CreationError::OsError(format!("No monitors were detected.")));
|
||||
};
|
||||
dpi_factor.unwrap_or_else(|| {
|
||||
util::get_cursor_pos()
|
||||
@@ -951,7 +953,7 @@ unsafe fn init(
|
||||
};
|
||||
|
||||
if !attributes.resizable {
|
||||
style &= !winuser::WS_SIZEBOX;
|
||||
style &= !WS_RESIZABLE;
|
||||
}
|
||||
|
||||
if pl_attribs.parent.is_some() {
|
||||
|
||||
Reference in New Issue
Block a user