فهرست منبع

Fixing issues that were happening because of TrackMouseEvent calls constantly being sent
To fix this issue I had to remove non-client area mouse leave tracking. Later it might warrant a proper fix.

Marko Pintera 12 سال پیش
والد
کامیت
f63154c79c
2فایلهای تغییر یافته به همراه8 افزوده شده و 34 حذف شده
  1. 4 29
      CamelotCore/Source/CmPlatformWndProc.cpp
  2. 4 5
      EditorWindowDock.txt

+ 4 - 29
CamelotCore/Source/CmPlatformWndProc.cpp

@@ -166,37 +166,15 @@ namespace CamelotFramework
 
 
 				return HTCLIENT;
 				return HTCLIENT;
 			}
 			}
-		case WM_NCMOUSELEAVE:
 		case WM_MOUSELEAVE:
 		case WM_MOUSELEAVE:
 			{
 			{
+				// Note: Right now I track only mouse leaving client area. So it's possible for the "mouse left window" callback
+				// to trigger, while the mouse is still in the non-client area of the window.
 				mIsTrackingMouse = false; // TrackMouseEvent ends when this message is received and needs to be re-applied
 				mIsTrackingMouse = false; // TrackMouseEvent ends when this message is received and needs to be re-applied
 
 
-				POINT mousePos;
-				GetCursorPos(&mousePos);
-
-				// Ensure we have actually left the window - it's possible we just moved from client to non-client area but
-				// that's not what we're interested in
-				if(mousePos.x < win->getLeft() || mousePos.x > (INT32)(win->getLeft() + win->getWidth()) ||
-					mousePos.y < win->getTop() || mousePos.y > (INT32)(win->getTop() + win->getHeight()))
-				{
-					CM_LOCK_MUTEX(mSync);
-
-					mMouseLeftWindows.push_back(win);
-				}
-				else
-				{
-					TRACKMOUSEEVENT tme = { sizeof(tme) };
-					
-					if(uMsg == WM_MOUSELEAVE)
-						tme.dwFlags = TME_LEAVE | TME_NONCLIENT;
-					else
-						tme.dwFlags = TME_LEAVE;
-
-					tme.hwndTrack = hWnd;
-					TrackMouseEvent(&tme);
+				CM_LOCK_MUTEX(mSync);
 
 
-					mIsTrackingMouse = true;
-				}
+				mMouseLeftWindows.push_back(win);
 			}
 			}
 			break;
 			break;
 		case WM_NCLBUTTONUP:
 		case WM_NCLBUTTONUP:
@@ -215,9 +193,6 @@ namespace CamelotFramework
 					TRACKMOUSEEVENT tme = { sizeof(tme) };
 					TRACKMOUSEEVENT tme = { sizeof(tme) };
 					tme.dwFlags = TME_LEAVE;
 					tme.dwFlags = TME_LEAVE;
 
 
-					if(uMsg == WM_NCMOUSEMOVE)
-						tme.dwFlags |= TME_NONCLIENT;
-
 					tme.hwndTrack = hWnd;
 					tme.hwndTrack = hWnd;
 					TrackMouseEvent(&tme);
 					TrackMouseEvent(&tme);
 
 

+ 4 - 5
EditorWindowDock.txt

@@ -4,16 +4,15 @@ Add icons to drag and drop - There's a built-in windows icon for this. I think.
 Add highlight to WindowMover so I can know when I'm mousing over it with a dragged window in hand
 Add highlight to WindowMover so I can know when I'm mousing over it with a dragged window in hand
 Ensure that dropping a window onto a mover will actually docks it properly
 Ensure that dropping a window onto a mover will actually docks it properly
 
 
-GUIManager only changes mouse over events in MouseMove method, but that method doesn't get called when mouse leaves the window!
-
 I still have the issue where GUIManager hack code got triggered
 I still have the issue where GUIManager hack code got triggered
 Get rid of the GUIManager mouseUp hack when I ensure resize/move using non client areas work
 Get rid of the GUIManager mouseUp hack when I ensure resize/move using non client areas work
 
 
 Prevent docking if available size is less than 20 pixels, otherwise there might be some weirdness
 Prevent docking if available size is less than 20 pixels, otherwise there might be some weirdness
 
 
-Possible solution to MouseUp problem:
-  on WM_ENTERSIZEMOVE call OIS and SetCooperativeLevel(BACKGROUND)
-  and on WM_EXITSIZEMOVE revert back to FOREGROUND coop level
+There are some weird issues with move/resize:
+ - Moving will sometimes block and delay for 2-3 seconds
+ - Resize will sometimes fail to register the resize area
+ - If I overlap two windows and move along the bottom resize border of the child window to the main window slowly, the resize cursor doesn't change
 
 
 ------------------------
 ------------------------