From 03ac6cab999eee5c9fa59cb7516ae9299cb6b170 Mon Sep 17 00:00:00 2001 From: Jay Han Date: Sat, 17 Oct 2020 09:28:04 -0700 Subject: [PATCH] default_pointer_shape option --- kitty/config_data.py | 5 +++++ kitty/mouse.c | 2 +- kitty/state.c | 1 + kitty/state.h | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kitty/config_data.py b/kitty/config_data.py index 32164a30b..b4ef05394 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -576,6 +576,11 @@ The shape of the mouse pointer when the program running in the terminal grabs th Valid values are: :code:`arrow`, :code:`beam` and :code:`hand` ''')) +o('default_pointer_shape', 'beam', option_type=choices('arrow', 'beam', 'hand'), long_text=(''' +The default shape of the mouse pointer. +Valid values are: :code:`arrow`, :code:`beam` and :code:`hand` +''')) + # }}} g('performance') # {{{ diff --git a/kitty/mouse.c b/kitty/mouse.c index 3f0d340ff..487b4096a 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -295,7 +295,7 @@ get_url_sentinel(Line *line, index_type url_start) { static inline void set_mouse_cursor_for_screen(Screen *screen) { - mouse_cursor_shape = screen->modes.mouse_tracking_mode == NO_TRACKING ? BEAM : OPT(pointer_shape_when_grabbed); + mouse_cursor_shape = screen->modes.mouse_tracking_mode == NO_TRACKING ? OPT(default_pointer_shape): OPT(pointer_shape_when_grabbed); } static inline void diff --git a/kitty/state.c b/kitty/state.c index 91a1d805f..8830be57b 100644 --- a/kitty/state.c +++ b/kitty/state.c @@ -703,6 +703,7 @@ PYWRAP1(set_options) { S(resize_in_steps, PyObject_IsTrue); S(allow_hyperlinks, PyObject_IsTrue); S(pointer_shape_when_grabbed, pointer_shape); + S(default_pointer_shape, pointer_shape); GA(tab_bar_style); global_state.tab_bar_hidden = PyUnicode_CompareWithASCIIString(ret, "hidden") == 0 ? true: false; diff --git a/kitty/state.h b/kitty/state.h index 5d4c5ca04..3d4949249 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -66,6 +66,7 @@ typedef struct { bool allow_hyperlinks; monotonic_t resize_debounce_time; MouseShape pointer_shape_when_grabbed; + MouseShape default_pointer_shape; struct { UrlPrefix *values; size_t num, max_prefix_len;