aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Stewart <ryan@binsoftware.com>2015-03-24 13:24:07 -0700
committerRyan Stewart <ryan@binsoftware.com>2015-03-24 13:25:24 -0700
commit1c20ff87f1d58cb1a0f846ab961734291040b45a (patch)
tree3ee457fce043d4fcbc02e3c833d258e53326c6da
parent8a463f664302d90fbe31800ec25afadb1cf6d7c3 (diff)
downloadglutin-1c20ff87f1d58cb1a0f846ab961734291040b45a.tar.gz
glutin-1c20ff87f1d58cb1a0f846ab961734291040b45a.zip
honor top-left coordinates when requesting fullscreen to make sure window appears on the correct monitor
-rw-r--r--src/win32/init.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/win32/init.rs b/src/win32/init.rs
index b458d95..8ec8cb1 100644
--- a/src/win32/init.rs
+++ b/src/win32/init.rs
@@ -164,6 +164,12 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
(None, None)
};
+ let (x, y) = if builder.monitor.is_some() {
+ (Some(rect.left), Some(rect.top))
+ } else {
+ (None, None)
+ };
+
let style = if !builder.visible || builder.headless {
style
} else {
@@ -173,8 +179,7 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
let handle = user32::CreateWindowExW(ex_style, class_name.as_ptr(),
title.as_ptr() as winapi::LPCWSTR,
style | winapi::WS_CLIPSIBLINGS | winapi::WS_CLIPCHILDREN,
- if builder.monitor.is_some() { 0 } else { winapi::CW_USEDEFAULT },
- if builder.monitor.is_some() { 0 } else { winapi::CW_USEDEFAULT },
+ x.unwrap_or(winapi::CW_USEDEFAULT), y.unwrap_or(winapi::CW_USEDEFAULT),
width.unwrap_or(winapi::CW_USEDEFAULT), height.unwrap_or(winapi::CW_USEDEFAULT),
ptr::null_mut(), ptr::null_mut(), kernel32::GetModuleHandleW(ptr::null()),
ptr::null_mut());