Commit Graph
154 Commits
Author SHA1 Message Date
Alexis Rouillard 8e64ac59df Merge pull request #5131 from rmt/master
Force layer-shell commit after configure
2026-07-03 22:02:56 +02:00
Alex 8f7ed880c4 bar: fix indentation of height type warning 2026-07-03 21:49:25 +02:00
Alex b88f88b457 Merge remote-tracking branch 'origin/master' into fix-height-type-warning 2026-07-03 21:49:00 +02:00
Alexis Rouillard 4b7786811a Merge branch 'master' into master 2026-07-03 21:47:44 +02:00
Ibrahim Issa 4d1a561cdc feat(modules): pause background threads when display is asleep
Currently, modules polling hardware nodes continuously wake up kernel drivers even when the monitor is asleep (e.g., DPMS off), flooding dmesg.

- Adds 'disable-on-sleep' config flag
- Hooks GTK window map/unmap signals to track DPMS state
- Propagates suspend/resume calls to AModule worker threads
2026-07-03 18:44:03 +02:00
Robert M. Thomson 942411d7a1 Force layer-shell commit after configure
Assisted-by: pi:gpt-5.5
2026-06-15 10:36:29 +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
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
Visal Vijay 0332da0cef bar: warn on invalid height type in configuration 2026-03-25 15:18:00 +05:30
Alex 47fb21a2c1 chore: upgrade to clang-format@21 2026-02-04 09:24:14 +01:00
BBaoVanC 5ab28b901c Fix return type of input to gtk_layer_set_namespace 2026-02-01 22:01:04 -06:00
Holbormon 762c4f2e27 Use name config field to set GTK layer namespace
Provides an easy way to disambiguate several waybars so that compositors like Hyprland may apply granular layer rules to different waybars.
2026-01-16 15:12:09 +00:00
Cole Leavitt 4a5358e8c5 fix: handle null GDK window reference in surface initialization 2025-09-17 21:17:26 -07:00
Alexis Rouillard 07d3a4da10 Merge pull request #4333 from Arkoniak/relative_paths_in_includes
Relative paths in included configs
2025-08-08 08:53:55 +02:00
Arkoniak f824ae9334 Relative paths in included configs 2025-07-29 10:45:31 +03:00
Martynas Maciulevičius b7ff47fb05 User kill signal config keys: Use underscore instead of dash 2025-06-27 09:31:51 +03:00
Martynas Maciulevičius 3c7a9bf432 Documentation for sigusr1 and sigusr2 config 2025-06-27 09:31:51 +03:00
Martynas Maciulevičius aaea814217 Idempotent bar show/hide via configurable user kill signals 2025-06-27 09:31:51 +03:00
Lars Niesen 8a15cbad5c Fixes: Add stretching of modules and modules-center toggling
Thanks to tmccombs this commit fixes some inconsitencies in #3730.
These inconsitencies were:
- Fixed the oversight of missing the implementation of expand_center for
  center_ and right_
- Removes a last minut printf debugging statment I missed.
2025-03-09 16:15:39 +01:00
Lars Niesen f9acc1fed9 Add stretching of modules and modules-center toggling
This Patch allows the stretching of modules-{left,center,right} as well
add a "expand" flag to AModule. This allows one module to consume the
leftover space.
To allow the left or right modules to fully consume the center, the
changes also include a way to remove the center box (center_)
altogether.
2024-11-20 00:00:27 +01:00
Aleksei Bavshin 45fec7bcbb Revert "change layer for mode invisible to nullopt"
Previous commit should have a better workaround for #3211.

This reverts commit b61ea62732.
2024-09-14 22:43:07 -07:00
Aleksei Bavshin 7b23d58684 fix(bar): force commit for occluded surfaces
All the mode or visibility changes require `wl_surface_commit` to be
applied. gtk-layer-shell will attempt to force GTK to commit, but may
fail if the surface has stopped receiving frame callbacks[^1].
Thus, we could get stuck in a state where the bar is hidden and unable
to regain visibility.

To address this, a new API has been added to gtk-layer-shell,
`gtk_layer_try_force_commit`, which does `wl_surface_commit` with the
necessary safety checks to avoid corrupting GTK internal state.

Note: this change bumps gtk-layer-shell requirement to 0.9.0.

[^1]: https://github.com/wmww/gtk-layer-shell/issues/185
2024-09-14 22:43:06 -07:00
Aleksei Bavshin 4a6af0da99 fix(bar): use overlay layer for hide and overlay modes
This fixes a major inconsistency with the swaybar implementation of
these modes[^1]. `overlay` layer no longer has security implications due
to a wide adoption of `ext-session-lock`, so it's safe to use.

Following config will restore the previous behavior:
```json
"modes": {
    "hide": { "layer": "top" },
    "overlay": { "layer": "top" }
},
```

[^1]: https://github.com/swaywm/sway/commit/2f7247e08a16610228067c9ec34d2b6d897e15fa
2024-09-13 01:26:25 -07:00
Austin Horstman a544f4b2cd bar: fix setVisible
Accidentally removed updating the visible variable
2024-07-20 09:33:13 -05:00
Austin Horstman 14c3235c12 src: clang-tidy 2024-07-02 10:38:58 -05:00
wmlhwl b61ea62732 change layer for mode invisible to nullopt 2024-05-19 13:53:09 +02:00
Sano 70ef406d6b check for group modules array in key conversion 2024-03-23 18:39:22 +01:00
Alexis Rouillard bba8da76b6 Merge pull request #2836 from alebastr/require-gtk-layer-shell
Require gtk-layer-shell
2024-02-19 22:57:50 +01:00
Aleksei Bavshin 8a4a44896a refactor: merge BarSurface into Bar
With only one implementation left, the abstraction is no longer
necessary.
2024-02-19 03:00:38 -08:00
Aleksei Bavshin 4420447e74 fix(bar): use std::string for mode names
`string_view` leads to UAF when reading custom mode definitions from the
configuration.
2024-02-19 01:50:40 -08:00
zjeffer a02bacdd53 fix build warning 2024-02-18 12:01:36 +01:00
Aleksei Bavshin 3cb587945a fix: use gtk_layer_set_keyboard_mode()
`gtk_layer_set_keyboard_interactivity()` is deprecated and was removed
in gtk4-layer-shell.
Note that this bumps version requirement to 0.6.0
2024-02-17 11:23:19 -08:00
Aleksei Bavshin 9a21884272 feat!: drop RawSurfaceImpl with direct use of wlr-layer-shell
BREAKING CHANGE: gtk-layer-shell is now required and unconditionally
used. The corresponding config option is removed.

As a part of preparation for future versions of GTK, remove an ability
to use wlr-layer-shell directly. The APIs it required were dropped in
GTK4, and with the menus/tooltips positioning issue being practically
unsolvable it doesn't make sense to keep maintaining the code.
2024-02-17 11:23:17 -08:00
Aleksei Bavshin 2f555a6936 refactor(bar): use Gtk enums for position and orientation
Ensure that the position and the corresponding CSS class on window are
always set.
2024-02-14 22:11:21 -08:00
Erik Reider f7224d8459 Initial implementation 2023-10-26 23:22:02 +02:00
Brenno Lemos fad858782c feat: improve drawer configuration 2023-10-14 18:24:50 -03:00
Brenno Lemos 5246ab15cb feat: add drawer bool option to group 2023-10-14 17:17:52 -03:00
Brenno Lemos bbb7fb0c82 refactor: don't use a group's box directly in bar 2023-10-14 13:23:11 -03:00
Cherser-s 936937ec78 store margins and global window offset in the bar object 2023-08-25 20:37:14 +03:00
maqrrr 339bea1213 Add a new start_hidden bool 2023-05-15 07:01:00 -04:00
Alex 3bda22da72 Merge pull request #1589 from qubidt/module-group-orientation
group module: configurable orientation
2023-03-02 19:42:22 +01:00
Kauan Decarli de77787b60 Allow any module to implement signal handling 2023-01-21 21:57:28 -03:00
Bao Trinh f5a24d12e5 group module: configurable orientation
currently, the orientation of group modules is always the opposite of
the bar. Change it so that:

* the default orientation of the group module is always the opposite of
  its parent, even for nested groups
* the orientation can be overridden in the config
* css ID and class are set for the group element
2022-09-03 18:37:35 -05:00
Daan Goossens ae9fb57790 fix: vertical bar not anchored when width is set 2022-05-25 16:09:21 +02:00
Nicolas Berbiche 6851e26450 bar: don't set layer-shell anchor for edges
Don't set the anchor for certain edges when the width or the height
is not set to a value of 'auto' (1).

When the bar is vertical, the top and bottom edges are not anchored
otherwise the left and right edges are not anchored.

This resolves an issue wherein the width and height set for the
layer-shell were ignored because the layer was set to anchor to all
edges.
2022-04-17 18:19:36 -04:00
Alex f2fcadbf62 refactor: lint 2022-04-06 08:37:19 +02:00
Daniel Moore f4c6dfcddc Uses user-defined mode when toggling visibility rather than resetting to default mode 2022-03-12 13:32:08 -07:00
Andy Russell 54085dbde0 avoid use-after-free in lambda 2022-03-03 19:40:43 -05:00
ilkecan 548bd2ab1a Add fixed-center option
Resolves #957
2021-12-28 16:00:25 +03:00