xcb: Add support for obtaining default xcb connection

This is needed by qtx11extras now that we can meet a nullptr QScreen.

Change-Id: I755523cbbbbe188f454bd518d2d86a981542458f
Reviewed-by: Richard J. Moore <rich@kde.org>
bb10
Jan Kundrát 2015-03-12 17:00:44 +01:00
parent 4de80f30ee
commit 5585d66ff0
2 changed files with 10 additions and 0 deletions

View File

@ -233,6 +233,9 @@ void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resour
case Display:
result = display();
break;
case Connection:
result = connection();
break;
default:
break;
}
@ -454,6 +457,12 @@ void *QXcbNativeInterface::display()
return Q_NULLPTR;
}
void *QXcbNativeInterface::connection()
{
QXcbIntegration *integration = QXcbIntegration::instance();
return integration->defaultConnection()->xcb_connection();
}
void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time)
{
if (screen) {

View File

@ -98,6 +98,7 @@ public:
void *x11Screen();
void *rootWindow();
void *display();
void *connection();
static void setStartupId(const char *);
static void setAppTime(QScreen *screen, xcb_timestamp_t time);
static void setAppUserTime(QScreen *screen, xcb_timestamp_t time);