Fix deprecation warning on macOS 10.12
This commit is contained in:
parent
47851ebb1b
commit
419f43ceed
@ -9,11 +9,15 @@
|
|||||||
#include "data-types.h"
|
#include "data-types.h"
|
||||||
#include <Cocoa/Cocoa.h>
|
#include <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
#ifndef NSWindowStyleMaskTitled
|
||||||
|
#define NSWindowStyleMaskTitled NSTitledWindowMask
|
||||||
|
#endif
|
||||||
|
|
||||||
PyObject*
|
PyObject*
|
||||||
cocoa_hide_titlebar(PyObject UNUSED *self, PyObject *window_id) {
|
cocoa_hide_titlebar(PyObject UNUSED *self, PyObject *window_id) {
|
||||||
NSView *native_view = (NSView*)PyLong_AsVoidPtr(window_id);
|
NSView *native_view = (NSView*)PyLong_AsVoidPtr(window_id);
|
||||||
NSWindow* window = [native_view window];
|
NSWindow* window = [native_view window];
|
||||||
[window setStyleMask:
|
[window setStyleMask:
|
||||||
[window styleMask] & ~NSTitledWindowMask];
|
[window styleMask] & ~NSWindowStyleMaskTitled];
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user