diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index 124f883d4..aafc76277 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -601,7 +601,7 @@ render_os_window(OSWindow *os_window, double now, unsigned int active_window_id, bool is_active_window = i == tab->active_window; draw_cells(WD.vao_idx, WD.gvao_idx, WD.xstart, WD.ystart, WD.dx * x_ratio, WD.dy * y_ratio, WD.screen, os_window, is_active_window, true); if (WD.screen->start_visual_bell_at != 0) { - double bell_left = global_state.opts.visual_bell_duration - (now - WD.screen->start_visual_bell_at); + double bell_left = OPT(visual_bell_duration) - (now - WD.screen->start_visual_bell_at); set_maximum_wait(bell_left); } w->cursor_visible_at_last_render = WD.screen->cursor_render_info.is_visible; w->last_cursor_x = WD.screen->cursor_render_info.x; w->last_cursor_y = WD.screen->cursor_render_info.y; w->last_cursor_shape = WD.screen->cursor_render_info.shape; diff --git a/kitty/core_text.m b/kitty/core_text.m index 872903a93..d41cf8e5e 100644 --- a/kitty/core_text.m +++ b/kitty/core_text.m @@ -437,7 +437,7 @@ render_glyphs(CTFontRef font, unsigned int width, unsigned int height, unsigned CGContextSetShouldSmoothFonts(render_ctx, true); CGContextSetGrayFillColor(render_ctx, 1, 1); // white glyphs CGContextSetGrayStrokeColor(render_ctx, 1, 1); - CGContextSetLineWidth(render_ctx, global_state.opts.macos_thicken_font); + CGContextSetLineWidth(render_ctx, OPT(macos_thicken_font)); CGContextSetTextDrawingMode(render_ctx, kCGTextFillStroke); CGContextSetTextMatrix(render_ctx, CGAffineTransformIdentity); CGContextSetTextPosition(render_ctx, 0, height - baseline); diff --git a/kitty/glfw.c b/kitty/glfw.c index 8a9da6774..e4aa8eabb 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -781,7 +781,7 @@ glfw_init(PyObject UNUSED *self, PyObject *args) { // Joysticks cause slow startup on some linux systems, see // https://github.com/kovidgoyal/kitty/issues/830 glfwInitHint(GLFW_ENABLE_JOYSTICKS, 0); - global_state.opts.debug_keyboard = debug_keyboard != 0; + OPT(debug_keyboard) = debug_keyboard != 0; #ifdef __APPLE__ glfwInitHint(GLFW_COCOA_CHDIR_RESOURCES, 0); glfwInitHint(GLFW_COCOA_MENUBAR, 0); diff --git a/kitty/state.c b/kitty/state.c index c3854c1e6..f4920e85e 100644 --- a/kitty/state.c +++ b/kitty/state.c @@ -387,7 +387,7 @@ PYWRAP1(set_options) { global_state.debug_font_fallback = debug_font_fallback ? true : false; #define GA(name) ret = PyObject_GetAttrString(opts, #name); if (ret == NULL) return NULL; #define SS(name, dest, convert) { GA(name); dest = convert(ret); Py_DECREF(ret); if (PyErr_Occurred()) return NULL; } -#define S(name, convert) SS(name, global_state.opts.name, convert) +#define S(name, convert) SS(name, OPT(name), convert) SS(kitty_mod, kitty_mod, PyLong_AsLong); S(hide_window_decorations, PyObject_IsTrue); S(visual_bell_duration, PyFloat_AsDouble); @@ -724,7 +724,7 @@ PYWRAP1(patch_global_colors) { #define P(name) { \ PyObject *val = PyDict_GetItemString(spec, #name); \ if (val) { \ - global_state.opts.name = PyLong_AsLong(val); \ + OPT(name) = PyLong_AsLong(val); \ } \ } P(active_border_color); P(inactive_border_color); P(bell_border_color);