Skip to content

Fix: Working --center flag on kwin and smithay-based compositors#441

Merged
Cloudef merged 1 commit intoCloudef:masterfrom
sophrosyne42:fix-wayland-centering
Jul 22, 2025
Merged

Fix: Working --center flag on kwin and smithay-based compositors#441
Cloudef merged 1 commit intoCloudef:masterfrom
sophrosyne42:fix-wayland-centering

Conversation

@sophrosyne42
Copy link
Contributor

@sophrosyne42 sophrosyne42 commented Jul 22, 2025

Partially fixes #422.

Setting the centered anchor to 0 fixes the -c/--center flag for smithay-based compositors, and doesn't appear to break it for others (e.g., Hyprland).

The -W/--width-factor flag is still broken. This commit fixes -W when bemenu is centered, but not on other anchor points.

Tested on niri (Smithay-based), and Hyprland.

Setting the anchor to 0 when centered fixes the -c/--center flag for
smithay-based compositors, and doesn't appear to break it for others.

The -W/--width-factor flag is still broken. This commit fixes -W when
bemenu is centered, but not on other anchor points.

Tested on Niri (Smithay-based), and Hyprland.
@Cloudef
Copy link
Owner

Cloudef commented Jul 22, 2025

Checked and this seems to be correct according to spec

Requests that the compositor anchor the surface to the specified edges and corners. If two orthogonal edges are specified (e.g. 'top' and 'left'), then the anchor point will be the intersection of the edges (e.g. the top left corner of the output); otherwise the anchor point will be centered on that edge, or in the center if none is specified.

Anchor is double-buffered, see wl_surface.commit.

@Cloudef Cloudef merged commit 249f18f into Cloudef:master Jul 22, 2025
2 of 4 checks passed
@sophrosyne42 sophrosyne42 deleted the fix-wayland-centering branch July 22, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--center flag not working on kwin and smithay, -W flag not working on smithay

2 participants