Commit Graph
4717 Commits
Author SHA1 Message Date
Siriusuna 81fd9ee4ab fix(mpd): truncate before sanitization and improve tooltip UX
Fix an issue in the MPD module where text failed to render
when raw tags containing markup characters were truncated
mid-sequence after sanitization,
resulting in fragmented XML entities (such as `&` cut into `&am`).

Resolve this by shifting the order of operations to
truncate the raw strings *before* running `sanitize_string`.
To keep `setLabel` decoupled and clean,
we introduce helper methods (`getArtistStr`, `getAlbumArtistStr`,
`getAlbumStr`, `getTitleStr`) inside the `MPD` class,
matching the architectural style of MPRIS.

Additionally:
- Introduce support for the customizable `ellipsis` config option
  (defaulting to `…`).
- Switch the truncation logic of the MPD module to be
  visual-width-aware using the newly extracted
  `waybar::util::utf8_truncate`.
- Decouple the tooltip text from the main label's truncated text.
  The tooltip now displays un-truncated, complete metadata
  (properly escaped), providing a significantly better user
  experience.
2026-05-22 03:15:26 +08:00
Siriusuna 435c212be1 fix(mpris): escape Pango markup in tooltip
Fix an issue where the mpris module's tooltip failed to render
when track metadata contained unescaped XML/HTML markup characters.

This occurred because
the mpris module formatted raw strings into the tooltip template
before passing the final string directly to `set_tooltip_markup()`,
triggering GTK/Pango parsing warnings and rendering failures.

Resolve this by wrapping tooltip metadata fields
in `Glib::Markup::escape_text` before formatting,
ensuring Pango-compliant strings are always delivered to the GTK
tooltip markup.
2026-05-22 02:59:09 +08:00
Siriusuna f8cc7173ca refactor: extract utf8 truncation logic to utility
Move the UTF-8 visual-width measurement and truncation helper functions
from the mpris module to a common utility
(include/util/utf8_string.hpp and src/util/utf8_string.cpp).

This decouples string truncation and width measurement
from the mpris module, allowing other modules (like mpd) to reuse.
The helper function `utf8_truncate` (formerly `truncate` in mpris)
and `utf8_width` is exported under the `waybar::util` namespace,
while the low-level `measure_and_truncate` (formerly `utf8_truncate`)
is encapsulated in an anonymous namespace in src/util/utf8_string.cpp
to avoid unnecessary API exposure.

No functional changes were made to the mpris module's behavior.
2026-05-22 02:52:40 +08:00
buzz 85163c6847 fix(hyprland/workspaces): replace EventBox with Button for taskbar windows 2026-05-21 18:50:43 +02:00
buzz ea36aab3ba docs(hyprland/workspaces): add on-scroll-up and on-scroll-down to man page 2026-05-21 17:34:07 +02:00
buzz eb3b86c4d8 fix(hyprland/workspaces): support on-scroll-up and on-scroll-down config options
The handleScroll method unconditionally dispatched workspace cycling commands
and never checked for custom on-scroll-up/on-scroll-down config values.

Register the scroll handler when custom scroll commands are configured (even
without enable-bar-scroll), and delegate to AModule::handleScroll so user
commands are executed, matching the pattern used by other modules.
2026-05-21 17:02:39 +02:00
Ezequiel Colunga AchaandCursor fcf1fb798c fix(wlr/taskbar): let task titles shrink within available space
The taskbar currently requests enough width for every task title, which can push right-side modules off-screen when many windows are open. Allow task buttons to share the taskbar allocation and ellipsize title labels instead of forcing the whole module to grow.

This keeps neighboring modules visible while preserving the existing taskbar click actions and formatting behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-20 15:06:41 -03:00
Francois Lachese 876eaaf70f fix(amodule): prevent crash when cursor timeout fires after destruction 2026-05-20 15:57:38 +02:00
finitemonkey 0351ac8fb2 Additional options when muted for the PulseAudio-Slider module:
- Add "muted" class for styling the muted state.
- Add "zero-on-mute" boolean option to control slider position
  when muted.
- Add "unmute-on-volume-change" boolean option to control whether
  to automatically unmute when the volume changes.
2026-05-17 08:22:17 +01:00
Adam Druzd ff76e96786 fix(hyprland): keep workspace hover over taskbar icons 2026-05-17 09:12:08 +02:00
Desuwa 7e2afaa5b3 fix: mpd specify timer interval in seconds 2026-05-16 14:05:17 -07:00
Tom Benham 40c9d92e3d test(hyprland): fix dispatch test 2026-05-16 21:29:43 +02:00
Tom Benham cdb792af41 fix(hyprland/workspaces): fix IPC call when using "move-to-monitor": true 2026-05-16 18:03:09 +02:00
Milad Alizadeh 0ec6d06472 Guard set_current_layout against unknown layout names (wtype, hot-plugged
devices) so transient events stop blanking layout_. Refresh layouts_map_
on "added"/"xkb_keymap" input events and union layouts across all
keyboards so new devices contribute their layouts. Release mutex_ before
the refresh sendCmd to avoid self-deadlock from the synchronous
signal_cmd emit.
2026-05-15 17:29:21 +01:00
Jérémie Rodon 5c3ec1fd63 fix(tray): hide module when no items are visible
Tray::update() already had logic to hide the module when all child items were passive, but it was only re-run on item add/remove — never on a status change. When the last visible item transitioned to Passive, the item hid itself but the now-empty module remained visible.

Connect Tray to each item's Gtk::EventBox signal_show/signal_hide so update() runs on every visibility transition, and simplify update() to check child->get_visible() directly instead of inspecting the `passive` CSS class. The Tray-level `show-passive-items` read becomes redundant since Item already honours it when deciding its own visibility; remove it along with the now-unused Tray::show_passive_ member.

Fixes: #3721
2026-05-11 22:47:24 +02:00
Mint c5f834b881 Merge branch 'Alexays:master' into master 2026-05-10 11:02:22 -03:00
Alexis Rouillard 05945748dc Merge pull request #5013 from higorprado/fix/hyprland-lua-dispatch-protocol
fix(hyprland/workspaces): adapt dispatch commands for Lua IPC protocol
2026-05-04 23:17:38 +02:00
Alexis Rouillard 4c105f7cd7 Merge pull request #5007 from nschloe/toctou-fixes
Various toctou fixes
2026-05-03 13:27:52 +02:00
Higor Prado 97917db593 test(hyprland): expose dispatch internals for unit tests
Move buildLuaDispatch and isLuaProtocol from private to
protected/public so IPCTestHelper can access them.

Add 7 tests covering all buildLuaDispatch branches, dispatch
error path, and isLuaProtocol cache behavior.
2026-05-02 20:25:43 -03:00
Higor Prado e17c0d9f0a fix(hyprland/workspaces): adapt dispatch commands for Lua IPC protocol
Hyprland 0.54 replaced the text-based dispatch socket protocol with a
Lua-based one. Commands like "dispatch workspace 1" are now interpreted
as invalid Lua (return hl.dispatch(workspace 1)), breaking workspace
clicks and scroll navigation.

Add IPC::dispatch() that probes the running Hyprland on first call and
routes commands through the new hl.dsp Lua API when the Lua protocol is
detected, falling back to the old text format otherwise.
2026-04-29 16:41:11 -03:00
Neltharion a66d6b1596 Do not reconnect if connection was refused
Otherwise, it will try to reconnect recursively
2026-04-29 03:40:06 +03:00
Evans 255f17d13c battery: guard _exists = true assignment inside if condition 2026-04-28 04:53:19 +00:00
Nico Schlömer 5af324f375 two more toctou bugs 2026-04-27 11:41:09 +02:00
Nico Schlömer 59d09c2c12 fix various toctou bugs in battery.cpp 2026-04-27 11:29:03 +02:00
Alexis Rouillard cca8dc38b6 Merge pull request #4990 from B2krobbery/fix-sni-make-unique
fix(sni): use std::make_unique for Item allocation
2026-04-22 20:50:48 +02:00
cebem1nt ab7bc8de1c feature: group - add reveal-delay config option for drawer 2026-04-18 13:34:29 -03:00
Volker Schlecht 29979e9227 Fix build for systems without SIGRTMIN/SIGRTMAX 2026-04-17 19:35:31 +02:00
Volker Schlecht 729dbbb82e Fix build for systems without SIGRTMIN/SIGRTMAX 2026-04-17 19:33:27 +02:00
Volker Schlecht bd39795f80 Fix build for systems without SIGRTMIN/SIGRTMAX 2026-04-17 19:31:59 +02:00
Volker Schlecht 0241d0eac6 Remove redefinition or SIGRTMIN/SIGRTMAX for OpenBSD 2026-04-17 19:27:39 +02:00
B2krobbery 7e9c46e4d1 fix(sni): use std::make_unique for Item allocation 2026-04-16 18:34:39 +05:30
Mervius e2d608e7fd Check if output still is in outputs before doing anything with it 2026-04-15 10:59:03 -05:00
Mervius d9b5d24284 Check if output still is in outputs before doing anything with it 2026-04-15 10:55:49 -05:00
Mervius 09b6df37ca Check if output still is in outputs before doing anything with it 2026-04-15 10:39:21 -05:00
Mervius 8b5b1eebbf Check if output still is in outputs before doing anything with it 2026-04-15 10:35:26 -05:00
Alexis Rouillard 3a321d934d Merge pull request #4982 from Mrpaoo/bug-fix
fix the io failure for hotplug-in device
2026-04-13 11:02:50 +02:00
yubo ac62754b28 fix the lint problem 2026-04-11 13:26:50 +08:00
Mervius efd245b552 Fix timeout with multiple monitors 2026-04-10 11:42:23 -05:00
Visal Vijay a8a46d1f1e Refactor: simplify complex conditional expressions in Hyprland workspace module 2026-04-09 19:40:05 +05:30
yubo 906a589715 fix the io failure for hotplug-in device 2026-04-09 21:20:45 +08:00
Alexis Rouillard 202ae4bd5f Merge pull request #4975 from pix-code/master
memory: feature - add "unit" config option
2026-04-07 12:45:24 +02:00
Alexis Rouillard 6acc94ca37 Merge pull request #4967 from argentite/net-addr-del-fix
Network: fix: delete correct address type
2026-04-07 12:45:07 +02:00
Alexis Rouillard 66c09bc5b7 Merge pull request #4964 from adrianlzt/fix/network-bandwidth-event-race
fix(network): prevent near-zero bandwidth on rapid event-driven updates
2026-04-07 12:41:31 +02:00
Alexis Rouillard c30d4ce3e6 Merge pull request #4970 from B2krobbery/fix-group-module-leak
fix(bar): ensure exception safety for group module allocation
2026-04-07 12:39:42 +02:00
Alexis Rouillard cead1a0543 Merge pull request #4973 from cebem1nt/group-ref-fix
Group ref fix
2026-04-07 12:38:44 +02:00
Duke B fc11789a4f add unit config option to memory module 2026-04-05 19:01:36 -04:00
cebem1nt ae11954398 fix: ensure passing group_config as reference 2026-04-04 22:11:19 -03:00
Visal Vijay 36518e4eca fix(bar): ensure exception safety when creating group modules using std::unique_ptr 2026-04-03 19:47:17 +05:30
Anubhab Ghosh 16886117b3 Network: fix: delete correct address type
Only delete the corresponding address type (IPv4 or IPv6) when an event
about a specific type (AF_INET or AF_INET6) is received

This fixes situations where only one type of the address is deleted (and
possibly added again) but Waybar still thinks the interface is in
"linked" (no IP) state.
2026-04-02 19:54:19 +05:30
cebem1nt 8b1e574063 niri/workspaces: feature - add "hide-empty" config option (#4965) 2026-03-31 17:49:30 -03:00