summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xlib/qxlibdisplay.cpp
blob: 3b60af293f9d5309988b2b71215c2e65398dec21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "qxlibdisplay.h"

QXlibDisplay::QXlibDisplay(Display *display)
    : mDisplay(display)
{
    if (!mDisplay) {
        qFatal("Cannot connect to X server");
    }
    mDisplayName = QString::fromLocal8Bit(DisplayString(mDisplay));
}

QXlibDisplay::~QXlibDisplay()
{
    XCloseDisplay(mDisplay);
}

QString QXlibDisplay::displayName() const
{
     { return mDisplayName; }
}



Display * QXlibDisplay::nativeDisplay() const
{
    return mDisplay;
}

void QXlibDisplay::sync() const
{
    XSync(mDisplay, False);
}

void QXlibDisplay::flush() const
{
    XFlush(mDisplay);
}