Skip to content

Commit bd724d1

Browse files
committed
Updated to latest commit & fixed dbl click close behavior
1 parent c76c630 commit bd724d1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

libs/s25main/ingameWindows/IngameWindow.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ bool IngameWindow::Msg_LeftDown(const MouseCoords& mc)
212212

213213
bool IngameWindow::Msg_LeftUp(const MouseCoords& mc)
214214
{
215-
// Was a button pressed
216-
bool btnClicked = false;
217215
isMoving = false;
218216

219217
for(const auto btn : helpers::enumRange<IwButton>())
@@ -230,7 +228,6 @@ bool IngameWindow::Msg_LeftUp(const MouseCoords& mc)
230228

231229
if(IsPointInRect(mc.pos, GetButtonBounds(btn)))
232230
{
233-
btnClicked = true;
234231
switch(btn)
235232
{
236233
case IwButton::Close: Close(); return true;
@@ -257,9 +254,10 @@ bool IngameWindow::Msg_LeftUp(const MouseCoords& mc)
257254
}
258255
}
259256

260-
// On touch devices dblclick close window
261-
if(VIDEODRIVER.IsTouch() && mc.dbl_click && !btnClicked && !IsPinned() && closeBehavior_ == CloseBehavior::Regular)
257+
// On touch devices dblclick closes window
258+
if(VIDEODRIVER.IsTouch() && mc.dbl_click && closeBehavior_ != CloseBehavior::Custom)
262259
Close();
260+
return false;
263261
}
264262

265263
bool IngameWindow::Msg_MouseMove(const MouseCoords& mc)

0 commit comments

Comments
 (0)