Mir

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

Proposed by Alan Griffiths on 2017-09-25
Status: Merged
Approved by: Alan Griffiths on 2017-09-26
Approved revision: 4268
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 on 2017-09-26
Chris Halse Rogers 2017-09-25 Approve on 2017-09-25
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.
Chris Halse Rogers (raof) wrote :

LGTM

review: Approve
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)
lp:~alan-griffiths/mir/fix-1719359 updated on 2017-09-25
4268. By Alan Griffiths on 2017-09-25

Fix FTBFS using clang

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
1=== modified file 'examples/miral-shell/miral-app.sh'
2--- examples/miral-shell/miral-app.sh 2017-09-15 16:34:13 +0000
3+++ examples/miral-shell/miral-app.sh 2017-09-25 22:34:34 +0000
4@@ -43,7 +43,7 @@
5 if [ "${bindir}" != "" ]; then bindir="${bindir}/"; fi
6
7 if [ -e "${socket}" ]; then echo "Error: session endpoint '${socket}' already exists"; exit 1 ;fi
8-if [ -e "${wayland_display}" ]; then echo "Error: wayland endpoint '${wayland_display}' already exists"; exit 1 ;fi
9+if [ -e "${XDG_RUNTIME_DIR}/${wayland_display}" ]; then echo "Error: wayland endpoint '${wayland_display}' already exists"; exit 1 ;fi
10
11 qtubuntu_desktop_installed=$(apt list qtubuntu-desktop 2>/dev/null | grep installed | wc -l)
12 if [ "${qtubuntu_desktop_installed}" == "0" ]; then echo "Need qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""; exit 1 ;fi
13
14=== modified file 'include/core/mir/geometry/size.h'
15--- include/core/mir/geometry/size.h 2017-07-28 17:00:43 +0000
16+++ include/core/mir/geometry/size.h 2017-09-25 22:34:34 +0000
17@@ -29,12 +29,12 @@
18
19 struct Size
20 {
21- constexpr Size() {}
22- constexpr Size(Size const&) = default;
23- Size& operator=(Size const&) = default;
24+ constexpr Size() noexcept {}
25+ constexpr Size(Size const&) noexcept = default;
26+ Size& operator=(Size const&) noexcept = default;
27
28 template<typename WidthType, typename HeightType>
29- constexpr Size(WidthType&& width, HeightType&& height) : width(width), height(height) {}
30+ constexpr Size(WidthType&& width, HeightType&& height) noexcept : width(width), height(height) {}
31
32 Width width;
33 Height height;
34
35=== modified file 'src/server/CMakeLists.txt'
36--- src/server/CMakeLists.txt 2017-08-25 08:20:02 +0000
37+++ src/server/CMakeLists.txt 2017-09-25 22:34:34 +0000
38@@ -122,6 +122,7 @@
39 ${GLIB_LDFLAGS} ${GLIB_LIBRARIES}
40 ${UUID_LDFLAGS} ${UUID_LIBRARIES}
41 ${WAYLAND_SERVER_LDFLAGS} ${WAYLAND_SERVER_LIBRARIES}
42+ atomic
43 )
44
45 install(TARGETS mirserver
46
47=== modified file 'src/server/frontend/wayland/wayland_connector.cpp'
48--- src/server/frontend/wayland/wayland_connector.cpp 2017-09-22 15:49:10 +0000
49+++ src/server/frontend/wayland/wayland_connector.cpp 2017-09-25 22:34:34 +0000
50@@ -1190,7 +1190,8 @@
51 : seat{seat},
52 client{client},
53 target{target},
54- event_sink{event_sink}
55+ event_sink{event_sink},
56+ window_size{geometry::Size{0,0}}
57 {
58 }
59
60@@ -1206,11 +1207,17 @@
61 void error_buffer(geometry::Size, MirPixelFormat, std::string const& ) override {}
62 void update_buffer(graphics::Buffer&) override {}
63
64+ void latest_resize(geometry::Size window_size)
65+ {
66+ this->window_size = window_size;
67+ }
68+
69 private:
70 WlSeat* const seat;
71 wl_client* const client;
72 wl_resource* const target;
73 wl_resource* const event_sink;
74+ std::atomic<geometry::Size> window_size;
75 };
76
77 void SurfaceEventSink::handle_event(MirEvent const& event)
78@@ -1220,12 +1227,16 @@
79 case mir_event_type_resize:
80 {
81 auto resize = mir_event_get_resize_event(&event);
82- seat->spawn([event_sink=event_sink,
83- width = mir_resize_event_get_width(resize),
84- height = mir_resize_event_get_height(resize)]()
85+ geometry::Size new_size{mir_resize_event_get_width(resize), mir_resize_event_get_height(resize)};
86+ if (window_size != new_size)
87 {
88- wl_shell_surface_send_configure(event_sink, WL_SHELL_SURFACE_RESIZE_NONE, width, height);
89- });
90+ seat->spawn([event_sink=event_sink,
91+ width = mir_resize_event_get_width(resize),
92+ height = mir_resize_event_get_height(resize)]()
93+ {
94+ wl_shell_surface_send_configure(event_sink, WL_SHELL_SURFACE_RESIZE_NONE, width, height);
95+ });
96+ }
97 break;
98 }
99 case mir_event_type_input:
100@@ -1425,25 +1436,25 @@
101
102 auto params = ms::SurfaceCreationParameters()
103 .of_type(mir_window_type_freestyle)
104- .of_size(geom::Size{100, 100})
105+ .of_size(geom::Size{640, 480})
106 .with_buffer_stream(mir_surface.stream_id);
107
108- surface_id = shell->create_surface(
109- session,
110- params,
111- std::make_shared<SurfaceEventSink>(&seat, client, surface, resource));
112+ auto const sink = std::make_shared<SurfaceEventSink>(&seat, client, surface, resource);
113+ surface_id = shell->create_surface(session, params, sink);
114
115 {
116 // The shell isn't guaranteed to respect the requested size
117 auto const window = session->get_surface(surface_id);
118 auto const size = window->client_size();
119+ sink->latest_resize(size);
120 seat.spawn([resource=resource, height = size.height.as_int(), width = size.width.as_int()]()
121 { wl_shell_surface_send_configure(resource, WL_SHELL_SURFACE_RESIZE_NONE, width, height); });
122 }
123
124 mir_surface.set_resize_handler(
125- [shell, session, id = surface_id](geom::Size new_size)
126+ [shell, session, id = surface_id, sink](geom::Size new_size)
127 {
128+ sink->latest_resize(new_size);
129 shell::SurfaceSpecification new_size_spec;
130 new_size_spec.width = new_size.width;
131 new_size_spec.height = new_size.height;

Subscribers

People subscribed via source and target branches