~gerboland/qtubuntu/upstream-closer

« back to all changes in this revision

Viewing changes to src/ubuntumirclient/integration.cpp

  • Committer: Bileto Bot
  • Author(s): Gerry Boland
  • Date: 2016-10-24 11:32:31 UTC
  • mfrom: (280.6.15 enable-debug-mode)
  • Revision ID: ci-train-bot@canonical.com-20161024113231-ay0ahzs9jsytg5oq
Use mir-client-debug to map window coordinates to screen coordinates

If client detects testability framework was enabled, try to load the mir-client-debug library and use it to implement UbuntuWindow::mapToGlobal. This should enable Autopilot to correctly interact with the application. (LP: #1346633)

Approved by: Daniel d'Andrada, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include "integration.h"
19
19
#include "backingstore.h"
20
20
#include "clipboard.h"
 
21
#include "debugextension.h"
21
22
#include "glcontext.h"
22
23
#include "input.h"
23
24
#include "logging.h"
70
71
    QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended);
71
72
}
72
73
 
73
 
UbuntuClientIntegration::UbuntuClientIntegration()
 
74
 
 
75
UbuntuClientIntegration::UbuntuClientIntegration(int argc, char **argv)
74
76
    : QPlatformIntegration()
75
77
    , mNativeInterface(new UbuntuNativeInterface(this))
76
78
    , mFontDb(new QGenericUnixFontDatabase)
105
107
    mEglNativeDisplay = mir_connection_get_egl_native_display(mMirConnection);
106
108
    ASSERT((mEglDisplay = eglGetDisplay(mEglNativeDisplay)) != EGL_NO_DISPLAY);
107
109
    ASSERT(eglInitialize(mEglDisplay, nullptr, nullptr) == EGL_TRUE);
 
110
 
 
111
    // Has debug mode been requsted, either with "-testability" switch or QT_LOAD_TESTABILITY env var
 
112
    bool testability = qEnvironmentVariableIsSet("QT_LOAD_TESTABILITY");
 
113
    for (int i=1; !testability && i<argc; i++) {
 
114
        if (strcmp(argv[i], "-testability") == 0) {
 
115
            testability = true;
 
116
        }
 
117
    }
 
118
    if (testability) {
 
119
        mDebugExtension.reset(new UbuntuDebugExtension);
 
120
    }
108
121
}
109
122
 
110
123
void UbuntuClientIntegration::initialize()
211
224
 
212
225
QPlatformWindow* UbuntuClientIntegration::createPlatformWindow(QWindow* window) const
213
226
{
214
 
    return new UbuntuWindow(window, mInput, mNativeInterface, mEglDisplay, mMirConnection);
 
227
    return new UbuntuWindow(window, mInput, mNativeInterface, mEglDisplay, mMirConnection, mDebugExtension.data());
215
228
}
216
229
 
217
230
bool UbuntuClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const