Skip to content

Commit

Permalink
macOS: fix crash when trying to enter fullscreen while already in ful…
Browse files Browse the repository at this point in the history
…lscreen

YDK2 uses SetSystemUIMode() for fullscreen. This also uses space
otherwise reserved for the menu bar at the top, and is apparently
preferable for Ardour's UI.

However when a user manually enters fullscreen using the window
title-bar's green button (NSWindow toggleFullScreen). YDK will crash
when the user then also tries to use YDK's fullscreen mode:

```
NSWindowStyleMaskFullScreen cleared on a window outside of a full screen transition.
called from
  [NSWindow setStyleMask:]
  gdk_window_set_decorations
  gdk_window_fullscreen
```

Ideally we'd set NSApp presentation flags so that the toplevel window
would allow one to zoom (maximize), but not to enter fullscreen. Like it
used to be on OSX. It is unclear how to achieve this on macOS for
resizable windows, short of marking the top-level window a dialog or
utility window.
  • Loading branch information
x42 committed Apr 10, 2024
1 parent 6b3fbef commit fe7fd14
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libs/tk/ydk/quartz/gdkwindow-quartz.c
Original file line number Diff line number Diff line change
Expand Up @@ -2826,6 +2826,13 @@ gdk_window_fullscreen (GdkWindow *window)
!WINDOW_IS_TOPLEVEL (window))
return;

if ([impl->toplevel styleMask] & NSWindowStyleMaskFullScreen) {
/* already in full screen, this can happen when a user
* uses the "green button" to maximize the window.
*/
return;
}

geometry = get_fullscreen_geometry (window);
if (!geometry)
{
Expand Down

0 comments on commit fe7fd14

Please sign in to comment.