From 0959fd2243865ade95bdf8c513219ee575c1c2b1 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 15 Jan 2015 07:44:01 +0100 Subject: [PATCH] (Win32) Add Mouse Grab to menubar --- gfx/drivers_context/wgl_ctx.c | 3 +++ media/rarch.rc | 1 + menu/menu_list.c | 3 +-- win32/resource.h | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index bfac468994..165f227f33 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -322,6 +322,9 @@ static LRESULT win32_menu_loop(WPARAM wparam) case ID_M_FULL_SCREEN: cmd = RARCH_CMD_FULLSCREEN_TOGGLE; break; + case ID_M_MOUSE_GRAB: + cmd = RARCH_CMD_GRAB_MOUSE_TOGGLE; + break; case ID_M_QUIT: do_wm_close = true; break; diff --git a/media/rarch.rc b/media/rarch.rc index c5da60ed29..165e2860a3 100644 --- a/media/rarch.rc +++ b/media/rarch.rc @@ -27,6 +27,7 @@ BEGIN MENUITEM "Reset", ID_M_RESET MENUITEM "Menu Toggle", ID_M_MENU_TOGGLE MENUITEM "Pause Toggle", ID_M_PAUSE_TOGGLE + MENUITEM "Mouse Grab Toggle", ID_M_MOUSE_GRAB END POPUP "Window" BEGIN diff --git a/menu/menu_list.c b/menu/menu_list.c index ef604d8298..f11a458a85 100644 --- a/menu/menu_list.c +++ b/menu/menu_list.c @@ -38,8 +38,7 @@ void menu_list_destroy(file_list_t *list) } end: - if (list) - file_list_free(list); + file_list_free(list); } void menu_list_free(menu_list_t *menu_list) diff --git a/win32/resource.h b/win32/resource.h index 802a2ffd3f..8137b73588 100644 --- a/win32/resource.h +++ b/win32/resource.h @@ -23,3 +23,4 @@ #define ID_M_WINDOW_SCALE_9X 40020 #define ID_M_WINDOW_SCALE_10X 40021 #define ID_M_FULL_SCREEN 40022 +#define ID_M_MOUSE_GRAB 40023