comparison libvo/w32_common.c @ 17115:dbe315450a32

Fix message handling, process resize events
author reimar
date Tue, 06 Dec 2005 22:15:03 +0000
parents 852499addaa8
children e5f2f50744cd
comparison
equal deleted inserted replaced
17114:32fbef7a2e96 17115:dbe315450a32
19 uint32_t o_dheight; 19 uint32_t o_dheight;
20 20
21 static HINSTANCE hInstance; 21 static HINSTANCE hInstance;
22 HWND vo_window = 0; 22 HWND vo_window = 0;
23 static int cursor = 1; 23 static int cursor = 1;
24 static int event_flags;
24 25
25 static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { 26 static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
26 switch (message) { 27 switch (message) {
28 case WM_ACTIVATE:
29 event_flags |= VO_EVENT_EXPOSE;
30 break;
31 case WM_SIZE:
32 event_flags |= VO_EVENT_RESIZE;
33 vo_dwidth = lParam & 0xffff;
34 vo_dheight = lParam >> 16;
35 break;
27 case WM_CLOSE: 36 case WM_CLOSE:
28 mplayer_put_key(KEY_CLOSE_WIN); 37 mplayer_put_key(KEY_CLOSE_WIN);
29 break; 38 break;
30 case WM_SYSCOMMAND: 39 case WM_SYSCOMMAND:
31 switch (wParam) { 40 switch (wParam) {
88 return DefWindowProc(hWnd, message, wParam, lParam); 97 return DefWindowProc(hWnd, message, wParam, lParam);
89 } 98 }
90 99
91 int vo_w32_check_events(void) { 100 int vo_w32_check_events(void) {
92 MSG msg; 101 MSG msg;
93 int r = 0; 102 event_flags = 0;
94 while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { 103 while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) {
95 TranslateMessage(&msg); 104 TranslateMessage(&msg);
96 DispatchMessage(&msg); 105 DispatchMessage(&msg);
97 switch (msg.message) { 106 }
98 case WM_ACTIVATE: 107
99 r |= VO_EVENT_EXPOSE; 108 return event_flags;
100 break;
101 }
102 }
103
104 return r;
105 } 109 }
106 110
107 static void updateScreenProperties() { 111 static void updateScreenProperties() {
108 DEVMODE dm; 112 DEVMODE dm;
109 dm.dmSize = sizeof dm; 113 dm.dmSize = sizeof dm;