mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-27 03:11:46 +00:00
Use Apple private APIs to get workspace id
This commit is contained in:
parent
c5cc208397
commit
8de4dd334b
1 changed files with 14 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue