Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_WindowWin32.cpp
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* Monitor details. */ | /* Monitor details. */ | ||||
| MONITORINFOEX monitor; | MONITORINFOEX monitor; | ||||
| monitor.cbSize = sizeof(MONITORINFOEX); | monitor.cbSize = sizeof(MONITORINFOEX); | ||||
| monitor.dwFlags = 0; | monitor.dwFlags = 0; | ||||
| GetMonitorInfo(MonitorFromRect(&win_rect, MONITOR_DEFAULTTONEAREST), &monitor); | GetMonitorInfo(MonitorFromRect(&win_rect, MONITOR_DEFAULTTONEAREST), &monitor); | ||||
| /* Adjust our requested size to allow for caption and borders and constrain to monitor. */ | /* Constrain our requested values to fit within this monitor. */ | ||||
| AdjustWindowRectEx(&win_rect, WS_CAPTION, FALSE, 0); | win_rect.left = max(win_rect.left, monitor.rcWork.left); | ||||
nicholas_rishel: Intersecting with the monitor rect will be subtly different from clamping the origin and… | |||||
| width = min(monitor.rcWork.right - monitor.rcWork.left, win_rect.right - win_rect.left); | win_rect.top = max(win_rect.top, monitor.rcWork.top); | ||||
| left = min(max(monitor.rcWork.left, win_rect.left), monitor.rcWork.right - width); | win_rect.right = min(win_rect.right, monitor.rcWork.right); | ||||
| height = min(monitor.rcWork.bottom - monitor.rcWork.top, win_rect.bottom - win_rect.top); | win_rect.bottom = min(win_rect.bottom, monitor.rcWork.bottom); | ||||
| top = min(max(monitor.rcWork.top, win_rect.top), monitor.rcWork.bottom - height); | |||||
Not Done Inline ActionsDid you rule out monitor.rcWork being the issue here? I haven't dived into it but the symptoms are in line with what would happen if monitor.rcMonitor was the intended clip space. nicholas_rishel: Did you rule out monitor.rcWork being the issue here? I haven't dived into it but the symptoms… | |||||
| /* Adjust our requested values to allow for caption, borders, shadows, etc. | |||||
| Windows API Note: You cannot specify WS_OVERLAPPED when calling. */ | |||||
| AdjustWindowRectEx(&win_rect, style & ~WS_OVERLAPPED, FALSE, extended_style); | |||||
| /* Create our window based on these adjusted sizes and positions. */ | |||||
| width = win_rect.right - win_rect.left; | |||||
| left = win_rect.left; | |||||
| height = win_rect.bottom - win_rect.top; | |||||
| top = win_rect.top; | |||||
| m_hWnd = ::CreateWindowExW(extended_style, // window extended style | m_hWnd = ::CreateWindowExW(extended_style, // window extended style | ||||
| s_windowClassName, // pointer to registered class name | s_windowClassName, // pointer to registered class name | ||||
| title_16, // pointer to window name | title_16, // pointer to window name | ||||
| style, // window style | style, // window style | ||||
| left, // horizontal position of window | left, // horizontal position of window | ||||
| top, // vertical position of window | top, // vertical position of window | ||||
| width, // window width | width, // window width | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||
Intersecting with the monitor rect will be subtly different from clamping the origin and width/height; a change in origin now changes the clipped width/height. I'm not sure which behavior is preferable but I'd call this change in behavior out in the commit message if kept.