Commit Graph
23 Commits
Author SHA1 Message Date
Alexis Rouillard 6f1d9d754e Merge branch 'master' into niri-language-hide 2026-07-03 21:47:57 +02:00
Jason Chiu fb829c8a8e ## fix(niri/workspaces): crash (segfault) when setting workspace button markup
### Problem
Waybar segfaults on startup when `niri/workspaces` is the only configured
module (default options). Right after the first `WorkspacesChanged` event:
 
    Thread 1 "waybar" received signal SIGSEGV
    #0 gtk_label_set_markup ()
    #1 waybar::modules::niri::Workspaces::doUpdate () at src/modules/niri/workspaces.cpp:106
 
### Root cause
[doUpdate()](cci:1://file:///home/lj/Downloads/Waybar/src/modules/niri/window.cpp:27:0-90:1) set the label markup via:
 
    static_cast<Gtk::Label*>(button.get_children()[0])->set_markup(name);
 
The button's child *is* a valid `GtkLabel`, but gtkmm's `get_children()`
returns it wrapped as a generic `Gtk::Widget` (confirmed: `dynamic_cast`
to `Gtk::Label*` yields `nullptr`). The unchecked `static_cast` then
performs an invalid downcast, producing a corrupt pointer whose `gobj()`
is garbage (`0x1`), so `gtk_label_set_markup()` dereferences it and crashes.
 
This is reliably triggered when no other module has instantiated a
`Gtk::Label` yet (so the `Gtk::Label` wrapper isn't registered), which is
exactly the case for a `niri/workspaces`-only bar. The same idiom exists in
`sway/workspaces` and `wayfire/workspaces`; it's masked there because typical
configs include other label-using modules.

### Testing
- Reproduced the crash on 0.15.0 / current `master` with a minimal
  `"modules-left": ["niri/workspaces"]` config under niri.
- After the fix: no crash; three workspace buttons render with correct
  names/labels (`niri-workspace-1/2/3`).
2026-06-09 06:20:05 +00:00
cebem1nt 8b1e574063 niri/workspaces: feature - add "hide-empty" config option (#4965) 2026-03-31 17:49:30 -03:00
Austin Horstman 790101f824 chore: format
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-06 18:49:02 -06:00
Alexis Rouillard 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
Austin Horstman fe03dfaa3b perf(memory): eliminate deep copies in range-based for loops and lambdas
This commit addresses memory churn caused by implicit deep copies during traversal and allocation of complex structures:

- Replaced pass-by-value 'Json::Value' in std::ranges and range-based for loops with 'const auto&' or 'const Json::Value&' in Hyprland modules, preventing large JSON tree duplications on every update.

- Fixed implicit string and pair copies in UPower and CPU Frequency loops by converting 'auto' to 'const auto&' where possible.

- Added 'std::vector::reserve' calls before 'push_back' loops in MPRIS, Niri, and CFFI modules to prevent exponential vector reallocation during initialization.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 22:54:07 -06:00
Austin Horstman 2ff77fb73d refactor(niri): use shared ScopedFd utility
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-02 08:21:17 -06:00
Alex e18939210b fix: lint 2026-02-24 00:00:57 +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
https://github.com/Alexays/Waybar/commit/4295faa7c4b23b7f6e86669d1fe8c93562e10241

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-02-20 08:16:56 -06:00
cebem1nt f1140f00f9 niri/workspaces: change icons priority 2026-02-17 11:23:27 -03:00
Prakhar Chhalotre 3e7976c8eb fix: use pango markup for consistent formatting in format and tooltip-format 2026-02-13 02:23:16 +05:30
Alex 47fb21a2c1 chore: upgrade to clang-format@21 2026-02-04 09:24:14 +01:00
Aleksi Hannula 41c34b15d6 Hide niri/language widget if formatted string is empty 2025-10-03 09:16:02 +03:00
workflow 862ba2f568 feat(niri/language): add CSS classes 2025-09-29 17:43:23 +03:00
Alex ee91d18ad9 fix: lint 2025-06-22 10:01:36 +02:00
Alexis Rouillard 630f85dcb1 Merge branch 'master' into niri-workspace-urgency 2025-06-22 08:57:49 +01:00
Illia Ostapyshyn 19d2430516 niri/workspaces: Add empty icon 2025-05-19 23:01:19 +02:00
Duncan Overbruck 47e0f42523 niri: add support for urgency indicators to workspaces 2025-05-14 20:33:11 +02:00
hansi 0abb2166a4 turn off ellipsize for niri/language module 2025-02-08 00:29:09 +04:00
Alex 1142979581 chore: lint 2024-09-13 09:43:19 +02:00
Ivan Molodetskikh fef0bb995c niri: Replace gnu extension with GDataInputStream 2024-09-13 10:34:55 +03:00
Ivan Molodetskikh 46e7ed35de Add niri/workspaces, niri/window, niri/language 2024-09-13 10:34:55 +03:00