52 printf (
"Information of screen %d:\n", screen->root);
53 printf (
" width.........: %d\n", screen->width_in_pixels);
54 printf (
" height........: %d\n", screen->height_in_pixels);
55 printf (
" depth.........: %d\n", screen->root_depth);
56 printf (
" white pixel...: %x\n", screen->white_pixel);
57 printf (
" black pixel...: %x\n", screen->black_pixel);
60 const quint32 mask = XCB_CW_EVENT_MASK;
63 XCB_EVENT_MASK_ENTER_WINDOW
64 | XCB_EVENT_MASK_LEAVE_WINDOW
65 | XCB_EVENT_MASK_PROPERTY_CHANGE
68 xcb_change_window_attributes(
xcb_connection(), screen->root, mask, values);
70 xcb_generic_error_t *
error;
72 xcb_get_property_reply_t *reply =
76 XCB_ATOM_WINDOW, 0, 1024), &error);
78 if (reply && reply->format == 32 && reply->type == XCB_ATOM_WINDOW) {
79 xcb_window_t windowManager = *((xcb_window_t *)xcb_get_property_value(reply));
81 if (windowManager != XCB_WINDOW_NONE) {
82 xcb_get_property_reply_t *windowManagerReply =
95 free(windowManagerReply);
QXcbScreen(QXcbConnection *connection, xcb_screen_t *screen, int number)
Format
The following image formats are available in Qt.
int depth() const
Reimplement in subclass to return current depth of the screen.
xcb_connection_t * xcb_connection() const
QImage::Format format() const
Reimplement in subclass to return the image format which corresponds to the screen format...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void handleXcbError(xcb_generic_error_t *error)
QRect geometry() const
Reimplement in subclass to return the pixel geometry of the screen.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
bool m_syncRequestSupported
The QRect class defines a rectangle in the plane using integer precision.
QSize physicalSize() const
Reimplement this function in subclass to return the physical size of the screen.
The QSize class defines the size of a two-dimensional object using integer point precision.
xcb_atom_t atom(QXcbAtom::Atom atom) const
QString m_windowManagerName
#define qPrintable(string)