-
Notifications
You must be signed in to change notification settings - Fork 14
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 that text input is entered after child window is closed #216
Conversation
Ah! I forgot to actually set the parent on the child. Fixed. (and by fixed, I mean the test is now failing as it should) |
canonical/mir#2223 fixes this test on Mir. |
2244: Give keyboard focus to menus (grabbing popups) r=Saviq a=wmww According to XDG Shell, grabbing popups should be given keyboard focus and non-grabbing ones should not. This PR brings our keyboard focus logic in line with that. Fixes #2241. Tested by the recently-updated canonical/wlcs#216. Co-authored-by: William Wold <wm@wmww.sh> Co-authored-by: Alan Griffiths <alan@octopull.co.uk>
2244: Give keyboard focus to menus (grabbing popups) r=Saviq a=wmww According to XDG Shell, grabbing popups should be given keyboard focus and non-grabbing ones should not. This PR brings our keyboard focus logic in line with that. Fixes #2241. Tested by the recently-updated canonical/wlcs#216. Co-authored-by: William Wold <wm@wmww.sh> Co-authored-by: Alan Griffiths <alan@octopull.co.uk>
* Release 2.6.0 & changelog * gbm-kms: Be more relaxed in the rendering probe. (#2243) The libmali EGL implementation requires that the `gbm_device` passed in to `eglGetPlatformDisplay` be created from a DRM master fd. We can't guarantee this in the rendering probe, as the display platform may have already claimed DRM master. Instead, assume that an EGL platform which claims to support the GBM platform will be at least minimally usable with GBM. (cherry picked from commit 316b40d) * Merge #2244 2244: Give keyboard focus to menus (grabbing popups) r=Saviq a=wmww According to XDG Shell, grabbing popups should be given keyboard focus and non-grabbing ones should not. This PR brings our keyboard focus logic in line with that. Fixes #2241. Tested by the recently-updated canonical/wlcs#216. Co-authored-by: William Wold <wm@wmww.sh> Co-authored-by: Alan Griffiths <alan@octopull.co.uk> Co-authored-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Co-authored-by: William Wold <wm@wmww.sh>
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.
Oops! Looks like I left a review pending 😬
One non-blocking stylistic thing wrt operator wl_surface*()
, one question about what we're testing that might require changes.
TEST_F(TextInputV3WithInputMethodV2Test, text_input_does_not_enter_non_grabbing_popup) | ||
{ | ||
auto parent_surface = std::make_unique<wlcs::Surface>(app_client); | ||
EXPECT_CALL(text_input, enter(parent_surface->operator wl_surface*())); |
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.
Is there a reason this isn't EXPECT_CALL(text_input, enter(static_cast<wl_surface*>(*parent_surface)))
? That would seem more natural to me.
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.
(Presumably the static_cast
is necessary? Will *parent_surface
implicitly-coerce into wl_surface*
via operator wl_surface*()
?)
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 do believe some sort of explicit conversion is necessary. I, personally, like the explicit call to operator. Is there any reason to prefer static cast?
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, personally, like the explicit call to operator.
I, personally, find it strange to invoke operators by calling the operator function by name. The point of such functions is that they can be invoked using operator syntax.
If the intended use is to call the function by name then there are better names.
I'd be tempted to introduce a helper function:
auto as_wl_surface(auto const& s) -> wl_surface*
{
return s;
}
EXPECT_CALL(text_input, enter(parent_surface->operator wl_surface*())); | |
EXPECT_CALL(text_input, enter(as_wl_surface((*parent_surface))); |
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.
Is the latest update satisfactory?
EXPECT_CALL(text_input, leave(parent_surface->operator wl_surface*())).Times(0); | ||
EXPECT_CALL(text_input, enter(child_surface->operator wl_surface*())).Times(0); |
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 think these should EXPECT_CALL
leave(_)
and enter(_)
? We want to assert that the non-grabbing popup doesn't change the test_input
state, right?
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.
Done
…r leave any surface
426d84b
to
605bba9
Compare
Ready for review |
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.
A couple of nits, but this can land.
Feel free to fix them up, or not.
(I think the workflow for this now is just to approve and then let Sophie hit the “merge” button?)
EXPECT_CALL(text_input, leave(parent_surface->wl_surface())); | ||
EXPECT_CALL(text_input, enter(child_surface->wl_surface())); |
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.
Non-blocking, but this ordering is a protocol requirement, so we should probably enforce it.
EXPECT_CALL(text_input, leave(_)).Times(0); | ||
EXPECT_CALL(text_input, enter(_)).Times(0); | ||
auto child_xdg_surface = std::make_shared<wlcs::XdgSurfaceStable>(app_client, *child_surface); | ||
auto child_xdg_toplevel = std::make_shared<wlcs::XdgPopupStable>( |
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.
Nit: child_xdg_toplevel
-> child_xdg_popup
Not before #289 :) |
This is supposed to test canonical/mir#2189, but it passes for some reason. A problem for next week.