Fix hiding the window title in macOS

In b5c2163238 I introduced a bug where only the window title of the first OS window would be hidden. This commit fixes that bug.
The bug was caused by the code hiding the window title being in an `if` statement that only executes once.
This commit is contained in:
Luflosi 2019-08-13 20:56:17 +02:00
parent 4ef8f11f9e
commit d66123dd14
No known key found for this signature in database
GPG Key ID: 14140F703B7D8362

View File

@ -581,10 +581,6 @@ create_os_window(PyObject UNUSED *self, PyObject *args) {
Py_DECREF(ret);
#ifdef __APPLE__
cocoa_create_global_menu();
if (!(OPT(macos_show_window_title_in) & WINDOW)) {
if (glfwGetCocoaWindow) cocoa_hide_window_title(glfwGetCocoaWindow(glfw_window));
else log_error("Failed to load glfwGetCocoaWindow");
}
#endif
#define CC(dest, shape) {\
if (!dest##_cursor) { \
@ -641,8 +637,12 @@ create_os_window(PyObject UNUSED *self, PyObject *args) {
glfwSetKeyboardCallback(glfw_window, key_callback);
glfwSetDropCallback(glfw_window, drop_callback);
#ifdef __APPLE__
if (glfwGetCocoaWindow) cocoa_make_window_resizable(glfwGetCocoaWindow(glfw_window), OPT(macos_window_resizable));
else log_error("Failed to load glfwGetCocoaWindow");
if (glfwGetCocoaWindow) {
if (!(OPT(macos_show_window_title_in) & WINDOW)) {
cocoa_hide_window_title(glfwGetCocoaWindow(glfw_window));
}
cocoa_make_window_resizable(glfwGetCocoaWindow(glfw_window), OPT(macos_window_resizable));
} else log_error("Failed to load glfwGetCocoaWindow");
#endif
double now = monotonic();
w->is_focused = true;