Add warning for invalid exclusive and anchor combination (#1316)

This commit is contained in:
Lucas Baumann 2025-05-11 13:11:13 +02:00 committed by GitHub
parent c999033c29
commit eb59d155a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View file

@ -20,6 +20,7 @@ All notable changes to eww will be listed here, starting at changes since versio
- `get_locale` now follows POSIX standard for locale selection (By: mirhahn, w-lfchen) - `get_locale` now follows POSIX standard for locale selection (By: mirhahn, w-lfchen)
### Features ### Features
- Add warning and docs for incompatible `:anchor` and `:exclusive` options
- Add `eww poll` subcommand to force-poll a variable (By: kiana-S) - Add `eww poll` subcommand to force-poll a variable (By: kiana-S)
- Add OnDemand support for focusable on wayland (By: GallowsDove) - Add OnDemand support for focusable on wayland (By: GallowsDove)
- Add jq `raw-output` support (By: RomanHargrave) - Add jq `raw-output` support (By: RomanHargrave)

View file

@ -112,6 +112,13 @@ mod platform_wayland {
} else { } else {
window.set_layer_shell_margin(gtk_layer_shell::Edge::Top, yoffset); window.set_layer_shell_margin(gtk_layer_shell::Edge::Top, yoffset);
} }
// https://github.com/elkowar/eww/issues/296
if window_init.backend_options.wayland.exclusive
&& geometry.anchor_point.x != AnchorAlignment::CENTER
&& geometry.anchor_point.y != AnchorAlignment::CENTER
{
log::warn!("When ':exclusive true' the anchor has to include 'center', otherwise exlcusive won't work")
}
} }
if window_init.backend_options.wayland.exclusive { if window_init.backend_options.wayland.exclusive {
window.auto_exclusive_zone_enable(); window.auto_exclusive_zone_enable();

View file

@ -89,7 +89,7 @@ Depending on if you are using X11 or Wayland, some additional properties exist:
| Property | Description | | Property | Description |
| ----------: |------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ----------: |------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `stacking` | Where the window should appear in the stack. Possible values: `fg`, `bg`, `overlay`, `bottom`. | | `stacking` | Where the window should appear in the stack. Possible values: `fg`, `bg`, `overlay`, `bottom`. |
| `exclusive` | Whether the compositor should reserve space for the window automatically. Either `true` or `false`. | | `exclusive` | Whether the compositor should reserve space for the window automatically. Either `true` or `false`. If `true` `:anchor` has to include `center`. |
| `focusable` | Whether the window should be able to be focused. This is necessary for any widgets that use the keyboard to work. Possible values: `none`, `exclusive` and `ondemand`. | | `focusable` | Whether the window should be able to be focused. This is necessary for any widgets that use the keyboard to work. Possible values: `none`, `exclusive` and `ondemand`. |
| `namespace` | Set the wayland layersurface namespace eww uses. Accepts a `string` value. | | `namespace` | Set the wayland layersurface namespace eww uses. Accepts a `string` value. |