Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2010-10-19 13:38:56 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2010-10-19 13:38:56 +0400
commitd7b40531cdfd21791d4ed36373ceb8cefe052b51 (patch)
tree3302cf3895b2f55fbbddba7627185a8c3aac4b9a /intern
parenta781157047a5085fbe6d2a836571b6bff9871d02 (diff)
Fix [#20277] Bug with Continuous Grab on Windows
Reported by Alex Glawion When we have a maximized window we need to take into account that there are no borders.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 1366aebf9e7..75abc110743 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -373,15 +373,24 @@ void GHOST_WindowWin32::getWindowBounds(GHOST_Rect& bounds) const
void GHOST_WindowWin32::getClientBounds(GHOST_Rect& bounds) const
{
RECT rect;
-
+ GHOST_TWindowState state= this->getState();
LONG_PTR result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE);
+ int sm_cysizeframe = GetSystemMetrics(SM_CYSIZEFRAME);
::GetWindowRect(m_hWnd, &rect);
if((result & (WS_POPUP | WS_MAXIMIZE)) != (WS_POPUP | WS_MAXIMIZE)) {
- bounds.m_b = rect.bottom-GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYSIZEFRAME)*2;
- bounds.m_l = rect.left;
- bounds.m_r = rect.right-GetSystemMetrics(SM_CYSIZEFRAME)*2;
- bounds.m_t = rect.top;
+ if(state==GHOST_kWindowStateMaximized) {
+ // in maximized state we don't have borders on the window
+ bounds.m_b = rect.bottom-GetSystemMetrics(SM_CYCAPTION)- sm_cysizeframe*2;
+ bounds.m_l = rect.left + sm_cysizeframe;
+ bounds.m_r = rect.right - sm_cysizeframe;
+ bounds.m_t = rect.top;
+ } else {
+ bounds.m_b = rect.bottom-GetSystemMetrics(SM_CYCAPTION)-sm_cysizeframe*2;
+ bounds.m_l = rect.left;
+ bounds.m_r = rect.right-sm_cysizeframe*2;
+ bounds.m_t = rect.top;
+ }
} else {
::GetWindowRect(m_hWnd, &rect);
bounds.m_b = rect.bottom;