~alan-griffiths/qtmir/small-refactoring-of-QtEventFeeder

« back to all changes in this revision

Viewing changes to src/platforms/mirserver/display.cpp

  • Committer: CI Train Bot
  • Author(s): Gerry Boland
  • Date: 2015-06-17 13:46:06 UTC
  • mfrom: (328.6.12 qmirserver-hides-mirserver)
  • Revision ID: ci-train-bot@canonical.com-20150617134606-3h9ssmbzza0h24f4
[qpa] refactor QMirServer to clean up its API, and fix strange thread design.

This does the following:
- QMirServer has a much cleaner API - using d-pointer to encourage ABI stability
- move quit decision point to MirServerIntegration
- the Mir server is run from a class inheriting a QThread, simplifies thread control significantly
Approved by: Daniel d'Andrada

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include <mir/graphics/display.h>
25
25
#include <mir/graphics/display_configuration.h>
26
 
#include <QDebug>
27
26
 
28
27
namespace mg = mir::graphics;
29
28
 
30
29
// TODO: Listen for display changes and update the list accordingly
31
30
 
32
 
Display::Display(const QSharedPointer<MirServer> &server, QObject *parent)
33
 
  : QObject(parent)
34
 
  , m_mirServer(server)
 
31
Display::Display(const std::shared_ptr<mir::graphics::DisplayConfiguration> &displayConfig)
35
32
{
36
 
    std::shared_ptr<mir::graphics::DisplayConfiguration> displayConfig = m_mirServer->the_display()->configuration();
37
 
 
38
33
    displayConfig->for_each_output([this](mg::DisplayConfigurationOutput const& output) {
39
34
        if (output.used) {
40
35
            auto screen = new Screen(output);