linuxmint / linuxmint/mintupdate

Tray icon unresponsive after first click when window is hidden (tray_activate bug)

Open Beginner friendly
#1,062 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

BUG
Dominant language
Python
Stars
425
Forks
190
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
The tray icon becomes unresponsive after the first click. The first click works
correctly (shows the menu or the main window), but all subsequent clicks produce
no response. The tooltip still shows correctly, meaning the process (mintUpdate.py)
is alive but not reacting to clicks.
Screenshots
If applicable, add screenshots to help explain your problem, you can just drag & drop them here.

To Reproduce

  1. Log in to a Cinnamon session
  2. Click the update manager tray icon → works correctly
  3. Close the menu or window
  4. Click the tray icon again → no response
  5. Repeat clicks → still no response

Expected behavior
A clear and concise description of what you expected to happen.

Distribution:

  • [ x] Linux Mint
  • LMDE
  • Other (please specify)

Software version:
7.1.4

Logs:
Copy & paste the log output from Update Manager > View > Information here.

Crash report:
If you are reporting a crash, please run mintupdate from a terminal window, reproduce the crash and copy & paste any output from the terminal window here.

Additional context
Add any other context about the problem you think might be relevant.

Locale:
If the problem is with text not getting displayed correctly, paste the output of the terminal command locale.

Root cause
The bug is in the tray_activate method (mintUpdate.py, line ~1239):

def tray_activate(self, time=0):
    try:
        focused = self.ui_window.get_window().get_state() & Gdk.WindowState.FOCUSED
    except:
        focused = self.ui_window.is_active() and self.ui_window.get_visible()

    if focused:
        self.hide_window()
    else:
        self.show_window(time)

When the window is hidden, get_window().get_state() still reports
Gdk.WindowState.FOCUSED = True. As a result, tray_activate incorrectly
evaluates focused = True and calls hide_window() instead of show_window(),
even though the window is already hidden.

Fix
Add a visibility check to the focused condition:

focused = (self.ui_window.get_window().get_state() & Gdk.WindowState.FOCUSED) and self.ui_window.get_visible()

This ensures the window is only considered "focused" if it is both focused AND
actually visible, preventing the incorrect hide on subsequent clicks.

This one-line change fixes the issue completely (tested: 10 consecutive clicks
all working correctly).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in mintUpdate.py at the tray_activate method around line 1239 and reproduce the issue by clicking the tray icon after hiding the window. Check the focused and visible state handling, then verify that repeated clicks show or hide the window correctly, including the reported 10 consecutive clicks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.