From 70d773f103512deaaab690b08d7478dcb4d5182f Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Mon, 7 Sep 2015 21:21:17 +0200 Subject: [PATCH] Windows: If touch controls are off, and ingame, toggle fullscreen on doubleclick. --- Windows/WndMainWindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Windows/WndMainWindow.cpp b/Windows/WndMainWindow.cpp index 1b97a4f87b..af94df24e5 100644 --- a/Windows/WndMainWindow.cpp +++ b/Windows/WndMainWindow.cpp @@ -26,6 +26,7 @@ #include #include "base/NativeApp.h" +#include "base/timeutil.h" #include "Globals.h" #include "shellapi.h" @@ -1010,6 +1011,15 @@ namespace MainWindow NativeTouch(touch); SetCapture(hWnd); + // Simulate doubleclick, doesn't work with RawInput enabled + static double lastMouseDown; + double now = real_time_now(); + if ((now - lastMouseDown) < 0.2) { + if (!g_Config.bShowTouchControls && GetUIState() == UISTATE_INGAME) { + PostMessage(hwndMain, WM_USER_TOGGLE_FULLSCREEN, 0, 0); + } + } + lastMouseDown = real_time_now(); } break;