Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icon-tasklist: Fix some pinned launchers not properly updating when opened #587

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/panel/applets/icon-tasklist/IconTasklistApplet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,18 @@ public class IconTasklistApplet : Budgie.Applet {
if (button == null) { // Button might be pinned, try to get button from launcher instead
app_id = group.get_desktop_id();
button = buttons.get(app_id);

// Because the only way to get a desktop_id from an application on X11 is basically
// to just guess, the casing may not be correct, e.g. Nemo.desktop vs nemo.desktop.
// Try again to get the button, this time making the desktop_id all lowercase.
if (button == null) {
app_id = app_id.down();
button = buttons.get(app_id);
}
}

if (button == null) { // we don't manage this button
warning(@"an application ($(group.group_id)) was closed, but we couldn't find its button");
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/panel/applets/icon-tasklist/widgets/IconButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -620,14 +620,14 @@ public class IconButton : Gtk.ToggleButton {
public void update() {
if (window_group != null && window_group.has_windows()) {
get_style_context().add_class("running");
} else {
} else if (window_group != null && !window_group.has_windows()) {
get_style_context().remove_class("running");

if (!pinned) return;
window_group = null;

var active_window = window_group?.get_active_window() ?? window_group?.get_last_active_window();
set_tooltip_text(app?.name ?? active_window?.get_name() ?? "");
window_group = null;
}

set_active(has_active_window);
Expand Down
Loading