Commit Graph
34 Commits
Author SHA1 Message Date
Alex b9d5b3b4a2 Merge remote-tracking branch 'origin/master' into pr-5041
# Conflicts:
#	src/modules/niri/workspaces.cpp
2026-07-03 23:50:53 +02:00
Alexis Rouillard 471d7563b3 Merge pull request #4530 from martinetd/niri-column
[RFC] niri/window: add col/max_col parameters
2026-07-03 23:01:36 +02:00
Alexis Rouillard dca564ca52 Merge pull request #4463 from diego-velez/master
feat: Show Niri/window component when workspace is empty
2026-07-03 22:50:25 +02:00
Alexis Rouillard a5d510ff8a Merge branch 'master' into enable-bar-scroll 2026-07-03 22:22:30 +02:00
Alexis Rouillard 6506228061 Merge branch 'master' into niri-column 2026-07-03 22:22:02 +02:00
Alexis Rouillard 17b9dc2a94 Merge branch 'master' into master 2026-07-03 22:22:00 +02:00
Alex b7e5805f4b Merge remote-tracking branch 'origin/master' into RaphaelKimmig/master
# Conflicts:
#	include/modules/niri/workspaces.hpp
2026-07-03 22:11:34 +02:00
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
Jack Barnes 51becf2fbc feat(niri/workspaces): Add enable-bar-scroll option 2026-05-16 13:03:53 +08: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
Raphael Kimmig 85a8fca0de feat: allow sorting niri workspaces 2025-12-07 12:18:24 +01:00
Dominique Martinet 632e30eb9f niri/window: add col/max_col parameters
niri v25.08 added window positions to IPC, so waybar actually has the
information stored in json around.

This handles the associated WindowLayoutsChanged IPC message to keep the
position up to date in memory, and adds a couple of format messages to
show the current column, so one can dislpay where we are in the
workspace (in the hope of improving this feeling of being lost...)

Ideally a visual representation of the workspace like the one
illustrated in the PR[1] would be even better but this will probably do
for now.

Link: https://github.com/YaLTeR/niri/pull/1265#issuecomment-2724621758 [1]
2025-10-07 22:56:30 +09: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
Diego Velez 946f175aa2 feat: Show Niri/window component when workspace is empty 2025-09-13 15:17:01 -04: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