Comments (9)
There's no code in kitty to select monitors on which windows are opened.
Indeed neither monitors nor window positions are set by kitty, only
window sizes. That's up to the window manager/OS.
from kitty.
Interesting, it seems other applications with single instances are able to achieve the expected behavior (e.g. Finder). I am wondering if this may be related to something kitty is not doing, which it is expected by macOS and the WindowServer.
from kitty.
No idea, but patches welcome.
from kitty.
Will have a look, thanks for the input.
from kitty.
You will probably need to change initWithGlfwWindow method to pass [[NSApp keyWindow] screen] as the screen parameter to the call to initWithContentRect. The wrinkle is figuring out what contentRect should be, I dont recall if cocoa uses monitor local co-ords or a virtual space for these.
from kitty.
I am not sure detecting the screen of the key window is actually enough, since the command can be executed on a display where kitty is not the key window (e.g. by a shortcut manager), so the display ID of the currently active display would likely need to be determined by a more general function:
static CFStringRef display_active_display_uuid(void) {
CFStringRef menubar = CGSCopyActiveMenuBarDisplayIdentifier(CGSMainConnectionID());
return menubar;
}
uint32_t display_active_display_count(void) {
uint32_t count;
CGGetActiveDisplayList(0, NULL, &count);
return count;
}
uint32_t display_active_display_id(void) {
if (display_active_display_count() == 1) {
uint32_t did = 0;
uint32_t count = 0;
CGGetActiveDisplayList(1, &did, &count);
if (count == 1) return did;
else {
printf("ERROR (id): No active display detected!\n");
return 0;
}
}
CFStringRef uuid = display_active_display_uuid();
CFUUIDRef uuid_ref = CFUUIDCreateFromString(NULL, uuid);
uint32_t result = CGDisplayGetDisplayIDFromUUID(uuid_ref);
CFRelease(uuid_ref);
CFRelease(uuid);
return result;
}
from kitty.
For reference: glfw/glfw#1699
from kitty.
Isn't the expected behavior on macOS that the active display is the one
which has focus? Is there some reference/documentation saying that picking the display
with the menubar on it is correct?
from kitty.
Actually, there seems to be some code in kitty that controls the position of the window, which needs to be disabled such that the window is automatically spawned on the correct display (see #6932)
from kitty.
Related Issues (20)
- [startup_session] kitty crashes after opening HOT 3
- panel kitten crashes trying to draw a dock panel, throwing an out of memory error HOT 2
- Homebrew Bash completions do not work in POSIX mode HOT 13
- kitty hints highlight the wrong character in RTL text HOT 6
- Kitty is crashing when exit like as Tile Window HOT 2
- Some CJK fonts display weird HOT 1
- Broken brpaste when using kitty+tmux+joe editor HOT 3
- Open a new window in the current working directory while a script is running in other directory opens the windows in the wrong directory HOT 2
- U+2518 is missing its corner pixel when rendered on a non-HiDPI display on macOS HOT 1
- Regression: rendering of bold CJK characters broken
- Mouse pointer is not aligned to cell below it when using wayland. HOT 2
- Window title font inconsistently resized when using zoom controls
- Window size decreased each time Kitty is open HOT 2
- Fallback font ignores font weight HOT 4
- Crash with single-instance mode on displays with different scale factors HOT 5
- kitty cannot capture focus when switching programs via keyboard on WSLg HOT 2
- window_padding_width is not accounted for in mouse coordinate reports
- When splitting to create a new panel, the previous panel will flash. HOT 8
- I can't put transparency in kitty with i3wm HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kitty.