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

(#332) LayerSurfaceLayoutTest includes a test for a -1 exclusion zone #333

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

mattkae
Copy link
Contributor

@mattkae mattkae commented Mar 13, 2024

fixes #332

Implemented a test for zwlr_layer_surface_v1_set_exclusive_zone(-1), which means that the surface should ignore all exclusion zones (e.g. a background)

@mattkae mattkae requested a review from AlanGriffiths March 13, 2024 15:12
@mattkae mattkae requested a review from a team as a code owner March 13, 2024 15:12
Copy link
Contributor

@RAOF RAOF left a comment

Choose a reason for hiding this comment

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

I'm a bit confused at what this test is doing, and I think it's because the test isn't testing what you think it is.

I think it would be more obvious what it's doing if either:

  • You set up the exclusive surfaces first, then set up the exclusive=-1 surface and checked its position, or
  • You set up the exclusive=-1 surface, checked its position, then set up the exclusive surfaces and asserted that no reconfiguration occured.

(It's possible that this is more usefully two tests)

}

auto const expected_placement = layout.placement_rect(non_exlusive_zone);
surface.attach_visible_buffer(expected_placement.size.width.as_int(), expected_placement.size.height.as_int());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we attaching a new buffer to the surface? Why are we attaching a buffer with the same size as the previous buffer, but where that size has a different name?

Copy link
Contributor

Choose a reason for hiding this comment

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

Additionally, you're never committing this buffer, so it's not going to do anything?

EXPECT_THAT(layer_surface.last_size().height, Eq(expected_config_size.height));
}

auto const expected_placement = layout.placement_rect(non_exlusive_zone);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we naming this differently? expected_placement == initial_rect

@mattkae
Copy link
Contributor Author

mattkae commented Mar 14, 2024

I'm a bit confused at what this test is doing, and I think it's because the test isn't testing what you think it is.

I am attempting to test that ignoring exclusive zones while you are a fullscreened surface gives you the whole output, regardless of there being attached surfaces with exclusive zones defined.

I think it would be more obvious what it's doing if either:

* You set up the exclusive surfaces first, then set up the `exclusive=-1` surface and checked its position, or

* You set up the `exclusive=-1` surface, checked its position, _then_ set up the exclusive surfaces and asserted that no reconfiguration occured.

(It's possible that this is more usefully two tests)

These two tests sound like a better idea tho

@mattkae mattkae requested a review from RAOF March 14, 2024 18:39
Copy link
Contributor

@RAOF RAOF left a comment

Choose a reason for hiding this comment

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

Let's do some synchronous review of this next week. 😉

Comment on lines 968 to 969
auto const expected_placement = layout.placement_rect(output_rect());
surface.attach_visible_buffer(expected_placement.size.width.as_int(), expected_placement.size.height.as_int());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we attaching a new buffer with the same size (but with a different variable name for that size) here?

Comment on lines 963 to 966
if (request_size.width.as_int())
EXPECT_THAT(layer_surface.last_size().width, Eq(request_size.width));
if (request_size.height.as_int())
EXPECT_THAT(layer_surface.last_size().height, Eq(request_size.height));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure this isn't testing what you expect it to be testing? Particularly: we've attached a buffer of size initial_rect.size. That means that the surface has size initial_rect.size; the client buffer size is authoritative.

What this is testing is that the WM has suggested (in the configure event) that we make the surface size request_size.size.

@mattkae mattkae requested a review from RAOF March 18, 2024 20:49
Copy link
Contributor

@RAOF RAOF left a comment

Choose a reason for hiding this comment

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

Yeah, this is clearer now. Sweet!

@RAOF RAOF enabled auto-merge March 18, 2024 20:52
@RAOF RAOF added this pull request to the merge queue Mar 18, 2024
Merged via the queue into main with commit 524a389 Mar 18, 2024
10 of 11 checks passed
@RAOF RAOF deleted the feature/332 branch March 18, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LayerSurfaceLayoutTest should have a test for a -1 exclusion zone
2 participants