Skip to content

feat(applets): add destroy tooltip popup action#1138

Open
hammerlink wants to merge 1 commit intopop-os:masterfrom
hammerlink:feature/add-destroy-tooltip-popup
Open

feat(applets): add destroy tooltip popup action#1138
hammerlink wants to merge 1 commit intopop-os:masterfrom
hammerlink:feature/add-destroy-tooltip-popup

Conversation

@hammerlink
Copy link

@hammerlink hammerlink commented Feb 21, 2026

Problem

When an applet is minimized, its tooltip remains visible after activating the minimized button.
After the applet button is clicked it gets removed and it is no longer capable of detecting mouse movements.

Solution

After the applet button is removed destroy the tooltip popup.

At the moment the cosmic-applet-minimize cannot access the WindowId of the popup.
Therefor this PR exposes a Surface Action to destroy the tooltip popup on Window TOOLTIP_WINDOW_ID.
An alternative can be to expose TOOLTIP_WINDOW_ID directly instead of adding a new Surface action. Will change if wanted.

Related to pop-os/cosmic-panel#458
Needed for pop-os/cosmic-applets#1324

Checks

  • I have disclosed use of any AI generated code in my commit messages.
    • If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
    • In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
  • I understand these changes in full and will be able to respond to review comments.
  • My change is accurately described in the commit message.
  • My contribution is tested and working as described.
  • I have read the Developer Certificate of Origin and certify my contribution under its conditions.

}
#[cfg(feature = "wayland")]
crate::surface::Action::DestroyTooltipPopup => {
iced_winit::commands::popup::destroy_popup(*crate::applet::TOOLTIP_WINDOW_ID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be gated by the applet feature

Suggested change
iced_winit::commands::popup::destroy_popup(*crate::applet::TOOLTIP_WINDOW_ID)
#[cfg(feature = "applet")]
{
iced_winit::commands::popup::destroy_popup(*crate::applet::TOOLTIP_WINDOW_ID)
}
#[cfg(not(feature = "applet"))]
{
Task::none()
}

Copy link
Author

@hammerlink hammerlink Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, tested and applied it (had to apply the commit on libcosmic rev 384e8f6 to match the applet-minimize repo).

Though I think it would not cause any harm because of how the Destroy is handled. It is better to not run this task at all otherwise.

This commit adds a new surface action to explicitly destroy the tooltip
popup on `TOOLTIP_WINDOW_ID`, allowing proper cleanup when minimizing
applets.
@hammerlink hammerlink force-pushed the feature/add-destroy-tooltip-popup branch from d975166 to 3e710ff Compare March 23, 2026 20:31
@hammerlink hammerlink requested a review from wash2 March 23, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants