Commit graph

27 commits

Author SHA1 Message Date
scorpion-26
996a6611ad Add options for reordering widget layout.
Partially implements https://github.com/scorpion-26/gBar/issues/48 and https://github.com/scorpion-26/gBar/issues/20
2023-10-21 18:32:51 +02:00
scorpion-26
aee06ab49d SNI: Properly unsubscribe from item reload signal
I think not unsubscribing is the root cause of the mysterious calling of
ItemPropertyChanged from random names/object paths.
2023-08-24 00:09:05 +02:00
scorpion-26
383f25dbe1 SNI: Fix pixmap
g_variant_iter_n_children apparently returns 1 instead of 3 (array =
child, but I don't know).
I inverted the statement, because for empty property, it hasn't any
children.
2023-08-23 23:18:50 +02:00
scorpion-26
15ed9bfc66 SNI: Disallow watcher replacement
Should help against losing the name constantly, if another bar is
opened.
2023-08-23 15:29:13 +02:00
scorpion-26
a15bb1e17e SNI: Gracefully handle empty IconPixmap
An empty pixmap caused extreme flickering.
https://github.com/scorpion-26/gBar/issues/38
2023-08-22 22:30:38 +02:00
scorpion-26
ec478dec9c SNI: Fix crash with ToolTip of type String
TeamViewer exposes ToolTip as String (which is not compliant to the spec).
This caused gBar to crash, since we assume, that the tooltip variant is
always a container (struct), which glibc doesn't like.

We now fallback to g_variant_get_string if it is not according to spec

Fixes https://github.com/scorpion-26/gBar/issues/37
2023-08-22 15:17:18 +02:00
scorpion-26
3bac707bf5 Fix compiler warnings 2023-07-28 19:11:13 +02:00
scorpion-26
4a52bb744a SNI: Flush before querying item properties
Some apps have a tendency to deadlock after registration (notably
KeePassXC). Now we flush before querying the item properties, so any
pending answer should have left the bus, hopefully avoiding the deadlock
2023-07-28 18:58:00 +02:00
scorpion-26
a7862a4242 SNI: Remove callback for erased items
Should fix DBusNameVanished spam as found in https://github.com/scorpion-26/gBar/issues/29
2023-07-28 18:56:51 +02:00
scorpion-26
09ec1bfab6 SNI: Sort items
Reloading/adding new items causes jumps in the item order. Sorting
should stabilize the order
2023-07-26 14:04:36 +02:00
scorpion-26
884d3f1324 SNI: Only reload a given senderName once
Fix for: https://github.com/scorpion-26/gBar/issues/26
2023-07-26 14:03:52 +02:00
scorpion-26
39cf17c30f SNI: Use our object path for ItemPropertyChanged
ItemPropertyChanged is called multiple times per actual icon change.
senderName is the same, objectPath is the same, but our registered name
for the callback differs.
We can't use the provided name for item searching, since that *can*
differ from the one we registered with (Looking at you, Discord. Discord
registers with org.kde.StatusNotifierItem-*, but calls back with :*.*)
Since then the object path will sometimes be wrong for the name, we just
use the one from the icon we originally registered with. This causes
multiple icons to reload though

Potential fix for https://github.com/scorpion-26/gBar/issues/26
2023-07-26 13:37:11 +02:00
scorpion-26
fe7b02b10c SNI: Honor XDG_DATA_DIRS as icon directory
Also don't crash in Utils::FindFileWithName when directory doesn't exist

Potential fix for https://github.com/scorpion-26/gBar/issues/25
2023-07-25 01:47:17 +02:00
scorpion-26
abd3774c7d Fix SNI angle for top bar 2023-07-21 01:29:25 +02:00
scorpion-26
f78758c4ee SNI: Allow bar rotation
Texture was also rewritten, so it doesn't need the SNIPaddingTop hack as much
anymore
2023-07-21 01:08:38 +02:00
scorpion-26
18f3e123ed SNI: Allow IconPath to be empty
Fixes network-manager-applet
2023-07-04 12:21:19 +02:00
scorpion-26
e9c9d3abb1 SNI: Add Icon positioning config options 2023-05-04 16:14:18 +02:00
scorpion-26
79e78826e0 SNI: Only add to clientsToQuery once 2023-05-04 15:04:06 +02:00
scorpion-26
31e070a3da SNI: Add config 2023-05-04 13:57:50 +02:00
scorpion-26
b7a92e50d9 SNI: Add context menu
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.
2023-05-04 13:57:50 +02:00
scorpion-26
40115befdd SNI: Improve logging 2023-05-04 13:57:50 +02:00
scorpion-26
25912c7e35 SNI: Add tooltip 2023-05-04 13:57:50 +02:00
scorpion-26
6bd5a450b1 SNI: Implement changing properties 2023-05-04 13:57:50 +02:00
scorpion-26
b50ecb0f6c SNI: Fix freeze when connecting to Qt SNI apps
Qt waits until the callback to RegisterItem is done. Thus, we can't
query the item and need to defer it
2023-05-04 13:57:50 +02:00
scorpion-26
a02bce9b91 SNI: Remove items on bus name vanish 2023-05-04 13:57:50 +02:00
scorpion-26
d4ffac395b SNI: Proper alignment for the icons 2023-05-04 13:57:50 +02:00
scorpion-26
1241d7c87c SNI: Initial proof of concept
Implements a rough outline of the SNI (StatusNotifierItem) d-bus
protocol for tray icons.

Note: This is currently *very* WIP

Full implementation will close https://github.com/scorpion-26/gBar/issues/5
2023-05-04 13:57:50 +02:00