~gerboland/qtubuntu/enable-debug-mode

« back to all changes in this revision

Viewing changes to src/ubuntumirclient/integration.cpp

  • Committer: Gerry Boland
  • Date: 2016-04-12 13:10:43 UTC
  • mfrom: (280.2.34 enable-debug-mode)
  • Revision ID: gerry.boland@canonical.com-20160412131043-t14zmcbheuxclmhr
Merge lp:~dandrader/qtubuntu/enable-debug-mode, he kindly fixed merging this with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "input.h"
24
24
#include "logging.h"
25
25
#include "nativeinterface.h"
 
26
#include "offscreensurface.h"
26
27
#include "screen.h"
27
28
#include "theme.h"
28
29
#include "window.h"
46
47
{
47
48
    Q_UNUSED(options)
48
49
    Q_UNUSED(context)
49
 
    DASSERT(context != NULL);
50
 
    QCoreApplication::postEvent(QCoreApplication::instance(),
51
 
                                new QEvent(QEvent::ApplicationActivate));
 
50
    Q_ASSERT(context != NULL);
 
51
    if (qGuiApp->focusWindow()) {
 
52
        QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);
 
53
    } else {
 
54
        QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
 
55
    }
52
56
}
53
57
 
54
58
static void aboutToStopCallback(UApplicationArchive *archive, void* context)
55
59
{
56
60
    Q_UNUSED(archive)
57
 
    DASSERT(context != NULL);
 
61
    Q_ASSERT(context != NULL);
58
62
    UbuntuClientIntegration* integration = static_cast<UbuntuClientIntegration*>(context);
59
63
    QPlatformInputContext *inputContext = integration->inputContext();
60
64
    if (inputContext) {
61
65
        inputContext->hideInputPanel();
62
66
    } else {
63
 
        qWarning("UbuntuClientIntegration aboutToStopCallback(): no input context");
 
67
        qCWarning(ubuntumirclient) << "aboutToStopCallback(): no input context";
64
68
    }
65
 
    QCoreApplication::postEvent(QCoreApplication::instance(),
66
 
                                new QEvent(QEvent::ApplicationDeactivate));
 
69
    QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended);
67
70
}
68
71
 
69
72
 
188
191
    case OpenGL:
189
192
        return true;
190
193
 
 
194
    case ApplicationState:
 
195
        return true;
 
196
 
191
197
    case ThreadedOpenGL:
192
198
        if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {
193
199
            return true;
194
200
        } else {
195
 
            DLOG("ubuntumirclient: disabled threaded OpenGL");
 
201
            qCDebug(ubuntumirclient, "disabled threaded OpenGL");
196
202
            return false;
197
203
        }
198
204
    case MultipleWindows:
263
269
{
264
270
    return mNativeInterface;
265
271
}
 
272
 
 
273
QPlatformOffscreenSurface *UbuntuClientIntegration::createPlatformOffscreenSurface(
 
274
        QOffscreenSurface *surface) const
 
275
{
 
276
    return new UbuntuOffscreenSurface(surface);
 
277
}