Mir

Merge lp:~alan-griffiths/mir/fix-1719359 into lp:mir

Proposed by Alan Griffiths
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 4268
Proposed branch: lp:~alan-griffiths/mir/fix-1719359
Merge into: lp:mir
Diff against target: 131 lines (+29/-17)
4 files modified
examples/miral-shell/miral-app.sh (+1/-1)
include/core/mir/geometry/size.h (+4/-4)
src/server/CMakeLists.txt (+1/-0)
src/server/frontend/wayland/wayland_connector.cpp (+23/-12)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1719359
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Chris Halse Rogers Approve
Review via email: mp+331280@code.launchpad.net

Commit message

Don't configure Wayland windows that are already submitting buffers of the correct size. (LP: #1719359)

To post a comment you must log in.
Revision history for this message
Chris Halse Rogers (raof) wrote :

LGTM

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4267
https://mir-jenkins.ubuntu.com/job/mir-ci/3686/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/5053/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5289
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5277
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5277
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5277
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5097/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5097/console
    ABORTED: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5097/console
    ABORTED: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5097/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5097
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5097/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5097
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5097/artifact/output/*zip*/output.zip
    ABORTED: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5097/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3686/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:4268
https://mir-jenkins.ubuntu.com/job/mir-ci/3689/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/5057
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5293
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5281
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5281
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5281
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5101
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5101/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5101
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5101/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5101
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5101/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5101
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5101/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5101
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5101/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5101
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5101/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5101
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5101/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5101
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5101/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3689/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'examples/miral-shell/miral-app.sh'
--- examples/miral-shell/miral-app.sh 2017-09-15 16:34:13 +0000
+++ examples/miral-shell/miral-app.sh 2017-09-25 22:34:34 +0000
@@ -43,7 +43,7 @@
43if [ "${bindir}" != "" ]; then bindir="${bindir}/"; fi43if [ "${bindir}" != "" ]; then bindir="${bindir}/"; fi
4444
45if [ -e "${socket}" ]; then echo "Error: session endpoint '${socket}' already exists"; exit 1 ;fi45if [ -e "${socket}" ]; then echo "Error: session endpoint '${socket}' already exists"; exit 1 ;fi
46if [ -e "${wayland_display}" ]; then echo "Error: wayland endpoint '${wayland_display}' already exists"; exit 1 ;fi46if [ -e "${XDG_RUNTIME_DIR}/${wayland_display}" ]; then echo "Error: wayland endpoint '${wayland_display}' already exists"; exit 1 ;fi
4747
48qtubuntu_desktop_installed=$(apt list qtubuntu-desktop 2>/dev/null | grep installed | wc -l)48qtubuntu_desktop_installed=$(apt list qtubuntu-desktop 2>/dev/null | grep installed | wc -l)
49if [ "${qtubuntu_desktop_installed}" == "0" ]; then echo "Need qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""; exit 1 ;fi49if [ "${qtubuntu_desktop_installed}" == "0" ]; then echo "Need qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""; exit 1 ;fi
5050
=== modified file 'include/core/mir/geometry/size.h'
--- include/core/mir/geometry/size.h 2017-07-28 17:00:43 +0000
+++ include/core/mir/geometry/size.h 2017-09-25 22:34:34 +0000
@@ -29,12 +29,12 @@
2929
30struct Size30struct Size
31{31{
32 constexpr Size() {}32 constexpr Size() noexcept {}
33 constexpr Size(Size const&) = default;33 constexpr Size(Size const&) noexcept = default;
34 Size& operator=(Size const&) = default;34 Size& operator=(Size const&) noexcept = default;
3535
36 template<typename WidthType, typename HeightType>36 template<typename WidthType, typename HeightType>
37 constexpr Size(WidthType&& width, HeightType&& height) : width(width), height(height) {}37 constexpr Size(WidthType&& width, HeightType&& height) noexcept : width(width), height(height) {}
3838
39 Width width;39 Width width;
40 Height height;40 Height height;
4141
=== modified file 'src/server/CMakeLists.txt'
--- src/server/CMakeLists.txt 2017-08-25 08:20:02 +0000
+++ src/server/CMakeLists.txt 2017-09-25 22:34:34 +0000
@@ -122,6 +122,7 @@
122 ${GLIB_LDFLAGS} ${GLIB_LIBRARIES}122 ${GLIB_LDFLAGS} ${GLIB_LIBRARIES}
123 ${UUID_LDFLAGS} ${UUID_LIBRARIES}123 ${UUID_LDFLAGS} ${UUID_LIBRARIES}
124 ${WAYLAND_SERVER_LDFLAGS} ${WAYLAND_SERVER_LIBRARIES}124 ${WAYLAND_SERVER_LDFLAGS} ${WAYLAND_SERVER_LIBRARIES}
125 atomic
125)126)
126127
127install(TARGETS mirserver128install(TARGETS mirserver
128129
=== modified file 'src/server/frontend/wayland/wayland_connector.cpp'
--- src/server/frontend/wayland/wayland_connector.cpp 2017-09-22 15:49:10 +0000
+++ src/server/frontend/wayland/wayland_connector.cpp 2017-09-25 22:34:34 +0000
@@ -1190,7 +1190,8 @@
1190 : seat{seat},1190 : seat{seat},
1191 client{client},1191 client{client},
1192 target{target},1192 target{target},
1193 event_sink{event_sink}1193 event_sink{event_sink},
1194 window_size{geometry::Size{0,0}}
1194 {1195 {
1195 }1196 }
11961197
@@ -1206,11 +1207,17 @@
1206 void error_buffer(geometry::Size, MirPixelFormat, std::string const& ) override {}1207 void error_buffer(geometry::Size, MirPixelFormat, std::string const& ) override {}
1207 void update_buffer(graphics::Buffer&) override {}1208 void update_buffer(graphics::Buffer&) override {}
12081209
1210 void latest_resize(geometry::Size window_size)
1211 {
1212 this->window_size = window_size;
1213 }
1214
1209private:1215private:
1210 WlSeat* const seat;1216 WlSeat* const seat;
1211 wl_client* const client;1217 wl_client* const client;
1212 wl_resource* const target;1218 wl_resource* const target;
1213 wl_resource* const event_sink;1219 wl_resource* const event_sink;
1220 std::atomic<geometry::Size> window_size;
1214};1221};
12151222
1216void SurfaceEventSink::handle_event(MirEvent const& event)1223void SurfaceEventSink::handle_event(MirEvent const& event)
@@ -1220,12 +1227,16 @@
1220 case mir_event_type_resize:1227 case mir_event_type_resize:
1221 {1228 {
1222 auto resize = mir_event_get_resize_event(&event);1229 auto resize = mir_event_get_resize_event(&event);
1223 seat->spawn([event_sink=event_sink,1230 geometry::Size new_size{mir_resize_event_get_width(resize), mir_resize_event_get_height(resize)};
1224 width = mir_resize_event_get_width(resize),1231 if (window_size != new_size)
1225 height = mir_resize_event_get_height(resize)]()
1226 {1232 {
1227 wl_shell_surface_send_configure(event_sink, WL_SHELL_SURFACE_RESIZE_NONE, width, height);1233 seat->spawn([event_sink=event_sink,
1228 });1234 width = mir_resize_event_get_width(resize),
1235 height = mir_resize_event_get_height(resize)]()
1236 {
1237 wl_shell_surface_send_configure(event_sink, WL_SHELL_SURFACE_RESIZE_NONE, width, height);
1238 });
1239 }
1229 break;1240 break;
1230 }1241 }
1231 case mir_event_type_input:1242 case mir_event_type_input:
@@ -1425,25 +1436,25 @@
14251436
1426 auto params = ms::SurfaceCreationParameters()1437 auto params = ms::SurfaceCreationParameters()
1427 .of_type(mir_window_type_freestyle)1438 .of_type(mir_window_type_freestyle)
1428 .of_size(geom::Size{100, 100})1439 .of_size(geom::Size{640, 480})
1429 .with_buffer_stream(mir_surface.stream_id);1440 .with_buffer_stream(mir_surface.stream_id);
14301441
1431 surface_id = shell->create_surface(1442 auto const sink = std::make_shared<SurfaceEventSink>(&seat, client, surface, resource);
1432 session,1443 surface_id = shell->create_surface(session, params, sink);
1433 params,
1434 std::make_shared<SurfaceEventSink>(&seat, client, surface, resource));
14351444
1436 {1445 {
1437 // The shell isn't guaranteed to respect the requested size1446 // The shell isn't guaranteed to respect the requested size
1438 auto const window = session->get_surface(surface_id);1447 auto const window = session->get_surface(surface_id);
1439 auto const size = window->client_size();1448 auto const size = window->client_size();
1449 sink->latest_resize(size);
1440 seat.spawn([resource=resource, height = size.height.as_int(), width = size.width.as_int()]()1450 seat.spawn([resource=resource, height = size.height.as_int(), width = size.width.as_int()]()
1441 { wl_shell_surface_send_configure(resource, WL_SHELL_SURFACE_RESIZE_NONE, width, height); });1451 { wl_shell_surface_send_configure(resource, WL_SHELL_SURFACE_RESIZE_NONE, width, height); });
1442 }1452 }
14431453
1444 mir_surface.set_resize_handler(1454 mir_surface.set_resize_handler(
1445 [shell, session, id = surface_id](geom::Size new_size)1455 [shell, session, id = surface_id, sink](geom::Size new_size)
1446 {1456 {
1457 sink->latest_resize(new_size);
1447 shell::SurfaceSpecification new_size_spec;1458 shell::SurfaceSpecification new_size_spec;
1448 new_size_spec.width = new_size.width;1459 new_size_spec.width = new_size.width;
1449 new_size_spec.height = new_size.height;1460 new_size_spec.height = new_size.height;

Subscribers

People subscribed via source and target branches