Skip to content

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

@jatofe999

Description

@jatofe999

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions