mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-13 12:09:35 +03:00
Fix :opt:mouse_hide_wait
only taking effect after an event such as cursor blink or key press
Fixes #1073
This commit is contained in:
parent
27f2a2e3d5
commit
65f9ac32ef
@ -25,6 +25,9 @@ Changelog
|
||||
- Fix expansion of env vars not working in the :opt:`env` directive
|
||||
(:iss:`1075`)
|
||||
|
||||
- Fix :opt:`mouse_hide_wait` only taking effect after an event such as cursor
|
||||
blink or key press (:iss:`1073`)
|
||||
|
||||
|
||||
0.12.3 [2018-09-29]
|
||||
------------------------------
|
||||
|
@ -565,7 +565,10 @@ prepare_to_render_os_window(OSWindow *os_window, double now, unsigned int *activ
|
||||
}
|
||||
if (send_cell_data_to_gpu(TD.vao_idx, 0, TD.xstart, TD.ystart, TD.dx, TD.dy, TD.screen, os_window)) needs_render = true;
|
||||
}
|
||||
if (OPT(mouse_hide_wait) > 0 && now - os_window->last_mouse_activity_at > OPT(mouse_hide_wait)) hide_mouse(os_window);
|
||||
if (OPT(mouse_hide_wait) > 0 && !is_mouse_hidden(os_window)) {
|
||||
if (now - os_window->last_mouse_activity_at >= OPT(mouse_hide_wait)) hide_mouse(os_window);
|
||||
else set_maximum_wait(OPT(mouse_hide_wait) - now + os_window->last_mouse_activity_at);
|
||||
}
|
||||
Tab *tab = os_window->tabs + os_window->active_tab;
|
||||
*active_window_bg = OPT(background);
|
||||
for (unsigned int i = 0; i < tab->num_windows; i++) {
|
||||
|
@ -808,6 +808,12 @@ hide_mouse(OSWindow *w) {
|
||||
glfwSetInputMode(w->handle, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
||||
}
|
||||
|
||||
bool
|
||||
is_mouse_hidden(OSWindow *w) {
|
||||
return w->handle && glfwGetInputMode(w->handle, GLFW_CURSOR) == GLFW_CURSOR_HIDDEN;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
swap_window_buffers(OSWindow *w) {
|
||||
#ifdef __APPLE__
|
||||
|
@ -173,6 +173,7 @@ void event_loop_wait(double timeout);
|
||||
void swap_window_buffers(OSWindow *w);
|
||||
void make_window_context_current(OSWindow *w);
|
||||
void hide_mouse(OSWindow *w);
|
||||
bool is_mouse_hidden(OSWindow *w);
|
||||
void destroy_os_window(OSWindow *w);
|
||||
void focus_os_window(OSWindow *w, bool also_raise);
|
||||
void set_os_window_title(OSWindow *w, const char *title);
|
||||
|
Loading…
Reference in New Issue
Block a user