Use a dedicated static variable for tracking window system initialization
This commit is contained in:
parent
3459c55ebf
commit
bc829a9712
@ -296,6 +296,7 @@ set_dpi_from_os_window(OSWindow *w) {
|
|||||||
global_state.logical_dpi_y = yscale * factor;
|
global_state.logical_dpi_y = yscale * factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool is_first_window = true;
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
create_os_window(PyObject UNUSED *self, PyObject *args) {
|
create_os_window(PyObject UNUSED *self, PyObject *args) {
|
||||||
@ -303,7 +304,6 @@ create_os_window(PyObject UNUSED *self, PyObject *args) {
|
|||||||
char *title, *wm_class_class, *wm_class_name;
|
char *title, *wm_class_class, *wm_class_name;
|
||||||
PyObject *load_programs = NULL;
|
PyObject *load_programs = NULL;
|
||||||
if (!PyArg_ParseTuple(args, "iisss|Oiii", &width, &height, &title, &wm_class_name, &wm_class_class, &load_programs, &x, &y)) return NULL;
|
if (!PyArg_ParseTuple(args, "iisss|Oiii", &width, &height, &title, &wm_class_name, &wm_class_class, &load_programs, &x, &y)) return NULL;
|
||||||
bool is_first_window = standard_cursor == NULL;
|
|
||||||
|
|
||||||
if (is_first_window) {
|
if (is_first_window) {
|
||||||
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||||
@ -357,6 +357,7 @@ create_os_window(PyObject UNUSED *self, PyObject *args) {
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
cocoa_create_global_menu();
|
cocoa_create_global_menu();
|
||||||
#endif
|
#endif
|
||||||
|
is_first_window = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSWindow *w = add_os_window();
|
OSWindow *w = add_os_window();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user