~ubuntu-branches/ubuntu/vivid/mir/vivid

« back to all changes in this revision

Viewing changes to src/client/mir_prompt_session_api.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Daniel van Vugt
  • Date: 2014-07-17 07:58:53 UTC
  • mfrom: (1.1.67)
  • Revision ID: package-import@ubuntu.com-20140717075853-s4i71ob3iq4ns49z
Tags: 0.5.0+14.10.20140717-0ubuntu1
[ Daniel van Vugt ]
* New upstream release 0.5.0 (https://launchpad.net/mir/+milestone/0.5.0)
  - mirclient ABI unchanged at 8. Clients do not need rebuilding.
  - mirserver ABI bumped to 23. Servers need rebuilding, but probably don't
    need modification:
    . DefaultServerConfiguration/Cursor API: Cursor interfaces changed, most
      notably CursorImages moved from ::mir::graphics to ::mir::input.
    . DefaultServerConfiguration: New "prompt" API.
    . DefaultServerConfiguration: "clock" member is now static.
    . SessionAuthorizer: New functions.
    . ServerConfiguration: New function added: the_prompt_connector().
  - Enhancements:
    . Add AddressSanitizer cmake build type.
    . frontend, client API, tests: add support for prompt session
      permissions and for client detecting errors.
    . server: Ensure our emergency cleanup handling infrastructure is
      signal-safe.
    . Implement and enable an xcursor based image loader for cursors.
    . Fix warnings raised by the new g++-4.9.
    . shared, scene: Introduce a generic listener collection.
    . MirMotionEvent: Define a struct typedef to allow for
      pointer_coordinates to be used individually.
  - Bugs fixed:
    . Nexus 10 leaks during overlay operations (LP: #1331769)
    . MultiThreadedCompositor deadlocks (LP: #1335311)
    . Intermittent test failure in ClientSurfaceEvents can client query 
      orientation (LP: #1335741)
    . Intermittent test failure in ClientSurfaceEvents/OrientationEvents
      (LP: #1335752)
    . Intermittent memory error in ClientSurfaceEvents on
      orientation query (LP: #1335819)
    . mir_unit_tests.EventDistributorTest.* SEGFAULT (LP: #1338902)
    . [regression] Device locks randomly on welcome screen (LP: #1339700)
    . Intermittent deadlock when switching to session with custom display
      config & closing other session (LP: #1340669)
    . Mir cursor has no hotspot setting, assumes (0, 0) (LP: #1189775)
    . clang built mir_unit_tests.ProtobufSocketCommunicatorFD crashes
      intermittently (LP: #1300653)
    . g++-4.9 binary incompatibilities with libraries built with g++-4.8
      (LP: #1329089)
    . [test regression] SurfaceLoop fails sporadically on deleting surfaces
      for a disconnecting client (LP: #1335747)
    . Intermittent test failure ServerShutdown when clients are blocked
      (LP: #1335873)
    . [regression] mir_demo_client_multiwin is displayed with obviously
      wrong colours (LP: #1339471)
    . Partially onscreen surfaces not occluded when covered by another
      surface (LP: #1340078)
    . SurfaceConfigurator::attribute_set always say "unfocused" for focus
      property changes (LP: #1336548)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
namespace
28
28
{
29
29
void null_callback(MirPromptSession*, void*) {}
30
 
 
31
 
void add_prompt_provider_callback(
32
 
    MirPromptSession*,
33
 
    MirBool added,
34
 
    void* context)
35
 
{
36
 
    if (context)
37
 
        *(MirBool*)context = added;
38
 
}
39
 
 
40
30
}
41
31
 
42
32
MirPromptSession *mir_connection_create_prompt_session_sync(
63
53
    }
64
54
}
65
55
 
66
 
MirWaitHandle *mir_prompt_session_add_prompt_provider(
67
 
    MirPromptSession *prompt_session,
68
 
    pid_t provider_pid,
69
 
    mir_prompt_session_add_prompt_provider_callback callback,
70
 
    void* context)
71
 
{
72
 
    try
73
 
    {
74
 
        return prompt_session->add_prompt_provider(provider_pid, callback, context);
75
 
    }
76
 
    catch (std::exception const&)
77
 
    {
78
 
        // TODO callback with an error
79
 
        return nullptr;
80
 
    }
81
 
}
82
 
 
83
 
MirBool mir_prompt_session_add_prompt_provider_sync(
84
 
    MirPromptSession *prompt_session,
85
 
    pid_t provider_pid)
86
 
{
87
 
    MirBool result;
88
 
    mir_wait_for(mir_prompt_session_add_prompt_provider(prompt_session,
89
 
        provider_pid,
90
 
        add_prompt_provider_callback,
91
 
        &result));
92
 
    return result;
93
 
}
94
 
 
95
56
MirWaitHandle* mir_prompt_session_new_fds_for_prompt_providers(
96
57
    MirPromptSession *prompt_session,
97
58
    unsigned int no_of_fds,
116
77
    mir_wait_for(prompt_session->stop(&null_callback, nullptr));
117
78
    delete prompt_session;
118
79
}
 
80
 
 
81
MirBool mir_prompt_session_is_valid(MirPromptSession *prompt_session)
 
82
{
 
83
    auto const err = prompt_session->get_error_message();
 
84
 
 
85
    return MirBool(!*err);
 
86
}
 
87
 
 
88
char const *mir_prompt_session_error_message(MirPromptSession *prompt_session)
 
89
{
 
90
    return prompt_session->get_error_message();
 
91
}