From 170180709c10823a2259b0eb955fd043ff4da070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Bonithon?= Date: Sun, 2 Mar 2025 11:31:27 +0100 Subject: [PATCH] Completely hide pointer when fullscreen-timeout is set to 0 That's the intuitive meaning of 0 here, it seems to me. The wrap from 0 to 3600 makes it easier in practice to switch to the effect that 0 used to have: not hiding the pointer. Closes: #126 --- src/main_window.c | 10 +++++----- src/preferences_dialog.c | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main_window.c b/src/main_window.c index 32deff7f..6e4f10ba 100644 --- a/src/main_window.c +++ b/src/main_window.c @@ -2433,6 +2433,10 @@ cb_rstto_main_window_state_event (GtkWidget *widget, cb_rstto_main_window_hide_fs_mouse_cursor_timeout, window, cb_rstto_main_window_hide_fs_mouse_cursor_timeout_destroy); } + else + { + cb_rstto_main_window_hide_fs_mouse_cursor_timeout (window); + } if (rstto_settings_get_boolean_property (window->priv->settings_manager, "hide-thumbnails-fullscreen")) { @@ -2560,13 +2564,9 @@ cb_rstto_main_window_motion_notify_event (RsttoMainWindow *window, { REMOVE_SOURCE (window->priv->hide_fs_mouse_cursor_timeout_id); } - else - { - gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), NULL); - } - if (timeout > 0) { + gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), NULL); window->priv->hide_fs_mouse_cursor_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, 1000 * timeout, cb_rstto_main_window_hide_fs_mouse_cursor_timeout, window, diff --git a/src/preferences_dialog.c b/src/preferences_dialog.c index c1958948..3f6ee526 100644 --- a/src/preferences_dialog.c +++ b/src/preferences_dialog.c @@ -367,6 +367,7 @@ rstto_preferences_dialog_init (RsttoPreferencesDialog *dialog) dialog->priv->fullscreen_tab.cursor_timeout_label = gtk_label_new (_("Period of inactivity (seconds):")); dialog->priv->fullscreen_tab.cursor_timeout_button = gtk_spin_button_new_with_range (0, 3600, 1); gtk_spin_button_set_digits (GTK_SPIN_BUTTON (dialog->priv->fullscreen_tab.cursor_timeout_button), 0); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (dialog->priv->fullscreen_tab.cursor_timeout_button), TRUE); gtk_container_add (GTK_CONTAINER (dialog->priv->fullscreen_tab.cursor_hbox), dialog->priv->fullscreen_tab.cursor_timeout_label); gtk_container_add (GTK_CONTAINER (dialog->priv->fullscreen_tab.cursor_hbox), dialog->priv->fullscreen_tab.cursor_timeout_button); gtk_container_add (GTK_CONTAINER (dialog->priv->fullscreen_tab.cursor_vbox), dialog->priv->fullscreen_tab.cursor_hbox);