Commit Graph
448 Commits
Author SHA1 Message Date
Alex 6294ed2520 fix(hyprland/language): apply the CSS class on the main thread
onEvent() runs on the Hyprland IPC listener thread and mutated the label's
style context (add/remove class) directly, racing the GTK main thread's
drawing and corrupting the heap (double free / corrupted double-linked list).
Follow the Submap pattern: onEvent only stores the layout under the mutex and
emits the dispatcher; update() swaps the CSS class on the main thread, tracking
the previously applied class.

Fixes #4665
2026-07-05 23:06:37 +02:00
Alex 74cf45d530 fix(hyprland): detect Lua protocol without side-effecting dispatch
isLuaProtocol() probed the protocol by sending a real
"dispatch workspace __waybar_probe__". On Hyprland < 0.54 "workspace"
is a valid dispatcher, so the probe actually switched the user to a junk
workspace named __waybar_probe__ on the first workspace click/scroll.

Detect the protocol with the read-only "version" IPC query instead:
parse the numeric "version" field (falling back to the always-present
"tag" field) and treat Hyprland >= 0.54 as Lua. This has no side
effects. On any parse/query failure we log and fall back to the legacy
protocol, preserving prior behavior for older versions.
2026-07-05 10:13:24 +02:00
Alex 30dcd7a7ca fix(hyprland/workspaces): own debounce timer on main thread, fix UAF
The debounce timer added for flicker prevention was armed from the IPC
listener thread via Glib::signal_timeout().connect(), while its timeout
lambda and the m_updatePending flag ran on the GTK main thread — an
unsynchronized cross-thread data race on GLib timer/main-loop state.
Additionally ~Workspaces() never disconnected the timer, so a pending
timeout could fire on a freed 'this' (use-after-free).

Restore the pre-refactor threading model: onEvent now only mutates state
under m_mutex on the IPC thread and calls dp.emit() (Glib::Dispatcher is
thread-safe). The debounce timer is owned entirely by the main-thread
update() path, which arms/re-arms it on each dispatch and coalesces
bursts into a single refresh. ~Workspaces() disconnects the timer
(guarded) so none outlives the object. Debounce behavior is preserved.
2026-07-05 10:13:24 +02:00
Alex 5c06233340 style: clang-format the crash-fix changes 2026-07-04 03:17:33 +02:00
Alex 4eb2513cc0 fix(hyprland/language): pass named args in format-<lang> branches
The format-<short_description>[-<variant>] override branches only passed a
positional arg, so a format using {short}/{long}/{variant} threw 'argument
not found', which disabled the whole module. Now supply the same named args
as the fallback/tooltip branches. Fixes #5120.
2026-07-04 03:09:20 +02:00
AlexandClaude Opus 4.8 f72f84e011 fix: backward-compat + bug fixes and man-page build fix for 0.16.0
Post-0.15.0 review of the 0.15.0..HEAD range surfaced regressions and
bugs. This restores backward compatibility for existing configs/CSS,
fixes confirmed defects, and repairs the scdoc man-page build break on
master. Pango-markup tooltips are intentional and were kept.

Backward-compat restorations:
- AModule: honor legacy numeric Gdk::CursorType cursor values (int overload)
- memory: correct GiB divisor (was ~2.3% low); round bare {} placeholders
- wireplumber: scale max-volume into the linear domain so the cap works again
- idle_inhibitor: gate right/middle-click deactivate & scroll on dynamic-timeouts;
  accept both dynamic-timeout(s); widen timeout to double (no fractional truncation)
- custom: keep #custom-<name>.<class> CSS selectors working (classes on box_)
- image: don't wordexp-split a single path; fall back to the literal path
- niri/window: restore hide-when-empty (new show-empty opt-in); escape tooltip
- wlr/taskbar: plain-text tooltip when markup is disabled

Bug fixes:
- tray: fix use-after-free in onAdd; guard the watcher retry timeout
- hyprland: clamp max-windows iterator (OOB); drop duplicate language tooltip block
- niri/window: supply {col}/{max_col} args in the empty branch (fmt::format_error)
- mpris: escape {dynamic}/{player} tooltip; fix dangling player; albumArtist source
- mango: fix use-after-free race (dispatch under callback_mutex_)
- mpd: contain throwing checkErrors in noexcept idle paths (no std::terminate/UAF)
- keyboard_state: always render every lock label, with guarded defaults
- bluetooth: bound GATT ReadValue timeout, opt-in + services-resolved gating,
  preserve authoritative Battery1 percentage
- wireplumber: fix WpDevice reference leak / NULL handling
- battery, clock, dwl, wayfire, graph, custom_graph, transform, river: assorted
  crash/logic fixes

Man page / build:
- niri-workspaces: fix scdoc "indented by an amount greater than 1"
  (workspace-taskbar sub-options were mis-indented; breaks man-page build)
- document new show-empty (niri/window); correct network {txBitrate}/{rxBitrate}

Not compiled locally (no gtkmm on this host); C++ build relies on CI.
Man pages validated with scdoc 1.11.4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-04 02:14:13 +02:00
Emiliano Deustua 5f7629a36e format: Fix clang formatting 2026-07-04 01:42:54 +02:00
Emiliano Deustua 95664c7662 fix: Remove load persistent workspaces from workspace rules 2026-07-04 01:42:54 +02:00
Emiliano Deustua 7c86f1ccb4 fix: Use workspace ID to handle workspace updates 2026-07-04 01:42:54 +02:00
Alexis Rouillard 37dbd59dac Merge pull request #3017 from 0x000C0A71/master
[hyprland/workspaces] Add tooltips to hyprland/workspaces
2026-07-04 01:12:10 +02:00
Alexis Rouillard 78b9a38532 Merge pull request #4320 from LoricAndre/master
feat(hyprland/workspaces): add uniqueIcons option
2026-07-04 01:12:05 +02:00
Alex 8276f6a629 Merge remote-tracking branch 'origin/master' into pr-3017
# Conflicts:
#	include/modules/hyprland/workspaces.hpp
#	man/waybar-hyprland-workspaces.5.scd
#	src/modules/hyprland/workspaces.cpp
2026-07-04 00:55:38 +02:00
Alexis Rouillard 24dba2bb24 Merge pull request #4694 from whymusticode/max-icons
feat(hyprland/workspaces): add deduplication and max-icons option to workspace-taskbar
2026-07-04 00:55:34 +02:00
Alex 05f32172df Merge remote-tracking branch 'origin/master' into pr-4320
# Conflicts:
#	include/modules/hyprland/workspaces.hpp
#	man/waybar-hyprland-workspaces.5.scd
#	src/modules/hyprland/workspace.cpp
#	src/modules/hyprland/workspaces.cpp
2026-07-04 00:51:21 +02:00
Alexis Rouillard 3cd93d849f Merge pull request #5032 from yyyumeniku/master
hyprland/workspaces: add debounce timer to prevent workspace button f…
2026-07-04 00:42:04 +02:00
Alex 08e457e3cd Merge remote-tracking branch 'origin/master' into pr-4694
# Conflicts:
#	src/modules/hyprland/workspace.cpp
2026-07-04 00:41:50 +02:00
Alexis Rouillard 15fd0b6c5d Merge pull request #4772 from szbmrk/feat-hyprland-submap-icon-handling
feat(hyprland/submap): add config option to specify different icons for submaps
2026-07-04 00:41:11 +02:00
Alexis Rouillard a3101a1ca0 Merge branch 'master' into feat-hyprland-submap-icon-handling 2026-07-04 00:32:12 +02:00
Alexis Rouillard 423ca224f5 Merge branch 'master' into master 2026-07-04 00:32:08 +02:00
Alex da562a9172 Merge remote-tracking branch 'origin/master' into refactor/generic-tooltip
# Conflicts:
#	src/modules/wireplumber.cpp
2026-07-04 00:29:26 +02:00
Alex db4941efe7 refactor(tooltip): migrate modules to ALabel generic tooltip helper
Migrate idle_inhibitor, sway/language, sway/scratchpad,
hyprland/language and hyprland/window to the shared label/tooltip
setters. idle_inhibitor uses updateLabelAndTooltipForState; the others
keep their custom label/tooltip resolution (trim, precomputed tooltip,
rewriteString, per-lang/variant formats) and switch to the dedup-aware
setLabelMarkup/setTooltipMarkup.
2026-07-04 00:00:15 +02:00
Alex e792ed8f85 Merge remote-tracking branch 'origin/master' into pr-4861
# Conflicts:
#	src/modules/hyprland/workspace.cpp
2026-07-03 23:51:19 +02:00
Alexis Rouillard 41191802f1 Merge pull request #4994 from GlassyBridge/master
feat (hyprland/workspaces): support for state specific icon overrides
2026-07-03 23:03:05 +02:00
Alexis Rouillard fffb4b3159 Merge pull request #5012 from yihangwu539-png/feat/language-tooltip
feat(language): add tooltip support with configurable tooltip-format
2026-07-03 23:00:06 +02:00
Alexis Rouillard 2f6720c053 Merge pull request #4981 from xiyori/max-windows
Add max-windows option to hyprland/workspaces
2026-07-03 22:58:37 +02:00
Alexis Rouillard 8c4787bd88 Merge pull request #4529 from dimti/hyprland-language-class
Add css class to hyprland language module of short_name language code
2026-07-03 22:58:31 +02:00
Alexis Rouillard 3033e15868 Merge pull request #4958 from v-dermichev/feature/workspace-name-css-class
feat (hyprland/workspaces): expose workspace name as CSS class
2026-07-03 22:52:06 +02:00
Alexis Rouillard 5ff20943a9 Merge branch 'master' into hide-active 2026-07-03 22:22:24 +02:00
Alexis Rouillard 93db40b829 Merge branch 'master' into master 2026-07-03 22:22:21 +02:00
Alexis Rouillard 22441ea8f6 Merge branch 'master' into master 2026-07-03 22:22:19 +02:00
Alexis Rouillard 4700f2b423 Merge branch 'master' into max-windows 2026-07-03 22:22:16 +02:00
Alexis Rouillard 96696d0ec4 Merge branch 'master' into feat/language-tooltip 2026-07-03 22:22:14 +02:00
Alexis Rouillard 8ec7bd0939 Merge branch 'master' into hyprland-language-class 2026-07-03 22:22:11 +02:00
Alexis Rouillard 57689fe96b Merge branch 'master' into feature/workspace-name-css-class 2026-07-03 22:21:54 +02:00
Alexis Rouillard 9735efec5d Merge pull request #4353 from shibjyoti555/feature/if-empty
added a "fallback" option to hyprland/window when no window in focus
2026-07-03 22:04:05 +02:00
Alex 25e57bc625 fix(hyprland/window): use 2-space indentation for fallback block (clang-format) 2026-07-03 21:51:20 +02:00
Alex 4bba01c258 Merge remote-tracking branch 'origin/master' into feature/if-empty 2026-07-03 21:49:04 +02:00
Alexis Rouillard e852360106 Merge branch 'master' into refactor-bool-cleanup 2026-07-03 21:47:49 +02:00
Alexis Rouillard ee9737bf94 Merge pull request #4692 from aaronred345/hyprland-special-workspaces-multi-monitor
fix(hyprland/workspaces) Special Workspace Multi-Monitor Support
2026-07-03 21:46:43 +02:00
Alex 806f633318 hyprland/workspaces: refresh locally instead of reloading Hyprland config
Replace the getSocket1JsonReply("reload") call in onSpecialWorkspaceActivated
with the module's normal local refresh path: the state update to
m_activeSpecialWorkspaceName is picked up by the update() render (triggered by
the dp.emit() already issued at the end of onEvent), which re-evaluates active
state, icons and CSS classes. This avoids reloading the entire Hyprland config
on every special workspace activation while keeping the special-active icon and
CSS improvements.
2026-07-03 21:38:46 +02:00
Alex 9930c7be8a Merge remote-tracking branch 'origin/master' into hyprland-special-workspaces-multi-monitor 2026-07-03 21:37:55 +02:00
Alex dc017d8fd3 fix(hyprland/workspaces): disconnect hover-check timeout on Workspace destruction
The hover-check Glib::signal_timeout re-arms every 50ms and is not owned by
the Workspace. Since Workspaces are destroyed at runtime, a workspace removed
while its check is armed would let the timeout fire on freed memory (use-after-
free, also touching the destroyed m_button). Add a destructor that calls
stopHoverCheck() to disconnect the source.
2026-07-03 21:32:55 +02:00
Alex 987d5758a6 Merge remote-tracking branch 'origin/master' into fix/hyprland-workspace-taskbar-hover 2026-07-03 21:32:20 +02:00
Alexis Rouillard 8b5f5b3aea Merge pull request #5155 from Alexays/fix/hyprland-language-keyboard-name-commas
fix(hyprland/language): handle commas in keyboard-name config
2026-07-03 21:23:06 +02:00
Alexis Rouillard 1f2394aa78 Merge pull request #3698 from vpcano/hyprland-language-tooltip
Add tooltip functionality on hyprland/language module
2026-07-03 21:20:16 +02:00
Alex 6793b97eed fix(hyprland/language): handle commas in keyboard-name config
The active-layout event payload is `KEYBOARDNAME,LAYOUT`, and kbName was
taken as everything before the first comma. Keyboard names reported by
Hyprland can themselves contain commas (e.g. some MSI keyboards), so a
`keyboard-name` configured with a comma never matched the truncated value
and the module stopped updating.

Match the configured keyboard-name as a full prefix (followed by the ','
separator) instead. Layout parsing already handles commas via the
last-comma-before-parenthesis heuristic, so only the keyboard-name filter
needed fixing.

Addresses the keyboard-name case originally reported by @tirsek in #3406.
2026-07-03 21:15:35 +02:00
Alex f158f29acf Merge remote-tracking branch 'origin/master' into hyprland-window_no_title_from_special
# Conflicts:
#	src/modules/hyprland/window.cpp
2026-07-03 21:06:18 +02:00
Alex 6de8871882 Merge remote-tracking branch 'origin/master' into hyprland-language-tooltip
# Conflicts:
#	man/waybar-hyprland-language.5.scd
2026-07-03 21:01:53 +02:00
Alexis Rouillard fd81ff299e Merge pull request #4753 from The-Robin-Hood/master
hyprland/workspaces persistent fix and improve cursor handling configuration
2026-07-03 21:00:47 +02:00
Alexis Rouillard 1143444561 Merge pull request #5061 from buzz/fix/hyprland-workspaces-scroll
fix(hyprland): support custom scroll commands
2026-07-03 20:59:12 +02:00