Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not always starting with maximized window Mac OS #6021

Closed
marcoSven opened this issue Feb 14, 2023 · 8 comments
Closed

Not always starting with maximized window Mac OS #6021

marcoSven opened this issue Feb 14, 2023 · 8 comments
Labels

Comments

@marcoSven
Copy link

Describe the bug
I am trying to always launch with a maximized window.

When launching Kitty from the Dock for the first time the window is maximized.

The problem is when I launch another window with keyboard shortcuts

map cmd+t new_os_window_with_cwd
map cmd+n new_os_window

or from the Dock with right click "new OS Window".

The issue is related to the hide_window_decorations set to titlebar-only when set to no the window is always fully maximized.

It appears that the removed titlebar is not considered when trying to fully maximize the window - see screen recording.

Running kitty --start-as maximized always opens the window fully maximized.

How can we open a new window via new_os_window and new_os_window_with_cwd fully maximized too?

Screenshots

Launching a second new window via map cmd+n new_os_window

Screen.Recording.2023-02-14.at.14.18.36.mov

Environment details

mac 13.1 (22C65)
kitty 0.27.1

Additional context

# kitty.config
hide_window_decorations titlebar-only
remember_window_size  yes

allow_remote_control yes

# macos-launch-services-cmdline
--start-as maximized

@marcoSven marcoSven added the bug label Feb 14, 2023
@marcoSven
Copy link
Author

The window is always fully max when I change this setting to no or yes

It appears that the removed titlebar is not considered when trying to fully maximize the window

hide_window_decorations no

Screenshot 2023-02-14 at 15 01 23

hide_window_decorations yes

Screenshot 2023-02-14 at 15 02 47

Ideally, I would like to keep the rounded window borders only to keep it consistent with other applications.

@page-down
Copy link
Contributor

The OS window needs to be resized again after hiding the title bar to try to reach the remembered window size.
This might also involve moving the window position.

Until launch adds more fine-grained controls, you can use combine, toggle_maximized to maximize the window.

kitty -o 'map f1 combine : launch --type os-window : toggle_maximized'

https://sw.kovidgoyal.net/kitty/actions/#action-toggle_maximized

@marcoSven
Copy link
Author

Yes thank you that is my current workaround

# map cmd+t new_os_window_with_cwd
map cmd+t combine : launch --type=os-window --cwd=current : toggle_maximized
# map cmd+n new_os_window
map cmd+n combine : launch --type=os-window : toggle_maximized

But this is not ideal because of the window "zoom" animation 😄

@page-down
Copy link
Contributor

But this is not ideal because of the window "zoom" animation

Reducing the time might make you feel better, though still not maximizing the window before it shows up.

defaults write net.kovidgoyal.kitty NSWindowResizeTime -float 0.001

@marcoSven
Copy link
Author

Thank you I appreciate it

@marcoSven
Copy link
Author

marcoSven commented Feb 15, 2023

The OS window needs to be resized again after hiding the title bar to try to reach the remembered window size.

What is interesting to me is the fact that when launching the first instance via the GUI the window is fully maximized even with this setting hide_window_decorations titlebar-only

try to reach the remembered window size

I was hoping that changing this setting remember_window_size to no would help but all subsequent windows are now sized based on the width height setting.

I also tried setting the window sizes ( with pixels or columns). Even when setting the height to a larger value than is available on my screen, the window height is always missing the title bar's height ( the same as you can see in my recordings above ).

Would be great if there could be a configuration in the config similar to this

# macos-launch-services-cmdline
--start-as maximized

and or

launch --type=os-window --start-as=maximized

@kovidgoyal
Copy link
Owner

This is a limitation of macOS' window manager. Nothing kitty can do to fix it, other than adding hacks to try to workaround the broken sizing from the window manager or actually adding controls for os window state to launch. I dont mind adding those controls but I am not particularly motivated to do so personally, patches are welcome.

@page-down
Copy link
Contributor

... the removed titlebar is not considered ...
... I would like to keep the rounded window borders ...

This issue has been fixed in master, and you can enjoy your rounded borders without --os-window-state maximized.

But this is not ideal because of the window "zoom" animation

This one has also been improved, no more "zoom" animations, only when using launch --os-window-state.
You can compile from source to try it out, or wait for an updated nightly release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants