mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 16:58:09 +02:00
Add a function to hide the title bar on OS X
This commit is contained in:
19
kitty/cocoa_window.m
Normal file
19
kitty/cocoa_window.m
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* cocoa_window.m
|
||||
* Copyright (C) 2017 Kovid Goyal <kovid at kovidgoyal.net>
|
||||
*
|
||||
* Distributed under terms of the GPL3 license.
|
||||
*/
|
||||
|
||||
|
||||
#include "data-types.h"
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
PyObject*
|
||||
cocoa_hide_titlebar(PyObject UNUSED *self, PyObject *window_id) {
|
||||
NSView *native_view = (NSView*)PyLong_AsVoidPtr(window_id);
|
||||
NSWindow* window = [native_view window];
|
||||
[window setStyleMask:
|
||||
[window styleMask] & ~NSTitledWindowMask];
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
Reference in New Issue
Block a user