changeset 17115:dbe315450a32

Fix message handling, process resize events
author reimar
date Tue, 06 Dec 2005 22:15:03 +0000
parents 32fbef7a2e96
children 724353364790
files libvo/w32_common.c
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/w32_common.c	Tue Dec 06 21:34:42 2005 +0000
+++ b/libvo/w32_common.c	Tue Dec 06 22:15:03 2005 +0000
@@ -21,9 +21,18 @@
 static HINSTANCE hInstance;
 HWND vo_window = 0;
 static int cursor = 1;
+static int event_flags;
 
 static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
     switch (message) {
+	case WM_ACTIVATE:
+	    event_flags |= VO_EVENT_EXPOSE;
+	    break;
+	case WM_SIZE:
+	    event_flags |= VO_EVENT_RESIZE;
+	    vo_dwidth = lParam & 0xffff;
+	    vo_dheight = lParam >> 16;
+	    break;
 	case WM_CLOSE:
 	    mplayer_put_key(KEY_CLOSE_WIN);
 	    break;
@@ -90,18 +99,13 @@
 
 int vo_w32_check_events(void) {
     MSG msg;
-    int r = 0;
+    event_flags = 0;
     while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) {
 	TranslateMessage(&msg);
 	DispatchMessage(&msg);
-	switch (msg.message) {
-	    case WM_ACTIVATE:
-		r |= VO_EVENT_EXPOSE;
-		break;
-	}
     }
     
-    return r;
+    return event_flags;
 }
 
 static void updateScreenProperties() {