mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-09 23:54:20 +02:00
Use Apple private APIs to get workspace id
This commit is contained in:
@@ -21,6 +21,12 @@
|
||||
#define NSEventModifierFlagControl NSControlKeyMask
|
||||
#endif
|
||||
|
||||
typedef int CGSConnectionID;
|
||||
typedef int CGSWindowID;
|
||||
typedef int CGSWorkspaceID;
|
||||
extern CGSConnectionID _CGSDefaultConnection(void);
|
||||
extern void CGSGetWindowWorkspace(const CGSConnectionID cid, CGSWindowID wid, CGSWorkspaceID *workspace);
|
||||
|
||||
static NSMenuItem* title_menu = NULL;
|
||||
|
||||
|
||||
@@ -363,6 +369,14 @@ cocoa_focus_window(void *w) {
|
||||
[window makeKeyWindow];
|
||||
}
|
||||
|
||||
int
|
||||
cocoa_get_workspace_id(void *w) {
|
||||
NSWindow *window = (NSWindow*)w;
|
||||
int ans = 0;
|
||||
CGSGetWindowWorkspace(_CGSDefaultConnection(), [window windowNumber], &ans);
|
||||
return ans;
|
||||
}
|
||||
|
||||
bool
|
||||
cocoa_toggle_fullscreen(void *w, bool traditional) {
|
||||
NSWindow *window = (NSWindow*)w;
|
||||
|
||||
Reference in New Issue
Block a user