Commit Graph

1194 Commits

Author SHA1 Message Date
d046c19b85 systemd-failed-units: small tweaks
- Remove unneeded destructor impl
- Rename member variables for consistench with other files
- manpage wording fixes
- updateData(): small logic tweak
2026-03-17 21:34:59 +00:00
100349a5c7 Merge pull request #4910 from khaneliman/hyprland
fix(hyprland): misc hardening with ipc socket and events
2026-03-08 22:21:40 +01:00
f6d92fd708 fix(sni): render attention and overlay tray icon assets
Load attention and overlay pixmaps from item properties, watch the
corresponding update signals, and prefer attention artwork while an item is in
NeedsAttention state.

When an item only exports an attention movie asset, fall back to loading that
asset as a static pixbuf so the tray still shows the alert state.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-08 01:42:31 -06:00
2a748f1a56 fix(sni): delay tray item insertion until proxies are ready
Only add tray widgets after the SNI proxy has finished initializing and the
item has a valid id/category pair.

This also removes invalid items through the host teardown path, refreshes the
tray when item status changes, and avoids calling DBus methods through a null
proxy during early clicks or scroll events.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-08 01:20:15 -06:00
dd47a2b826 fix(hyprland/workspaces): stabilize reload and event handling
Hyprland workspace reloads could stack duplicate scroll-event connections,
causing a single wheel gesture to switch multiple workspaces after repeated
config reloads. The persistent-workspaces monitor-array form also created the
monitor name instead of the configured workspace name.

Disconnect and replace the scroll handler on reinit, fix the persistent
workspace name selection, normalize urgent-window address matching, and reject
malformed workspace payloads before they corrupt the local state machine.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-07 21:06:30 -06:00
b1a87f943c fix(hyprland/window): avoid stale state during IPC refresh
The window module re-entered the same shared_mutex while refreshing IPC state:
update() took the lock and then called queryActiveWorkspace(), which tried to
lock it again. That is undefined behavior for std::shared_mutex and could
manifest as a deadlock.

Remove the recursive lock path and reset the derived window state before each
IPC refresh. That keeps solo/floating/swallowing/fullscreen classes from
sticking around when the client lookup fails or a workspace becomes empty.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-07 21:06:30 -06:00
790101f824 chore: format
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-06 18:49:02 -06:00
22b2aff374 Merge pull request #4900 from AlisonB319/ab319/fix-hover-2
fix: sync tooltip updates without resetting hover state
2026-03-04 22:42:16 +01:00
100d4ec4a4 Merge pull request #4891 from khaneliman/bugfix/stab-003-test-001-hyprland-ipc
fix(hyprland-ipc): harden fd lifecycle and listener loop
2026-03-04 22:41:30 +01:00
b31292dee2 Merge pull request #4898 from khaneliman/memory
perf(memory): optimize string operations; remove deep copies, memdup, and icon theme rescanning
2026-03-04 22:40:55 +01:00
3eb2c7e8f4 sync tooltip updates without resetting hover state 2026-03-03 00:24:04 -08:00
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
5e7dbf1715 fix(command): return non-zero when child exec fails
Child exec failure paths were returning success, which masked command launch
errors from callers.

I switched the child-side failure exits to _exit(127) and added errno-specific
logging so failures propagate with actionable diagnostics.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 08:41:43 -06:00
8d22d3e07a refactor(sway): use shared ScopedFd for IPC sockets
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 08:23:06 -06:00
39e09118f9 refactor(wayfire): replace custom Sock with shared ScopedFd
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 08:21:20 -06:00
6dfe1c3111 feat(util): add ScopedFd RAII utility for file descriptors
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 08:21:12 -06:00
d0363313b8 fix(hyprland-ipc): harden fd lifecycle and listener loop
Hyprland IPC had fd lifecycle risks on failure/shutdown paths and used a
spin-sleep listener model.

I initialized fd state defensively, tightened connect/close/shutdown handling,
moved to blocking read with newline framing, and added RAII-style fd cleanup in
socket1 reply paths.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 08:09:44 -06:00
fd086d0f33 Merge pull request #4890 from khaneliman/bugfix/perf-001-safe-signal-bounded-queue
fix(util): bound SafeSignal queue growth under burst load
2026-03-01 18:19:25 +01:00
e4ff024fa8 fix(util): bound SafeSignal queue growth under burst load
SafeSignal could queue events forever when worker threads emitted faster than
the main loop could consume, which risks memory growth and stale updates.

I added a queue cap with a drop-oldest policy so growth stays bounded under
burst load, plus a regression test that validates bounded delivery.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-28 22:57:49 -06:00
44eed7afea fix(sleeper-thread): synchronize control flags with atomics
SleeperThread control flags were shared across threads without consistent
synchronization.

I converted the run/signal flags to atomics and updated wait predicates and
lifecycle transitions to use explicit atomic loads/stores.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-28 22:47:52 -06:00
dbbad059f7 fix(sleeper-thread): stop and join before worker reassignment
Reassigning SleeperThread could replace a joinable std::thread and trigger
std::terminate.

I now stop and join any existing worker before reassignment, then reset control
state before starting the replacement worker.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-28 22:28:22 -06:00
ef3d55980e fix: some crashes 2026-02-24 00:49:08 +01:00
e18939210b fix: lint 2026-02-24 00:00:57 +01:00
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
4aa8f98552 Merge pull request #4821 from cebem1nt/group-scroll-cutout
fix: owerwrite handleScroll to remove any scrolling handling from group
2026-02-23 23:46:02 +01:00
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
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
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
5b595a4dfe hyprland/workspaces: Add enable-bar-scroll option 2026-02-13 20:48:59 +01:00
a70651ed05 fix: use SafeSignal in ipc 2026-02-12 18:11:30 +01:00
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
a871d90161 Fix button action handling to consistently use the active player 2026-02-11 12:09:20 +01:00
3b478ee6a5 chore: format
Some unrelated files failed formatting.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-09 15:53:44 -06:00
f373ebfcbb Fix include of poll.h 2026-02-08 13:32:41 +01:00
40200afb68 fix: owerwrite handleScroll to remove any scrolling handling from group module 2026-02-06 14:43:12 -03:00
26c09f1e2e Merge pull request #4814 from Alexays/copilot/fix-menu-freeze-issue
Fix menu freezing when launching applications
2026-02-04 10:33:52 +01:00
65e708779b Fix function overload order to resolve compilation error
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-04 09:26:20 +00:00
04766452b4 Use idiomatic empty() check for strings
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-04 09:15:25 +00:00
c4982efa95 Add output_name parameter to forkExec for WAYBAR_OUTPUT_NAME env var
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
2026-02-04 09:14:45 +00:00
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
47fb21a2c1 chore: upgrade to clang-format@21 2026-02-04 09:24:14 +01:00
1639dec7d8 fix(json): use local CharReaderBuilder for thread safety 2026-01-24 23:40:07 +02:00
e3186abdce fix(cava): handle all output methods in frontend
Default to raw Cava module for non-GLSL output methods.
Fixes "Unknown module" error when no cava_config is specified.
2025-12-27 14:52:28 -05:00
c3d29b1185 Merge branch 'master' into battery-plugging-instant-updates 2025-12-18 19:04:31 +01:00
11c4e55376 Merge pull request #4591 from rrrnld/fix/multiple-batteries
Improve multiple battery support
2025-12-18 19:02:31 +01:00
374ccbb878 Merge pull request #4705 from rwwiv/fix/duplicate-layers-on-monitor-hotplug
fix: prevent duplicate layer surfaces on monitor hotplug
2025-12-18 19:00:48 +01:00
a9ef11a2b3 fix: prevent duplicate layer surfaces on monitor hotplug
The monitor signal handlers (signal_monitor_added, signal_monitor_removed)
were never disconnected during SIGUSR2 reload. Each reload accumulated
additional handlers, causing multiple layer surfaces to be created when
monitors were hotplugged.

This fix:
- Stores signal connections as class members
- Disconnects them before reconnecting in bindInterfaces()
- Clears stale outputs_ on reload
2025-12-17 22:17:35 -05:00
e03119fe94 Factory. cava_frontend 2025-12-09 18:13:45 +03:00
3773021546 cavaGLSL 2025-12-07 23:08:55 +03:00
52f4db1154 Moving GTK dispatcher into frontend 2025-12-05 10:04:52 +03:00