diff --git a/xcbutils.cpp b/xcbutils.cpp index 5bff1de8f2..5a24cb3ed2 100644 --- a/xcbutils.cpp +++ b/xcbutils.cpp @@ -265,6 +265,7 @@ Shm::Shm() , m_buffer(NULL) , m_segment(XCB_NONE) , m_valid(false) + , m_pixmapFormat(XCB_IMAGE_FORMAT_XY_BITMAP) { m_valid = init(); } @@ -290,6 +291,7 @@ bool Shm::init() qDebug() << "Failed to get SHM extension version information"; return false; } + m_pixmapFormat = version->pixmap_format; const int MAXSIZE = 4096 * 2048 * 4; // TODO check there are not larger windows m_shmId = shmget(IPC_PRIVATE, MAXSIZE, IPC_CREAT | 0600); if (m_shmId < 0) { diff --git a/xcbutils.h b/xcbutils.h index 4ce56eac25..5359fd1166 100644 --- a/xcbutils.h +++ b/xcbutils.h @@ -923,12 +923,14 @@ public: void *buffer() const; xcb_shm_seg_t segment() const; bool isValid() const; + uint8_t pixmapFormat() const; private: bool init(); int m_shmId; void *m_buffer; xcb_shm_seg_t m_segment; bool m_valid; + uint8_t m_pixmapFormat; }; inline @@ -955,6 +957,12 @@ int Shm::shmId() const return m_shmId; } +inline +uint8_t Shm::pixmapFormat() const +{ + return m_pixmapFormat; +} + } // namespace X11 } // namespace KWin