Skip to content

macos: Fix to offscreen window selections in Gimp 2.99

Lukas Oberhuber requested to merge lukaso/gtk:gtk-3-24-fix-gimp into gtk-3-24

This change completely fixes the problems with offscreen windows that make the Gimp 2.99 text tool widget unable to adjust the font as well as random crashes (which were likely related) on macOS.

Issues here: gimp#7626 (closed) and gimp#7608 (closed)

The problem was that (GTK versions of) NSWindows and NSViews were not being properly discovered within offscreen windows. This fixes that as well as making some object casts more robust.

This supersedes (by incorporation): !4262 (closed) and !4293 (closed).

Additionally, the root window does not have an NSWindow associated with it, so calls to get the NSWindow for the root are stopped.

Finally, the release of views is improved and matches the lifecycle of the view.

All these changes have been tested locally on a Monterey based Mac and are working without issuing any warnings (anymore).

cc @ebassi and @Jehan

Edited by Lukas Oberhuber

Merge request reports