beeware / beeware/toga

Problems with Qt implementation of StatusIcons

Open
#4,027 0 comments 0 reactions 0 assignees View on GitHub
bug linux qt
Dominant language
Python
Stars
5.4k
Forks
827
Avg merge
15h 39m
Merged PRs (30d)
40

Description

### Describe the bug

Qt's implemenation of StatusIcons has the following issue:
- On Wayland, the popup for the menu does not display on left-click in a MenuStatusIcon.
- On X11, when left-clicking a MenuStatusIcon, the context menu is positioned at the mouse position instead of above the systray like it does when right-clicked.

### Steps to reproduce

Run the statusicon example app.

### Expected behavior

A status icon is always displayed and above the systray.

### Screenshots

_No response_

### Environment

Fedora 42, all packages up-to-date

### Logs

_No response_

### Additional context

An outline to fix this is at https://github.com/beeware/toga/pull/3987#issuecomment-3694095967; however it was decied against fixing this in #3987 to not scope-creep and/or wait for KStatusNotifierItem support in system-pyside6 to land.

Another blocker is that KStatusNotifierItem's Python bindings are not shipped with Ubuntu, and is not available for people not using system-pyside6, so we'd still have to have an implementation for plain QSystemTrayIcon. How to handle left-click on Wayland is an open issue -- there's no good way for that without using KStatusNotifierItem; my inclination is to either a) do nothing or b) pop up a small window with "Actions" in its menu bar, with the "Actions" hooked up to the menus for that status icon.

Contributor guide

Open the contributing guide

Research direction

Run the statusicon example app on Wayland and X11 to reproduce the left-click behavior. Read the fix outline in PR #3987's issue comment and compare the constraints of KStatusNotifierItem with plain QSystemTrayIcon. Done should include a decided and tested behavior for both environments, including menu positioning and the Wayland limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.