Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNI implementation for tray icons #12

Merged
merged 16 commits into from
May 4, 2023
Merged

SNI implementation for tray icons #12

merged 16 commits into from
May 4, 2023

Conversation

scorpion-26
Copy link
Owner

@scorpion-26 scorpion-26 commented Mar 17, 2023

Implementation for SNI (StatusNotifierItem) d-bus protocol for tray icons.

Note: This is currently very WIP

Things that need to be done until it is ready for merging into master:

  • Implementing basic protocol (item, host and watcher)
  • Icon drawing
    • Drawing raw pixbufs
    • Properly align icons
  • Removing of items
  • Icon changing
  • Context menus (Quick and dirty implementation via libdbusmenu-gtk, proper styled implementation later)
  • Hide behind a pretty icon slider
  • Configuration: Compile time (Depends on submodules), and runtime (disable/enable)
  • Maybe: Properly implement watcher (So other apps can use it)

Full implementation will close #5

@scorpion-26 scorpion-26 changed the title SNI: Initial proof of concept WIP: SNI implementation for tray icons Mar 17, 2023
@scorpion-26
Copy link
Owner Author

All major features regarding the dbus protocol are now implemented.
The styling for the context menu for tray icons is currently very much broken. The window of the menu is always 200x200, which creates nasty blank space when the background is opaque (I left it transparent for now) and can cause clipping for long menu items (e.g. long names of steam games). This is probably a bug in libdbusmenu-gtk and there is no hope trying to fix it. Since context menus work functionally I'll complete and merge this PR and then try to look into ways to implement the context menu myself.

Implements a rough outline of the SNI (StatusNotifierItem) d-bus
protocol for tray icons.

Note: This is currently *very* WIP

Full implementation will close #5
Qt waits until the callback to RegisterItem is done. Thus, we can't
query the item and need to defer it
Since it uses a 13 year old library, it is broken. The popup size is
hard-fixed at 200x200, with looks really ugly with non-transparent
background.
@scorpion-26 scorpion-26 marked this pull request as ready for review May 4, 2023 14:26
@scorpion-26 scorpion-26 changed the title WIP: SNI implementation for tray icons SNI implementation for tray icons May 4, 2023
@scorpion-26 scorpion-26 merged commit ea857e5 into master May 4, 2023
scorpion-26 added a commit that referenced this pull request Mar 18, 2024
This is the fix for #79, but
blown out of proportions, because various things kept breaking

- Original fix: Add/Remove items instead of cleaning everything
  everytime something changes. If the dbus-menu was open, it was
  referencing the old widget causing issues. The new method keeps the
  original GtkDrawingArea and only replace the buffer/tooltip
- Create dbus-menu on widget creation instead of on click. This was
  actually the fix for
  #12 (comment).
  The css has also been updated, making the popup finally look good.
- With the new item refreshing theme KeePassXC kept deadlocking when the
  properties changed. To fix it, the dbus properties are now queried
  asynchronously via 'GetAll'
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.

Hide audio slider, add microphone slider, add system tray, scroll through workspaces and AMD GPU
1 participant