~ci-train-bot/qtubuntu/qtubuntu-ubuntu-xenial-landing-057

« back to all changes in this revision

Viewing changes to src/ubuntumirclient/integration.cpp

  • Committer: CI Train Bot
  • Author(s): Gerry Boland, Nick Dedekind
  • Date: 2016-02-05 11:55:35 UTC
  • mfrom: (310.1.4 qtubuntu-clean)
  • Revision ID: ci-train-bot@canonical.com-20160205115535-99xvn26a75cr399q
React to formFactor and window flag changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
               "rejected the incoming connection, so check its log file");
89
89
 
90
90
    mNativeInterface->setMirConnection(u_application_instance_get_mir_connection(mInstance));
91
 
 
92
 
    // Create default screen.
93
 
    mScreen = new UbuntuScreen(u_application_instance_get_mir_connection(mInstance));
94
 
    screenAdded(mScreen);
 
91
}
 
92
 
 
93
void UbuntuClientIntegration::initialize()
 
94
{
 
95
    MirConnection *mirConnection = u_application_instance_get_mir_connection(mInstance);
 
96
 
 
97
    // Init the ScreenObserver
 
98
    mScreenObserver.reset(new UbuntuScreenObserver(mirConnection));
 
99
    QObject::connect(mScreenObserver.data(), &UbuntuScreenObserver::screenAdded,
 
100
            [this](UbuntuScreen *screen) { this->screenAdded(screen); });
 
101
    Q_FOREACH(auto screen, mScreenObserver->screens()) {
 
102
        screenAdded(screen);
 
103
    }
95
104
 
96
105
    // Initialize input.
97
106
    if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_INPUT")) {
120
129
{
121
130
    delete mInput;
122
131
    delete mInputContext;
123
 
    delete mScreen;
124
132
    delete mServices;
125
133
}
126
134
 
165
173
 
166
174
QPlatformWindow* UbuntuClientIntegration::createPlatformWindow(QWindow* window)
167
175
{
168
 
    return new UbuntuWindow(window, mClipboard, static_cast<UbuntuScreen*>(mScreen),
169
 
                            mInput, u_application_instance_get_mir_connection(mInstance));
 
176
    return new UbuntuWindow(window, mClipboard, mInput, mNativeInterface,
 
177
                            u_application_instance_get_mir_connection(mInstance));
170
178
}
171
179
 
172
180
bool UbuntuClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const