From 2ffe031a7c60ccb6735cdef7858b90875be6d4b6 Mon Sep 17 00:00:00 2001 From: brotherdetjr Date: Thu, 8 Jan 2026 00:00:39 +0000 Subject: [PATCH] implement pinning functionality (#3) --- src/configsys.c | 3 +- src/key_grabber.c | 42 ++++++++- src/key_grabber.h | 5 ++ src/tilda-context-menu.c | 13 +++ src/tilda-keybinding.c | 34 +++++++ src/tilda.c | 3 + src/tilda_window.c | 188 ++++++++++++++++++++++++++++++++++++--- src/tilda_window.h | 18 ++++ src/wizard.c | 11 ++- 9 files changed, 297 insertions(+), 20 deletions(-) diff --git a/src/configsys.c b/src/configsys.c index 7add4613..9d9cf70b 100644 --- a/src/configsys.c +++ b/src/configsys.c @@ -46,6 +46,7 @@ static cfg_opt_t config_opts[] = { CFG_STR("fullscreen_key", "F11", CFGF_NONE), CFG_STR("toggle_transparency_key", "F12", CFGF_NONE), CFG_STR("toggle_searchbar_key", "f", CFGF_NONE), + CFG_STR("pin_key", "p", CFGF_NONE), CFG_STR("closetab_key", "w", CFGF_NONE), CFG_STR("nexttab_key", "Page_Down", CFGF_NONE), CFG_STR("prevtab_key", "Page_Up", CFGF_NONE), @@ -153,7 +154,7 @@ static cfg_opt_t config_opts[] = { CFG_BOOL("scroll_on_key", TRUE, CFGF_NONE), CFG_BOOL("bell", FALSE, CFGF_NONE), CFG_BOOL("run_command", FALSE, CFGF_NONE), - CFG_BOOL("pinned", TRUE, CFGF_NONE), + CFG_BOOL("display_on_all_workspaces", TRUE, CFGF_NONE), CFG_BOOL("animation", FALSE, CFGF_NONE), CFG_BOOL("hidden", FALSE, CFGF_NONE), CFG_BOOL("set_as_desktop", FALSE, CFGF_NONE), diff --git a/src/key_grabber.c b/src/key_grabber.c index 66faf110..0de30bfd 100644 --- a/src/key_grabber.c +++ b/src/key_grabber.c @@ -212,6 +212,14 @@ static void process_all_pending_gtk_events () gdk_display_flush (display); } +void set_pinned (gboolean value, struct tilda_window_ *tw) +{ + tw->is_pinned = value; + if (tw->pin_icon != NULL) { + gtk_widget_set_visible (tw->pin_icon, tw->is_pinned); + } +} + /** * @force_hide: This option is used by the auto hide feature, so we can ignore the checks to focus tilda instead * of pulling up. @@ -346,7 +354,7 @@ static void pull_down (struct tilda_window_ *tw) { * * Note that the "Always on top" property doesn't seem to go away, only this * property (Show on all desktops) does... */ - if (config_getbool ("pinned")) + if (config_getbool ("display_on_all_workspaces")) gtk_window_stick (GTK_WINDOW (tw->window)); if (config_getbool ("animation") && !tw->fullscreen) { @@ -414,9 +422,28 @@ static void onKeybindingPull (G_GNUC_UNUSED const char *keystring, gpointer user { DEBUG_FUNCTION("onKeybindingPull"); tilda_window *tw = TILDA_WINDOW(user_data); + + /* Only unpin if we're actually going to pull up (hide) the window, + * not if we're just going to focus it */ + gboolean needsFocus = !tw->focus_loss_on_keypress + && !gtk_window_is_active(GTK_WINDOW(tw->window)) + && !tw->hide_non_focused; + + if ((tw->current_state == STATE_DOWN) && !needsFocus) { + set_pinned (FALSE, tw); /* Unpin when hiding window */ + } + pull (tw, PULL_TOGGLE, FALSE); } +static void onKeybindingPin (G_GNUC_UNUSED const char *keystring, gpointer user_data) +{ + DEBUG_FUNCTION("onKeybindingPin"); + tilda_window *tw = TILDA_WINDOW(user_data); + + tilda_window_toggle_pin(tw); +} + gboolean tilda_keygrabber_bind (const gchar *keystr, tilda_window *tw) { /* Empty strings are no good */ @@ -431,6 +458,19 @@ void tilda_keygrabber_unbind (const gchar *keystr) tomboy_keybinder_unbind (keystr, (TomboyBindkeyHandler)onKeybindingPull); } +gboolean tilda_keygrabber_bind_pin (const gchar *keystr, tilda_window *tw) +{ + /* Empty strings are no good */ + if (keystr == NULL || strcmp ("", keystr) == 0) + return FALSE; + + return tomboy_keybinder_bind (keystr, (TomboyBindkeyHandler)onKeybindingPin, tw); +} + +void tilda_keygrabber_unbind_pin (const gchar *keystr) +{ + tomboy_keybinder_unbind (keystr, (TomboyBindkeyHandler)onKeybindingPin); +} /* vim: set ts=4 sts=4 sw=4 expandtab: */ diff --git a/src/key_grabber.h b/src/key_grabber.h index d2be2f85..27e435a5 100644 --- a/src/key_grabber.h +++ b/src/key_grabber.h @@ -22,11 +22,16 @@ G_BEGIN_DECLS void pull (struct tilda_window_ *tw, enum pull_action action, gboolean force_hide); +void set_pinned (gboolean value, struct tilda_window_ *tw); + extern void generate_animation_positions (tilda_window *tw); gboolean tilda_keygrabber_bind (const gchar *keystr, tilda_window *tw); void tilda_keygrabber_unbind (const gchar *keystr); +gboolean tilda_keygrabber_bind_pin (const gchar *keystr, tilda_window *tw); +void tilda_keygrabber_unbind_pin (const gchar *keystr); + /** * This function will make the tilda window active after it starts */ diff --git a/src/tilda-context-menu.c b/src/tilda-context-menu.c index efcd5dfb..6a8d698a 100644 --- a/src/tilda-context-menu.c +++ b/src/tilda-context-menu.c @@ -119,6 +119,17 @@ menu_searchbar_cb (GSimpleAction *action, tilda_window_toggle_searchbar (TILDA_WINDOW (user_data)); } +static void +menu_pin_cb (GSimpleAction *action, + GVariant *parameter, + gpointer user_data) +{ + DEBUG_FUNCTION ("menu_pin_cb"); + DEBUG_ASSERT (user_data != NULL); + + tilda_window_toggle_pin (TILDA_WINDOW (user_data)); +} + static void menu_preferences_cb (GSimpleAction *action, GVariant *parameter, @@ -208,6 +219,7 @@ create_menu_model (TildaContextMenu * context_menu) GMenu *toggle_section = g_menu_new (); g_menu_append (toggle_section, _("_Toggle Fullscreen"), "window.fullscreen"); g_menu_append (toggle_section, _("_Toggle Searchbar"), "window.searchbar"); + g_menu_append (toggle_section, _("_Toggle Pinned Mode"), "window.pin"); g_menu_append_section (menu, NULL, G_MENU_MODEL (toggle_section)); // preferences section @@ -259,6 +271,7 @@ tilda_context_menu_popup (tilda_window *tw, tilda_term *tt, const char * match, { .name="close-tab", menu_close_tab_cb }, { .name="fullscreen", menu_fullscreen_cb }, { .name="searchbar", menu_searchbar_cb }, + { .name="pin", menu_pin_cb }, { .name="preferences", menu_preferences_cb }, { .name="quit", menu_quit_cb } }; diff --git a/src/tilda-keybinding.c b/src/tilda-keybinding.c index 201bde9e..3bf03da5 100644 --- a/src/tilda-keybinding.c +++ b/src/tilda-keybinding.c @@ -39,6 +39,7 @@ const Keybinding common_bindings[] = { {"Toggle Fullscreen", "fullscreen_key"}, {"Toggle Transparency", "toggle_transparency_key"}, {"Toggle Searchbar", "toggle_searchbar_key"}, + {"Toggle Pin", "pin_key"}, {NULL, NULL} }; @@ -125,6 +126,11 @@ validate_pulldown_keybinding (const gchar* accel, const gchar* message, gboolean allow_empty_pull_shortcut); +static gboolean +validate_pin_keybinding (const gchar* accel, + tilda_window* tw, + const gchar* message); + static gboolean validate_keybinding (const gchar* accel, tilda_window *tw, @@ -505,6 +511,12 @@ validate_keybindings (TildaKeybindingTreeView *keybindings, if (!validate_pulldown_keybinding (shortcut, tw, message, allow_empty_pull_shortcut)) return FALSE; } + else if (0 == g_strcmp0 ("pin_key", config_name)) { + const char *message = _ ("The keybinding you chose for \"Toggle Pin\" is invalid. Please choose another."); + + if (!validate_pin_keybinding (shortcut, tw, message)) + return FALSE; + } else { gchar * message = g_strdup_printf ( _ ("The keybinding you chose for \"%s\" is invalid. Please choose another."), @@ -556,6 +568,28 @@ validate_pulldown_keybinding (const gchar* accel, } } +static gboolean +validate_pin_keybinding (const gchar* accel, + tilda_window* tw, + const gchar* message) +{ + if (strcmp(accel, "NULL") == 0) return TRUE; + + /* Try to grab the key. This is a good way to validate it :) */ + gboolean key_is_valid = tilda_keygrabber_bind_pin (accel, tw); + + if (key_is_valid) + return TRUE; + else + { + GtkWindow *window = GTK_WINDOW(tw->wizard_window); + + tilda_keybinding_show_invalid_keybinding_dialog (window, message); + + return FALSE; + } +} + static gboolean validate_keybinding (const gchar* accel, tilda_window *tw, diff --git a/src/tilda.c b/src/tilda.c index a91e753b..5c62d140 100644 --- a/src/tilda.c +++ b/src/tilda.c @@ -360,6 +360,9 @@ int main (int argc, char *argv[]) message); wizard (&tw); } + + /* Bind the pin key globally */ + tilda_keygrabber_bind_pin (config_getstr ("pin_key"), &tw); } } diff --git a/src/tilda_window.c b/src/tilda_window.c index f8e73afc..068d1db7 100644 --- a/src/tilda_window.c +++ b/src/tilda_window.c @@ -37,6 +37,8 @@ static tilda_term* tilda_window_get_current_terminal (tilda_window *tw); +static void update_pin_icon_visibility (tilda_window *tw); + static gboolean show_confirmation_dialog (tilda_window *tw, const char *message); @@ -283,12 +285,51 @@ toggle_searchbar_cb (tilda_window *tw) return GDK_EVENT_STOP; } +static gboolean +toggle_pin_cb (tilda_window *tw) +{ + tilda_window_toggle_pin (tw); + + return GDK_EVENT_STOP; +} + void tilda_window_toggle_searchbar (tilda_window *tw) { tilda_search_box_toggle (TILDA_SEARCH_BOX (tw->search)); } +void +tilda_window_toggle_pin (tilda_window *tw) +{ + DEBUG_FUNCTION("tilda_window_toggle_pin"); + DEBUG_ASSERT (tw != NULL); + + /* Don't allow pinning/unpinning during animation */ + if (tw->current_state == STATE_GOING_UP || tw->current_state == STATE_GOING_DOWN) { + return; + } + + /* If window is not visible, bring it to screen first */ + if (tw->current_state == STATE_UP) { + pull (tw, PULL_DOWN, FALSE); + } + + gboolean new_pin_state = !tw->is_pinned; + tw->is_pinned = new_pin_state; + if (tw->pin_icon != NULL) { + gtk_widget_set_visible (tw->pin_icon, new_pin_state); + } + + if (new_pin_state) { + /* Just pinned - stop any pending auto-hide */ + tilda_window_stop_auto_hide(tw); + } else { + /* Just unpinned - restore focus to window to prevent immediate auto-hide */ + tilda_window_set_active(tw); + } +} + /* Zoom helpers */ static const double zoom_factors[] = { TERMINAL_SCALE_MINIMUM, @@ -520,10 +561,9 @@ static gboolean auto_hide_tick(gpointer data) return TRUE; } -/* Start auto hide tick */ -static void start_auto_hide_tick(tilda_window *tw) +void tilda_window_start_auto_hide(tilda_window *tw) { - DEBUG_FUNCTION("start_auto_hide_tick"); + DEBUG_FUNCTION("tilda_window_start_auto_hide"); // If the delay is less or equal to 1000ms then the timer is not precise // enough, because it takes already about 200ms to register it, so we // rather sleep for the given amount of time. @@ -549,8 +589,7 @@ static void start_auto_hide_tick(tilda_window *tw) } } -/* Stop auto hide tick */ -static void stop_auto_hide_tick(tilda_window *tw) +void tilda_window_stop_auto_hide(tilda_window *tw) { if (tw->auto_hide_tick_handler != 0) { @@ -559,6 +598,23 @@ static void stop_auto_hide_tick(tilda_window *tw) } } +static gboolean delayed_auto_hide_cb(gpointer data) +{ + DEBUG_FUNCTION("delayed_auto_hide_cb"); + tilda_window *tw = TILDA_WINDOW(data); + + /* Check again if we should still auto-hide: + * - Pin state might have changed + * - Window might have regained focus (e.g., after unpinning) + */ + if (tw->auto_hide_on_focus_lost && !tw->is_pinned && + !gtk_window_is_active(GTK_WINDOW(tw->window))) { + tilda_window_start_auto_hide(tw); + } + + return G_SOURCE_REMOVE; +} + static gboolean mouse_enter (GtkWidget *widget, G_GNUC_UNUSED GdkEvent *event, gpointer data) { DEBUG_FUNCTION ("mouse_enter"); @@ -566,7 +622,7 @@ static gboolean mouse_enter (GtkWidget *widget, G_GNUC_UNUSED GdkEvent *event, g DEBUG_ASSERT (widget != NULL); tilda_window *tw = TILDA_WINDOW(data); - stop_auto_hide_tick(tw); + tilda_window_stop_auto_hide(tw); return GDK_EVENT_STOP; } @@ -580,14 +636,71 @@ static gboolean mouse_leave (GtkWidget *widget, G_GNUC_UNUSED GdkEvent *event, g GdkEventCrossing *ev = (GdkEventCrossing*)event; tilda_window *tw = TILDA_WINDOW(data); - if ((ev->mode != GDK_CROSSING_NORMAL) || (tw->auto_hide_on_mouse_leave == FALSE)) + /* Don't trigger auto-hide if: + * - Crossing mode is not normal (e.g., grab-related) + * - Auto-hide on mouse leave is disabled + * - Window is pinned + * - Mouse moved to a child widget (detail == INFERIOR) + */ + if ((ev->mode != GDK_CROSSING_NORMAL) || + (tw->auto_hide_on_mouse_leave == FALSE) || + (tw->is_pinned == TRUE) || + (ev->detail == GDK_NOTIFY_INFERIOR)) return GDK_EVENT_STOP; - start_auto_hide_tick(tw); + tilda_window_start_auto_hide(tw); return GDK_EVENT_STOP; } +static gboolean pin_icon_button_press_cb (G_GNUC_UNUSED GtkWidget *widget, + G_GNUC_UNUSED GdkEventButton *event, + gpointer data) +{ + DEBUG_FUNCTION ("pin_icon_button_press_cb"); + DEBUG_ASSERT (data != NULL); + + tilda_window *tw = TILDA_WINDOW(data); + + /* Toggle pin state (will unpin since icon is only visible when pinned) */ + tilda_window_toggle_pin(tw); + + return GDK_EVENT_STOP; +} + +static gboolean pin_icon_enter_notify_cb (GtkWidget *widget, + G_GNUC_UNUSED GdkEventCrossing *event, + G_GNUC_UNUSED gpointer data) +{ + DEBUG_FUNCTION ("pin_icon_enter_notify_cb"); + + /* Change cursor to hand pointer */ + GdkWindow *window = gtk_widget_get_window (widget); + if (window) { + GdkDisplay *display = gdk_window_get_display (window); + GdkCursor *cursor = gdk_cursor_new_for_display (display, GDK_HAND2); + gdk_window_set_cursor (window, cursor); + g_object_unref (cursor); + } + + return GDK_EVENT_PROPAGATE; +} + +static gboolean pin_icon_leave_notify_cb (GtkWidget *widget, + G_GNUC_UNUSED GdkEventCrossing *event, + G_GNUC_UNUSED gpointer data) +{ + DEBUG_FUNCTION ("pin_icon_leave_notify_cb"); + + /* Restore default cursor */ + GdkWindow *window = gtk_widget_get_window (widget); + if (window) { + gdk_window_set_cursor (window, NULL); + } + + return GDK_EVENT_PROPAGATE; +} + static gboolean focus_out_event_cb (GtkWidget *widget, G_GNUC_UNUSED GdkEvent *event, gpointer data) { DEBUG_FUNCTION ("focus_out_event_cb"); @@ -617,10 +730,16 @@ static gboolean focus_out_event_cb (GtkWidget *widget, G_GNUC_UNUSED GdkEvent *e tw->focus_loss_on_keypress = FALSE; } - if (tw->auto_hide_on_focus_lost == FALSE) + if (tw->auto_hide_on_focus_lost == FALSE || tw->is_pinned == TRUE) return GDK_EVENT_PROPAGATE; - start_auto_hide_tick(tw); + /* If focus loss is due to a KeyPress, delay auto-hide to allow keybinding + * handlers (like pin toggle) to run and potentially update is_pinned */ + if (xevent.type == KeyPress) { + g_timeout_add(50, delayed_auto_hide_cb, tw); + } else { + tilda_window_start_auto_hide(tw); + } return GDK_EVENT_PROPAGATE; } @@ -755,6 +874,7 @@ static gint tilda_window_setup_keyboard_accelerators (tilda_window *tw) tilda_add_config_accelerator_by_path("quit_key", "/context/Quit", G_CALLBACK(tilda_window_confirm_quit), tw); tilda_add_config_accelerator_by_path("toggle_transparency_key", "/context/Toggle Transparency", G_CALLBACK(toggle_transparency_cb), tw); tilda_add_config_accelerator_by_path("toggle_searchbar_key", "/context/Toggle Searchbar", G_CALLBACK(toggle_searchbar_cb), tw); + tilda_add_config_accelerator_by_path("pin_key", "/context/Toggle Pinned Mode", G_CALLBACK(toggle_pin_cb), tw); tilda_add_config_accelerator_by_path("nexttab_key", "/context/Next Tab", G_CALLBACK(tilda_window_next_tab), tw); tilda_add_config_accelerator_by_path("prevtab_key", "/context/Previous Tab", G_CALLBACK(tilda_window_prev_tab), tw); @@ -927,7 +1047,7 @@ gboolean tilda_window_init (const gchar *config_file, const gint instance, tilda tilda_window_set_fullscreen(tw); /* Set up all window properties */ - if (config_getbool ("pinned")) + if (config_getbool ("display_on_all_workspaces")) gtk_window_stick (GTK_WINDOW(tw->window)); if(config_getbool ("set_as_desktop")) @@ -1018,8 +1138,9 @@ gboolean tilda_window_init (const gchar *config_file, const gint instance, tilda g_signal_connect (G_OBJECT (tw->notebook), "switch-page", G_CALLBACK (switch_page_cb), tw); /* Setup the tilda window. The tilda window consists of a top level window that contains the following widgets: - * * The main_box holds a GtkNotebook with all the terminal tabs - * * The search_box holds the TildaSearchBox widget + * * The main_box holds the pin_panel, notebook, and search_box + * * The pin_panel is a dedicated horizontal bar at the top containing just the pin icon + * * The search_box is at the bottom for search functionality */ GtkWidget *main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); tw->search = tilda_search_box_new (); @@ -1027,10 +1148,44 @@ gboolean tilda_window_init (const gchar *config_file, const gint instance, tilda GtkStyleContext *context = gtk_widget_get_style_context(main_box); gtk_style_context_add_class(context, GTK_STYLE_CLASS_BACKGROUND); - gtk_container_add (GTK_CONTAINER(tw->window), main_box); + /* Create dedicated pin panel - a horizontal box at the top */ + GtkWidget *pin_panel = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); + + /* Create pin icon */ + GtkWidget *pin_label = gtk_label_new ("\xF0\x9F\x93\x8C"); /* 📌 pin emoji */ + gtk_widget_set_margin_start (pin_label, 10); + gtk_widget_set_margin_end (pin_label, 10); + gtk_widget_set_margin_top (pin_label, 5); + gtk_widget_set_margin_bottom (pin_label, 5); + + /* Wrap pin icon in an event box to make it clickable */ + tw->pin_icon = gtk_event_box_new (); + gtk_container_add (GTK_CONTAINER (tw->pin_icon), pin_label); + gtk_event_box_set_above_child (GTK_EVENT_BOX (tw->pin_icon), TRUE); + + /* Connect click and hover events */ + g_signal_connect (tw->pin_icon, "button-press-event", + G_CALLBACK (pin_icon_button_press_cb), tw); + g_signal_connect (tw->pin_icon, "enter-notify-event", + G_CALLBACK (pin_icon_enter_notify_cb), tw); + g_signal_connect (tw->pin_icon, "leave-notify-event", + G_CALLBACK (pin_icon_leave_notify_cb), tw); + + /* Pack pin icon to the right side of pin panel */ + gtk_box_pack_end (GTK_BOX (pin_panel), tw->pin_icon, FALSE, FALSE, 0); + + /* Initialize pin state */ + tw->is_pinned = FALSE; + gtk_widget_set_visible (tw->pin_icon, FALSE); + + /* Add pin panel, notebook and search to main_box */ + gtk_box_pack_start (GTK_BOX (main_box), pin_panel, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (main_box), tw->notebook, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (main_box), tw->search, FALSE, TRUE, 0); + /* Add main_box directly to window */ + gtk_container_add (GTK_CONTAINER(tw->window), main_box); + g_signal_connect (tw->search, "search", G_CALLBACK (search_cb), tw); @@ -1040,6 +1195,7 @@ gboolean tilda_window_init (const gchar *config_file, const gint instance, tilda /* Show the widgets */ gtk_widget_show_all (main_box); gtk_widget_set_visible(tw->search, FALSE); + gtk_widget_set_visible(tw->pin_icon, FALSE); /* the tw->window widget will be shown later, by pull() */ /* Position the window */ @@ -1212,9 +1368,13 @@ gint tilda_window_close_tab (tilda_window *tw, gint tab_index, gboolean force_ex switch (config_getint ("on_last_terminal_exit")) { case RESTART_TERMINAL: + /* Reset pin state when creating new terminal after last one closed */ + set_pinned (FALSE, tw); tilda_window_add_tab (tw); break; case RESTART_TERMINAL_AND_HIDE: + /* Reset pin state when creating new terminal after last one closed */ + set_pinned (FALSE, tw); tilda_window_add_tab (tw); pull (tw, PULL_UP, TRUE); break; diff --git a/src/tilda_window.h b/src/tilda_window.h index 107b711e..3e7acc08 100644 --- a/src/tilda_window.h +++ b/src/tilda_window.h @@ -45,6 +45,7 @@ struct tilda_window_ GtkWidget *window; GtkWidget *notebook; GtkWidget *search; + GtkWidget *pin_icon; /* Pin status icon in dedicated panel at top */ GList *terms; GtkAccelGroup * accel_group; @@ -59,6 +60,8 @@ struct tilda_window_ /* Temporarily disable auto hiding */ gboolean disable_auto_hide; + /* Pin state - when TRUE, prevents auto-hide on focus lost */ + gboolean is_pinned; /* Auto hide tick-function handler */ guint auto_hide_tick_handler; /* Auto hide current time */ @@ -216,6 +219,21 @@ void tilda_window_refresh_transparency(tilda_window *tw); */ void tilda_window_toggle_searchbar (tilda_window *tw); +/** + * Toggles the pinned state of the tilda window. + */ +void tilda_window_toggle_pin (tilda_window *tw); + +/** + * Start the auto-hide timer + */ +void tilda_window_start_auto_hide (tilda_window *tw); + +/** + * Stop the auto-hide timer + */ +void tilda_window_stop_auto_hide (tilda_window *tw); + /** * Show confirm dialog before quitting (if enabled) */ diff --git a/src/wizard.c b/src/wizard.c index bee4bf0e..1ece44b0 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -127,6 +127,9 @@ gint wizard (tilda_window *tw) * validation easier. */ tilda_keygrabber_unbind (config_getstr ("key")); + /* Unbind the pin key as well */ + tilda_keygrabber_unbind_pin (config_getstr ("pin_key")); + /* Adding widget title for CSS selection */ gtk_widget_set_name (GTK_WIDGET(tw->wizard_window), "Wizard"); @@ -437,7 +440,7 @@ static void check_display_on_all_workspaces_toggled_cb (GtkWidget *w, tilda_wind { const gboolean status = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(w)); - config_setbool ("pinned", status); + config_setbool ("display_on_all_workspaces", status); if (status) gtk_window_stick (GTK_WINDOW (tw->window)); @@ -452,7 +455,7 @@ static void check_set_as_desktop_toggled_cb (GtkWidget *widget, tilda_window *tw config_setbool ("set_as_desktop", status); g_signal_handlers_block_by_func (check_display_on_all_workspaces, check_display_on_all_workspaces_toggled_cb, NULL); - gboolean status_display_on_all_workspaces = config_getbool ("pinned"); + gboolean status_display_on_all_workspaces = config_getbool ("display_on_all_workspaces"); if (status) { gtk_widget_set_sensitive (check_display_on_all_workspaces, FALSE); @@ -1853,7 +1856,7 @@ static void set_wizard_state_from_config (tilda_window *tw) { GdkRGBA *current_palette; /* General Tab */ - CHECK_BUTTON ("check_display_on_all_workspaces", "pinned"); + CHECK_BUTTON ("check_display_on_all_workspaces", "display_on_all_workspaces"); initialize_set_as_desktop_checkbox (); CHECK_BUTTON ("check_always_on_top", "above"); CHECK_BUTTON ("check_do_not_show_in_taskbar", "notaskbar"); @@ -2002,7 +2005,7 @@ static void initialize_set_as_desktop_checkbox (void) { GtkWidget *check_display_on_all_workspaces = GTK_WIDGET(gtk_builder_get_object (xml, "check_display_on_all_workspaces")); gboolean status = config_getbool("set_as_desktop"); - gboolean status_display_on_all_workspaces = config_getbool ("pinned"); + gboolean status_display_on_all_workspaces = config_getbool ("display_on_all_workspaces"); if (status) { gtk_widget_set_sensitive (check_display_on_all_workspaces, FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_display_on_all_workspaces), TRUE);