Kitty: 2 small issues on macOS

Created on 7 May 2018  路  16Comments  路  Source: kovidgoyal/kitty

1) If I run kitty, make the window fullscreen, go back to the desktop, I cannot create another kitty window. It works only if I have the first kitty window visibile on the desktop

2) when I have an external monitor attached to my macbook (with the lid closed, i.e. I only have the external monitor in use) when I make the kitty window fullscreen there are some pixels on the left border of the screen which are not visibile, so the characters on the first column are not completely visible. it's like a little less than half column, so not a big deal, but slightly annoying nevertheless :)

thanks for your work!

macOS

Most helpful comment

Ah, I see. Well, that's a fundamental limitation of cocoa/gflw. In cocoa as far as I know (short of running as root) you can only get events such as keypress events on a focused window. If no window is focused you dont get key events. This is reflected in the design of glfw, where you only get key events with a window callback.

I assume other cocoa applications work around that by defining actions in the global menu, these are triggered by the OS even when no window is focused. kitty has no global shortcuts (apart from the basic ones all cocoa applications have.

So to fix this I assume kitty would need to create such a global shortcut. The annoying part would be mapping back from kitty's shortcut definition to cocoa key names/modifier masks, which would be a lot of code. I might get to it someday...

All 16 comments

  1. What does cannot create a new kitty window mean? A new window in the existing instance? A new kitty instance? How are you creating the new window when you are on the desktop?

  2. This is not something I have any way to test, so if you want to fix it you will have to figure it out yourself. Fullscreening is done by glfw (the windowing toolkit kitty uses) so look in glfw/cocoa_*.c
    The code is called from line 605 in kitty/glfw.c.
    And which fullscreen method are you using? The green button, the kitty fullscreen shortcut? Do they both show this problem? Probably easier to just add some padding in kitty.conf.

1) I'm using the command new_os_window (which I've mapped to super+n) and it's the only method I'm using to create a new window

2) I'm using the green button. I'll try both your suggestions, thanks

I'm not a mac user, but why would the sortcut work when you areont he desktop? Presumably the shortcut will go to whatever application has focus or the desktop itself.

when I try to create a new window, kitty is obviously the focused app. it creates a new window only when I'm on the screen with a kitty window already open. If I try to do the same with e.g. Terminal.app, I can create a new window the way I described.

OK I'll take a look at it the next time I have access to a mac.

thanks!

Maybe I can help. I can test it on my mac tomorrow.

I can confirm that kitty does not create a new window on macOS when it is not on the current desktop. This does not depend on kitty being fullscreen or not, kitty can also be a normal sized window on another desktop.

@cvlmtg

If I run kitty, make the window fullscreen, go back to the desktop, I cannot create another kitty window. It works only if I have the first kitty window visibile on the desktop

I can't reproduce this bug. I clicked the green button to make kitty fullscreen, pressed the shortcut(Ctrl+Shift+n) to create a new os window, a new window had spawned.

when I have an external monitor attached to my macbook (with the lid closed, i.e. I only have the external monitor in use) when I make the kitty window fullscreen there are some pixels on the left border of the screen which are not visibile, so the characters on the first column are not completely visible. it's like a little less than half column, so not a big deal, but slightly annoying nevertheless :)

In my case maximizing kitty is perfectly fit on the screen.

What's in your kitty.conf? Can you try this default one in the repo? https://github.com/kovidgoyal/kitty/blob/master/kitty/kitty.conf

@Luflosi

I can't reproduce it. I have multiple monitors connected to my mac, launched a kitty instance, and created a new os window, everything seems to work for me as long as a kitty window has focused on it.
Of course switch to another desktop doesn't work, kitty can lose focus if it is on another desktop in the background which is not the current one. It required a global shortcut support.

@theJian

I can't reproduce this bug. I clicked the green button to make kitty fullscreen, pressed the shortcut(Ctrl+Shift+n) to create a new os window, a new window had spawned.

you missed one step. after clicking the green button, you have to press ctrl-left to go back to the desktop, press cmd-tab to be sure kitty is the focused app, and then press ctrl-shift-n

In my case maximizing kitty is perfectly fit on the screen.

On the macbook native screen or on an external monitor? on my macbook screen kitty fits perfectly, but when the same fullscreen window is on an external monitor there's a small slice missing on the left border

@cvlmtg

you missed one step. after clicking the green button, you have to press ctrl-left to go back to the desktop, press cmd-tab to be sure kitty is the focused app, and then press ctrl-shift-n

I have tried again. When I pressed cmd-tab to focus on kitty, current desktop automatically switches to where the kitty on. And pressed ctrl-shift-n will create a tab, not a window.
image
Actually, it creates a new tab instead of a window when kitty is being fullscreen.

On the macbook native screen or on an external monitor? on my macbook screen kitty fits perfectly, but when the same fullscreen window is on an external monitor there's a small slice missing on the left border

Both. I tried on native retina screen and external LED screens.

I cannot reproduce this either, although I dont think I understand it. Steps It tried:

1) Launch kitty
2) Click green button
3) Press ctrl-left
4) At this point I am on the desktop and finder is the focused application

so what do I do now? How do I make kitty the focused application without bringing any of its windows into focus? If I press cmd+tab the kitty window comes into focus and all kitty shortcuts work.

Go to System Preferences > Mission Control and disable "When switching to an application, switch to a Space with open windows for the application", follow the four steps as you described them and then click the kitty icon in the dock or switch to kitty using cmd+tab. Kitty should now be the focused application without any open windows on that space.

Ah, I see. Well, that's a fundamental limitation of cocoa/gflw. In cocoa as far as I know (short of running as root) you can only get events such as keypress events on a focused window. If no window is focused you dont get key events. This is reflected in the design of glfw, where you only get key events with a window callback.

I assume other cocoa applications work around that by defining actions in the global menu, these are triggered by the OS even when no window is focused. kitty has no global shortcuts (apart from the basic ones all cocoa applications have.

So to fix this I assume kitty would need to create such a global shortcut. The annoying part would be mapping back from kitty's shortcut definition to cocoa key names/modifier masks, which would be a lot of code. I might get to it someday...

Note I have not actually tested the fix,beyond making sure that moving the new_os_window shortcut to the global menu does not break the shortcut.

This fix has been working well for me for the past couple days, thanks!

Was this page helpful?
0 / 5 - 0 ratings