Skip to content

Commit

Permalink
Fix middle_unlock option
Browse files Browse the repository at this point in the history
  • Loading branch information
maron2000 authored Nov 6, 2024
1 parent 6e6f9c8 commit 36cfc35
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/sdlmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4471,6 +4471,8 @@ static void HandleMouseButton(SDL_MouseButtonEvent * button, SDL_MouseMotionEven
#endif
bool inputToScreen = false;
bool inMenu = false;
Section_prop * section=static_cast<Section_prop *>(control->GetSection("sdl"));
std::string munlock;

#if DOSBOXMENU_TYPE == DOSBOXMENU_SDLDRAW /* SDL drawn menus */
if (GFX_GetPreventFullscreen()) {
Expand Down Expand Up @@ -4996,7 +4998,8 @@ static void HandleMouseButton(SDL_MouseButtonEvent * button, SDL_MouseMotionEven
// Don't pass click to mouse handler
break;
}
if (((middleunlock == 1 && !sdl.mouse.autoenable) || (middleunlock == 2 && sdl.mouse.autoenable) || middleunlock == 3) && sdl.mouse.autolock && mouse_notify_mode == 0 && button->button == SDL_BUTTON_MIDDLE) {
munlock = section->Get_string("middle_unlock");
if (((munlock == "manual" && !sdl.mouse.autoenable) || (munlock == "auto" && sdl.mouse.autoenable) || munlock == "both") && mouse_notify_mode == 0 && button->button == SDL_BUTTON_MIDDLE) {
GFX_CaptureMouse();
break;
}
Expand Down

0 comments on commit 36cfc35

Please sign in to comment.