Mir

Merge lp:~vanvugt/mir/async-is-not-sync into lp:mir

Proposed by Daniel van Vugt
Status: Rejected
Rejected by: Cemil Azizoglu
Proposed branch: lp:~vanvugt/mir/async-is-not-sync
Merge into: lp:mir
Prerequisite: lp:~mir-team/mir/rename-mir_window_create
Diff against target: 1348 lines (+132/-132)
52 files modified
benchmarks/frame-uniformity/touch_measuring_client.cpp (+1/-1)
examples/basic.c (+1/-1)
examples/client_helpers.cpp (+1/-1)
examples/eglapp.c (+1/-1)
examples/fingerpaint.c (+1/-1)
examples/flicker.c (+1/-1)
examples/multiwin.c (+3/-3)
examples/progressbar.c (+1/-1)
examples/release_at_exit.c (+1/-1)
examples/tooltip.c (+1/-1)
include/client/mir_toolkit/mir_screencast.h (+1/-1)
include/client/mir_toolkit/mir_surface.h (+20/-20)
playground/egldiamond_render_surface.c (+1/-1)
playground/mir_demo_client_chain_jumping_buffers.c (+1/-1)
playground/mir_demo_client_prerendered_frames.c (+1/-1)
playground/render_surface.cpp (+1/-1)
src/client/mir_surface_api.cpp (+5/-5)
src/client/symbols.map (+1/-1)
src/platforms/android/utils/test_android_hardware_sanity.cpp (+2/-2)
src/server/graphics/nested/mir_client_host_connection.cpp (+1/-1)
tests/acceptance-tests/test_buffer_stream_arrangement.cpp (+2/-2)
tests/acceptance-tests/test_client_cookie.cpp (+1/-1)
tests/acceptance-tests/test_client_cursor_api.cpp (+1/-1)
tests/acceptance-tests/test_client_focus_notification.cpp (+1/-1)
tests/acceptance-tests/test_client_input.cpp (+1/-1)
tests/acceptance-tests/test_client_library.cpp (+26/-26)
tests/acceptance-tests/test_client_library_errors.cpp (+5/-5)
tests/acceptance-tests/test_client_logging.cpp (+1/-1)
tests/acceptance-tests/test_client_surface_events.cpp (+2/-2)
tests/acceptance-tests/test_client_surface_visibility.cpp (+1/-1)
tests/acceptance-tests/test_client_surfaces.cpp (+11/-11)
tests/acceptance-tests/test_confined_pointer.cpp (+1/-1)
tests/acceptance-tests/test_custom_window_management.cpp (+8/-8)
tests/acceptance-tests/test_display_configuration.cpp (+1/-1)
tests/acceptance-tests/test_nested_mir.cpp (+1/-1)
tests/acceptance-tests/test_new_display_configuration.cpp (+1/-1)
tests/acceptance-tests/test_presentation_chain.cpp (+3/-3)
tests/acceptance-tests/test_render_surface.cpp (+3/-3)
tests/acceptance-tests/test_server_disconnect.cpp (+1/-1)
tests/acceptance-tests/test_surface_morphing.cpp (+1/-1)
tests/acceptance-tests/test_surface_placement.cpp (+2/-2)
tests/acceptance-tests/test_system_compositor_window_manager.cpp (+1/-1)
tests/integration-tests/client/test_mirsurface.cpp (+1/-1)
tests/integration-tests/test_error_reporting.cpp (+1/-1)
tests/integration-tests/test_surfaceloop.cpp (+2/-2)
tests/mir_test_framework/any_surface.cpp (+1/-1)
tests/mir_test_framework/connected_client_with_a_surface.cpp (+1/-1)
tests/mir_test_framework/visible_surface.cpp (+1/-1)
tests/performance-tests/test_client_startup.cpp (+1/-1)
tests/privileged-tests/test_input_events.cpp (+1/-1)
tests/test-clients/impolite-shutdown/scroll.cpp (+1/-1)
tests/test-clients/mir-stress/src/client.cpp (+1/-1)
To merge this branch: bzr merge lp:~vanvugt/mir/async-is-not-sync
Reviewer Review Type Date Requested Status
Cemil Azizoglu (community) Disapprove
Andreas Pokorny (community) Disapprove
Mir CI Bot continuous-integration Approve
Alan Griffiths Needs Information
Alberto Aguirre (community) Approve
Review via email: mp+314797@code.launchpad.net

Commit message

Proof of concept to simplify spelling of the more commonly used synchronous functions:
   s/mir_create_window/mir_create_window_async/g
   s/mir_create_window_sync/mir_create_window/g

Description of the change

Request for comments. If people like this we can do it for other functions too.

I think it's important we discuss this now. If the main priority for 1.0 is to get the client API right...

Yes, I've modified the 0.26 ABI. If it lands then we can backport to lp:mir/0.26

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3936
https://mir-jenkins.ubuntu.com/job/mir-ci/2715/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/3530
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3598
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3588
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3588
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3588
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3557
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3557/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3557
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3557/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3557
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3557/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3557
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3557/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3557
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3557/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3557
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3557/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

We don't really use async anywhere else. I prefer not to do this. If people like it I don't mind abstaining.

review: Disapprove
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I know we don't use it, but we should :) Wait to hear more thoughts...

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Apart from "too late now" there are two arguments:

/1/ the "sync" version is more common and should have the shorter name
/2/ the "sync" version is more specialized and should have the longer name

The former is certainly true of our test and example code. (I'm not sure of a good codebase to assess it in the real world.)

The latter is also true. It also calls out that call might take some significant time to return.

I'm marginally in favour of what we have now.

review: Disapprove
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

Just going by our current main toolkits, gdk and qtubuntu, both of those use _sync versions...

So approve based on current toolkit usage.

review: Approve
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

SDL also seems to prefer the *_sync versions.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

*Needs Discussion*

Hmm. If no downstream uses it should we simply remove the async option?

review: Needs Information
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

> *Needs Discussion*
>
> Hmm. If no downstream uses it should we simply remove the async option?

Maybe?

We can always introduce async methods later, after we have a good manual dispatch solution to address the callback safety concerns from a user's perspective.

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

To add more things that use mir:

Kodi also uses *_sync functions...

content-hub uses apis in a synchronous fashion:
mir_wait_for(mir_prompt_session_new_fds_for_prompt_providers(
        d->m_mirSession, 1, client_fd_callback, d));

lp:~vanvugt/mir/async-is-not-sync updated
3937. By Daniel van Vugt

Merge latest trunk

3938. By Daniel van Vugt

Merge latest trunk and fix lots of conflicts

3939. By Daniel van Vugt

Remove dead code

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The manual dispatch problem is actually pretty simple. I solved it back in 2014 but decided not to propose the solution when I realized I had solved it using entirely public APIs (so it did not need to live in libmirclient at all)...
https://code.launchpad.net/~vanvugt/mir/event-queue/+merge/208563

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

FAILED: Continuous integration, rev:3938
https://mir-jenkins.ubuntu.com/job/mir-ci/2765/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/3625/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3700
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3690
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3690
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3690
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3652
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3652/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3652/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3652
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3652/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3652
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3652/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3652
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3652/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3652/console

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

^^^
Bug 1646558, plus WTF:

04:30:01 15: [ FAILED ] 3 tests, listed below:
04:30:01 15: [ FAILED ] FocusSelection.when_client_connects_shell_is_notified_of_session
04:30:01 15: [ FAILED ] Process.a_main_fn_is_executed
04:30:01 15: [ FAILED ] Process.a_successful_exit_function_succeeds

lp:~vanvugt/mir/async-is-not-sync updated
3940. By Daniel van Vugt

Try again

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3939
https://mir-jenkins.ubuntu.com/job/mir-ci/2767/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/3627
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3702
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3692
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3692
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3692
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3654
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3654/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3654
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3654/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3654
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3654/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3654
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3654/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3654
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3654/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3654
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3654/artifact/output/*zip*/output.zip

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

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

FAILED: Continuous integration, rev:3940
https://mir-jenkins.ubuntu.com/job/mir-ci/2769/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/3630/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3705
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3695
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3695
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3695
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3657
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3657/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3657
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3657/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3657/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3657
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3657/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3657
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3657/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3657
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3657/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
lp:~vanvugt/mir/async-is-not-sync updated
3941. By Daniel van Vugt

Merge latest trunk

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

PASSED: Continuous integration, rev:3941
https://mir-jenkins.ubuntu.com/job/mir-ci/2770/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/3631
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/3706
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/3696
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/3696
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/3696
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/3658/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/3658/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/3658/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/3658/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/3658/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3658
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/3658/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

I think we should incentivise clients to use the async version.. and make clear which calls might include round-trips to the server. So I have a weak preference of the current state - async being the shorter version and "_sync" kind of standing out.

I think it would be more helpful to hand out an fd to make the toolkits or clients gain control over the dispatch.

review: Disapprove
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

This was discussed in the standup. I'll summarize the opinions against it to go with Alberto's favorable opinion above.

What you are proposing is to change not just what this MP changes but all the async/sync functions. This is a huge change (evidenced by the size of this branch just to change one of them). We do not have the time to do it in Mir 0.26 timeframe for sure - it's already late. Besides, toolkits have already written their code, and renaming to make their lives easier will make it harder for them because now they'd have to change their code to adapt to all the new names.

Another argument against this is that calling out 'sync' in the function name provides a visual clue for the user that this function may take longer than other functions that do not have 'sync' suffix (i.e. do not need to contact to server).

Yet another argument is that it's a lot of busy work for not enough gain (even if we didn't take the time crunch that we're in into account).

We can have a wider team discussion in an upcoming sprint to see if everyone can be convinced that this is a good idea.

review: Disapprove
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That makes perfect, but partial sense.

The sole justification for looking at doing a 1.0 release soon was to get the API right. And this certainly comes under that heading. Although realistically I don't think we're going to get everything right in 1.0.

Your justification for rejecting this branch is actually a strong argument against the wide scale API breaks we've been pushing through at high speed recently. Indeed we've broken too much too quickly. If we acknowledge and accept that then I think this branch should be a part of it, and helps us to get the API closer to right.

Unmerged revisions

3941. By Daniel van Vugt

Merge latest trunk

3940. By Daniel van Vugt

Try again

3939. By Daniel van Vugt

Remove dead code

3938. By Daniel van Vugt

Merge latest trunk and fix lots of conflicts

3937. By Daniel van Vugt

Merge latest trunk

3936. By Daniel van Vugt

First attempt

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'benchmarks/frame-uniformity/touch_measuring_client.cpp'
--- benchmarks/frame-uniformity/touch_measuring_client.cpp 2017-01-18 02:29:37 +0000
+++ benchmarks/frame-uniformity/touch_measuring_client.cpp 2017-01-19 08:14:45 +0000
@@ -40,7 +40,7 @@
40 mir_window_spec_set_name(spec, "frame-uniformity-test");40 mir_window_spec_set_name(spec, "frame-uniformity-test");
41 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);41 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);
4242
43 auto window = mir_create_window_sync(spec);43 auto window = mir_create_window(spec);
44 mir_window_spec_release(spec);44 mir_window_spec_release(spec);
45 45
46 if (!mir_window_is_valid(window))46 if (!mir_window_is_valid(window))
4747
=== modified file 'examples/basic.c'
--- examples/basic.c 2017-01-18 19:57:47 +0000
+++ examples/basic.c 2017-01-19 08:14:45 +0000
@@ -117,7 +117,7 @@
117117
118 ///\internal [surface_create_tag]118 ///\internal [surface_create_tag]
119 // ...we create a surface using that format.119 // ...we create a surface using that format.
120 mcd.window = mir_create_window_sync(spec);120 mcd.window = mir_create_window(spec);
121 puts("Window created");121 puts("Window created");
122 ///\internal [surface_create_tag]122 ///\internal [surface_create_tag]
123123
124124
=== modified file 'examples/client_helpers.cpp'
--- examples/client_helpers.cpp 2017-01-18 02:29:37 +0000
+++ examples/client_helpers.cpp 2017-01-19 08:14:45 +0000
@@ -155,7 +155,7 @@
155 mir_window_spec_set_pixel_format(spec.get(), selected_format);155 mir_window_spec_set_pixel_format(spec.get(), selected_format);
156 mir_window_spec_set_name(spec.get(), __PRETTY_FUNCTION__);156 mir_window_spec_set_name(spec.get(), __PRETTY_FUNCTION__);
157 mir_window_spec_set_buffer_usage(spec.get(), hardware ? mir_buffer_usage_hardware : mir_buffer_usage_software);157 mir_window_spec_set_buffer_usage(spec.get(), hardware ? mir_buffer_usage_hardware : mir_buffer_usage_software);
158 auto window = mir_create_window_sync(spec.get());158 auto window = mir_create_window(spec.get());
159 return window;159 return window;
160}160}
161161
162162
=== modified file 'examples/eglapp.c'
--- examples/eglapp.c 2017-01-18 02:29:37 +0000
+++ examples/eglapp.c 2017-01-19 08:14:45 +0000
@@ -487,7 +487,7 @@
487 if (output_id != mir_display_output_id_invalid)487 if (output_id != mir_display_output_id_invalid)
488 mir_window_spec_set_fullscreen_on_output(spec, output_id);488 mir_window_spec_set_fullscreen_on_output(spec, output_id);
489489
490 window = mir_create_window_sync(spec);490 window = mir_create_window(spec);
491 mir_window_spec_release(spec);491 mir_window_spec_release(spec);
492492
493 CHECK(mir_window_is_valid(window), "Can't create a window");493 CHECK(mir_window_is_valid(window), "Can't create a window");
494494
=== modified file 'examples/fingerpaint.c'
--- examples/fingerpaint.c 2017-01-18 13:59:18 +0000
+++ examples/fingerpaint.c 2017-01-19 08:14:45 +0000
@@ -456,7 +456,7 @@
456 mir_window_spec_set_name(spec, "Mir Fingerpaint");456 mir_window_spec_set_name(spec, "Mir Fingerpaint");
457 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);457 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);
458458
459 window = mir_create_window_sync(spec);459 window = mir_create_window(spec);
460 mir_window_spec_release(spec);460 mir_window_spec_release(spec);
461461
462 if (window != NULL)462 if (window != NULL)
463463
=== modified file 'examples/flicker.c'
--- examples/flicker.c 2017-01-18 02:29:37 +0000
+++ examples/flicker.c 2017-01-19 08:14:45 +0000
@@ -159,7 +159,7 @@
159 mir_window_spec_set_name(spec, __FILE__);159 mir_window_spec_set_name(spec, __FILE__);
160 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);160 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);
161161
162 window = mir_create_window_sync(spec);162 window = mir_create_window(spec);
163 mir_window_spec_release(spec);163 mir_window_spec_release(spec);
164164
165 assert(window != NULL);165 assert(window != NULL);
166166
=== modified file 'examples/multiwin.c'
--- examples/multiwin.c 2017-01-18 02:29:37 +0000
+++ examples/multiwin.c 2017-01-19 08:14:45 +0000
@@ -255,7 +255,7 @@
255 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);255 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);
256 mir_window_spec_set_name(spec, "red");256 mir_window_spec_set_name(spec, "red");
257257
258 win[0].window = mir_create_window_sync(spec);258 win[0].window = mir_create_window(spec);
259 win[0].fill.r = 0xff;259 win[0].fill.r = 0xff;
260 win[0].fill.g = 0x00;260 win[0].fill.g = 0x00;
261 win[0].fill.b = 0x00;261 win[0].fill.b = 0x00;
@@ -265,7 +265,7 @@
265 mir_window_spec_set_name(spec, "green");265 mir_window_spec_set_name(spec, "green");
266 mir_window_spec_set_width(spec, 300);266 mir_window_spec_set_width(spec, 300);
267 mir_window_spec_set_height(spec, 150);267 mir_window_spec_set_height(spec, 150);
268 win[1].window = mir_create_window_sync(spec);268 win[1].window = mir_create_window(spec);
269 win[1].fill.r = 0x00;269 win[1].fill.r = 0x00;
270 win[1].fill.g = 0xff;270 win[1].fill.g = 0xff;
271 win[1].fill.b = 0x00;271 win[1].fill.b = 0x00;
@@ -275,7 +275,7 @@
275 mir_window_spec_set_name(spec, "blue");275 mir_window_spec_set_name(spec, "blue");
276 mir_window_spec_set_width(spec, 150);276 mir_window_spec_set_width(spec, 150);
277 mir_window_spec_set_height(spec, 300);277 mir_window_spec_set_height(spec, 300);
278 win[2].window = mir_create_window_sync(spec);278 win[2].window = mir_create_window(spec);
279 win[2].fill.r = 0x00;279 win[2].fill.r = 0x00;
280 win[2].fill.g = 0x00;280 win[2].fill.g = 0x00;
281 win[2].fill.b = 0xff;281 win[2].fill.b = 0xff;
282282
=== modified file 'examples/progressbar.c'
--- examples/progressbar.c 2017-01-18 02:29:37 +0000
+++ examples/progressbar.c 2017-01-19 08:14:45 +0000
@@ -267,7 +267,7 @@
267267
268 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);268 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);
269269
270 window = mir_create_window_sync(spec);270 window = mir_create_window(spec);
271 mir_window_spec_release(spec);271 mir_window_spec_release(spec);
272272
273 if (window != NULL)273 if (window != NULL)
274274
=== modified file 'examples/release_at_exit.c'
--- examples/release_at_exit.c 2017-01-18 02:29:37 +0000
+++ examples/release_at_exit.c 2017-01-19 08:14:45 +0000
@@ -55,7 +55,7 @@
55 MirWindowSpec *spec = mir_create_normal_window_spec(connection, 640, 480);55 MirWindowSpec *spec = mir_create_normal_window_spec(connection, 640, 480);
56 mir_window_spec_set_pixel_format(spec, pixel_format);56 mir_window_spec_set_pixel_format(spec, pixel_format);
5757
58 window = mir_create_window_sync(spec);58 window = mir_create_window(spec);
59 mir_window_spec_release(spec);59 mir_window_spec_release(spec);
6060
61 mir_window_release_sync(window);61 mir_window_release_sync(window);
6262
=== modified file 'examples/tooltip.c'
--- examples/tooltip.c 2017-01-18 02:29:37 +0000
+++ examples/tooltip.c 2017-01-19 08:14:45 +0000
@@ -113,7 +113,7 @@
113 mir_window_spec_set_min_height(spec, height);113 mir_window_spec_set_min_height(spec, height);
114 mir_window_spec_set_max_height(spec, height);114 mir_window_spec_set_max_height(spec, height);
115115
116 MirWindow* tooltip = mir_create_window_sync(spec);116 MirWindow* tooltip = mir_create_window(spec);
117 mir_window_spec_release(spec);117 mir_window_spec_release(spec);
118118
119 MirBufferStream* const bs = mir_window_get_buffer_stream(tooltip);119 MirBufferStream* const bs = mir_window_get_buffer_stream(tooltip);
120120
=== modified file 'include/client/mir_toolkit/mir_screencast.h'
--- include/client/mir_toolkit/mir_screencast.h 2017-01-18 02:29:37 +0000
+++ include/client/mir_toolkit/mir_screencast.h 2017-01-19 08:14:45 +0000
@@ -35,7 +35,7 @@
35 *35 *
36 * \param [in] connection a valid mir connection36 * \param [in] connection a valid mir connection
37 * \return A handle that can ultimately be passed to37 * \return A handle that can ultimately be passed to
38 * mir_create_window() or mir_window_apply_spec()38 * mir_create_window_async() or mir_window_apply_spec()
39 */39 */
40MirScreencastSpec* mir_create_screencast_spec(MirConnection* connection);40MirScreencastSpec* mir_create_screencast_spec(MirConnection* connection);
4141
4242
=== modified file 'include/client/mir_toolkit/mir_surface.h'
--- include/client/mir_toolkit/mir_surface.h 2017-01-18 04:43:15 +0000
+++ include/client/mir_toolkit/mir_surface.h 2017-01-19 08:14:45 +0000
@@ -43,7 +43,7 @@
43 * \param [in] width Requested width. The server is not guaranteed to return a window of this width.43 * \param [in] width Requested width. The server is not guaranteed to return a window of this width.
44 * \param [in] height Requested height. The server is not guaranteed to return a window of this height.44 * \param [in] height Requested height. The server is not guaranteed to return a window of this height.
45 *45 *
46 * \return A handle that can be passed to mir_create_window() to complete construction.46 * \return A handle that can be passed to mir_create_window_async() to complete construction.
47 */47 */
48MirWindowSpec* mir_create_normal_window_spec(MirConnection* connection,48MirWindowSpec* mir_create_normal_window_spec(MirConnection* connection,
49 int width, int height);49 int width, int height);
@@ -69,7 +69,7 @@
69 * location.69 * location.
70 * \param [in] edge The preferred edge direction to attach to. Use70 * \param [in] edge The preferred edge direction to attach to. Use
71 * mir_edge_attachment_any for no preference.71 * mir_edge_attachment_any for no preference.
72 * \return A handle that can be passed to mir_create_window()72 * \return A handle that can be passed to mir_create_window_async()
73 * to complete construction.73 * to complete construction.
74 */74 */
75MirWindowSpec*75MirWindowSpec*
@@ -100,7 +100,7 @@
100 * location.100 * location.
101 * \param [in] edge The preferred edge direction to attach to. Use101 * \param [in] edge The preferred edge direction to attach to. Use
102 * mir_edge_attachment_any for no preference.102 * mir_edge_attachment_any for no preference.
103 * \return A handle that can be passed to mir_create_window()103 * \return A handle that can be passed to mir_create_window_async()
104 * to complete construction.104 * to complete construction.
105 */105 */
106MirWindowSpec*106MirWindowSpec*
@@ -163,7 +163,7 @@
163 * \param [in] connection Connection the window will be created on163 * \param [in] connection Connection the window will be created on
164 * \param [in] width Requested width. The server is not guaranteed to return a window of this width.164 * \param [in] width Requested width. The server is not guaranteed to return a window of this width.
165 * \param [in] height Requested height. The server is not guaranteed to return a window of this height.165 * \param [in] height Requested height. The server is not guaranteed to return a window of this height.
166 * \return A handle that can be passed to mir_create_window() to complete construction.166 * \return A handle that can be passed to mir_create_window_async() to complete construction.
167 */167 */
168MirWindowSpec*168MirWindowSpec*
169mir_create_input_method_window_spec(MirConnection* connection,169mir_create_input_method_window_spec(MirConnection* connection,
@@ -171,15 +171,15 @@
171171
172/**172/**
173 * Create a window specification.173 * Create a window specification.
174 * This can be used with mir_create_window() to create a window or with174 * This can be used with mir_create_window_async() to create a window or with
175 * mir_window_apply_spec() to change an existing window.175 * mir_window_apply_spec() to change an existing window.
176 * \remark For use with mir_create_window() at least the type, width, height,176 * \remark For use with mir_create_window_async() at least the type, width, height,
177 * format and buffer_usage must be set. (And for types requiring a parent that177 * format and buffer_usage must be set. (And for types requiring a parent that
178 * too must be set.)178 * too must be set.)
179 *179 *
180 * \param [in] connection a valid mir connection180 * \param [in] connection a valid mir connection
181 * \return A handle that can ultimately be passed to181 * \return A handle that can ultimately be passed to
182 * mir_create_window() or mir_window_apply_spec()182 * mir_create_window_async() or mir_window_apply_spec()
183 */183 */
184MirWindowSpec* mir_create_window_spec(MirConnection* connection);184MirWindowSpec* mir_create_window_spec(MirConnection* connection);
185185
@@ -193,7 +193,7 @@
193193
194/**194/**
195 * Update a window specification with a window type.195 * Update a window specification with a window type.
196 * This can be used with mir_create_window() to create a window or with196 * This can be used with mir_create_window_async() to create a window or with
197 * mir_window_apply_spec() to change an existing window.197 * mir_window_apply_spec() to change an existing window.
198 * \remark For use with mir_window_apply_spec() the shell need not support198 * \remark For use with mir_window_apply_spec() the shell need not support
199 * arbitrary changes of type and some target types may require the setting of199 * arbitrary changes of type and some target types may require the setting of
@@ -345,7 +345,7 @@
345 * \param [in] spec Specification to mutate345 * \param [in] spec Specification to mutate
346 * \param [in] output_id ID of output to place window on. From MirDisplayOutput.output_id346 * \param [in] output_id ID of output to place window on. From MirDisplayOutput.output_id
347 *347 *
348 * \note If this call returns %true then a valid window returned from mir_create_window() is348 * \note If this call returns %true then a valid window returned from mir_create_window_async() is
349 * guaranteed to be fullscreen on the specified output. An invalid window is returned349 * guaranteed to be fullscreen on the specified output. An invalid window is returned
350 * if the server unable to, or policy prevents it from, honouring this request.350 * if the server unable to, or policy prevents it from, honouring this request.
351 */351 */
@@ -357,7 +357,7 @@
357 * \param [in] mode Requested preferred orientation357 * \param [in] mode Requested preferred orientation
358 *358 *
359 * \note If the server is unable to create a window with the preferred orientation at359 * \note If the server is unable to create a window with the preferred orientation at
360 * the point mir_create_window() is called it will instead return an invalid window.360 * the point mir_create_window_async() is called it will instead return an invalid window.
361 */361 */
362void mir_window_spec_set_preferred_orientation(MirWindowSpec* spec, MirOrientationMode mode);362void mir_window_spec_set_preferred_orientation(MirWindowSpec* spec, MirOrientationMode mode);
363363
@@ -375,9 +375,9 @@
375 * mir_edge_attachment_any for no preference.375 * mir_edge_attachment_any for no preference.
376 * \return False if the operation is invalid for this window type.376 * \return False if the operation is invalid for this window type.
377 *377 *
378 * \note If the parent window becomes invalid before mir_create_window() is processed,378 * \note If the parent window becomes invalid before mir_create_window_async() is processed,
379 * it will return an invalid window. If the parent window is valid at the time379 * it will return an invalid window. If the parent window is valid at the time
380 * mir_create_window() is called but is later closed, this window will also receive380 * mir_create_window_async() is called but is later closed, this window will also receive
381 * a close event.381 * a close event.
382 */382 */
383bool mir_window_spec_attach_to_foreign_parent(MirWindowSpec* spec,383bool mir_window_spec_attach_to_foreign_parent(MirWindowSpec* spec,
@@ -391,7 +391,7 @@
391 * \param [in] state Requested state391 * \param [in] state Requested state
392 *392 *
393 * \note If the server is unable to create a window with the requested state at393 * \note If the server is unable to create a window with the requested state at
394 * the point mir_create_window() is called it will instead return an invalid window.394 * the point mir_create_window_async() is called it will instead return an invalid window.
395 */395 */
396void mir_window_spec_set_state(MirWindowSpec* spec, MirWindowState state);396void mir_window_spec_set_state(MirWindowSpec* spec, MirWindowState state);
397397
@@ -492,7 +492,7 @@
492 *492 *
493 * \note If this call returns %true then the server is guaranteed to honour this request.493 * \note If this call returns %true then the server is guaranteed to honour this request.
494 * If the server is unable to create a window with this pixel format at494 * If the server is unable to create a window with this pixel format at
495 * the point mir_create_window() is called it will instead return an invalid window.495 * the point mir_create_window_async() is called it will instead return an invalid window.
496 */496 */
497void mir_window_spec_set_pixel_format(MirWindowSpec* spec, MirPixelFormat format);497void mir_window_spec_set_pixel_format(MirWindowSpec* spec, MirPixelFormat format);
498498
@@ -505,7 +505,7 @@
505 *505 *
506 * \note If this call returns %true then the server is guaranteed to honour this request.506 * \note If this call returns %true then the server is guaranteed to honour this request.
507 * If the server is unable to create a window with this buffer usage at507 * If the server is unable to create a window with this buffer usage at
508 * the point mir_create_window() is called it will instead return an invalid window.508 * the point mir_create_window_async() is called it will instead return an invalid window.
509 */509 */
510void mir_window_spec_set_buffer_usage(MirWindowSpec* spec, MirBufferUsage usage);510void mir_window_spec_set_buffer_usage(MirWindowSpec* spec, MirBufferUsage usage);
511511
@@ -560,7 +560,7 @@
560 * non-null MirWindow*, but the window may be invalid in560 * non-null MirWindow*, but the window may be invalid in
561 * case of an error.561 * case of an error.
562 */562 */
563void mir_create_window(MirWindowSpec* requested_specification,563void mir_create_window_async(MirWindowSpec* requested_specification,
564 MirWindowCallback callback, void* context);564 MirWindowCallback callback, void* context);
565565
566/**566/**
@@ -569,7 +569,7 @@
569 * \return The new window. This is guaranteed non-null, but may be invalid569 * \return The new window. This is guaranteed non-null, but may be invalid
570 * in the case of error.570 * in the case of error.
571 */571 */
572MirWindow* mir_create_window_sync(MirWindowSpec* requested_specification);572MirWindow* mir_create_window(MirWindowSpec* requested_specification);
573573
574/**574/**
575 * Release the supplied window and any associated buffer.575 * Release the supplied window and any associated buffer.
@@ -937,11 +937,11 @@
937937
938MirWaitHandle* mir_surface_create(MirSurfaceSpec* requested_specification,938MirWaitHandle* mir_surface_create(MirSurfaceSpec* requested_specification,
939 mir_surface_callback callback, void* context)939 mir_surface_callback callback, void* context)
940__attribute__((deprecated("use mir_create_window_async() instead")));
941
942MirSurface* mir_surface_create_sync(MirSurfaceSpec* requested_specification)
940__attribute__((deprecated("use mir_create_window() instead")));943__attribute__((deprecated("use mir_create_window() instead")));
941944
942MirSurface* mir_surface_create_sync(MirSurfaceSpec* requested_specification)
943__attribute__((deprecated("use mir_create_window_sync() instead")));
944
945MirWaitHandle *mir_surface_release(945MirWaitHandle *mir_surface_release(
946 MirSurface *surface,946 MirSurface *surface,
947 mir_surface_callback callback,947 mir_surface_callback callback,
948948
=== modified file 'playground/egldiamond_render_surface.c'
--- playground/egldiamond_render_surface.c 2017-01-18 02:29:37 +0000
+++ playground/egldiamond_render_surface.c 2017-01-19 08:14:45 +0000
@@ -237,7 +237,7 @@
237237
238 mir_window_spec_set_event_handler(spec, resize_callback, render_surface);238 mir_window_spec_set_event_handler(spec, resize_callback, render_surface);
239239
240 window = mir_create_window_sync(spec);240 window = mir_create_window(spec);
241 mir_window_spec_release(spec);241 mir_window_spec_release(spec);
242242
243 CHECK(eglsurface != EGL_NO_SURFACE, "eglCreateWindowSurface failed");243 CHECK(eglsurface != EGL_NO_SURFACE, "eglCreateWindowSurface failed");
244244
=== modified file 'playground/mir_demo_client_chain_jumping_buffers.c'
--- playground/mir_demo_client_chain_jumping_buffers.c 2017-01-18 02:29:37 +0000
+++ playground/mir_demo_client_chain_jumping_buffers.c 2017-01-19 08:14:45 +0000
@@ -211,7 +211,7 @@
211 spec, render_surface[2], chain_width, chain_height, displacement_x, chain_height);211 spec, render_surface[2], chain_width, chain_height, displacement_x, chain_height);
212 mir_surface_spec_add_render_surface(212 mir_surface_spec_add_render_surface(
213 spec, render_surface[3], chain_width, chain_height, chain_width, chain_height);213 spec, render_surface[3], chain_width, chain_height, chain_width, chain_height);
214 MirWindow* window = mir_create_window_sync(spec);214 MirWindow* window = mir_create_window(spec);
215 mir_window_spec_release(spec);215 mir_window_spec_release(spec);
216216
217 MirBufferUsage usage = mir_buffer_usage_software;217 MirBufferUsage usage = mir_buffer_usage_software;
218218
=== modified file 'playground/mir_demo_client_prerendered_frames.c'
--- playground/mir_demo_client_prerendered_frames.c 2017-01-18 02:29:37 +0000
+++ playground/mir_demo_client_prerendered_frames.c 2017-01-19 08:14:45 +0000
@@ -172,7 +172,7 @@
172 mir_window_spec_set_pixel_format(spec, format);172 mir_window_spec_set_pixel_format(spec, format);
173 mir_surface_spec_add_render_surface(173 mir_surface_spec_add_render_surface(
174 spec, render_surface, width, height, displacement_x, displacement_y);174 spec, render_surface, width, height, displacement_x, displacement_y);
175 MirWindow* window = mir_create_window_sync(spec);175 MirWindow* window = mir_create_window(spec);
176 if (!mir_window_is_valid(window))176 if (!mir_window_is_valid(window))
177 {177 {
178 printf("could not create a window\n");178 printf("could not create a window\n");
179179
=== modified file 'playground/render_surface.cpp'
--- playground/render_surface.cpp 2017-01-18 02:29:37 +0000
+++ playground/render_surface.cpp 2017-01-19 08:14:45 +0000
@@ -210,7 +210,7 @@
210 pixel_format,210 pixel_format,
211 mir_buffer_usage_software);211 mir_buffer_usage_software);
212212
213 auto window = mir_create_window_sync(spec);213 auto window = mir_create_window(spec);
214 mir_window_spec_release(spec);214 mir_window_spec_release(spec);
215215
216 fill_stream_with(buffer_stream, 255, 0, 0, 128);216 fill_stream_with(buffer_stream, 255, 0, 0, 128);
217217
=== modified file 'src/client/mir_surface_api.cpp'
--- src/client/mir_surface_api.cpp 2017-01-18 04:43:15 +0000
+++ src/client/mir_surface_api.cpp 2017-01-19 08:14:45 +0000
@@ -556,16 +556,16 @@
556}556}
557}557}
558558
559void mir_create_window(MirWindowSpec* requested_specification,559void mir_create_window_async(MirWindowSpec* requested_specification,
560 MirWindowCallback callback, void* context)560 MirWindowCallback callback, void* context)
561{561{
562 window_create_helper(requested_specification, callback, context);562 window_create_helper(requested_specification, callback, context);
563}563}
564564
565MirWindow* mir_create_window_sync(MirWindowSpec* requested_specification)565MirWindow* mir_create_window(MirWindowSpec* requested_specification)
566{566{
567 WindowSync ws;567 WindowSync ws;
568 mir_create_window(requested_specification,568 mir_create_window_async(requested_specification,
569 reinterpret_cast<MirWindowCallback>(set_result),569 reinterpret_cast<MirWindowCallback>(set_result),
570 &ws);570 &ws);
571 return ws.wait_for_result();571 return ws.wait_for_result();
@@ -908,7 +908,7 @@
908908
909MirSurface* mir_surface_create_sync(MirSurfaceSpec* requested_specification)909MirSurface* mir_surface_create_sync(MirSurfaceSpec* requested_specification)
910{910{
911 return mir_create_window_sync(requested_specification);911 return mir_create_window(requested_specification);
912}912}
913913
914MirWaitHandle* mir_surface_create(MirSurfaceSpec* requested_specification,914MirWaitHandle* mir_surface_create(MirSurfaceSpec* requested_specification,
915915
=== modified file 'src/client/symbols.map'
--- src/client/symbols.map 2017-01-18 16:25:59 +0000
+++ src/client/symbols.map 2017-01-19 08:14:45 +0000
@@ -540,8 +540,8 @@
540 mir_window_spec_set_buffer_usage;540 mir_window_spec_set_buffer_usage;
541 mir_window_spec_set_streams;541 mir_window_spec_set_streams;
542 mir_window_apply_spec;542 mir_window_apply_spec;
543 mir_create_window_async;
543 mir_create_window;544 mir_create_window;
544 mir_create_window_sync;
545 mir_window_release;545 mir_window_release;
546 mir_window_release_sync;546 mir_window_release_sync;
547 mir_window_is_valid;547 mir_window_is_valid;
548548
=== modified file 'src/platforms/android/utils/test_android_hardware_sanity.cpp'
--- src/platforms/android/utils/test_android_hardware_sanity.cpp 2017-01-18 02:29:37 +0000
+++ src/platforms/android/utils/test_android_hardware_sanity.cpp 2017-01-19 08:14:45 +0000
@@ -119,7 +119,7 @@
119 connection, test_width, test_height);119 connection, test_width, test_height);
120 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);120 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
121 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);121 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);
122 auto const window = mir_create_window_sync(spec);122 auto const window = mir_create_window(spec);
123 mir_window_spec_release(spec);123 mir_window_spec_release(spec);
124124
125 EXPECT_THAT(window, IsValid());125 EXPECT_THAT(window, IsValid());
@@ -175,7 +175,7 @@
175 auto const spec = mir_create_normal_window_spec(connection, test_width, test_height);175 auto const spec = mir_create_normal_window_spec(connection, test_width, test_height);
176 mir_window_spec_set_pixel_format(spec, select_format_for_visual_id(visual_id));176 mir_window_spec_set_pixel_format(spec, select_format_for_visual_id(visual_id));
177177
178 auto const mir_surface = mir_create_window_sync(spec);178 auto const mir_surface = mir_create_window(spec);
179 mir_window_spec_release(spec);179 mir_window_spec_release(spec);
180180
181 EXPECT_THAT(mir_surface, IsValid());181 EXPECT_THAT(mir_surface, IsValid());
182182
=== modified file 'src/server/graphics/nested/mir_client_host_connection.cpp'
--- src/server/graphics/nested/mir_client_host_connection.cpp 2017-01-18 19:57:47 +0000
+++ src/server/graphics/nested/mir_client_host_connection.cpp 2017-01-19 08:14:45 +0000
@@ -108,7 +108,7 @@
108 MirWindowSpec* spec)108 MirWindowSpec* spec)
109 : mir_connection(mir_connection),109 : mir_connection(mir_connection),
110 mir_surface{110 mir_surface{
111 mir_create_window_sync(spec)}111 mir_create_window(spec)}
112 {112 {
113 if (!mir_window_is_valid(mir_surface))113 if (!mir_window_is_valid(mir_surface))
114 {114 {
115115
=== modified file 'tests/acceptance-tests/test_buffer_stream_arrangement.cpp'
--- tests/acceptance-tests/test_buffer_stream_arrangement.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_buffer_stream_arrangement.cpp 2017-01-19 08:14:45 +0000
@@ -209,7 +209,7 @@
209 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);209 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);
210 mir_window_spec_set_streams(spec, infos.data(), infos.size());210 mir_window_spec_set_streams(spec, infos.data(), infos.size());
211211
212 window = mir_create_window_sync(spec);212 window = mir_create_window(spec);
213 mir_window_spec_release(spec);213 mir_window_spec_release(spec);
214 EXPECT_TRUE(mir_window_is_valid(window)) << mir_window_get_error_message(window);214 EXPECT_TRUE(mir_window_is_valid(window)) << mir_window_get_error_message(window);
215}215}
@@ -263,7 +263,7 @@
263 auto spec = mir_create_normal_window_spec(connection, 100, 100);263 auto spec = mir_create_normal_window_spec(connection, 100, 100);
264 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);264 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
265 mir_window_spec_set_streams(spec, infos.data(), infos.size());265 mir_window_spec_set_streams(spec, infos.data(), infos.size());
266 auto window = mir_create_window_sync(spec);266 auto window = mir_create_window(spec);
267 mir_window_spec_release(spec);267 mir_window_spec_release(spec);
268 EXPECT_TRUE(mir_window_is_valid(window));268 EXPECT_TRUE(mir_window_is_valid(window));
269 EXPECT_THAT(mir_window_get_error_message(window), StrEq(""));269 EXPECT_THAT(mir_window_get_error_message(window), StrEq(""));
270270
=== modified file 'tests/acceptance-tests/test_client_cookie.cpp'
--- tests/acceptance-tests/test_client_cookie.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_client_cookie.cpp 2017-01-19 08:14:45 +0000
@@ -62,7 +62,7 @@
62 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);62 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
63 mir_window_spec_set_fullscreen_on_output(spec, 1);63 mir_window_spec_set_fullscreen_on_output(spec, 1);
64 mir_window_spec_set_event_handler(spec, &cookie_capturing_callback, this);64 mir_window_spec_set_event_handler(spec, &cookie_capturing_callback, this);
65 window = mir_create_window_sync(spec);65 window = mir_create_window(spec);
66 mir_window_spec_release(spec);66 mir_window_spec_release(spec);
6767
68 mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window));68 mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window));
6969
=== modified file 'tests/acceptance-tests/test_client_cursor_api.cpp'
--- tests/acceptance-tests/test_client_cursor_api.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_client_cursor_api.cpp 2017-01-19 08:14:45 +0000
@@ -137,7 +137,7 @@
137 auto spec = mir_create_normal_window_spec(connection, 1, 1);137 auto spec = mir_create_normal_window_spec(connection, 1, 1);
138 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);138 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
139 mir_window_spec_set_name(spec, client_name.c_str());139 mir_window_spec_set_name(spec, client_name.c_str());
140 auto const window = mir_create_window_sync(spec);140 auto const window = mir_create_window(spec);
141 mir_window_spec_release(spec);141 mir_window_spec_release(spec);
142142
143 mir_buffer_stream_swap_buffers_sync(143 mir_buffer_stream_swap_buffers_sync(
144144
=== modified file 'tests/acceptance-tests/test_client_focus_notification.cpp'
--- tests/acceptance-tests/test_client_focus_notification.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_client_focus_notification.cpp 2017-01-19 08:14:45 +0000
@@ -44,7 +44,7 @@
44 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);44 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
45 mir_window_spec_set_event_handler(spec, FocusSurface::handle_event, this);45 mir_window_spec_set_event_handler(spec, FocusSurface::handle_event, this);
4646
47 window = mir_create_window_sync(spec);47 window = mir_create_window(spec);
48 mir_window_spec_release(spec);48 mir_window_spec_release(spec);
4949
50 mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window));50 mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window));
5151
=== modified file 'tests/acceptance-tests/test_client_input.cpp'
--- tests/acceptance-tests/test_client_input.cpp 2017-01-18 16:25:59 +0000
+++ tests/acceptance-tests/test_client_input.cpp 2017-01-19 08:14:45 +0000
@@ -97,7 +97,7 @@
97 auto spec = mir_create_normal_window_spec(connection, surface_width, surface_height);97 auto spec = mir_create_normal_window_spec(connection, surface_width, surface_height);
98 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);98 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
99 mir_window_spec_set_name(spec, name.c_str());99 mir_window_spec_set_name(spec, name.c_str());
100 window = mir_create_window_sync(spec);100 window = mir_create_window(spec);
101 mir_window_spec_release(spec);101 mir_window_spec_release(spec);
102 if (!mir_window_is_valid(window))102 if (!mir_window_is_valid(window))
103 BOOST_THROW_EXCEPTION(std::runtime_error{std::string{"Failed creating a window: "}+103 BOOST_THROW_EXCEPTION(std::runtime_error{std::string{"Failed creating a window: "}+
104104
=== modified file 'tests/acceptance-tests/test_client_library.cpp'
--- tests/acceptance-tests/test_client_library.cpp 2017-01-18 19:57:47 +0000
+++ tests/acceptance-tests/test_client_library.cpp 2017-01-19 08:14:45 +0000
@@ -349,7 +349,7 @@
349 auto spec = mir_create_normal_window_spec(connection, request_width, request_height);349 auto spec = mir_create_normal_window_spec(connection, request_width, request_height);
350 mir_window_spec_set_pixel_format(spec, request_format);350 mir_window_spec_set_pixel_format(spec, request_format);
351 mir_window_spec_set_buffer_usage(spec, request_buffer_usage);351 mir_window_spec_set_buffer_usage(spec, request_buffer_usage);
352 window = mir_create_window_sync(spec);352 window = mir_create_window(spec);
353 mir_window_spec_release(spec);353 mir_window_spec_release(spec);
354354
355 ASSERT_THAT(window, NotNull());355 ASSERT_THAT(window, NotNull());
@@ -372,7 +372,7 @@
372 connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);372 connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
373 auto const spec = mir_create_normal_window_spec(connection, 123, 456);373 auto const spec = mir_create_normal_window_spec(connection, 123, 456);
374 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);374 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
375 window = mir_create_window_sync(spec);375 window = mir_create_window(spec);
376 mir_window_spec_release(spec);376 mir_window_spec_release(spec);
377377
378 EXPECT_THAT(window, IsValid());378 EXPECT_THAT(window, IsValid());
@@ -389,7 +389,7 @@
389 mir_create_normal_window_spec(connection, 640, 480);389 mir_create_normal_window_spec(connection, 640, 480);
390 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);390 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
391391
392 window = mir_create_window_sync(spec);392 window = mir_create_window(spec);
393393
394 mir_window_spec_release(spec);394 mir_window_spec_release(spec);
395395
@@ -429,7 +429,7 @@
429 auto const spec = mir_create_normal_window_spec(connection, width, height);429 auto const spec = mir_create_normal_window_spec(connection, width, height);
430 mir_window_spec_set_pixel_format(spec, format);430 mir_window_spec_set_pixel_format(spec, format);
431 mir_window_spec_set_pointer_confinement(spec, mir_pointer_confined_to_window);431 mir_window_spec_set_pointer_confinement(spec, mir_pointer_confined_to_window);
432 window = mir_create_window_sync(spec);432 window = mir_create_window(spec);
433 mir_window_spec_release(spec);433 mir_window_spec_release(spec);
434434
435 EXPECT_THAT(window, IsValid());435 EXPECT_THAT(window, IsValid());
@@ -450,7 +450,7 @@
450450
451 int const min_width = 480;451 int const min_width = 480;
452 mir_window_spec_set_min_width(spec, min_width);452 mir_window_spec_set_min_width(spec, min_width);
453 window = mir_create_window_sync(spec);453 window = mir_create_window(spec);
454 mir_window_spec_release(spec);454 mir_window_spec_release(spec);
455455
456 EXPECT_THAT(window, IsValid());456 EXPECT_THAT(window, IsValid());
@@ -471,7 +471,7 @@
471471
472 int const min_height = 480;472 int const min_height = 480;
473 mir_window_spec_set_min_height(spec, min_height);473 mir_window_spec_set_min_height(spec, min_height);
474 window = mir_create_window_sync(spec);474 window = mir_create_window(spec);
475 mir_window_spec_release(spec);475 mir_window_spec_release(spec);
476476
477 EXPECT_THAT(window, IsValid());477 EXPECT_THAT(window, IsValid());
@@ -492,7 +492,7 @@
492492
493 int const max_width = 1024;493 int const max_width = 1024;
494 mir_window_spec_set_max_width(spec, max_width);494 mir_window_spec_set_max_width(spec, max_width);
495 window = mir_create_window_sync(spec);495 window = mir_create_window(spec);
496 mir_window_spec_release(spec);496 mir_window_spec_release(spec);
497497
498 EXPECT_THAT(window, IsValid());498 EXPECT_THAT(window, IsValid());
@@ -513,7 +513,7 @@
513513
514 int const max_height = 1024;514 int const max_height = 1024;
515 mir_window_spec_set_max_height(spec, max_height);515 mir_window_spec_set_max_height(spec, max_height);
516 window = mir_create_window_sync(spec);516 window = mir_create_window(spec);
517 mir_window_spec_release(spec);517 mir_window_spec_release(spec);
518518
519 EXPECT_THAT(window, IsValid());519 EXPECT_THAT(window, IsValid());
@@ -537,7 +537,7 @@
537537
538 mir_window_spec_set_min_width(spec, min_width);538 mir_window_spec_set_min_width(spec, min_width);
539 mir_window_spec_set_min_height(spec, min_height);539 mir_window_spec_set_min_height(spec, min_height);
540 window = mir_create_window_sync(spec);540 window = mir_create_window(spec);
541 mir_window_spec_release(spec);541 mir_window_spec_release(spec);
542542
543 auto const buffer_stream = mir_window_get_buffer_stream(window);543 auto const buffer_stream = mir_window_get_buffer_stream(window);
@@ -558,7 +558,7 @@
558 auto const spec = mir_create_normal_window_spec(connection, 640, 480);558 auto const spec = mir_create_normal_window_spec(connection, 640, 480);
559 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);559 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
560560
561 window = mir_create_window_sync(spec);561 window = mir_create_window(spec);
562 mir_window_spec_release(spec);562 mir_window_spec_release(spec);
563563
564 // Expect zero (not wired up to detect the physical display yet)564 // Expect zero (not wired up to detect the physical display yet)
@@ -576,7 +576,7 @@
576 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);576 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
577 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);577 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);
578578
579 window = mir_create_window_sync(spec);579 window = mir_create_window(spec);
580580
581 MirNativeBuffer *native;581 MirNativeBuffer *native;
582 auto bs = mir_window_get_buffer_stream(window);582 auto bs = mir_window_get_buffer_stream(window);
@@ -589,7 +589,7 @@
589 mir_window_spec_set_width(spec, 100);589 mir_window_spec_set_width(spec, 100);
590 mir_window_spec_set_height(spec, 100);590 mir_window_spec_set_height(spec, 100);
591591
592 window = mir_create_window_sync(spec);592 window = mir_create_window(spec);
593 bs = mir_window_get_buffer_stream(window);593 bs = mir_window_get_buffer_stream(window);
594 mir_buffer_stream_get_current_buffer(bs, &native);594 mir_buffer_stream_get_current_buffer(bs, &native);
595 EXPECT_FALSE(native->flags & mir_buffer_flag_can_scanout);595 EXPECT_FALSE(native->flags & mir_buffer_flag_can_scanout);
@@ -602,7 +602,7 @@
602 mir_window_spec_set_height(spec, 600);602 mir_window_spec_set_height(spec, 600);
603 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);603 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);
604604
605 window = mir_create_window_sync(spec);605 window = mir_create_window(spec);
606 bs = mir_window_get_buffer_stream(window);606 bs = mir_window_get_buffer_stream(window);
607 mir_buffer_stream_get_current_buffer(bs, &native);607 mir_buffer_stream_get_current_buffer(bs, &native);
608 EXPECT_FALSE(native->flags & mir_buffer_flag_can_scanout);608 EXPECT_FALSE(native->flags & mir_buffer_flag_can_scanout);
@@ -612,7 +612,7 @@
612612
613 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);613 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);
614614
615 window = mir_create_window_sync(spec);615 window = mir_create_window(spec);
616 bs = mir_window_get_buffer_stream(window);616 bs = mir_window_get_buffer_stream(window);
617 mir_buffer_stream_get_current_buffer(bs, &native);617 mir_buffer_stream_get_current_buffer(bs, &native);
618 EXPECT_TRUE(native->flags & mir_buffer_flag_can_scanout);618 EXPECT_TRUE(native->flags & mir_buffer_flag_can_scanout);
@@ -645,7 +645,7 @@
645 mir_window_spec_set_width(spec, size.width);645 mir_window_spec_set_width(spec, size.width);
646 mir_window_spec_set_height(spec, size.height);646 mir_window_spec_set_height(spec, size.height);
647647
648 window = mir_create_window_sync(spec);648 window = mir_create_window(spec);
649 auto bs = mir_window_get_buffer_stream(window);649 auto bs = mir_window_get_buffer_stream(window);
650650
651 MirNativeBuffer *native = NULL;651 MirNativeBuffer *native = NULL;
@@ -683,7 +683,7 @@
683 {683 {
684 old_surface_count = current_surface_count();684 old_surface_count = current_surface_count();
685685
686 mir_create_window(spec, create_surface_callback, this);686 mir_create_window_async(spec, create_surface_callback, this);
687 wait_for_window_create();687 wait_for_window_create();
688688
689 ASSERT_THAT(current_surface_count(), Eq(old_surface_count + 1));689 ASSERT_THAT(current_surface_count(), Eq(old_surface_count + 1));
@@ -867,7 +867,7 @@
867 auto surface_spec = mir_create_normal_window_spec(connection, width, height);867 auto surface_spec = mir_create_normal_window_spec(connection, width, height);
868 mir_window_spec_set_pixel_format(surface_spec, format);868 mir_window_spec_set_pixel_format(surface_spec, format);
869869
870 auto window = mir_create_window_sync(surface_spec);870 auto window = mir_create_window(surface_spec);
871 mir_window_spec_release(surface_spec);871 mir_window_spec_release(surface_spec);
872872
873 EXPECT_THAT(window, IsValid());873 EXPECT_THAT(window, IsValid());
@@ -893,7 +893,7 @@
893 auto surface_spec = mir_create_normal_window_spec(connection, width, height);893 auto surface_spec = mir_create_normal_window_spec(connection, width, height);
894 mir_window_spec_set_pixel_format(surface_spec, format);894 mir_window_spec_set_pixel_format(surface_spec, format);
895895
896 window = mir_create_window_sync(surface_spec);896 window = mir_create_window(surface_spec);
897 mir_window_spec_release(surface_spec);897 mir_window_spec_release(surface_spec);
898898
899 EXPECT_THAT(window, IsValid());899 EXPECT_THAT(window, IsValid());
@@ -932,7 +932,7 @@
932 MirBufferUsage const buffer_usage{mir_buffer_usage_hardware};932 MirBufferUsage const buffer_usage{mir_buffer_usage_hardware};
933 mir_window_spec_set_buffer_usage(surface_spec, buffer_usage);933 mir_window_spec_set_buffer_usage(surface_spec, buffer_usage);
934934
935 auto window = mir_create_window_sync(surface_spec);935 auto window = mir_create_window(surface_spec);
936 mir_window_spec_release(surface_spec);936 mir_window_spec_release(surface_spec);
937937
938 EXPECT_THAT(window, IsValid());938 EXPECT_THAT(window, IsValid());
@@ -959,7 +959,7 @@
959 auto id = mir_output_get_id(output);959 auto id = mir_output_get_id(output);
960 mir_window_spec_set_fullscreen_on_output(surface_spec, id);960 mir_window_spec_set_fullscreen_on_output(surface_spec, id);
961961
962 auto window = mir_create_window_sync(surface_spec);962 auto window = mir_create_window(surface_spec);
963 mir_window_spec_release(surface_spec);963 mir_window_spec_release(surface_spec);
964964
965 EXPECT_THAT(window, IsValid());965 EXPECT_THAT(window, IsValid());
@@ -1000,7 +1000,7 @@
1000 MirBufferUsage const buffer_usage{mir_buffer_usage_hardware};1000 MirBufferUsage const buffer_usage{mir_buffer_usage_hardware};
1001 mir_window_spec_set_buffer_usage(surface_spec, buffer_usage);1001 mir_window_spec_set_buffer_usage(surface_spec, buffer_usage);
10021002
1003 auto window = mir_create_window_sync(surface_spec);1003 auto window = mir_create_window(surface_spec);
1004 mir_window_spec_release(surface_spec);1004 mir_window_spec_release(surface_spec);
10051005
1006 EXPECT_THAT(window, IsValid());1006 EXPECT_THAT(window, IsValid());
@@ -1028,7 +1028,7 @@
1028 MirBufferUsage const buffer_usage{mir_buffer_usage_software};1028 MirBufferUsage const buffer_usage{mir_buffer_usage_software};
1029 mir_window_spec_set_buffer_usage(surface_spec, buffer_usage);1029 mir_window_spec_set_buffer_usage(surface_spec, buffer_usage);
10301030
1031 auto window = mir_create_window_sync(surface_spec);1031 auto window = mir_create_window(surface_spec);
1032 mir_window_spec_release(surface_spec);1032 mir_window_spec_release(surface_spec);
10331033
1034 EXPECT_THAT(window, IsValid());1034 EXPECT_THAT(window, IsValid());
@@ -1067,7 +1067,7 @@
10671067
1068 auto surface_spec = mir_create_normal_window_spec(connection, 800, 600);1068 auto surface_spec = mir_create_normal_window_spec(connection, 800, 600);
1069 mir_window_spec_set_pixel_format(surface_spec, mir_pixel_format_argb_8888);1069 mir_window_spec_set_pixel_format(surface_spec, mir_pixel_format_argb_8888);
1070 auto window = mir_create_window_sync(surface_spec);1070 auto window = mir_create_window(surface_spec);
1071 mir_window_spec_release(surface_spec);1071 mir_window_spec_release(surface_spec);
10721072
1073 ASSERT_THAT(window, IsValid());1073 ASSERT_THAT(window, IsValid());
@@ -1090,7 +1090,7 @@
10901090
1091 auto surface_spec = mir_create_normal_window_spec(connection, 800, 600);1091 auto surface_spec = mir_create_normal_window_spec(connection, 800, 600);
1092 mir_window_spec_set_pixel_format(surface_spec, mir_pixel_format_argb_8888);1092 mir_window_spec_set_pixel_format(surface_spec, mir_pixel_format_argb_8888);
1093 auto window = mir_create_window_sync(surface_spec);1093 auto window = mir_create_window(surface_spec);
1094 mir_window_spec_release(surface_spec);1094 mir_window_spec_release(surface_spec);
10951095
1096 ASSERT_THAT(window, IsValid());1096 ASSERT_THAT(window, IsValid());
@@ -1109,7 +1109,7 @@
11091109
1110 auto surface_spec = mir_create_normal_window_spec(first_client, 800, 600);1110 auto surface_spec = mir_create_normal_window_spec(first_client, 800, 600);
1111 mir_window_spec_set_pixel_format(surface_spec, mir_pixel_format_argb_8888);1111 mir_window_spec_set_pixel_format(surface_spec, mir_pixel_format_argb_8888);
1112 auto main_surface = mir_create_window_sync(surface_spec);1112 auto main_surface = mir_create_window(surface_spec);
1113 mir_window_spec_release(surface_spec);1113 mir_window_spec_release(surface_spec);
11141114
1115 ASSERT_THAT(main_surface, IsValid());1115 ASSERT_THAT(main_surface, IsValid());
@@ -1133,7 +1133,7 @@
1133 im_parent_id,1133 im_parent_id,
1134 &attachment_rect,1134 &attachment_rect,
1135 mir_edge_attachment_any);1135 mir_edge_attachment_any);
1136 auto im_surface = mir_create_window_sync(surface_spec);1136 auto im_surface = mir_create_window(surface_spec);
11371137
1138 EXPECT_THAT(im_surface, IsValid());1138 EXPECT_THAT(im_surface, IsValid());
11391139
11401140
=== modified file 'tests/acceptance-tests/test_client_library_errors.cpp'
--- tests/acceptance-tests/test_client_library_errors.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_client_library_errors.cpp 2017-01-19 08:14:45 +0000
@@ -92,7 +92,7 @@
9292
93 auto spec = mir_create_normal_window_spec(connection, 800, 600);93 auto spec = mir_create_normal_window_spec(connection, 800, 600);
94 mir_window_spec_set_pixel_format(spec, mir_pixel_format_xbgr_8888);94 mir_window_spec_set_pixel_format(spec, mir_pixel_format_xbgr_8888);
95 auto window = mir_create_window_sync(spec);95 auto window = mir_create_window(spec);
96 mir_window_spec_release(spec);96 mir_window_spec_release(spec);
9797
98 ASSERT_NE(window, nullptr);98 ASSERT_NE(window, nullptr);
@@ -139,7 +139,7 @@
139139
140 auto spec = mir_create_normal_window_spec(connection, 800, 600);140 auto spec = mir_create_normal_window_spec(connection, 800, 600);
141 mir_window_spec_set_pixel_format(spec, mir_pixel_format_xbgr_8888);141 mir_window_spec_set_pixel_format(spec, mir_pixel_format_xbgr_8888);
142 auto window = mir_create_window_sync(spec);142 auto window = mir_create_window(spec);
143 mir_window_spec_release(spec);143 mir_window_spec_release(spec);
144144
145 mir_window_release_sync(window);145 mir_window_release_sync(window);
@@ -168,7 +168,7 @@
168168
169 auto spec = mir_create_normal_window_spec(connection, 800, 600);169 auto spec = mir_create_normal_window_spec(connection, 800, 600);
170 mir_window_spec_set_pixel_format(spec, mir_pixel_format_xbgr_8888);170 mir_window_spec_set_pixel_format(spec, mir_pixel_format_xbgr_8888);
171 auto window = mir_create_window_sync(spec);171 auto window = mir_create_window(spec);
172 mir_window_spec_release(spec);172 mir_window_spec_release(spec);
173173
174 ASSERT_NE(window, nullptr);174 ASSERT_NE(window, nullptr);
@@ -195,7 +195,7 @@
195195
196 auto spec = mir_create_normal_window_spec(connection, 800, 600);196 auto spec = mir_create_normal_window_spec(connection, 800, 600);
197 mir_window_spec_set_pixel_format(spec, mir_pixel_format_xbgr_8888);197 mir_window_spec_set_pixel_format(spec, mir_pixel_format_xbgr_8888);
198 auto window = mir_create_window_sync(spec);198 auto window = mir_create_window(spec);
199 mir_window_spec_release(spec);199 mir_window_spec_release(spec);
200200
201 ASSERT_NE(window, nullptr);201 ASSERT_NE(window, nullptr);
@@ -227,7 +227,7 @@
227 };227 };
228 mir_window_spec_attach_to_foreign_parent(spec, invalid_id, &rect, mir_edge_attachment_any);228 mir_window_spec_attach_to_foreign_parent(spec, invalid_id, &rect, mir_edge_attachment_any);
229229
230 auto window = mir_create_window_sync(spec);230 auto window = mir_create_window(spec);
231 EXPECT_THAT(window, Not(IsValid()));231 EXPECT_THAT(window, Not(IsValid()));
232 EXPECT_THAT(mir_window_get_error_message(window), MatchesRegex(".*Lookup.*failed.*"));232 EXPECT_THAT(mir_window_get_error_message(window), MatchesRegex(".*Lookup.*failed.*"));
233233
234234
=== modified file 'tests/acceptance-tests/test_client_logging.cpp'
--- tests/acceptance-tests/test_client_logging.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_client_logging.cpp 2017-01-19 08:14:45 +0000
@@ -62,7 +62,7 @@
62 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);62 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
63 mir_window_spec_set_name(spec, "Rumpelstiltskin");63 mir_window_spec_set_name(spec, "Rumpelstiltskin");
64 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);64 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);
65 auto window = mir_create_window_sync(spec);65 auto window = mir_create_window(spec);
66 ASSERT_THAT(window, NotNull());66 ASSERT_THAT(window, NotNull());
67 mir_window_spec_release(spec);67 mir_window_spec_release(spec);
6868
6969
=== modified file 'tests/acceptance-tests/test_client_surface_events.cpp'
--- tests/acceptance-tests/test_client_surface_events.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_client_surface_events.cpp 2017-01-19 08:14:45 +0000
@@ -531,7 +531,7 @@
531 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);531 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
532 mir_window_spec_set_event_handler(spec, &raise_signal_on_close_event, &done);532 mir_window_spec_set_event_handler(spec, &raise_signal_on_close_event, &done);
533533
534 auto window = mir_create_window_sync(spec);534 auto window = mir_create_window(spec);
535535
536 mir_window_spec_release(spec);536 mir_window_spec_release(spec);
537537
@@ -622,7 +622,7 @@
622 auto spec = mir_create_normal_window_spec(connection, 640, 480);622 auto spec = mir_create_normal_window_spec(connection, 640, 480);
623 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);623 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
624 mir_window_spec_set_event_handler(spec, &surface_output_capturing_callback, &context);624 mir_window_spec_set_event_handler(spec, &surface_output_capturing_callback, &context);
625 auto window = mir_create_window_sync(spec);625 auto window = mir_create_window(spec);
626 mir_window_spec_release(spec);626 mir_window_spec_release(spec);
627627
628 ASSERT_TRUE(context.captured.wait_for(10s));628 ASSERT_TRUE(context.captured.wait_for(10s));
629629
=== modified file 'tests/acceptance-tests/test_client_surface_visibility.cpp'
--- tests/acceptance-tests/test_client_surface_visibility.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_client_surface_visibility.cpp 2017-01-19 08:14:45 +0000
@@ -113,7 +113,7 @@
113 mir_window_spec_set_name(spec, name);113 mir_window_spec_set_name(spec, name);
114 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);114 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);
115 mir_window_spec_set_event_handler(spec, &event_callback, &mock_callback);115 mir_window_spec_set_event_handler(spec, &event_callback, &mock_callback);
116 auto window = mir_create_window_sync(spec);116 auto window = mir_create_window(spec);
117 mir_window_spec_release(spec);117 mir_window_spec_release(spec);
118 return window;118 return window;
119}119}
120120
=== modified file 'tests/acceptance-tests/test_client_surfaces.cpp'
--- tests/acceptance-tests/test_client_surfaces.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_client_surfaces.cpp 2017-01-19 08:14:45 +0000
@@ -68,12 +68,12 @@
68 68
69 auto spec = mir_create_normal_window_spec(connection, width_1, height_1);69 auto spec = mir_create_normal_window_spec(connection, width_1, height_1);
70 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);70 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
71 window[0] = mir_create_window_sync(spec);71 window[0] = mir_create_window(spec);
7272
73 mir_window_spec_set_width(spec, width_2);73 mir_window_spec_set_width(spec, width_2);
74 mir_window_spec_set_height(spec, height_2);74 mir_window_spec_set_height(spec, height_2);
7575
76 window[1] = mir_create_window_sync(spec);76 window[1] = mir_create_window(spec);
77 77
78 mir_window_spec_release(spec);78 mir_window_spec_release(spec);
7979
@@ -112,7 +112,7 @@
112 {112 {
113 auto spec = mir_create_normal_window_spec(connection, 1, 1);113 auto spec = mir_create_normal_window_spec(connection, 1, 1);
114 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);114 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
115 window[i] = mir_create_window_sync(spec);115 window[i] = mir_create_window(spec);
116 mir_window_spec_release(spec);116 mir_window_spec_release(spec);
117 }117 }
118118
@@ -146,7 +146,7 @@
146 MirOrientationMode mode{GetParam()};146 MirOrientationMode mode{GetParam()};
147 mir_window_spec_set_preferred_orientation(spec, mode);147 mir_window_spec_set_preferred_orientation(spec, mode);
148148
149 auto window = mir_create_window_sync(spec);149 auto window = mir_create_window(spec);
150 mir_window_spec_release(spec);150 mir_window_spec_release(spec);
151151
152 ASSERT_THAT(window, IsValid());152 ASSERT_THAT(window, IsValid());
@@ -172,7 +172,7 @@
172 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);172 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
173 ASSERT_THAT(spec, NotNull());173 ASSERT_THAT(spec, NotNull());
174174
175 auto menu = mir_create_window_sync(spec);175 auto menu = mir_create_window(spec);
176 mir_window_spec_release(spec);176 mir_window_spec_release(spec);
177177
178 ASSERT_THAT(menu, IsValid());178 ASSERT_THAT(menu, IsValid());
@@ -192,7 +192,7 @@
192 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);192 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
193 ASSERT_THAT(spec, NotNull());193 ASSERT_THAT(spec, NotNull());
194194
195 auto tooltip = mir_create_window_sync(spec);195 auto tooltip = mir_create_window(spec);
196 mir_window_spec_release(spec);196 mir_window_spec_release(spec);
197197
198 ASSERT_THAT(tooltip, IsValid());198 ASSERT_THAT(tooltip, IsValid());
@@ -208,7 +208,7 @@
208 ASSERT_THAT(spec, NotNull());208 ASSERT_THAT(spec, NotNull());
209 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);209 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
210210
211 auto dialog = mir_create_window_sync(spec);211 auto dialog = mir_create_window(spec);
212 mir_window_spec_release(spec);212 mir_window_spec_release(spec);
213213
214 ASSERT_THAT(dialog, IsValid());214 ASSERT_THAT(dialog, IsValid());
@@ -224,7 +224,7 @@
224 ASSERT_THAT(spec, NotNull());224 ASSERT_THAT(spec, NotNull());
225 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);225 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
226226
227 auto dialog = mir_create_window_sync(spec);227 auto dialog = mir_create_window(spec);
228 mir_window_spec_release(spec);228 mir_window_spec_release(spec);
229229
230 ASSERT_THAT(dialog, IsValid());230 ASSERT_THAT(dialog, IsValid());
@@ -240,7 +240,7 @@
240 ASSERT_THAT(spec, NotNull());240 ASSERT_THAT(spec, NotNull());
241 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);241 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
242242
243 auto im = mir_create_window_sync(spec);243 auto im = mir_create_window(spec);
244 mir_window_spec_release(spec);244 mir_window_spec_release(spec);
245245
246 EXPECT_EQ(mir_window_get_type(im), mir_window_type_inputmethod);246 EXPECT_EQ(mir_window_get_type(im), mir_window_type_inputmethod);
@@ -253,7 +253,7 @@
253 auto spec = mir_create_normal_window_spec(connection, 123, 456);253 auto spec = mir_create_normal_window_spec(connection, 123, 456);
254 ASSERT_THAT(spec, NotNull());254 ASSERT_THAT(spec, NotNull());
255 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);255 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
256 auto window = mir_create_window_sync(spec);256 auto window = mir_create_window(spec);
257 mir_window_spec_release(spec);257 mir_window_spec_release(spec);
258258
259 /*259 /*
@@ -324,7 +324,7 @@
324324
325 mir_persistent_id_release(parent_id);325 mir_persistent_id_release(parent_id);
326326
327 auto im = mir_create_window_sync(spec);327 auto im = mir_create_window(spec);
328 mir_window_spec_release(spec);328 mir_window_spec_release(spec);
329329
330 mir_window_release_sync(im);330 mir_window_release_sync(im);
331331
=== modified file 'tests/acceptance-tests/test_confined_pointer.cpp'
--- tests/acceptance-tests/test_confined_pointer.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_confined_pointer.cpp 2017-01-19 08:14:45 +0000
@@ -81,7 +81,7 @@
81 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);81 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
82 mir_window_spec_set_pointer_confinement(spec, mir_pointer_confined_to_window);82 mir_window_spec_set_pointer_confinement(spec, mir_pointer_confined_to_window);
83 mir_window_spec_set_name(spec, name.c_str());83 mir_window_spec_set_name(spec, name.c_str());
84 window = mir_create_window_sync(spec);84 window = mir_create_window(spec);
85 mir_window_spec_release(spec);85 mir_window_spec_release(spec);
86 if (!mir_window_is_valid(window))86 if (!mir_window_is_valid(window))
87 {87 {
8888
=== modified file 'tests/acceptance-tests/test_custom_window_management.cpp'
--- tests/acceptance-tests/test_custom_window_management.cpp 2017-01-18 04:43:15 +0000
+++ tests/acceptance-tests/test_custom_window_management.cpp 2017-01-19 08:14:45 +0000
@@ -78,7 +78,7 @@
78 {78 {
79 auto spec = mir_create_normal_window_spec(connection, 800, 600);79 auto spec = mir_create_normal_window_spec(connection, 800, 600);
80 mir_window_spec_set_pixel_format(spec, mir_pixel_format_bgr_888);80 mir_window_spec_set_pixel_format(spec, mir_pixel_format_bgr_888);
81 auto window = mir_create_window_sync(spec);81 auto window = mir_create_window(spec);
82 mir_window_spec_release(spec);82 mir_window_spec_release(spec);
8383
84 return window;84 return window;
@@ -316,7 +316,7 @@
316316
317 EXPECT_CALL(window_manager, add_surface(_,_,_)).WillOnce(Invoke(check_add_surface));317 EXPECT_CALL(window_manager, add_surface(_,_,_)).WillOnce(Invoke(check_add_surface));
318318
319 auto window = mir_create_window_sync(surface_spec);319 auto window = mir_create_window(surface_spec);
320 mir_window_spec_release(surface_spec);320 mir_window_spec_release(surface_spec);
321321
322 mir_window_release_sync(window);322 mir_window_release_sync(window);
@@ -334,7 +334,7 @@
334 auto surface_spec = mir_create_normal_window_spec(connection, width, height);334 auto surface_spec = mir_create_normal_window_spec(connection, width, height);
335 mir_window_spec_set_pixel_format(surface_spec, format);335 mir_window_spec_set_pixel_format(surface_spec, format);
336336
337 auto window = mir_create_window_sync(surface_spec);337 auto window = mir_create_window(surface_spec);
338 mir_window_spec_release(surface_spec);338 mir_window_spec_release(surface_spec);
339339
340 surface_spec = mir_create_window_spec(connection);340 surface_spec = mir_create_window_spec(connection);
@@ -380,7 +380,7 @@
380 auto connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);380 auto connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
381 auto surface_spec = mir_create_normal_window_spec(connection, width, height);381 auto surface_spec = mir_create_normal_window_spec(connection, width, height);
382 mir_window_spec_set_pixel_format(surface_spec, format);382 mir_window_spec_set_pixel_format(surface_spec, format);
383 auto parent = mir_create_window_sync(surface_spec);383 auto parent = mir_create_window(surface_spec);
384 mir_window_spec_release(surface_spec);384 mir_window_spec_release(surface_spec);
385385
386 surface_spec = mir_create_tip_window_spec(386 surface_spec = mir_create_tip_window_spec(
@@ -433,7 +433,7 @@
433433
434 EXPECT_CALL(window_manager, add_surface(_,_,_)).WillOnce(Invoke(check_placement));434 EXPECT_CALL(window_manager, add_surface(_,_,_)).WillOnce(Invoke(check_placement));
435435
436 auto child = mir_create_window_sync(surface_spec);436 auto child = mir_create_window(surface_spec);
437 mir_window_spec_release(surface_spec);437 mir_window_spec_release(surface_spec);
438438
439 EXPECT_TRUE(received.wait_for(400ms));439 EXPECT_TRUE(received.wait_for(400ms));
@@ -460,13 +460,13 @@
460 auto connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);460 auto connection = mir_connect_sync(new_connection().c_str(), __PRETTY_FUNCTION__);
461 auto surface_spec = mir_create_normal_window_spec(connection, width, height);461 auto surface_spec = mir_create_normal_window_spec(connection, width, height);
462 mir_window_spec_set_pixel_format(surface_spec, format);462 mir_window_spec_set_pixel_format(surface_spec, format);
463 auto parent = mir_create_window_sync(surface_spec);463 auto parent = mir_create_window(surface_spec);
464 mir_window_spec_release(surface_spec);464 mir_window_spec_release(surface_spec);
465465
466 surface_spec = mir_create_menu_window_spec(466 surface_spec = mir_create_menu_window_spec(
467 connection, width, height, parent, &dummy_rect, mir_edge_attachment_any);467 connection, width, height, parent, &dummy_rect, mir_edge_attachment_any);
468 mir_window_spec_set_pixel_format(surface_spec, format);468 mir_window_spec_set_pixel_format(surface_spec, format);
469 auto child = mir_create_window_sync(surface_spec);469 auto child = mir_create_window(surface_spec);
470 mir_window_spec_release(surface_spec);470 mir_window_spec_release(surface_spec);
471471
472 surface_spec = mir_create_window_spec(connection);472 surface_spec = mir_create_window_spec(connection);
@@ -590,7 +590,7 @@
590 auto surface_spec = mir_create_normal_window_spec(connection, width, height);590 auto surface_spec = mir_create_normal_window_spec(connection, width, height);
591 mir_window_spec_set_pixel_format(surface_spec, format);591 mir_window_spec_set_pixel_format(surface_spec, format);
592 mir_window_spec_set_event_handler(surface_spec, &window_placement_event_callback, &placement_check);592 mir_window_spec_set_event_handler(surface_spec, &window_placement_event_callback, &placement_check);
593 auto window = mir_create_window_sync(surface_spec);593 auto window = mir_create_window(surface_spec);
594 mir_window_spec_release(surface_spec);594 mir_window_spec_release(surface_spec);
595595
596 scene_surface->placed_relative(placement_);596 scene_surface->placed_relative(placement_);
597597
=== modified file 'tests/acceptance-tests/test_display_configuration.cpp'
--- tests/acceptance-tests/test_display_configuration.cpp 2017-01-18 13:59:18 +0000
+++ tests/acceptance-tests/test_display_configuration.cpp 2017-01-19 08:14:45 +0000
@@ -208,7 +208,7 @@
208208
209 auto const spec = mir_create_normal_window_spec(connection, 100, 100);209 auto const spec = mir_create_normal_window_spec(connection, 100, 100);
210 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);210 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
211 window = mir_create_window_sync(spec);211 window = mir_create_window(spec);
212 mir_window_spec_release(spec);212 mir_window_spec_release(spec);
213 mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window));213 mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window));
214 }214 }
215215
=== modified file 'tests/acceptance-tests/test_nested_mir.cpp'
--- tests/acceptance-tests/test_nested_mir.cpp 2017-01-19 04:35:37 +0000
+++ tests/acceptance-tests/test_nested_mir.cpp 2017-01-19 08:14:45 +0000
@@ -813,7 +813,7 @@
813 },813 },
814 &surface_event_received);814 &surface_event_received);
815815
816 auto window = mir_create_window_sync(spec);816 auto window = mir_create_window(spec);
817 mir_window_spec_release(spec);817 mir_window_spec_release(spec);
818818
819 EXPECT_TRUE(surface_event_received.wait_for(30s));819 EXPECT_TRUE(surface_event_received.wait_for(30s));
820820
=== modified file 'tests/acceptance-tests/test_new_display_configuration.cpp'
--- tests/acceptance-tests/test_new_display_configuration.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_new_display_configuration.cpp 2017-01-19 08:14:45 +0000
@@ -268,7 +268,7 @@
268 auto const spec = mir_create_normal_window_spec(connection, 100, 100);268 auto const spec = mir_create_normal_window_spec(connection, 100, 100);
269 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);269 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
270 mir_window_spec_set_event_handler(spec, &handle_event, this);270 mir_window_spec_set_event_handler(spec, &handle_event, this);
271 window = mir_create_window_sync(spec);271 window = mir_create_window(spec);
272 mir_window_spec_release(spec);272 mir_window_spec_release(spec);
273 mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window));273 mir_buffer_stream_swap_buffers_sync(mir_window_get_buffer_stream(window));
274274
275275
=== modified file 'tests/acceptance-tests/test_presentation_chain.cpp'
--- tests/acceptance-tests/test_presentation_chain.cpp 2017-01-18 04:43:15 +0000
+++ tests/acceptance-tests/test_presentation_chain.cpp 2017-01-19 08:14:45 +0000
@@ -112,7 +112,7 @@
112 mir_window_spec_set_pixel_format(spec, pf);112 mir_window_spec_set_pixel_format(spec, pf);
113 mir_surface_spec_add_presentation_chain(113 mir_surface_spec_add_presentation_chain(
114 spec, size.width.as_int(), size.height.as_int(), 0, 0, chain);114 spec, size.width.as_int(), size.height.as_int(), 0, 0, chain);
115 auto window = mir_create_window_sync(spec);115 auto window = mir_create_window(spec);
116 mir_window_spec_release(spec);116 mir_window_spec_release(spec);
117 return window;117 return window;
118 }118 }
@@ -134,7 +134,7 @@
134 MirWindowSpec* spec = mir_create_normal_window_spec(134 MirWindowSpec* spec = mir_create_normal_window_spec(
135 connection, size.width.as_int(), size.height.as_int());135 connection, size.width.as_int(), size.height.as_int());
136 mir_window_spec_set_pixel_format(spec, pf);136 mir_window_spec_set_pixel_format(spec, pf);
137 auto window = mir_create_window_sync(spec);137 auto window = mir_create_window(spec);
138 mir_window_spec_release(spec);138 mir_window_spec_release(spec);
139 spec = mir_create_window_spec(connection);139 spec = mir_create_window_spec(connection);
140 mir_surface_spec_add_presentation_chain(140 mir_surface_spec_add_presentation_chain(
@@ -381,7 +381,7 @@
381 auto spec = mir_create_normal_window_spec(381 auto spec = mir_create_normal_window_spec(
382 connection, size.width.as_int(), size.height.as_int());382 connection, size.width.as_int(), size.height.as_int());
383 mir_window_spec_set_pixel_format(spec, pf);383 mir_window_spec_set_pixel_format(spec, pf);
384 auto window = mir_create_window_sync(spec);384 auto window = mir_create_window(spec);
385 mir_window_spec_release(spec);385 mir_window_spec_release(spec);
386386
387 spec = mir_create_window_spec(connection);387 spec = mir_create_window_spec(connection);
388388
=== modified file 'tests/acceptance-tests/test_render_surface.cpp'
--- tests/acceptance-tests/test_render_surface.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_render_surface.cpp 2017-01-19 08:14:45 +0000
@@ -148,7 +148,7 @@
148 physical_size.width.as_int(), physical_size.height.as_int());148 physical_size.width.as_int(), physical_size.height.as_int());
149 mir_surface_spec_add_render_surface(149 mir_surface_spec_add_render_surface(
150 spec, rs, logical_size.width.as_int(), logical_size.height.as_int(), 0, 0);150 spec, rs, logical_size.width.as_int(), logical_size.height.as_int(), 0, 0);
151 auto window = mir_create_window_sync(spec);151 auto window = mir_create_window(spec);
152 mir_window_spec_release(spec);152 mir_window_spec_release(spec);
153153
154 EXPECT_THAT(window, IsValid());154 EXPECT_THAT(window, IsValid());
@@ -172,7 +172,7 @@
172 auto spec = mir_create_normal_window_spec(connection, width, height);172 auto spec = mir_create_normal_window_spec(connection, width, height);
173 mir_window_spec_set_pixel_format(spec, format);173 mir_window_spec_set_pixel_format(spec, format);
174 mir_surface_spec_add_render_surface(spec, rs, width, height, 0, 0);174 mir_surface_spec_add_render_surface(spec, rs, width, height, 0, 0);
175 auto window = mir_create_window_sync(spec);175 auto window = mir_create_window(spec);
176 mir_window_spec_release(spec);176 mir_window_spec_release(spec);
177 auto bs = mir_render_surface_get_buffer_stream(rs,177 auto bs = mir_render_surface_get_buffer_stream(rs,
178 640, 480,178 640, 480,
@@ -236,7 +236,7 @@
236 auto spec = mir_create_normal_window_spec(connection, width, height);236 auto spec = mir_create_normal_window_spec(connection, width, height);
237 mir_window_spec_set_pixel_format(spec, format);237 mir_window_spec_set_pixel_format(spec, format);
238 mir_surface_spec_add_render_surface(spec, rs, width, height, 0, 0);238 mir_surface_spec_add_render_surface(spec, rs, width, height, 0, 0);
239 auto window = mir_create_window_sync(spec);239 auto window = mir_create_window(spec);
240 mir_window_spec_release(spec);240 mir_window_spec_release(spec);
241 auto pc = mir_render_surface_get_presentation_chain(rs);241 auto pc = mir_render_surface_get_presentation_chain(rs);
242242
243243
=== modified file 'tests/acceptance-tests/test_server_disconnect.cpp'
--- tests/acceptance-tests/test_server_disconnect.cpp 2017-01-18 13:59:18 +0000
+++ tests/acceptance-tests/test_server_disconnect.cpp 2017-01-19 08:14:45 +0000
@@ -120,7 +120,7 @@
120 create_surface.exec([&] {120 create_surface.exec([&] {
121 auto spec = mir_create_normal_window_spec(connection, 800, 600);121 auto spec = mir_create_normal_window_spec(connection, 800, 600);
122 mir_window_spec_set_pixel_format(spec, mir_pixel_format_xbgr_8888);122 mir_window_spec_set_pixel_format(spec, mir_pixel_format_xbgr_8888);
123 window = mir_create_window_sync(spec);123 window = mir_create_window(spec);
124 mir_window_spec_release(spec);124 mir_window_spec_release(spec);
125 });125 });
126126
127127
=== modified file 'tests/acceptance-tests/test_surface_morphing.cpp'
--- tests/acceptance-tests/test_surface_morphing.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_surface_morphing.cpp 2017-01-19 08:14:45 +0000
@@ -104,7 +104,7 @@
104104
105 specifier(spec);105 specifier(spec);
106106
107 auto const window = mir_create_window_sync(spec);107 auto const window = mir_create_window(spec);
108 mir_window_spec_release(spec);108 mir_window_spec_release(spec);
109109
110 return SurfaceHandle{window};110 return SurfaceHandle{window};
111111
=== modified file 'tests/acceptance-tests/test_surface_placement.cpp'
--- tests/acceptance-tests/test_surface_placement.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_surface_placement.cpp 2017-01-19 08:14:45 +0000
@@ -90,7 +90,7 @@
9090
91 specifier(spec);91 specifier(spec);
9292
93 auto const window = mir_create_window_sync(spec);93 auto const window = mir_create_window(spec);
94 mir_window_spec_release(spec);94 mir_window_spec_release(spec);
9595
96 return window;96 return window;
@@ -103,7 +103,7 @@
103103
104 specifier(spec);104 specifier(spec);
105105
106 auto const window = mir_create_window_sync(spec);106 auto const window = mir_create_window(spec);
107 mir_window_spec_release(spec);107 mir_window_spec_release(spec);
108108
109 return window;109 return window;
110110
=== modified file 'tests/acceptance-tests/test_system_compositor_window_manager.cpp'
--- tests/acceptance-tests/test_system_compositor_window_manager.cpp 2017-01-18 02:29:37 +0000
+++ tests/acceptance-tests/test_system_compositor_window_manager.cpp 2017-01-19 08:14:45 +0000
@@ -78,7 +78,7 @@
7878
79 mir_window_spec_set_pixel_format(spec, mir_pixel_format_bgr_888);79 mir_window_spec_set_pixel_format(spec, mir_pixel_format_bgr_888);
80 mir_window_spec_set_fullscreen_on_output(spec, output_id);80 mir_window_spec_set_fullscreen_on_output(spec, output_id);
81 auto const window = mir_create_window_sync(spec);81 auto const window = mir_create_window(spec);
82 mir_window_spec_release(spec);82 mir_window_spec_release(spec);
8383
84 mir_window_set_event_handler(window, on_surface_event, this);84 mir_window_set_event_handler(window, on_surface_event, this);
8585
=== modified file 'tests/integration-tests/client/test_mirsurface.cpp'
--- tests/integration-tests/client/test_mirsurface.cpp 2017-01-18 02:29:37 +0000
+++ tests/integration-tests/client/test_mirsurface.cpp 2017-01-19 08:14:45 +0000
@@ -150,7 +150,7 @@
150150
151 std::unique_ptr<MirWindow, std::function<void(MirWindow*)>> create_surface(MirWindowSpec* spec)151 std::unique_ptr<MirWindow, std::function<void(MirWindow*)>> create_surface(MirWindowSpec* spec)
152 {152 {
153 return {mir_create_window_sync(spec), [](MirWindow *window){mir_window_release_sync(window);}};153 return {mir_create_window(spec), [](MirWindow *window){mir_window_release_sync(window);}};
154 }154 }
155155
156 MirWindowSpec spec{nullptr, 640, 480, mir_pixel_format_abgr_8888};156 MirWindowSpec spec{nullptr, 640, 480, mir_pixel_format_abgr_8888};
157157
=== modified file 'tests/integration-tests/test_error_reporting.cpp'
--- tests/integration-tests/test_error_reporting.cpp 2017-01-18 02:29:37 +0000
+++ tests/integration-tests/test_error_reporting.cpp 2017-01-19 08:14:45 +0000
@@ -132,7 +132,7 @@
132 auto const spec = mir_create_normal_window_spec(connection, 640, 480);132 auto const spec = mir_create_normal_window_spec(connection, 640, 480);
133 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);133 mir_window_spec_set_pixel_format(spec, mir_pixel_format_abgr_8888);
134134
135 auto const window = mir_create_window_sync(spec);135 auto const window = mir_create_window(spec);
136 mir_window_spec_release(spec);136 mir_window_spec_release(spec);
137137
138 ASSERT_TRUE(window != NULL);138 ASSERT_TRUE(window != NULL);
139139
=== modified file 'tests/integration-tests/test_surfaceloop.cpp'
--- tests/integration-tests/test_surfaceloop.cpp 2017-01-18 02:29:37 +0000
+++ tests/integration-tests/test_surfaceloop.cpp 2017-01-19 08:14:45 +0000
@@ -165,7 +165,7 @@
165TEST_F(SurfaceLoop, all_created_buffers_are_destroyed)165TEST_F(SurfaceLoop, all_created_buffers_are_destroyed)
166{166{
167 for (int i = 0; i != max_surface_count; ++i)167 for (int i = 0; i != max_surface_count; ++i)
168 window[i] = mir_create_window_sync(surface_spec);168 window[i] = mir_create_window(surface_spec);
169169
170 for (int i = 0; i != max_surface_count; ++i)170 for (int i = 0; i != max_surface_count; ++i)
171 mir_window_release_sync(window[i]);171 mir_window_release_sync(window[i]);
@@ -174,5 +174,5 @@
174TEST_F(SurfaceLoop, all_created_buffers_are_destroyed_if_client_disconnects_without_releasing_surfaces)174TEST_F(SurfaceLoop, all_created_buffers_are_destroyed_if_client_disconnects_without_releasing_surfaces)
175{175{
176 for (int i = 0; i != max_surface_count; ++i)176 for (int i = 0; i != max_surface_count; ++i)
177 window[i] = mir_create_window_sync(surface_spec);177 window[i] = mir_create_window(surface_spec);
178}178}
179179
=== modified file 'tests/mir_test_framework/any_surface.cpp'
--- tests/mir_test_framework/any_surface.cpp 2017-01-18 02:29:37 +0000
+++ tests/mir_test_framework/any_surface.cpp 2017-01-19 08:14:45 +0000
@@ -42,7 +42,7 @@
4242
43 auto spec = mir_create_normal_window_spec(connection, size.width.as_int(), size.height.as_int());43 auto spec = mir_create_normal_window_spec(connection, size.width.as_int(), size.height.as_int());
44 mir_window_spec_set_pixel_format(spec, f);44 mir_window_spec_set_pixel_format(spec, f);
45 auto window = mir_create_window_sync(spec);45 auto window = mir_create_window(spec);
46 mir_window_spec_release(spec);46 mir_window_spec_release(spec);
4747
48 if (!mir_window_is_valid(window))48 if (!mir_window_is_valid(window))
4949
=== modified file 'tests/mir_test_framework/connected_client_with_a_surface.cpp'
--- tests/mir_test_framework/connected_client_with_a_surface.cpp 2017-01-18 02:29:37 +0000
+++ tests/mir_test_framework/connected_client_with_a_surface.cpp 2017-01-19 08:14:45 +0000
@@ -31,7 +31,7 @@
31 mir_window_spec_set_name(spec, "ConnectedClientWithASurfaceFixtureSurface");31 mir_window_spec_set_name(spec, "ConnectedClientWithASurfaceFixtureSurface");
32 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);32 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_hardware);
3333
34 window = mir_create_window_sync(spec);34 window = mir_create_window(spec);
35 mir_window_spec_release(spec);35 mir_window_spec_release(spec);
36 ASSERT_TRUE(mir_window_is_valid(window));36 ASSERT_TRUE(mir_window_is_valid(window));
37}37}
3838
=== modified file 'tests/mir_test_framework/visible_surface.cpp'
--- tests/mir_test_framework/visible_surface.cpp 2017-01-18 02:29:37 +0000
+++ tests/mir_test_framework/visible_surface.cpp 2017-01-19 08:14:45 +0000
@@ -23,7 +23,7 @@
23 visible{false}23 visible{false}
24{24{
25 mir_window_spec_set_event_handler(spec, VisibleSurface::event_callback, this);25 mir_window_spec_set_event_handler(spec, VisibleSurface::event_callback, this);
26 window = mir_create_window_sync(spec);26 window = mir_create_window(spec);
27 // Swap buffers to ensure window is visible for event based tests27 // Swap buffers to ensure window is visible for event based tests
28 if (mir_window_is_valid(window))28 if (mir_window_is_valid(window))
29 {29 {
3030
=== modified file 'tests/performance-tests/test_client_startup.cpp'
--- tests/performance-tests/test_client_startup.cpp 2017-01-18 02:29:37 +0000
+++ tests/performance-tests/test_client_startup.cpp 2017-01-19 08:14:45 +0000
@@ -71,7 +71,7 @@
7171
72 auto spec = mir_create_normal_window_spec(connection, 720, 1280);72 auto spec = mir_create_normal_window_spec(connection, 720, 1280);
73 mir_window_spec_set_pixel_format(spec, format);73 mir_window_spec_set_pixel_format(spec, format);
74 auto window = mir_create_window_sync(spec);74 auto window = mir_create_window(spec);
7575
76 mir_window_spec_release(spec);76 mir_window_spec_release(spec);
7777
7878
=== modified file 'tests/privileged-tests/test_input_events.cpp'
--- tests/privileged-tests/test_input_events.cpp 2017-01-18 02:29:37 +0000
+++ tests/privileged-tests/test_input_events.cpp 2017-01-19 08:14:45 +0000
@@ -209,7 +209,7 @@
209 mir_connection_get_available_surface_formats(connection, &pixel_format, 1, &valid_formats);209 mir_connection_get_available_surface_formats(connection, &pixel_format, 1, &valid_formats);
210 auto spec = mir_create_normal_window_spec(connection, 640, 480);210 auto spec = mir_create_normal_window_spec(connection, 640, 480);
211 mir_window_spec_set_pixel_format(spec, pixel_format);211 mir_window_spec_set_pixel_format(spec, pixel_format);
212 auto const window = mir_create_window_sync(spec);212 auto const window = mir_create_window(spec);
213 mir_window_spec_release(spec);213 mir_window_spec_release(spec);
214 if (!mir_window_is_valid(window))214 if (!mir_window_is_valid(window))
215 throw std::runtime_error("Failed to create MirWindow");215 throw std::runtime_error("Failed to create MirWindow");
216216
=== modified file 'tests/test-clients/impolite-shutdown/scroll.cpp'
--- tests/test-clients/impolite-shutdown/scroll.cpp 2017-01-18 02:29:37 +0000
+++ tests/test-clients/impolite-shutdown/scroll.cpp 2017-01-19 08:14:45 +0000
@@ -82,7 +82,7 @@
82 mir_window_spec_set_name(spec.get(), __PRETTY_FUNCTION__);82 mir_window_spec_set_name(spec.get(), __PRETTY_FUNCTION__);
83 mir_window_spec_set_buffer_usage(spec.get(), mir_buffer_usage_hardware);83 mir_window_spec_set_buffer_usage(spec.get(), mir_buffer_usage_hardware);
8484
85 MirWindow *window = mir_create_window_sync(spec.get());85 MirWindow *window = mir_create_window(spec.get());
86 spec.reset();86 spec.reset();
8787
88 assert(window != NULL);88 assert(window != NULL);
8989
=== modified file 'tests/test-clients/mir-stress/src/client.cpp'
--- tests/test-clients/mir-stress/src/client.cpp 2017-01-18 13:59:18 +0000
+++ tests/test-clients/mir-stress/src/client.cpp 2017-01-19 08:14:45 +0000
@@ -78,7 +78,7 @@
78 mir_window_spec_set_name(spec, __PRETTY_FUNCTION__);78 mir_window_spec_set_name(spec, __PRETTY_FUNCTION__);
79 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);79 mir_window_spec_set_buffer_usage(spec, mir_buffer_usage_software);
8080
81 surface_ = mir_create_window_sync(spec);81 surface_ = mir_create_window(spec);
82 mir_window_spec_release(spec);82 mir_window_spec_release(spec);
8383
84 return true;84 return true;

Subscribers

People subscribed via source and target branches