13 Commits

Author SHA1 Message Date
Mitchell Hashimoto
63f77f0c9f macos: fix unwanted resize in non native fullscreen (#2901)
Fixes #2516 

Those changes mean that when we have one ghostty window in non-native
fullscreen and another ghostty window not in fullscreen switching to not
fullscreen window won't cause appearing menu bar and dock. I think it
looks good:
![Screenshot 2024-12-07 at 19 18
33](https://github.com/user-attachments/assets/125eb18f-3b2f-469a-a5ba-0469dd12462a)

If we implement detection and make menu bar and dock appear for not
fullscreen window in this case it will cause the fullscreen window to
change its size and will look bad.

Non-native fullscreen works bad with multiple screens in either way.
E.g. switching to a non-native fullscreen window would cause menubar
disappering on another screen or switching to not fullscreen window
would show menu bar over fullscreen window on another screen. I think
nobody would want non-native fullscreen with multiple screens.
2024-12-11 08:52:25 -08:00
Dmitry Zhlobo
49f105cd27 macos: make non-native fullscreen windows not resizeable 2024-12-08 16:34:44 -08:00
Dmitry Zhlobo
080afce649 found a better explanation for the reason to hide dock before menu 2024-12-08 13:09:37 +01:00
Dmitry Zhlobo
0d0aeccf0f fix unwanted resize of non-native fullscreen window
Removing autoHideDock and autoHideMenuBar options cause window to
resize.

Fix #2516
2024-12-08 13:09:37 +01:00
Mitchell Hashimoto
f384fd038b macos: trigger fullscreenDidChange on any fullscreen event
Fixes #2840
Related to #2842

This builds on #2842 by missing a key situation: when native fullscreen
is toggled using the menu bar items it doesn't go through our
`FullscreenStyle` machinery so we don't trigger fullscreen change
events.

This commit makes it so that our FullscreenStyle always listens for
native fullscreen change (even in non-native modes) to fire a fullscreen
did change event. This way we can always rely on the event to be fired
when fullscreen changes no matter what.
2024-12-01 11:37:04 -08:00
Mitchell Hashimoto
1ae9322959 macos: non-native fs keeps track of screen number for change screen comp
Fixes #2370

Comparing NSScreens directly was fragile. It appears that AppKit/Cocoa
can return different instances of NSScreen for the same screen for
unknown reasons between calls to windowDidChangeScreen. I don't fully
understand why this happens.

In any case, our comparison was not safe. Instad, we now keep track of
of the CGDirectDisplayID for each screen and compare those instead.
2024-10-05 06:21:30 -10:00
Mitchell Hashimoto
22b9f24978 macos: clarify comments, clean up notifications for fullscreen 2024-09-30 20:10:23 -07:00
Mitchell Hashimoto
639434df33 macos: exit native fullscreen if we try to enter non-native 2024-09-30 15:01:44 -07:00
Mitchell Hashimoto
93f0b9dce9 macos: only exit on screen change if the screen really changed 2024-09-30 14:48:05 -07:00
Mitchell Hashimoto
ef5b835dc4 macos: only hide dock on the screen with the dock 2024-09-30 14:25:33 -07:00
Mitchell Hashimoto
408c33e174 macos: handle non-native fullscreen changing screens 2024-09-30 14:14:01 -07:00
Mitchell Hashimoto
35462331ae macos: non-native fs sets frame async to account for style changes
Fixes #1996
2024-09-30 10:44:26 -07:00
Mitchell Hashimoto
718fa6042c macos: new fullscreen implementation 2024-09-30 09:42:46 -07:00