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

[macOS] keep application running if all windows are closed #543

Closed
aequitas opened this issue May 16, 2018 · 4 comments
Closed

[macOS] keep application running if all windows are closed #543

aequitas opened this issue May 16, 2018 · 4 comments

Comments

@aequitas
Copy link

Currently if all windows are closed, kitty application will quit. Normal behaviour for macOS applications is to keep running until explicitly told to quit. This allows to have the application in the [cmd]-[tab] menu to switch to and create new windows. It would be nice for kitty to adopt this behaviour as well.

@kovidgoyal
Copy link
Owner

Not worth the effort for me, but patches are welcome. Why would you use cmd-tab to create a new window instead of spotlight or a global hotkey to create new windows?

@aequitas
Copy link
Author

Thanks for the quick response. I understand you don't deem this worth the effort on your part. I'd be glad to contribute the patch for this.

To recap: on macOS applications and apps are 2 separate entities, so to say. You run an application which in turn contains the apps. Compared to windows/linux where every window is its own application. So on macOS you switch to an application using cmd-tab, so you can act within that application context (interact with it, switch windows, create windows, etc).

I already use spotlight to initially start kitty, but I like it to behave like all other mac apps I use frequently in that I can access it from the tab menu regardless of the amount of windows it has. Creating a hotkey is a good suggestion but it's not a fit for me.

After some initial investigation yesterday I think the part where the change should be made is in this main_loop https://github.com/kovidgoyal/kitty/blob/master/kitty/child-monitor.c#L767 to keep it running after the last window has been closed. However I think the handling of input events requires an active window/child as I have not yet been able to make it work. Maybe you can shed a light on this?

@kovidgoyal
Copy link
Owner

You basically need to change main_loop() to not quit when no windows are present. And then you need to change GLFW, the toolkit kitty uses (see the glfw directory) to process key events with no active window. Then you need to change kitty, to make use of the changes in glfw to process key events with no active window. This is a fairly big job.

@kovidgoyal
Copy link
Owner

Thanks to the fix for #524 this became simple to implement.

@kovidgoyal kovidgoyal reopened this Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants