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

GTK: paint_with_z_index is broken #922

Closed
xStrom opened this issue May 12, 2020 · 3 comments
Closed

GTK: paint_with_z_index is broken #922

xStrom opened this issue May 12, 2020 · 3 comments
Labels
bug does not behave the way it is supposed to shell/gtk concerns the GTK backend

Comments

@xStrom
Copy link
Member

xStrom commented May 12, 2020

paint_with_z_index internally calls into piet render_ctx.current_transform() which returns an unexpected value when running on Wayland. This can be seen in the anim example.

Piet internally seems to just call cairo_get_matrix so is this an issue with cairo on Wayland or what?

The returned matrix seems to have a static +26x / +60y translation added to it on Wayland. Indeed the GTK connect_draw handler receives a cairo context which has the following transform applied to it already: Affine([1.0, 0.0, 0.0, 1.0, 26.0, 60.0]).

Faulty behavior originally discovered by @Finnerale in #876.

@xStrom xStrom added bug does not behave the way it is supposed to shell/gtk concerns the GTK backend labels May 12, 2020
@xStrom xStrom changed the title GTK: paint_with_z_index broken when running on Wayland GTK: paint_with_z_index is broken May 12, 2020
@xStrom
Copy link
Member Author

xStrom commented May 12, 2020

Okay I managed to reproduce the issue even with GTK on X11, so this isn't a Wayland specific issue or a GTK library bug. The issue can be reproduced on GTK/X11 by enabling debug_widget_id() on the multiwin example. The GTK menu system also applies a translate on the cairo context.

The current paint_with_z_index implementation doesn't work when there is a non-druid transform applied.

@xStrom
Copy link
Member Author

xStrom commented May 12, 2020

This issue was fixed in piet#195. Druid will start behaving correctly whenever we update to piet 0.0.14.

@xStrom xStrom added S-blocked waits for another PR or dependency and removed S-blocked waits for another PR or dependency labels May 12, 2020
@xStrom
Copy link
Member Author

xStrom commented May 13, 2020

We've updated to piet 0.1.0 so this should be fixed now.

@xStrom xStrom closed this as completed May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug does not behave the way it is supposed to shell/gtk concerns the GTK backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant