gala icon indicating copy to clipboard operation
gala copied to clipboard

WindowClone: Layout in allocate virtual

Open leolost2605 opened this issue 1 year ago • 2 comments

Currently we are doing most of the layout management by hardcoding x, y, width and height of our child actors. However we can make the whole thing simpler and more robust by doing the layout management in the allocate virtual method as recommended by clutter docs.

Since the root cause for the following issues was that we didn't allocate some children on rare occasions which was fixed in this PR this fixes https://github.com/elementary/gala/issues/2053 and fixes https://github.com/elementary/gala/issues/1898 and therefore closes #2072

There are still some issues when windows spawn while multitasking view is open (like for example they reserve space but don't show) that I would like to tackle in follow up PRs but at least it doesn't completely break anymore as on current main :)

fixes #2088

leolost2605 avatar Oct 10 '24 11:10 leolost2605

Tooltips also appear to be cut off and text looks pretty gnarly. Although when I went back to get a screenshot the other textures all look aligned correctly here :thinking:

This branch: Screenshot from 2024-10-11 10 47 41

main: Screenshot from 2024-10-11 10 48 45

danirabbit avatar Oct 11 '24 17:10 danirabbit

@danirabbit the allocations are clamped to pixels now could you try again with that? I'm not so good at noticing those differences :sweat_smile: (and the tooltip thing I don't seem to be able to reproduce, probably requires a very specific window size and name :shrug:)

leolost2605 avatar Oct 12 '24 12:10 leolost2605

~So fedora is failing because for some reason it compiles with stricter rules (?) about implicit function declaration and clutter_actor_get_relative_transformation_matrix is defined in clutter-mutter.h and not clutter.h which we don't include anywhere. And we can't include it because it pulls in _private headers that aren't shipped. At least that's what I figured maybe I'm wrong somewhere :)~ See comment below

leolost2605 avatar Nov 23 '24 16:11 leolost2605

Nvm I found a utility method that's much better to use in this case and properly exported :)

leolost2605 avatar Nov 23 '24 16:11 leolost2605

@leolost2605 Is this ready for review? I really want to include this in 8.0.4 release.

One thing I noticed is that clone no longer has magnifying filters? clone.set_content_scaling_filters (Clutter.ScalingFilter.TRILINEAR, Clutter.ScalingFilter.TRILINEAR); seems to fix this.

lenemter avatar Nov 25 '24 16:11 lenemter

@lenemter yes it's ready.

I've added the filters although TBH i don't really know what they do :sweat_smile:

leolost2605 avatar Nov 25 '24 18:11 leolost2605

Opened https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4156 for your missing includes…

tintou avatar Nov 29 '24 14:11 tintou

Thank you!

leolost2605 avatar Nov 29 '24 15:11 leolost2605

@danirabbit Can you review this branch please?

lenemter avatar Dec 07 '24 10:12 lenemter

There are still some issues when windows spawn while multitasking view is open (like for example they reserve space but don't show) that I would like to tackle in follow up PRs but at least it doesn't completely break anymore as on current main :)

From the description (the breaking refers to the version before the workaround was merged)

If it's a must I can do it here though :shrug:

leolost2605 avatar Dec 09 '24 21:12 leolost2605