From a04df24bc2f5f90698b3fad7d055428c949eb9f4 Mon Sep 17 00:00:00 2001 From: Peter Uithoven Date: Fri, 7 Dec 2018 18:11:06 +0100 Subject: [PATCH] Fix tooltip update (#162) Start listening for keyboard shortcut change when indicator is created (get_display_widget), as apposed to only after the menu has been opened (get_widget). Making sure the tooltip is always up to date. --- src/Slingshot.vala | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Slingshot.vala b/src/Slingshot.vala index d3ccdeaa7..aa5322f61 100644 --- a/src/Slingshot.vala +++ b/src/Slingshot.vala @@ -53,14 +53,6 @@ public class Slingshot.Slingshot : Wingpanel.Indicator { public override Gtk.Widget? get_widget () { if (view == null) { - if (keybinding_settings != null) { - keybinding_settings.changed.connect ((key) => { - if (key == "panel-main-menu") { - update_tooltip (); - } - }); - } - settings = new Settings (); view = new SlingshotView (); @@ -91,6 +83,14 @@ public class Slingshot.Slingshot : Wingpanel.Indicator { indicator_grid.attach (indicator_icon, 0, 0, 1, 1); indicator_grid.attach (indicator_label, 1, 0, 1, 1); update_tooltip (); + + if (keybinding_settings != null) { + keybinding_settings.changed.connect ((key) => { + if (key == "panel-main-menu") { + update_tooltip (); + } + }); + } } visible = true; @@ -177,4 +177,3 @@ public Wingpanel.Indicator get_indicator (Module module, Wingpanel.IndicatorMana var indicator = new Slingshot.Slingshot (); return indicator; } -