From bb2a53fd6aadead02fc0a7eaa0c02c2d8e15bd03 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sat, 14 Jan 2006 11:04:05 +0000 Subject: [PATCH] Fix double toggling of full screen and fix potential issue if 'q' was bound to do something and the user was really trying to quit without doing whatever that was. Both of these were OS X specific issues due to the fact that Quit and Enter Full Screen are two menu options and handled as such. --- stepmania/src/StepMania.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index e4e77ca90e..c6b6840c93 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1266,6 +1266,16 @@ bool HandleGlobalInputs( const InputEventPlus &input ) return true; } } +#else + if( input.DeviceI == DeviceInput(DEVICE_KEYBOARD, KEY_Cq) && + (INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_LMETA) ) || + INPUTFILTER->IsBeingPressed( DeviceInput(DEVICE_KEYBOARD, KEY_RMETA) )) ) + { + /* The user quit is handled by the menu item so we don't need to set it here; + * however, we do want to return that it has been handled since this will happen + * first. */ + return true; + } #endif bool bDoScreenshot = @@ -1300,7 +1310,14 @@ bool HandleGlobalInputs( const InputEventPlus &input ) INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LALT))) ) { /* alt-enter */ + /* In OS X, this is a menu item and will be handled as such. This will happen + * first and then the lower priority GUI thread will happen second causing the + * window to toggle twice. Another solution would be to put a timer in + * ArchHooks::SetToggleWindowed() and just not set the bool it if it's been less + * than, say, half a second. */ +#if !defined(MACOSX) ArchHooks::SetToggleWindowed(); +#endif return true; }