Add a function to hide the title bar on OS X

This commit is contained in:
Kovid Goyal
2017-06-03 08:45:27 +05:30
parent 8047743882
commit 24a4fbd987
4 changed files with 43 additions and 1 deletions

19
kitty/cocoa_window.m Normal file
View 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;
}