Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0776e69

Browse files
authored
Merge pull request #4316 from erikeah/master
2 parents 39d6d80 + bb19040 commit 0776e69

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/modules/upower.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ UPower::UPower(const std::string &id, const Json::Value &config)
1010
: AIconLabel(config, "upower", id, "{percentage}", 0, true, true, true), sleeping_{false} {
1111
box_.set_name(name_);
1212
box_.set_spacing(0);
13-
box_.set_has_tooltip(AModule::tooltipEnabled());
1413
// Tooltip box
1514
contentBox_.set_orientation((box_.get_orientation() == Gtk::ORIENTATION_HORIZONTAL)
1615
? Gtk::ORIENTATION_VERTICAL
@@ -70,8 +69,10 @@ UPower::UPower(const std::string &id, const Json::Value &config)
7069
g_signal_connect(upClient_, "device-removed", G_CALLBACK(deviceRemoved_cb), this);
7170

7271
// Subscribe tooltip query events
73-
box_.set_has_tooltip();
74-
box_.signal_query_tooltip().connect(sigc::mem_fun(*this, &UPower::queryTooltipCb), false);
72+
box_.set_has_tooltip(AModule::tooltipEnabled());
73+
if (AModule::tooltipEnabled()) {
74+
box_.signal_query_tooltip().connect(sigc::mem_fun(*this, &UPower::queryTooltipCb), false);
75+
}
7576

7677
resetDevices();
7778
setDisplayDevice();

0 commit comments

Comments
 (0)