Commit Graph

103 Commits

Author SHA1 Message Date
Austin Horstman 7d8be29f97 perf(sni): eliminate icon theme rescanning from system tray hotpath
Valgrind Massif profiling revealed that invoking Gtk::IconTheme::rescan_if_needed() inside SNI updateImage() and getIconByName() loops caused considerable memory churn and potential filesystem stat overhead whenever a system tray app pushed a metadata update.

This commit removes the rescan polling from the SNI proxy callback pipeline and the DefaultGtkIconThemeWrapper, restricting icon theme caching to load boundaries.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 22:54:07 -06:00
copilot-swe-agent[bot] d5297bc424 fix: resolve PulseAudio/WirePlumber deadlock and freeze issues
- Fix AudioBackend destructor: properly lock the PA mainloop before
  disconnecting the context to prevent race conditions with PA callbacks

- Fix context leak on reconnect: call pa_context_unref() when the old
  context is replaced after PA_CONTEXT_FAILED to avoid resource leaks

- Fix PA mainloop killed on reconnect (critical): PA_CONTEXT_TERMINATED
  was unconditionally calling quit() on the mainloop, even during
  reconnection when the old context fires TERMINATED after the new one
  was created. This was killing the new context and preventing successful
  reconnection, causing Waybar to appear frozen. The fix only quits
  the mainloop when the terminating context is still the active one.

- Fix Wireplumber use-after-free: explicitly disconnect GObject signal
  handlers for mixer_api_, def_nodes_api_, and om_ before clearing the
  object references in the destructor to prevent callbacks from firing
  with a destroyed self pointer.

- Fix GVariant memory leak in Wireplumber::handleScroll: unref the
  GVariant created for the set-volume signal after the emit call.

Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-28 14:27:22 +00:00
Alex 802bf184fb fix: lint 2026-02-24 00:49:23 +01:00
Alex ef3d55980e fix: some crashes 2026-02-24 00:49:08 +01:00
cebem1nt 429d7df52b fix: backlight/slider fix rounding issue on scroll up 2026-02-05 23:38:47 -03:00
Alex 47fb21a2c1 chore: upgrade to clang-format@21 2026-02-04 09:24:14 +01:00
schmop ce1da5a178 Make udev_deleter not linux-only and fix freebsd build 2025-11-01 10:57:18 +01:00
schmop 4e25871655 Reapply "Make battery module update on plugging/unplugging again (refs #2519)"
This reverts commit bb2c67ebad.
2025-10-31 13:43:36 +01:00
Aaron Andersen bef35e48fe backlight: gracefully handle a null epoll device 2025-10-09 20:52:51 -04:00
Pol Rivero 45d01ce6e5 Implement "active-window-position" 2025-08-18 21:23:36 +02:00
Alexis Rouillard c63e332fb2 Merge pull request #4278 from rwsalie/master
add openbsd support
2025-08-08 08:43:52 +02:00
Alexis Rouillard 3dce0956ec Merge pull request #3930 from Invertisment/master 2025-08-08 08:24:58 +02:00
bilaliscarioth 682fc34c1d fix linters for css_reload_helper.cpp 2025-07-13 14:03:09 +02:00
bilaliscarioth 0cb605b529 start openbsd ports 2025-07-08 02:13:33 +02:00
Pol Rivero c98cb7095d Merge remote-tracking branch 'upstream/master' 2025-07-06 10:18:59 +02:00
Martynas Maciulevičius aaea814217 Idempotent bar show/hide via configurable user kill signals 2025-06-27 09:31:51 +03:00
Martynas Maciulevičius 460b19ba1b Fix default icon in tray module 2025-06-26 20:34:56 +03:00
Alexis Rouillard 456c3add4a Merge pull request #4102 from edwin0cheng/style-sym
Use load_symbolic for gtk icon to support styling in tray icon
2025-06-22 08:29:42 +01:00
Alexis Rouillard 44a8910022 Merge pull request #4173 from S0nter/master
privacy: ignore some streams
2025-06-22 08:24:22 +01:00
peelz 25f432b0ce refactor: avoid Gio namespace pollution 2025-06-22 00:50:25 -04:00
Gregor Kleen 831602a913 privacy: default to ignoring all stream.monitor pw nodes 2025-06-08 12:23:50 +03:00
Edwin Cheng 0340760e12 Use load_symbolic for gtk icon instead of load_icon. 2025-05-07 16:57:54 +08:00
Pol Rivero 4222032fa1 Merge remote-tracking branch 'upstream/master' 2025-04-29 19:59:42 +02:00
Austin Horstman afb1ee5422 audio_backend: fix crash
Getting crashes when called before we have proper information.
2025-04-11 14:53:47 -05:00
Angelo Dureghello 6fd859c0c4 add login-proxy option
There are cases where systemd-logind is not used/running. Result is
that bcklight module will not run.

Add an option that, when set to false, allows backlight module to
work without systemd-logind.
2025-03-22 18:40:47 +01:00
Pol Rivero bc2e143ac5 Extract icon loading logic to separate class 2025-01-27 11:46:35 +01:00
Alex 481b01d9af fix: lint 2025-01-25 09:31:32 +01:00
Alexis Rouillard bb2c67ebad Revert "Make battery module update on plugging/unplugging again (refs #2519)" 2025-01-25 09:24:48 +01:00
Alexis Rouillard dc64b3542b Merge pull request #3474 from schmop/battery-plugging-instant-updates
Make battery module update on plugging/unplugging again (refs #2519)
2025-01-25 09:20:02 +01:00
Sv. Lockal 865121b21d Fix compilation with libc++
This file uses std::sort and does not import correct header.
Compilation with libstdc++ worked due to some indirect import, but compilation with LLVM libc++ fails.
2025-01-04 10:28:14 +00:00
Alexis Rouillard e959f1d230 Merge pull request #3808 from Nambers/master
Using 'auto' instead of 'self' in backlight module
2024-12-07 09:58:30 +01:00
eritque0arcus 6bac784b51 fix: use auto and add self as fallback 2024-12-04 12:46:09 -06:00
Maja Kądziołka 6d28740896 Add locking for interacting with the pulseaudio thread
Before this commit, Waybar would sometimes get into a state
where it would consume 100% of a CPU core, and the pulseaudio widget
would stop responding to volume adjustments.

In this state, the pulseaudio mainloop thread would spin, with the
counter of enabled defer events at 1, but no actual enabled defer
event in the list to get the counter back to zero after an iteration
in the mainloop.

This could happen if the unsynchronized interactions with the mainloop
thread happened to modify the list of deferred events at the same
time as the mainloop.

This commit introduces locking in accordance with the PulseAudio
documentation on the threaded mainloop:

> The lock needs to be held whenever you call any PulseAudio function that
> uses an object associated with this main loop. Those objects include
> pa_mainloop, pa_context, pa_stream and pa_operation, and the various event
> objects (pa_io_event, pa_time_event, pa_defer_event).
2024-12-03 19:37:36 +01:00
Kate Adkins 86ce9f7278 fix null-deref due to unconstructed PrivacyNodeInfo
This would cause Waybar to crash if the privacy module ever got
e.g. a empty (but properly null-terminated) string for the
application_name.
2024-11-15 12:32:55 -07:00
Philipp Hentschel e3095c6d1d clang-format 2024-09-21 13:25:36 +02:00
Philipp Hentschel d6bfeb5a44 added is running condition to default_sink_is_running check 2024-09-21 13:25:36 +02:00
Philipp Hentschel 8b1d73690d added running check to default sink return condition 2024-09-21 13:25:36 +02:00
Philipp Hentschel 9c47b2e9dd removed debug logging 2024-09-21 13:25:36 +02:00
Philipp Hentschel dedee8cd14 pulseaudio: show correct sink volume on default output changes
on sinkInfo callbacks, the default sink now has highest priority.
That fixes an issue that the volume indicator is not updated when
the changes the default output to another devices.

added PA_SINK_IDLE as valid state. PA_SINK_RUNNING is only true
if any sound output is happening on sink switch. Indicator should
also update when no sound is being played.
2024-09-21 13:25:36 +02:00
Austin Horstman 05d69ae822 src/util/css_reload_helper: clang-format 2024-08-02 23:06:53 -05:00
schmop f4608b3e31 Fix battery status changes not being detected
Historically we listened to /sys/class/poewr_supply inotify events,
which does not seem to work anymore.
We switched now to udev netlink kernel events.
2024-07-27 01:15:42 +02:00
DomCristaldi 58e21e876e walk up symlink tree
"reload_style_on_change" would check if the target file is a symlink,
but only resolves the first link. If the symlink is acutally a chain of
symlink, such as what happens with NixOS's mkOutOfStoreSymlink, we will
not find the actual file style file.

Update the symlink resolution logic to walk down the symlink chain until
it finds a non-symlink. Also check against a the original filename
(which may be a symlink) to guard against infinitely looping on a
circular symlink chain.
2024-07-20 22:58:03 -04:00
Lauri Niskanen 23274a9d57 pulseaudio: Consider ignored sinks never running
If the current sink happens to be ignored it is never considered running
so it will be replaced with another sink.
2024-07-06 01:30:11 +03:00
Austin Horstman d66685a3aa util: clang-tidy 2024-07-02 10:38:58 -05:00
Nicolas Lenz 76c2f3166e format RegexCollection output using match results 2024-06-05 19:58:27 +02:00
hrdl 74773885c6 Pipewire backend: use pipewire thread lock
Fixes #3047.
2024-04-13 14:25:28 +02:00
Kuruyia fe15530f34 refactor(privacy): clean up the module 2024-03-25 20:16:47 +01:00
Alexis Rouillard f228c13802 Merge pull request #2638 from staticssleever668/fix_mold_linking
refactor(backlight): use concrete types for some helper functions
2024-03-22 23:19:49 +01:00
zjeffer 11310b89f0 hyprland/workspaces: Use hyprland's persistent workspaces configuration 2024-02-18 16:04:47 +01:00
Alexis Rouillard 1dce607c42 Merge pull request #2852 from dpayne/add_css_reload
Adding css reloader
2024-01-29 22:44:29 +01:00