Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree/container: ensure pixman rect is valid in container_arrange_title_bar() #8112

Merged
merged 1 commit into from May 7, 2024

Conversation

emersion
Copy link
Member

Fixes "Invalid rectangle passed" errors printed by Pixman.

…e_bar()

Fixes "Invalid rectangle passed" errors printed by Pixman.
@mstoeckl
Copy link
Contributor

The errors mentioned can be triggered by setting the titlebar horizontal padding to some large value, with e.g. swaymsg titlebar_padding 500 5.

This PR does fix the invalid rectangle warnings. However, passing a width of 0 to sway_text_node_set_max_width does not, as I'd expect, hide the title text node, and the node still renders (at full width) off to the right of the titlebar. For example:
title-ext

Adding the following line fixes the edge case for me, but I don't know if it's the right way to handle the issue.

wlr_scene_node_set_enabled(node->node, alloc_width > 0);

@Nefsen402
Copy link
Contributor

Nefsen402 commented Apr 30, 2024

The reason why sway_text_node_set_max_width() with 0 doesn't work is because it will internally generate a wlr_fbox with 0 area. wlr_scene special cases these rects and interprets them as having a source box of the entire input texture.

Nevermind, it special cases 0 width as having no max with but I think the fbox concern is real.

As a fixup, this MR LGTM.

@Nefsen402
Copy link
Contributor

Fixed up the max_width thing with #8140

@emersion emersion merged commit 30f5c3a into swaywm:master May 7, 2024
3 checks passed
@emersion emersion deleted the invalid-pixman-rect branch May 7, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants