-
Notifications
You must be signed in to change notification settings - Fork 104
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
feature: adding an is_above method to the SurfaceStack so that compositor authors can write tests to assert the relative z-order of surfaces #3707
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look fine, will need someone else who better knows Mir architecture to clarify if there should be this z_order feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced that we have to bake in a z-order to our APIs. If we ever start positioning surfaces in 3D, then the z-order will depend on viewpoint(s).
Having said that, we already have:
void raise(SurfaceSet const& surfaces);
void swap_z_order(SurfaceSet const& first, SurfaceSet const& second);
void send_to_back(SurfaceSet const& surfaces);
So, maybe that thought is moot.
Now, the semantics of z_order()
are not intuitive.
- '0' == "at front" OR "expired"OR "not found"
- layers are not respected (comparing windows from different layers doesn't work)
I think we would do better with an interface for making assertions:
EXPECT_TRUE(shell->assert_that(window1, is_above, window2));
@AlanGriffiths Do you mean this API literally, or would the shell have a method like |
The API I suggested is more fluent (reads more like English) and allows some additional predicates to be added without breaking ABI (e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nitpicking
…ors can write tests to assert the relative z-order of surfaces
cb662b9
to
ab38a60
Compare
What's new?
AbstractShell::is_above
,FocusController::is_above
, andSurfaceStack::is_above
WindowManagementTestHarness
to focus a window and queryis_above
MinimalWindowManagerTest
s that assert points aboutis_above