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

Release 1.7.0 #323

Merged
merged 3 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cmake_minimum_required(VERSION 3.5)
cmake_policy(SET CMP0015 NEW)
cmake_policy(SET CMP0022 NEW)

project(wlcs VERSION 1.6.1)
project(wlcs VERSION 1.7.0)

add_definitions(-D_GNU_SOURCE)
add_definitions(-D_FILE_OFFSET_BITS=64)
Expand Down
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
wlcs (1.7.0-0ubuntu0) UNRELEASED; urgency=medium

* New upstream release. Notable changes:
+ New tests for input-method-v1 (#302)
+ Handle incomplete logical pointer/touch events better (#313)
+ XdgToplevelStable: Fix race in .configure handling (#318)
+ helpers: avoid triggering a kernel warning (#320)
+ InProcessServer: Fix xdg_shell window construction (#324)
+ XdgSurfaceStable: Fix configure event logic

-- Michał Sawicz <[email protected]> Tue, 05 Dec 2023 13:52:28 +0100

wlcs (1.6.1-0ubuntu0) UNRELEASED; urgency=medium

* Bump project version in CMakeLists.txt
Expand Down
27 changes: 27 additions & 0 deletions src/in_process_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,16 @@ class wlcs::Client::Impl
auto xdg_surface = std::make_shared<XdgSurfaceStable>(client, surface);
auto xdg_toplevel = std::make_shared<XdgToplevelStable>(*xdg_surface);

// Protocol *requires* us to ack the initial configure before attaching a buffer
bool initial_configure_received = false;
EXPECT_CALL(*xdg_surface, configure(testing::_))
.WillOnce(
[&initial_configure_received, xdg_surface = static_cast<struct xdg_surface*>(*xdg_surface)](uint32_t serial)
{
xdg_surface_ack_configure(xdg_surface, serial);
initial_configure_received = true;
});

surface.run_on_destruction([xdg_surface, xdg_toplevel]() mutable
{
xdg_toplevel.reset();
Expand All @@ -801,6 +811,23 @@ class wlcs::Client::Impl

wl_surface_commit(surface);

client.dispatch_until([&initial_configure_received]() { return initial_configure_received; });
/* Make absolutely sure the functor above, which captures a stack variable by reference
* is not going to be invoked outside this function
*/
testing::Mock::VerifyAndClearExpectations(xdg_surface.get());

/* And we might as well ack any subsequent configures.
* Since we don't need to capture anything but the xdg_surface, which has to be
* live if we're getting a callback on it, this is safe to escape this frame
*/
ON_CALL(*xdg_surface, configure(testing::_))
.WillByDefault(
[xdg_surface = static_cast<struct xdg_surface*>(*xdg_surface)](uint32_t serial)
{
xdg_surface_ack_configure(xdg_surface, serial);
});

surface.attach_visible_buffer(width, height);

return surface;
Expand Down
7 changes: 5 additions & 2 deletions tests/xdg_surface_stable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,19 @@ TEST_F(XdgSurfaceStableTest, gets_configure_event)
wlcs::Surface surface{client};
wlcs::XdgSurfaceStable xdg_surface{client, surface};

bool configure_received{false};
EXPECT_CALL(xdg_surface, configure)
.WillOnce([&](auto serial)
{
xdg_surface_ack_configure(xdg_surface, serial);
configure_received = true;
});

wlcs::XdgToplevelStable toplevel{xdg_surface};
surface.attach_buffer(600, 400);
// The first commit triggers an initial xdg_surface.configure event
wl_surface_commit(surface);

client.roundtrip();
client.dispatch_until([&configure_received]() { return configure_received;} );
}

TEST_F(XdgSurfaceStableTest, creating_xdg_surface_from_wl_surface_with_existing_role_is_an_error)
Expand Down
Loading