summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-09-02 23:27:42 +0200
committerBoris Faure <billiob@gmail.com>2019-09-02 23:27:42 +0200
commit98017f1647decbf39cc64e2c53eb0bc90ec7aa59 (patch)
treec14335943ae8fbb95571d5832e94e7347d7b9c98 /src
parent42e358d194ac3d7af02890668c69bae11c2186fa (diff)
hide cursor: fix unchecking "auto hide cursor". Closes T8148
Diffstat (limited to 'src')
-rw-r--r--src/bin/config.h2
-rw-r--r--src/bin/options_behavior.c6
-rw-r--r--src/bin/win.c4
3 files changed, 7 insertions, 5 deletions
diff --git a/src/bin/config.h b/src/bin/config.h
index d28c445..e9e65c7 100644
--- a/src/bin/config.h
+++ b/src/bin/config.h
@@ -116,4 +116,6 @@ void config_reset_keys(Config *config);
116const char *config_theme_path_get(const Config *config); 116const char *config_theme_path_get(const Config *config);
117const char *config_theme_path_default_get(const Config *config); 117const char *config_theme_path_default_get(const Config *config);
118 118
119#define CONFIG_CURSOR_IDLE_TIMEOUT_MAX 60.0
120
119#endif 121#endif
diff --git a/src/bin/options_behavior.c b/src/bin/options_behavior.c
index 9e92cc9..7216472 100644
--- a/src/bin/options_behavior.c
+++ b/src/bin/options_behavior.c
@@ -221,7 +221,7 @@ _cb_op_hide_cursor_changed(void *data,
221 } 221 }
222 else 222 else
223 { 223 {
224 config->hide_cursor = INFINITY; 224 config->hide_cursor = CONFIG_CURSOR_IDLE_TIMEOUT_MAX + 1.0;
225 elm_object_disabled_set(ctx->sld_hide_cursor, EINA_TRUE); 225 elm_object_disabled_set(ctx->sld_hide_cursor, EINA_TRUE);
226 } 226 }
227 config_save(config, NULL); 227 config_save(config, NULL);
@@ -629,7 +629,7 @@ options_behavior(Evas_Object *opbox, Evas_Object *term)
629 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5); 629 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
630 elm_object_text_set(o, _("Translucent")); 630 elm_object_text_set(o, _("Translucent"));
631 elm_object_text_set(o, _("Auto hide the mouse cursor when idle:")); 631 elm_object_text_set(o, _("Auto hide the mouse cursor when idle:"));
632 elm_check_state_set(o, !isnan(config->hide_cursor)); 632 elm_check_state_set(o, config->hide_cursor < CONFIG_CURSOR_IDLE_TIMEOUT_MAX);
633 elm_box_pack_end(bx, o); 633 elm_box_pack_end(bx, o);
634 evas_object_show(o); 634 evas_object_show(o);
635 evas_object_smart_callback_add(o, "changed", 635 evas_object_smart_callback_add(o, "changed",
@@ -643,7 +643,7 @@ options_behavior(Evas_Object *opbox, Evas_Object *term)
643 elm_slider_span_size_set(o, 40); 643 elm_slider_span_size_set(o, 40);
644 elm_slider_unit_format_set(o, _("%1.1f s")); 644 elm_slider_unit_format_set(o, _("%1.1f s"));
645 elm_slider_indicator_format_set(o, _("%1.1f s")); 645 elm_slider_indicator_format_set(o, _("%1.1f s"));
646 elm_slider_min_max_set(o, 0.0, 60.0); 646 elm_slider_min_max_set(o, 0.0, CONFIG_CURSOR_IDLE_TIMEOUT_MAX);
647 elm_slider_value_set(o, config->hide_cursor); 647 elm_slider_value_set(o, config->hide_cursor);
648 elm_box_pack_end(bx, o); 648 elm_box_pack_end(bx, o);
649 evas_object_show(o); 649 evas_object_show(o);
diff --git a/src/bin/win.c b/src/bin/win.c
index 6b1382f..c4c8be9 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -1609,7 +1609,7 @@ _cb_win_mouse_move(void *data,
1609 if (wn->on_popover) 1609 if (wn->on_popover)
1610 return; 1610 return;
1611 1611
1612 if (!isnan(wn->config->hide_cursor)) 1612 if (wn->config->hide_cursor < CONFIG_CURSOR_IDLE_TIMEOUT_MAX)
1613 { 1613 {
1614 if (wn->hide_cursor_timer) 1614 if (wn->hide_cursor_timer)
1615 { 1615 {
@@ -1819,7 +1819,7 @@ imf_done:
1819 1819
1820 } 1820 }
1821 1821
1822 if (!isnan(wn->config->hide_cursor)) 1822 if (wn->config->hide_cursor < CONFIG_CURSOR_IDLE_TIMEOUT_MAX)
1823 { 1823 {
1824 wn->hide_cursor_timer = ecore_timer_add( 1824 wn->hide_cursor_timer = ecore_timer_add(
1825 wn->config->hide_cursor, _hide_cursor, wn); 1825 wn->config->hide_cursor, _hide_cursor, wn);