Add function for setting the startup ID for the next window that will be shown.
This is useful for applications being requested to show a second window (e.g. via DBus) Change-Id: I04add2aa82dce63e854ba0f1c020274ed586bf1f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
This commit is contained in:
parent
d041ae30d6
commit
d7564624ac
@ -445,6 +445,7 @@ public:
|
||||
void setFocusWindow(QXcbWindow *);
|
||||
|
||||
QByteArray startupId() const { return m_startupId; }
|
||||
void setStartupId(const QByteArray &nextId) { m_startupId = nextId; }
|
||||
void clearStartupId() { m_startupId.clear(); }
|
||||
|
||||
void grabServer();
|
||||
|
@ -225,6 +225,14 @@ void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceStr
|
||||
return result;
|
||||
}
|
||||
|
||||
QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterface::nativeResourceFunctionForIntegration(const QByteArray &resource)
|
||||
{
|
||||
QByteArray lowerCaseResource = resource.toLower();
|
||||
if (lowerCaseResource == "setstartupid")
|
||||
return NativeResourceForIntegrationFunction(setStartupId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::nativeResourceFunctionForScreen(const QByteArray &resource)
|
||||
{
|
||||
const QByteArray lowerCaseResource = resource.toLower();
|
||||
@ -287,6 +295,15 @@ void QXcbNativeInterface::setAppUserTime(QScreen* screen, xcb_timestamp_t time)
|
||||
static_cast<QXcbScreen *>(screen->handle())->connection()->setNetWmUserTime(time);
|
||||
}
|
||||
|
||||
void QXcbNativeInterface::setStartupId(const char *data)
|
||||
{
|
||||
QByteArray startupId(data);
|
||||
QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration());
|
||||
QXcbConnection *defaultConnection = integration->defaultConnection();
|
||||
if (defaultConnection)
|
||||
defaultConnection->setStartupId(startupId);
|
||||
}
|
||||
|
||||
QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::nativeResourceFunctionForContext(const QByteArray &resource)
|
||||
{
|
||||
QByteArray lowerCaseResource = resource.toLower();
|
||||
|
@ -81,6 +81,7 @@ public:
|
||||
void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen);
|
||||
void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window);
|
||||
|
||||
NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) Q_DECL_OVERRIDE;
|
||||
NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource);
|
||||
NativeResourceForScreenFunction nativeResourceFunctionForScreen(const QByteArray &resource) Q_DECL_OVERRIDE;
|
||||
|
||||
@ -96,6 +97,7 @@ public:
|
||||
void *startupId();
|
||||
void *x11Screen();
|
||||
void *rootWindow();
|
||||
static void setStartupId(const char *);
|
||||
static void setAppTime(QScreen *screen, xcb_timestamp_t time);
|
||||
static void setAppUserTime(QScreen *screen, xcb_timestamp_t time);
|
||||
static void *eglContextForContext(QOpenGLContext *context);
|
||||
|
Loading…
Reference in New Issue
Block a user