parent
2443d76ac3
commit
2f5b110c41
@ -240,6 +240,7 @@ type_map = {
|
||||
'scrollback_in_new_tab': to_bool,
|
||||
'font_size': to_font_size,
|
||||
'font_size_delta': positive_float,
|
||||
'focus_follows_mouse': to_bool,
|
||||
'cursor_shape': to_cursor_shape,
|
||||
'open_url_modifiers': to_open_url_modifiers,
|
||||
'repaint_delay': positive_int,
|
||||
|
||||
@ -90,6 +90,9 @@ select_by_word_characters :@-./_~?&=%+#
|
||||
# zero to disable mouse cursor hiding.
|
||||
mouse_hide_wait 3.0
|
||||
|
||||
# Set the active window to the window under the mouse when moving the mouse around
|
||||
focus_follows_mouse no
|
||||
|
||||
# The enabled window layouts. A comma separated list of layout names. The special value * means
|
||||
# all layouts. The first listed layout will be used as the startup layout.
|
||||
# For a list of available layouts, see the file layouts.py
|
||||
|
||||
@ -164,6 +164,12 @@ detect_url(Window *w, Screen *screen, unsigned int x, unsigned int y) {
|
||||
|
||||
HANDLER(handle_move_event) {
|
||||
unsigned int x, y;
|
||||
if (OPT(focus_follows_mouse)) {
|
||||
Tab *t = global_state.tabs + global_state.active_tab;
|
||||
if (window_idx != t->active_window) {
|
||||
call_boss(switch_focus_to, "I", window_idx);
|
||||
}
|
||||
}
|
||||
if (!cell_for_pos(w, &x, &y)) return;
|
||||
Screen *screen = w->render_data.screen;
|
||||
detect_url(w, screen, x, y);
|
||||
|
||||
@ -151,6 +151,7 @@ PYWRAP1(set_options) {
|
||||
#define S(name, convert) { GA(name); global_state.opts.name = convert(ret); Py_DECREF(ret); if (PyErr_Occurred()) return NULL; }
|
||||
S(visual_bell_duration, PyFloat_AsDouble);
|
||||
S(enable_audio_bell, PyObject_IsTrue);
|
||||
S(focus_follows_mouse, PyObject_IsTrue);
|
||||
S(cursor_blink_interval, PyFloat_AsDouble);
|
||||
S(cursor_stop_blinking_after, PyFloat_AsDouble);
|
||||
S(cursor_shape, PyLong_AsLong);
|
||||
|
||||
@ -18,6 +18,7 @@ typedef struct {
|
||||
char_type select_by_word_characters[256]; size_t select_by_word_characters_count;
|
||||
color_type url_color;
|
||||
double repaint_delay, input_delay;
|
||||
bool focus_follows_mouse;
|
||||
} Options;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@ -80,7 +80,6 @@ class Window:
|
||||
self.tab_id = tab.id
|
||||
self.tabref = weakref.ref(tab)
|
||||
self.override_title = None
|
||||
self.last_mouse_cursor_pos = 0, 0
|
||||
self.destroyed = False
|
||||
self.click_queue = deque(maxlen=3)
|
||||
self.geometry = WindowGeometry(0, 0, 0, 0, 0, 0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user