diff options
author | Boris Faure <billiob@gmail.com> | 2020-07-29 22:43:25 +0200 |
---|---|---|
committer | Boris Faure <billiob@gmail.com> | 2020-08-10 22:43:34 +0200 |
commit | df6b0138956fbe923f68d63567747ea88562718c (patch) | |
tree | 03cecba356008c58e08a4ca7f65b4863130e3bf2 | |
parent | 44364fcfab0796f4249bc53af385f43008ad80a0 (diff) |
win/options_mouse: apply mouse timer change to current terms
(cherry picked from commit d082b0d6d78033d144734e44c0aa7c81b9bc41ec)
-rw-r--r-- | src/bin/options_mouse.c | 2 | ||||
-rw-r--r-- | src/bin/win.c | 49 |
2 files changed, 32 insertions, 19 deletions
diff --git a/src/bin/options_mouse.c b/src/bin/options_mouse.c index 1e41072..c858ebe 100644 --- a/src/bin/options_mouse.c +++ b/src/bin/options_mouse.c | |||
@@ -93,6 +93,7 @@ _cb_op_hide_cursor_changed(void *data, | |||
93 | config->hide_cursor = CONFIG_CURSOR_IDLE_TIMEOUT_MAX + 1.0; | 93 | config->hide_cursor = CONFIG_CURSOR_IDLE_TIMEOUT_MAX + 1.0; |
94 | elm_object_disabled_set(ctx->sld_hide_cursor, EINA_TRUE); | 94 | elm_object_disabled_set(ctx->sld_hide_cursor, EINA_TRUE); |
95 | } | 95 | } |
96 | windows_update(); | ||
96 | config_save(config); | 97 | config_save(config); |
97 | } | 98 | } |
98 | 99 | ||
@@ -109,6 +110,7 @@ _cb_hide_cursor_slider_chg(void *data, | |||
109 | return; | 110 | return; |
110 | 111 | ||
111 | config->hide_cursor = value; | 112 | config->hide_cursor = value; |
113 | windows_update(); | ||
112 | config_save(config); | 114 | config_save(config); |
113 | } | 115 | } |
114 | 116 | ||
diff --git a/src/bin/win.c b/src/bin/win.c index 42c60d2..594cfc5 100644 --- a/src/bin/win.c +++ b/src/bin/win.c | |||
@@ -146,6 +146,7 @@ struct _Term | |||
146 | unsigned char miniview_shown : 1; | 146 | unsigned char miniview_shown : 1; |
147 | unsigned char popmedia_deleted : 1; | 147 | unsigned char popmedia_deleted : 1; |
148 | unsigned char has_bg_cursor : 1; | 148 | unsigned char has_bg_cursor : 1; |
149 | unsigned char core_cursor_set: 1; | ||
149 | 150 | ||
150 | Eina_Bool sendfile_request_enabled : 1; | 151 | Eina_Bool sendfile_request_enabled : 1; |
151 | Eina_Bool sendfile_progress_enabled : 1; | 152 | Eina_Bool sendfile_progress_enabled : 1; |
@@ -1605,6 +1606,27 @@ _win_split_direction(Term_Container *tc, | |||
1605 | return 0; | 1606 | return 0; |
1606 | } | 1607 | } |
1607 | 1608 | ||
1609 | static Eina_Bool | ||
1610 | _set_cursor(Term *term, void *data) | ||
1611 | { | ||
1612 | const char *cursor = data; | ||
1613 | |||
1614 | assert(term->core); | ||
1615 | if (cursor) | ||
1616 | { | ||
1617 | elm_object_cursor_set(term->core, cursor); | ||
1618 | term->core_cursor_set = 1; | ||
1619 | } | ||
1620 | else | ||
1621 | { | ||
1622 | if (term->core_cursor_set) | ||
1623 | elm_object_cursor_unset(term->core); | ||
1624 | term->core_cursor_set = 0; | ||
1625 | } | ||
1626 | |||
1627 | return ECORE_CALLBACK_PASS_ON; | ||
1628 | } | ||
1629 | |||
1608 | static void | 1630 | static void |
1609 | _win_update(Term_Container *tc) | 1631 | _win_update(Term_Container *tc) |
1610 | { | 1632 | { |
@@ -1613,6 +1635,14 @@ _win_update(Term_Container *tc) | |||
1613 | assert (tc->type == TERM_CONTAINER_TYPE_WIN); | 1635 | assert (tc->type == TERM_CONTAINER_TYPE_WIN); |
1614 | wn = (Win*) tc; | 1636 | wn = (Win*) tc; |
1615 | 1637 | ||
1638 | if (wn->config->hide_cursor >= CONFIG_CURSOR_IDLE_TIMEOUT_MAX) | ||
1639 | { | ||
1640 | ecore_timer_del(wn->hide_cursor_timer); | ||
1641 | wn->hide_cursor_timer = NULL; | ||
1642 | |||
1643 | for_each_term_do(wn, &_set_cursor, NULL); | ||
1644 | } | ||
1645 | |||
1616 | wn->child->update(wn->child); | 1646 | wn->child->update(wn->child); |
1617 | } | 1647 | } |
1618 | 1648 | ||
@@ -2038,25 +2068,6 @@ _cb_win_mouse_down(void *data, | |||
2038 | } | 2068 | } |
2039 | 2069 | ||
2040 | static Eina_Bool | 2070 | static Eina_Bool |
2041 | _set_cursor(Term *term, void *data) | ||
2042 | { | ||
2043 | const char *cursor = data; | ||
2044 | |||
2045 | assert(term->core); | ||
2046 | if (cursor) | ||
2047 | { | ||
2048 | elm_object_cursor_set(term->core, cursor); | ||
2049 | } | ||
2050 | else | ||
2051 | { | ||
2052 | elm_object_cursor_unset(term->core); | ||
2053 | } | ||
2054 | |||
2055 | return ECORE_CALLBACK_PASS_ON; | ||
2056 | } | ||
2057 | |||
2058 | |||
2059 | static Eina_Bool | ||
2060 | _hide_cursor(void *data) | 2071 | _hide_cursor(void *data) |
2061 | { | 2072 | { |
2062 | Win *wn = data; | 2073 | Win *wn = data; |