Nheko-Reborn / nheko

Desktop client for Matrix using Qt and C++20.
https://nheko-reborn.github.io/
GNU General Public License v3.0
1.89k stars 199 forks source link

Clicking tray icon or notifications on Windows doesn't bring app window to top #1414

Open nyanpasu64 opened 1 year ago

nyanpasu64 commented 1 year ago

Describe the bug

On Windows 10, clicking a message notification does not focus the Nheko window, restore Nheko from tray notification, or unminimize the window.

Minimizing Nheko, then clicking the tray icon twice to hide and show the window, does not unminimize it. It also mostly fails to focus the window if not on top.

To Reproduce

Notification:

  1. Click to another window, or minimize Nheko.
  2. Alternatively, enable "minimize to tray" and close the window (so it keeps running in the tray).
  3. When another person sends you a message, click the Windows notification.

Minimize then close to tray:

  1. Enable "minimize to tray".
  2. Click Nheko's title bar's Minimize button.
    • Clicking Nheko's taskbar window icon to minimize it, instead behaves like "Close to tray".
  3. Click the Nheko tray icon to close the window, then again to reshow the window.
    • Right-clicking the taskbar window icon and clicking "Close window", then clicking the Nheko tray icon to reshow the window, instead behaves like "Close to tray".

Close to tray:

  1. Enable "minimize to tray".
  2. Optionally click Nheko's taskbar window icon to minimize it.
    • Note that closing the window (through right-clicking the taskbar, or clicking the title bar X) without minimizing it, then clicking the Nheko tray icon to reshow the window, does not reproduce this bug.
  3. Click the Nheko tray icon to close the window, then again to reshow the window.

What happened?

When you click a message notification, Nheko does not bring the window to top and focus, reopen the closed window, or unminimize from taskbar.

When you minimize Nheko then click the tray icon, Nheko does not unminimize the minimized window.

If the window was closed by clicking the tray icon, then clicking the tray icon again does not focus the window or bring it to top. If Nheko was previously focused and on top before you clicked the tray icon twice, it becomes unfocused, and keyboard input is directed to the taskbar rather than Nheko.

Expected behavior

Clicking a notification always results in a visible window, and brings it to top.

Clicking the tray icon with Nheko closed always results in a visible window focused and brought to top, even if minimized beforehand, or if closed through the tray icon. Maybe this should also happen if Nheko's window is already visible but not on top.

Screenshots

Nheko on top, click tray icon twice, still on top but unfocused and taskbar is focused:

nheko tray bug

Version

0.11.3-d27e42de

Operating system

Windows

Installation method

Windows download

Qt version

No response

C++ compiler

No response

Desktop Environment

No response

Did you use profiles?

Relevant log output

No response

Backtrace

No response

0verEngineer commented 1 year ago

This happens on KDE as well (and i think Gnome as well)

deepbluev7 commented 1 year ago

On Linux it should only happen on wayland.