MacOS Titlebar not responding to close action and sends to underlying window
Steps to reproduce
- open a dialog above a gtk window
- notice that mouseclicks on the titlebar are received by the window below (though seems to be intermittent)
I've not been able to create a selfcontained demo, but I have a patch which demonstrates the fix.
Current behavior
clicks on title bar buttons are sent to window below some of the time
Expected outcome
Clicks on title bar buttons are always sent to the dialog box.
Version information
MacOS 3.24.38
Additional information
Attached a patch. The issue appears to be that MacOS windows have their y origin at the bottom and gtk windows at the top. In this particular case when gtk is trying to calculate the titlebar, it incorrectly assumes the wrong coordinate system.
As the problem was intermittent, it's not certain this fix is enough. However I've not been able to make the problem happen since applying this patch, and the is without doubt a problem with the assumptions about the y origin.
patch-macos-fix-titlebar-detection.diff
This is the tracking issue in GIMP: gimp#9772 (closed)