A source event has the first bit always set, whereas we only handle
events that equal 0x10 (PA_SUBSCRIPTION_EVENT_CHANGE). Now the bitmask
is correctly handled.
Fixes https://github.com/scorpion-26/gBar/issues/82
This is the fix for https://github.com/scorpion-26/gBar/issues/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
https://github.com/scorpion-26/gBar/pull/12#issuecomment-1529143790.
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'
This widget called "Title" is a simple text with the title of the
currently active window. To prevent clipping the size of the title is capped by the
config variable "MaxTitleLength".
Implements https://github.com/scorpion-26/gBar/issues/77
Since you can now customize what widgets go in the center, the names of
these config options are no longer fitting. They are now renamed to
CenterSpace and CenterWidgets respectively.
If the current monitor would quickly change, GetOutdatedPackagesAsync
would be called while the previous instance is still running, which
caused crashes. Now, GetOutdatedPackagesAsync only uses one
instance/callback a time.
Since there is no way to map a connector to a Gdk Window ID and window
ID's are not static per monitor, the entire Window and Wayland system
has been rewritten to store a "target monitor" connector name, which is
the name of the monitor we want to be on. Every time a monitor is
removed or added, it is checked against the monitors of our Wayland
backend to match connector to Gdk ID and then the Window is
created/destroyed on the window(The target monitor is preferred, but if
it doesn't exist, other monitors are used too).
This is not perfect, since the matching of connector name to Gdk ID is
only an approximation of the Gdk behaviour (Especially rough
on hyprland with the headless monitor. A hack is needed to handle that).
Additionally the monitor can now be specified by connector name when
starting up (e.g. "gBar bar DP-1").
gBar no longer crashes when it's monitor is removed and is instead
evacuated onto another monitor or the next monitor added. We don't
change any monitor indices etc., which results in some glitchy results
Since 37b0896 stb_image isn't used anymore and recently the nix CI also
broke because of the hacky way the include directory is determined. This
is now fixed. One side effect of this is, that gBar no longer needs to
be cloned recursively.
Even though an scss file is present, it needs to be converted manually and only the
CSS file is parsed. This pull request sets out to fix that.
there is preliminary scss support using libsass now (libsass is technically "deprecated" but there seems to be no other
c/c++ library for converting scss to css)
The menu that was created for the sni context menu was never destroyed.
Instead of creating a new menu each time, the existing menu is recycled
and destroyed when the item is.
According to XDG specifications paths like /usr/share etc. are usually
in XDG_DATA_DIRS. Since this variable may be set differently for other
linux distributions we prefer those environment variables to hard-coded
paths. As such hard-coded paths have been removed
This solves issue #66
gtk_icon_theme_load_icon returns a pixbuf which is not owned by us, and
therefore g_free shouldn't be called. When reloading an icon, this pixbuf
was reused by the icon theme even though we just free'd it.
Fixes: https://github.com/scorpion-26/gBar/issues/74
This adds a config option to override the name of the icons displayed.
This also removes the frankenstein monster of the icon location
querying, which was a giant mess and not even remotely close to being
compliant with the XDG spec. Instead we use the much simpler Gtk API
which has the added benefit of properly supporting themes.
The SNI filter also now work for items without a set tooltip (e.g. steam).
For these items the object name is matched instead.
Implements https://github.com/scorpion-26/gBar/issues/63
This PR adds classes to every widget.
Introduces a breaking change for the lock-button, which needs to be
added to the style.css manually if you're using a custom one.
Every widget gets a "widget" class as well as a specific one like an id.
In the future, names/ids should be used for that.
Also cleaned up the sensors a little as well as the related CSS.
Fixes#70.
To facilitate that, Texture now accepts GdkPixbuf instead of raw
uint8_t[], because we can't convert svgs into uint8_t[] easily without
the use of GdkPixbuf.
gtk_remove_widget unrefs the widget and destroys it and all its children.
Since we also do that in the destructor, we do a double free.
To fix this, a ref is added to prevent destroying by gtk_remove_widget.