From d5c094df75959538ae85176e09210a2670cb4f81 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Thu, 18 Feb 2010 00:50:08 +0000 Subject: [PATCH] In linux when in fullscreen, make escape leave fullscreen then pause. More like on windows? git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5079 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Core.cpp | 6 ++++-- Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index c77ba1c6d0..1e722b7ac3 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -269,9 +269,11 @@ void ProcessXEvents(void) key = XLookupKeysym((XKeyEvent*)&event, 0); if(key == XK_F4 && ((event.xkey.state & Mod1Mask) == Mod1Mask)) Host_Message(WM_USER_STOP); - else if (key == XK_Escape) - Host_Message(WM_USER_PAUSE); break; + case KeyPress: + key = XLookupKeysym((XKeyEvent*)&event, 0); + if (key == XK_Escape) + Host_Message(WM_USER_PAUSE); case ClientMessage: if ((ulong) event.xclient.data.l[0] == XInternAtom(dpy, "WM_DELETE_WINDOW", False)) Host_Message(WM_USER_STOP); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp index 50bf1ad47a..63602872e5 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLUtil.cpp @@ -571,7 +571,7 @@ void OpenGL_Update() switch(event.type) { case KeyRelease: key = XLookupKeysym((XKeyEvent*)&event, 0); - if((key >= XK_F1 && key <= XK_F9) || key == XK_Escape) { + if(key >= XK_F1 && key <= XK_F9) { g_VideoInitialize.pKeyPress(FKeyPressed, ShiftPressed, ControlPressed); FKeyPressed = -1; } else { @@ -590,13 +590,20 @@ void OpenGL_Update() else FKeyPressed = key - 0xff4e; } - else if (key == XK_Return && ((event.xkey.state & Mod1Mask) == Mod1Mask)) - ToggleFullscreenMode(); else if (key == XK_Escape) { - if (!GLWin.fs) - FKeyPressed = 0x1c; + if (GLWin.fs) + { + ToggleFullscreenMode(); + XEvent event; + do { + XMaskEvent(GLWin.dpy, StructureNotifyMask, &event); + } while ( (event.type != MapNotify) || (event.xmap.event != GLWin.win) ); + } + g_VideoInitialize.pKeyPress(0x1c, ShiftPressed, ControlPressed); } + else if (key == XK_Return && ((event.xkey.state & Mod1Mask) == Mod1Mask)) + ToggleFullscreenMode(); else { if(key == XK_Shift_L || key == XK_Shift_R) ShiftPressed = true;