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

WindowClone: Layout in allocate virtual #2082

Merged
merged 29 commits into from
Dec 10, 2024
Merged

Conversation

leolost2605
Copy link
Member

@leolost2605 leolost2605 commented Oct 10, 2024

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 #2053 and
fixes #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 by reverting #2072

Fixes #2128

@leolost2605 leolost2605 requested a review from a team October 10, 2024 12:18
Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that this fixes the linked issues, but it looks like the textures (window clones, close buttons, app icons) are all rendered half a pixel offset so they're blurry (this is on LoDPI and Wayland)

@danirabbit
Copy link
Member

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 🤔

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

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

@leolost2605
Copy link
Member Author

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

@leolost2605 leolost2605 mentioned this pull request Nov 21, 2024
@leolost2605 leolost2605 force-pushed the leolost/windowclone-allocate branch from 5798c65 to 0ae64b1 Compare November 23, 2024 15:18
@leolost2605 leolost2605 force-pushed the leolost/windowclone-allocate branch from 0ae64b1 to 32ea331 Compare November 23, 2024 15:39
@leolost2605
Copy link
Member Author

leolost2605 commented Nov 23, 2024

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
Copy link
Member Author

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

@lenemter
Copy link
Member

@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.

@leolost2605
Copy link
Member Author

@lenemter yes it's ready.

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

@lenemter lenemter mentioned this pull request Nov 25, 2024
1 task
@tintou
Copy link
Member

tintou commented Nov 29, 2024

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

@leolost2605
Copy link
Member Author

Thank you!

Copy link
Member

@lenemter lenemter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, one small issue in the code, after that should be ready to go

src/InternalUtils.vala Outdated Show resolved Hide resolved
@lenemter lenemter requested a review from danirabbit December 5, 2024 12:50
@lenemter
Copy link
Member

lenemter commented Dec 7, 2024

@danirabbit Can you review this branch please?

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks sharp but it looks like this re-introduces the issue where windows that spawn while multitasking view is open aren't added. To reproduce:

  1. Open screenshot and set a timed screenshot
  2. Open multitasking view
  3. when the timer runs out the new window will be transparent with no icon tooltip etc

@leolost2605
Copy link
Member Author

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 🤷

Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry I missed that. In that case 👍 😀

@leolost2605 leolost2605 merged commit 903bc3f into main Dec 10, 2024
5 checks passed
@leolost2605 leolost2605 deleted the leolost/windowclone-allocate branch December 10, 2024 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants