parent
bdcac9aed3
commit
9193a20b44
@ -12,6 +12,8 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
|
||||
- Fix drawing of a few sextant characters incorrect (:pull:`3105`)
|
||||
|
||||
- macOS: Fix minimize not working for chromeless windows (:iss:`3112`)
|
||||
|
||||
|
||||
0.19.2 [2020-11-13]
|
||||
-------------------
|
||||
|
||||
1
glfw/cocoa_platform.h
vendored
1
glfw/cocoa_platform.h
vendored
@ -129,6 +129,7 @@ typedef struct _GLFWwindowNS
|
||||
bool maximized;
|
||||
bool retina;
|
||||
bool in_traditional_fullscreen;
|
||||
bool titlebar_hidden;
|
||||
unsigned long pre_full_screen_style_mask;
|
||||
|
||||
// Cached window properties to filter out duplicate events
|
||||
|
||||
@ -1314,6 +1314,16 @@ void _glfwPlatformUpdateIMEState(_GLFWwindow *w, int which, int a, int b, int c,
|
||||
glfw_window = NULL;
|
||||
}
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)item {
|
||||
if (item.action == @selector(performMiniaturize:)) return YES;
|
||||
return [super validateMenuItem:item];
|
||||
}
|
||||
|
||||
- (void)performMiniaturize:(id)sender
|
||||
{
|
||||
if (glfw_window && (!glfw_window->decorated || glfw_window->ns.titlebar_hidden)) [self miniaturize:self];
|
||||
else [super performMiniaturize:sender];
|
||||
}
|
||||
|
||||
- (BOOL)canBecomeKeyWindow
|
||||
{
|
||||
@ -2293,6 +2303,29 @@ GLFWAPI id glfwGetCocoaWindow(GLFWwindow* handle)
|
||||
return window->ns.object;
|
||||
}
|
||||
|
||||
GLFWAPI void glfwHideCocoaTitlebar(GLFWwindow* handle, bool yes) {
|
||||
@autoreleasepool {
|
||||
_GLFWwindow* w = (_GLFWwindow*) handle;
|
||||
NSWindow *window = w->ns.object;
|
||||
w->ns.titlebar_hidden = yes;
|
||||
NSButton *button;
|
||||
button = [window standardWindowButton: NSWindowCloseButton];
|
||||
if (button) button.hidden = yes;
|
||||
button = [window standardWindowButton: NSWindowMiniaturizeButton];
|
||||
if (button) button.hidden = yes;
|
||||
button = [window standardWindowButton: NSWindowZoomButton];
|
||||
[window setTitlebarAppearsTransparent:yes];
|
||||
if (button) button.hidden = yes;
|
||||
if (yes) {
|
||||
[window setTitleVisibility:NSWindowTitleHidden];
|
||||
[window setStyleMask: [window styleMask] | NSWindowStyleMaskFullSizeContentView];
|
||||
} else {
|
||||
[window setTitleVisibility:NSWindowTitleVisible];
|
||||
[window setStyleMask: [window styleMask] & ~NSWindowStyleMaskFullSizeContentView];
|
||||
}
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
GLFWAPI GLFWcocoatextinputfilterfun glfwSetCocoaTextInputFilter(GLFWwindow *handle, GLFWcocoatextinputfilterfun callback) {
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(nil);
|
||||
|
||||
@ -199,6 +199,7 @@ def generate_wrappers(glfw_header: str) -> None:
|
||||
functions.append(Function(decl))
|
||||
for line in '''\
|
||||
void* glfwGetCocoaWindow(GLFWwindow* window)
|
||||
void glfwHideCocoaTitlebar(GLFWwindow* window, bool yes)
|
||||
void* glfwGetNSGLContext(GLFWwindow *window)
|
||||
uint32_t glfwGetCocoaMonitor(GLFWmonitor* monitor)
|
||||
GLFWcocoatextinputfilterfun glfwSetCocoaTextInputFilter(GLFWwindow* window, GLFWcocoatextinputfilterfun callback)
|
||||
|
||||
@ -615,30 +615,6 @@ cocoa_hide_window_title(void *w)
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
void
|
||||
cocoa_hide_titlebar(void *w)
|
||||
{
|
||||
@autoreleasepool {
|
||||
|
||||
cocoa_hide_window_title(w);
|
||||
|
||||
NSWindow *window = (NSWindow*)w;
|
||||
NSButton *button;
|
||||
|
||||
button = [window standardWindowButton: NSWindowCloseButton];
|
||||
if (button) button.hidden = true;
|
||||
button = [window standardWindowButton: NSWindowMiniaturizeButton];
|
||||
if (button) button.hidden = true;
|
||||
button = [window standardWindowButton: NSWindowZoomButton];
|
||||
if (button) button.hidden = true;
|
||||
|
||||
[window setTitlebarAppearsTransparent:YES];
|
||||
[window setStyleMask:
|
||||
[window styleMask] | NSWindowStyleMaskFullSizeContentView];
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
void
|
||||
cocoa_system_beep(void) {
|
||||
NSBeep();
|
||||
|
||||
2
kitty/glfw-wrapper.c
generated
2
kitty/glfw-wrapper.c
generated
@ -380,6 +380,8 @@ load_glfw(const char* path) {
|
||||
|
||||
*(void **) (&glfwGetCocoaWindow_impl) = dlsym(handle, "glfwGetCocoaWindow");
|
||||
|
||||
*(void **) (&glfwHideCocoaTitlebar_impl) = dlsym(handle, "glfwHideCocoaTitlebar");
|
||||
|
||||
*(void **) (&glfwGetNSGLContext_impl) = dlsym(handle, "glfwGetNSGLContext");
|
||||
|
||||
*(void **) (&glfwGetCocoaMonitor_impl) = dlsym(handle, "glfwGetCocoaMonitor");
|
||||
|
||||
4
kitty/glfw-wrapper.h
generated
4
kitty/glfw-wrapper.h
generated
@ -2147,6 +2147,10 @@ typedef void* (*glfwGetCocoaWindow_func)(GLFWwindow*);
|
||||
GFW_EXTERN glfwGetCocoaWindow_func glfwGetCocoaWindow_impl;
|
||||
#define glfwGetCocoaWindow glfwGetCocoaWindow_impl
|
||||
|
||||
typedef void (*glfwHideCocoaTitlebar_func)(GLFWwindow*, bool);
|
||||
GFW_EXTERN glfwHideCocoaTitlebar_func glfwHideCocoaTitlebar_impl;
|
||||
#define glfwHideCocoaTitlebar glfwHideCocoaTitlebar_impl
|
||||
|
||||
typedef void* (*glfwGetNSGLContext_func)(GLFWwindow*);
|
||||
GFW_EXTERN glfwGetNSGLContext_func glfwGetNSGLContext_impl;
|
||||
#define glfwGetNSGLContext glfwGetNSGLContext_impl
|
||||
|
||||
@ -14,7 +14,6 @@ extern void cocoa_focus_window(void *w);
|
||||
extern long cocoa_window_number(void *w);
|
||||
extern void cocoa_create_global_menu(void);
|
||||
extern void cocoa_hide_window_title(void *w);
|
||||
extern void cocoa_hide_titlebar(void *w);
|
||||
extern void cocoa_system_beep(void);
|
||||
extern void cocoa_set_activation_policy(bool);
|
||||
extern void cocoa_set_titlebar_color(void *w, color_type color);
|
||||
@ -695,7 +694,7 @@ create_os_window(PyObject UNUSED *self, PyObject *args) {
|
||||
#ifdef __APPLE__
|
||||
if (glfwGetCocoaWindow) {
|
||||
if (OPT(hide_window_decorations) & 2) {
|
||||
cocoa_hide_titlebar(glfwGetCocoaWindow(glfw_window));
|
||||
glfwHideCocoaTitlebar(glfw_window, true);
|
||||
} else if (!(OPT(macos_show_window_title_in) & WINDOW)) {
|
||||
cocoa_hide_window_title(glfwGetCocoaWindow(glfw_window));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user