mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
macOS: Display the newly created OS window in specified state
Fix the maximized window can't occupy full screen space when window decoration or title bar is hidden. Fix resize_in_steps being applied even when window is maximized. Allows to specify `os_window_state` in startup session file.
This commit is contained in:
@@ -1868,8 +1868,9 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
|
||||
if (window->monitor)
|
||||
{
|
||||
_glfwPlatformShowWindow(window);
|
||||
_glfwPlatformFocusWindow(window);
|
||||
// Do not show the window here until after setting the window size, maximized state, and full screen
|
||||
// _glfwPlatformShowWindow(window);
|
||||
// _glfwPlatformFocusWindow(window);
|
||||
acquireMonitor(window);
|
||||
}
|
||||
|
||||
@@ -2061,8 +2062,12 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window)
|
||||
|
||||
void _glfwPlatformMaximizeWindow(_GLFWwindow* window)
|
||||
{
|
||||
if (![window->ns.object isZoomed])
|
||||
if (![window->ns.object isZoomed]) {
|
||||
const NSSize original = [window->ns.object resizeIncrements];
|
||||
[window->ns.object setResizeIncrements:NSMakeSize(1.0, 1.0)];
|
||||
[window->ns.object zoom:nil];
|
||||
[window->ns.object setResizeIncrements:original];
|
||||
}
|
||||
}
|
||||
|
||||
void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
|
||||
Reference in New Issue
Block a user