mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-28 12:21:55 +00:00
Use a dedicated static variable for tracking window system initialization
This commit is contained in:
parent
3459c55ebf
commit
bc829a9712
1 changed files with 2 additions and 1 deletions
|
|
@ -296,6 +296,7 @@ set_dpi_from_os_window(OSWindow *w) {
|
|||
global_state.logical_dpi_y = yscale * factor;
|
||||
}
|
||||
|
||||
static bool is_first_window = true;
|
||||
|
||||
static PyObject*
|
||||
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;
|
||||
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;
|
||||
bool is_first_window = standard_cursor == NULL;
|
||||
|
||||
if (is_first_window) {
|
||||
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||
|
|
@ -357,6 +357,7 @@ create_os_window(PyObject UNUSED *self, PyObject *args) {
|
|||
#ifdef __APPLE__
|
||||
cocoa_create_global_menu();
|
||||
#endif
|
||||
is_first_window = false;
|
||||
}
|
||||
|
||||
OSWindow *w = add_os_window();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue