summaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-11-05 01:53:12 +0000
committerDarkvater <Darkvater@openttd.org>2006-11-05 01:53:12 +0000
commit3aa12e1cd035e79036d6f5e76b3d058beed054ac (patch)
tree2527c9d7874f7886074280ddc6d14bf703e1978a /video
parente922f05723a5c33e5749c288e4b59ea93f2a2500 (diff)
downloadopenttd-3aa12e1cd035e79036d6f5e76b3d058beed054ac.tar.xz
(svn r7062) -[win32] Codechange: Remove unneeded WM_MOUSEENTER event, and change mouse behaviour
a bit so that any specific windows inside (eg IME compositor) will have a cursor.
Diffstat (limited to 'video')
-rw-r--r--video/win32_v.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/video/win32_v.c b/video/win32_v.c
index c38c6b54c..65e5915ff 100644
--- a/video/win32_v.c
+++ b/video/win32_v.c
@@ -180,9 +180,7 @@ int RedrawScreenDebug(void)
}
#endif
-/* Windows 95 will not have a WM_MOUSELEAVE message, so define it if
- * needed. There is no such event as WM_MOUSEENTER, we just made this up :) */
-#define WM_MOUSEENTER WM_USER + 1
+/* Windows 95 will not have a WM_MOUSELEAVE message, so define it if needed */
#if !defined(WM_MOUSELEAVE)
#define WM_MOUSELEAVE 0x02A3
#endif
@@ -287,15 +285,12 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
_right_button_down = false;
return 0;
- case WM_MOUSEENTER:
- _cursor.in_window = true;
- DrawMouseCursor();
- break;
-
case WM_MOUSELEAVE:
UndrawMouseCursor();
_cursor.in_window = false;
- break;
+
+ if (!_left_button_down && !_right_button_down) MyShowCursor(true);
+ return 0;
case WM_MOUSEMOVE: {
int x = (int16)LOWORD(lParam);
@@ -303,13 +298,13 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
POINT pt;
/* If the mouse was not in the window and it has moved it means it has
- * come into the window, so send a WM_MOUSEENTER message. Also start
+ * come into the window, so start drawing the mouse. Also start
* tracking the mouse for exiting the window */
if (!_cursor.in_window) {
_cursor.in_window = true;
SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
- if (hwnd != GetCapture()) PostMessage(hwnd, WM_MOUSEENTER, 0, 0L);
+ DrawMouseCursor();
}
if (_wnd.double_size) {
@@ -391,10 +386,6 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
}
break;
- case WM_NCMOUSEMOVE:
- MyShowCursor(true);
- return 0;
-
case WM_SIZE:
if (wParam != SIZE_MINIMIZED) {
/* Set maximized flag when we maximize (obviously), but also when we