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

Test XDG shell (stable) version 5 #277

Merged
merged 10 commits into from Mar 20, 2023
Merged

Test XDG shell (stable) version 5 #277

merged 10 commits into from Mar 20, 2023

Conversation

wmww
Copy link
Contributor

@wmww wmww commented Mar 9, 2023

No description provided.

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.

Looks like I've got a couple of questions to resolve here.

tests/xdg_popup.cpp Outdated Show resolved Hide resolved
tests/xdg_popup.cpp Outdated Show resolved Hide resolved
}
catch (wlcs::ProtocolError const& err)
{
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be testing that we're sending the correct protocol error; it looks like that should be xdg_toplevel::invalid_parent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only if the protocol version is new enough to support xdg_toplevel::invalid_parent. We could test this, but I really don't see why it matters.

Copy link
Contributor

Choose a reason for hiding this comment

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

Technically this shouldn't be a protocol error until xdg-shell v5. A truly pedantic test would bind to xdg-shell < v5, set up a parent loop, and assert no protocol error. 😉

It's not a big thing (because protocol errors can't be used for error recovery), but it can be helpful for client developers to send the specified error. As an aspirational conformance suite, we should be checking adherence to the protocol; that specifies a specific error, it's cheap to check it, we should.

Copy link
Contributor

Choose a reason for hiding this comment

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

(I don't expect you to write the “parent loops are fine on <v5” test, but we should gate this test on ≥v5, and test the correct error is sent)

@@ -523,6 +560,29 @@ class LayerV1PopupManager : public XdgPopupManagerBase
int popup_surface_configure_count{0};
};

auto surface_actually_at_location(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is pragmatic, but I think we're approaching the point where we might want to develop some more WLCS/compositor hooks to do these sorts of things more explicitly. Not blocking this, just flagging.

std::make_pair(manager.state.value().x, manager.state.value().y),
Eq(std::make_pair(-popup_width, -popup_height))) << "popup initially placed in incorrect position";

manager.move_parent_using_pointer({5, 5});
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 moving using the pointer, rather than server.move_surface_to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because in Mir, server.move_surface_to doesn't generate a window manager request.

Copy link
Contributor

Choose a reason for hiding this comment

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

😱

Copy link
Contributor

Choose a reason for hiding this comment

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

More seriously, ok. Add it to the pile of things tracked by #278.

{
XdgPopupStableManager manager{this};

manager.client.bind_if_supported<xdg_wm_base>(wlcs::AtLeastVersion{XDG_POSITIONER_SET_REACTIVE_SINCE_VERSION});
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably have a cleaner way to do this; again, not blocking.

wlcs::XdgToplevelStable toplevel{xdg_shell_surface};
EXPECT_CALL(toplevel, wm_capabilities).Times(1);
client.roundtrip();
surface.attach_buffer(100, 100);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to attach a buffer here? As far as I can tell the relevant xdg_surface events should be sent before the first buffer is attached and the surface is mapped, and if this attach is needed then isn't this test racy, as attach_buffer doesn't wait for any server response?

bors bot added a commit to canonical/mir that referenced this pull request Mar 14, 2023
2862: Detect cyclic parent-child relationships r=AlanGriffiths a=wmww

Required to pass the new WLCS tests added by canonical/wlcs#277

Co-authored-by: Sophie Winter <git@phie.me>
@RAOF
Copy link
Contributor

RAOF commented Mar 16, 2023

Looks good; I still have this question, and we should gate the invalid_parent tests on v5 (where it exists) and verify the error returned.

@wmww wmww requested a review from RAOF March 17, 2023 16:37
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.

Yup, my concerns have been resolved.

bors r+

@AlanGriffiths
Copy link
Contributor

bors r+

Why the silence?

bors r=RAOF

bors bot added a commit that referenced this pull request Mar 20, 2023
277: Test XDG shell (stable) version 5 r=RAOF a=wmww



Co-authored-by: Sophie Winter <wm@wmww.sh>
Co-authored-by: Sophie Winter <git@phie.me>
@AlanGriffiths
Copy link
Contributor

bors cancel

@bors
Copy link
Contributor

bors bot commented Mar 20, 2023

Canceled.

@AlanGriffiths
Copy link
Contributor

bors r=RAOF

@bors bors bot merged commit 30d30e8 into main Mar 20, 2023
10 checks passed
@bors bors bot deleted the xdg-shell-stable-v5 branch March 20, 2023 17:06
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.

None yet

3 participants