Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 1619060

Browse files
committed
Don't handle Alt+F4 from UInputMan - different event dispatched when multiple windows exist (followup to 0611feb)
1 parent 2f9822c commit 1619060

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,12 @@ namespace RTE {
165165
switch (sdlEvent.type) {
166166
case SDL_QUIT:
167167
System::SetQuit(true);
168-
break;
168+
return;
169169
case SDL_WINDOWEVENT:
170+
if (sdlEvent.window.event == SDL_WINDOWEVENT_CLOSE) {
171+
System::SetQuit(true);
172+
return;
173+
}
170174
g_WindowMan.HandleWindowEvent(sdlEvent);
171175
break;
172176
case SDL_KEYUP:

Managers/UInputMan.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,9 +922,6 @@ namespace RTE {
922922
} else if (!FlagCtrlState() && FlagAltState()) {
923923
if (KeyPressed(SDLK_F2)) {
924924
ContentFile::ReloadAllBitmaps();
925-
} else if (KeyPressed(SDLK_F4)) {
926-
// Alt+F4 OS event doesn't seem to work when in multi-display fullscreen, probably because multiple windows, so just handle it here all the time.
927-
System::SetQuit();
928925
// Alt+Enter to switch resolution multiplier
929926
} else if (KeyPressed(SDLK_RETURN)) {
930927
g_WindowMan.ChangeResolutionMultiplier();

0 commit comments

Comments
 (0)