From: Eric Branlund Date: Sun, 22 Mar 2020 19:02:28 +0000 (-0700) Subject: It's not currently used in hengband, but bring over the change to mouse event handlin... X-Git-Tag: vmacos2.2.1-7d~6 X-Git-Url: http://git.osdn.net/view?p=hengbandforosx%2Fhengbandosx.git;a=commitdiff_plain;h=2c751de0350284cf64edd6a478436c11a3dfa243 It's not currently used in hengband, but bring over the change to mouse event handling from Angband that prevents clicks on the title bar from being passed to the core. --- diff --git a/src/main-cocoa.m b/src/main-cocoa.m index 7a32574ae..778452c39 100644 --- a/src/main-cocoa.m +++ b/src/main-cocoa.m @@ -4963,10 +4963,12 @@ static void AngbandHandleEventMouseDown( NSEvent *event ) /* Coordinates run from (0,0) to (cols-1, rows-1). */ BOOL mouseInMapSection = (x > 13 && x <= cols - 1 && y > 0 && y <= rows - 2); - /* If we are displaying a menu, allow clicks anywhere; if we are - * displaying the main game interface, only allow clicks in the map - * section */ - if (!displayingMapInterface || (displayingMapInterface && mouseInMapSection)) + /* If we are displaying a menu, allow clicks anywhere within + * the terminal bounds; if we are displaying the main game + * interface, only allow clicks in the map section */ + if ((!displayingMapInterface && x >= 0 && x < cols && + y >= 0 && y < rows) || + (displayingMapInterface && mouseInMapSection)) { /* [event buttonNumber] will return 0 for left click, * 1 for right click, but this is safer */