Commit Graph

2249 Commits

Author SHA1 Message Date
Austin Horstman
e684e701df perf(sni): eliminate redundant g_memdup2 allocation for D-Bus pixbufs
Memory profiling via Valgrind Massif indicated that 10-20% of peak memory allocations within the SNI loop resulted from copying DBus image data payloads via g_memdup2 before modifying them from ARGB to RGBA.

This commit optimizes the pixel conversion by directly allocating the final array via g_malloc and running the ARGB->RGBA transposition in a single pass while copying from the read-only GVariant buffer, entirely eliminating the intermediate g_memdup stage.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 22:54:07 -06:00
Austin Horstman
4c71b2bf9f perf(memory): optimize C++ string operations to reduce heap fragmentation
- Replaced pass-by-value std::string parameters with const std::string&
or std::string_view to prevent SSO overallocations.

- Refactored static mapping functions in UPower to return
std::string_view instead of constructing std::string literals, enabling
perfect cache locality.

- Optimized string concatenation in hot loops (network IPs, inhibitor
lists, sway window marks) by using std::string::append() and
pre-reserving capacity instead of overloaded operator+ which produces
temporary heap instances.

These optimizations reduce high-frequency memory churn and overall heap
fragmentation within the main rendering loops.

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
7744320ab2 fix: build 2026-02-24 00:55:27 +01: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
Alexis Rouillard
a32413a74f Merge pull request #4880 from Alexays/copilot/fix-mpd-module-crash
mpd: fix socket FD leak on system-level connection errors
2026-02-24 00:06:11 +01:00
copilot-swe-agent[bot]
82f076c6c2 mpd: fix FD leak by resetting connection on MPD_ERROR_SYSTEM errors
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-23 23:04:36 +00:00
Alex
e18939210b fix: lint 2026-02-24 00:00:57 +01:00
Alexis Rouillard
aacf0cbc99 Merge pull request #4881 from Alexays/copilot/fix-sigabrt-usb-unplug-issue
battery: fix SIGABRT on USB device unplug race condition
2026-02-24 00:00:19 +01:00
copilot-swe-agent[bot]
49d4049ea3 Fix SIGABRT on USB unplug race condition in battery module
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-23 22:55:05 +00:00
copilot-swe-agent[bot]
0c46818e95 Fix crash when bluetooth DBus manager returns null on timeout
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-23 22:54:23 +00:00
Alexis Rouillard
64ecdcfa87 Merge pull request #4846 from BlueManCZ/fix-mpris-fallback-player
fix(mpris): fall back to next non-ignored player and prefer playing players
2026-02-23 23:51:04 +01:00
Alexis Rouillard
730e558cf4 Merge pull request #4834 from khaneliman/niri
feat(niri): niri depends on socket
2026-02-23 23:43:30 +01:00
Alexis Rouillard
22fd2da40e Merge pull request #4836 from Cprakhar/fix/tooltip-return-type-in-format-strings
feat: add `{tooltip}` in format replacements in custom module
2026-02-23 23:26:07 +01:00
Alexis Rouillard
6fa8ad3430 Merge pull request #4849 from 44vladimirov/power_switch_events
battery: power switch events
2026-02-22 18:32:08 +01:00
Alexis Rouillard
54e7451cf0 Merge pull request #4856 from Cprakhar/feat/tooltip-format-cpu
feat: add tooltip-format config option in cpu module
2026-02-20 17:36:17 +01:00
Austin Horstman
ae60ca6233 refactor(niri): declared constructor
Move constructor from hpp to cpp to align with other modules

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-20 08:16:56 -06:00
Austin Horstman
a194b576be feat(niri): niri depends on socket
Don't attempt to use niri modules when socket connection fails. Prevents
rendering modules when running another compositor. In same concept as
previous Hyprland change
4295faa7c4

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-20 08:16:56 -06:00
GG2R10
9c871c90a7 fix: move silence_ = false inside idle lambda 2026-02-19 15:12:23 -05:00
cebem1nt
f1140f00f9 niri/workspaces: change icons priority 2026-02-17 11:23:27 -03:00
Alexis Rouillard
e4e47cad5c Merge pull request #3088 from VAWVAW/hyprland-bar-scroll
hyprland/workspaces: Add `enable-bar-scroll` option
2026-02-13 23:43:12 +01:00
Alexis Rouillard
01628dda85 Merge pull request #4852 from tobixen/fix/keyboard-state-hotplug-crash
fix(keyboard-state): fix segfault on device hotplug removal
2026-02-13 23:27:05 +01:00
Prakhar Chhalotre
2337d308ce Merge branch 'master' into feat/tooltip-format-cpu 2026-02-14 03:28:29 +05:30
vawvaw
5b595a4dfe hyprland/workspaces: Add enable-bar-scroll option 2026-02-13 20:48:59 +01:00
Prakhar Chhalotre
3e7976c8eb fix: use pango markup for consistent formatting in format and tooltip-format 2026-02-13 02:23:16 +05:30
Prakhar Chhalotre
4ac539206f feat: add tooltip-format config option in cpu module 2026-02-13 02:00:17 +05:30
Tobias Brox
13469a8847 fix(keyboard-state): fix segfault on device hotplug
The keyboard-state module crashes with SIGSEGV in libinput_device_ref
when a new input device appears in /dev/input/.

Three bugs fixed:

1. Missing NULL check: tryAddDevice() calls libinput_path_add_device()
   which returns NULL on failure, then immediately passes the result to
   libinput_device_ref() without checking.  On laptops, virtual input
   devices (power buttons, lid switch, etc.) appear and disappear in
   /dev/input/ triggering the hotplug handler; if libinput can't open
   one of these, the NULL return causes the segfault.

2. Missing cleanup on device removal: The IN_DELETE handler erased
   devices from the map without calling libinput_path_remove_device(),
   leaving dangling pointers in the libinput context.

3. Thread safety: libinput_devices_ was accessed from 3 threads
   (main/GTK, libinput_thread_, hotplug_thread_) without any mutex.

Fixes #4851

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 11:57:23 +01:00
Alexey Vladimirov
3bcadfdf5a battery: power switch events 2026-02-12 01:42:30 +03:00
BlueManCZ
a871d90161 Fix button action handling to consistently use the active player 2026-02-11 12:09:20 +01:00
BlueManCZ
0a50e82d0d Prioritize currently playing player 2026-02-11 11:47:05 +01:00
BlueManCZ
a69b7a5536 Handle fallback player for ignored MPRIS players 2026-02-11 10:53:48 +01:00
Prakhar Chhalotre
bd222984bb fix: remove unnecessary console log for battery status 2026-02-11 01:12:21 +05:30
Austin Horstman
3b478ee6a5 chore: format
Some unrelated files failed formatting.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-09 15:53:44 -06:00
Austin Horstman
c9a7cbbdb3 fix(image): treat missing interval as once
PR #4390 enabled millisecond intervals but changed image interval parsing so a missing interval could resolve to 1ms. That creates a hot update loop and can spike CPU and destabilize rendering in drawer/group setups (issue #4835).

Use explicit semantics: missing, null, non-numeric, or <=0 interval is treated as "once" (max sleep), while positive numeric values still support ms precision with a 1ms floor. This keeps the intended feature (sub-second polling when requested) without defaulting to busy looping.

Also align waybar-image(5) docs with runtime behavior.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-09 15:27:35 -06:00
Prakhar Chhalotre
f96fb53eeb feat: add tooltip in format replacments 2026-02-10 01:00:07 +05:30
Prakhar Chhalotre
7e6da1adb2 fix: update tooltip method to use pango markup formatting 2026-02-09 00:16:11 +05:30
Alexis Rouillard
dad6e8a257 Merge pull request #4812 from Alexays/copilot/fix-tooltip-sync-issue
Fix custom module tooltip not updating on exec output change
2026-02-04 10:12:20 +01:00
Alexis Rouillard
98c2ace0ec Merge pull request #4813 from Alexays/copilot/fix-bluetooth-module-issue
Fix Pango markup rendering in bluetooth module tooltips
2026-02-04 10:11:18 +01:00
copilot-swe-agent[bot]
2b29c9a5d6 Fix tooltip sync issue by removing conditional checks
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-04 09:08:42 +00:00
Alexis Rouillard
08baa3fd40 Merge pull request #4808 from Alexays/copilot/fix-corrupted-double-linked-list
Fix heap corruption from GTK operations on IPC thread in Hyprland modules
2026-02-04 10:08:13 +01:00
copilot-swe-agent[bot]
717cc4a4d1 Fix Pango markup rendering in bluetooth module tooltip
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-04 09:07:46 +00:00
Alexis Rouillard
4c5167083d Merge pull request #4809 from Alexays/copilot/fix-unhandled-exception
Fix unhandled JSON exception in signal handler
2026-02-04 10:04:16 +01:00
Alexis Rouillard
7261d00c31 Merge pull request #4810 from Alexays/copilot/fix-waybar-crash-pango
Fix Pango NULL layout crash in cava module
2026-02-04 10:03:11 +01:00
copilot-swe-agent[bot]
da8fd864c6 Simplify mutex locking in WindowCount module
- Acquire lock once at start of update() and hold for entire function
- Remove redundant lock from queryActiveWorkspace() since it's only called from update()
This addresses code review feedback and makes the locking strategy clearer

Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-04 08:57:53 +00:00
copilot-swe-agent[bot]
0a8b7b096a Simplify fix: only add isInt() check in refresh methods
Changed approach per maintainer feedback - instead of caching signal values,
just add isInt() check before accessing config_["signal"].asInt() in refresh()
methods. This is simpler and more minimal.

Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-04 08:57:08 +00:00
copilot-swe-agent[bot]
c1240a98aa Fix mutex locking in WindowCount module
Ensure workspace_ accesses are properly protected by mutex after queryActiveWorkspace call

Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-04 08:56:17 +00:00
copilot-swe-agent[bot]
330c77c87a Fix thread safety in Hyprland modules to prevent corrupted double-linked list crash
- Move GTK operations from IPC thread to GTK main thread in Window module
- Move GTK operations from IPC thread to GTK main thread in WindowCount module
- Move GTK style class operations from IPC thread to GTK main thread in Submap module
- Language and Workspaces modules already safe (only update internal state)

Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-04 08:54:36 +00:00
copilot-swe-agent[bot]
03de38b4d0 Fix Pango NULL layout crash by clearing markup before hiding label
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-04 08:54:32 +00:00
Alexis Rouillard
1466ca8bef Merge pull request #4729 from xav-ie/fix-cava-audio-height-init
fix-cava-audio-height-init
2026-02-04 09:54:00 +01:00