Skip to content

Commit 54d4485

Browse files
jayrmcountingpine
authored andcommitted
gfxlib: win32: move posting of EVENT_MOUSE_EXIT event in to ToggleFullScreen
- fix WM_SYSKEYDOWN message; it should fall through to WM_KEYDOWN|UP handler
1 parent fe37508 commit 54d4485

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/gfxlib2/win32/gfx_win32.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,13 @@ static void fb_hSetMouseClip( void )
8989
ClipCursor(&rc);
9090
}
9191

92-
static void ToggleFullScreen( void )
92+
static void ToggleFullScreen( EVENT *e )
9393
{
94+
if (has_focus) {
95+
e->type = EVENT_MOUSE_EXIT;
96+
fb_hPostEvent(e);
97+
}
98+
9499
if (fb_win32.flags & DRIVER_NO_SWITCH)
95100
return;
96101

@@ -324,11 +329,7 @@ LRESULT CALLBACK fb_hWin32WinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
324329
case WM_SIZE:
325330
if (fb_win32.is_active) {
326331
if ( wParam == SIZE_MAXIMIZED ) {
327-
if (has_focus) {
328-
e.type = EVENT_MOUSE_EXIT;
329-
fb_hPostEvent(&e);
330-
}
331-
ToggleFullScreen();
332+
ToggleFullScreen(&e);
332333
return FALSE;
333334
}
334335
}
@@ -337,15 +338,11 @@ LRESULT CALLBACK fb_hWin32WinProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
337338
case WM_SYSKEYDOWN:
338339
if (fb_win32.is_active) {
339340
if ( (wParam == VK_RETURN) && (lParam & 0x20000000) ) {
340-
if (has_focus) {
341-
e.type = EVENT_MOUSE_EXIT;
342-
fb_hPostEvent(&e);
343-
}
344-
ToggleFullScreen();
341+
ToggleFullScreen(&e);
345342
return FALSE;
346343
}
347344
}
348-
break;
345+
/* fall through */
349346

350347
case WM_KEYDOWN:
351348
case WM_KEYUP:

0 commit comments

Comments
 (0)