summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-02-07 17:30:47 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-02-07 17:31:02 (GMT)
commit864e16ad2858ba752070528b1ba03edeafa54579 (patch)
tree06b32b19a8ac8f98831f3c8e3685c9ce01771545 /src/plugins/platforms/xcb/qxcbwindow.cpp
parent573901d760414ad7c1fd74bad75b2c21532d0ce0 (diff)
downloadQt-864e16ad2858ba752070528b1ba03edeafa54579.zip
Qt-864e16ad2858ba752070528b1ba03edeafa54579.tar.gz
Qt-864e16ad2858ba752070528b1ba03edeafa54579.tar.bz2
Added atom resolving, resizing, and window title support to XCB backend.
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 7d18d52..c6bb6d7 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -61,6 +61,7 @@ QXcbWindow::QXcbWindow(QWidget *tlw)
XCB_NONE,
// XCB_CW_EVENT_MASK
XCB_EVENT_MASK_EXPOSURE
+ | XCB_EVENT_MASK_STRUCTURE_NOTIFY
| XCB_EVENT_MASK_BUTTON_PRESS
| XCB_EVENT_MASK_BUTTON_RELEASE
| XCB_EVENT_MASK_BUTTON_MOTION
@@ -121,8 +122,17 @@ void QXcbWindow::setParent(const QPlatformWindow *)
{
}
-void QXcbWindow::setWindowTitle(const QString &)
+void QXcbWindow::setWindowTitle(const QString &title)
{
+ QByteArray ba = title.toUtf8();
+ xcb_change_property (connection(),
+ XCB_PROP_MODE_REPLACE,
+ m_window,
+ m_screen->connection()->atom(QXcbAtom::_NET_WM_NAME),
+ m_screen->connection()->atom(QXcbAtom::UTF8_STRING),
+ 8,
+ ba.length(),
+ ba.constData());
}
void QXcbWindow::raise()
@@ -152,6 +162,19 @@ void QXcbWindow::handleExposeEvent(xcb_expose_event_t *event)
surface->flush(widget(), widget()->geometry(), QPoint());
}
+void QXcbWindow::handleConfigureNotifyEvent(xcb_configure_notify_event_t *event)
+{
+ int xpos = geometry().x();
+ int ypos = geometry().y();
+
+ if ((event->width == geometry().width() && event->height == geometry().height()) || event->x != 0 || event->y != 0) {
+ xpos = event->x;
+ ypos = event->y;
+ }
+
+ QWindowSystemInterface::handleGeometryChange(widget(), QRect(xpos, ypos, event->width, event->height));
+}
+
static Qt::MouseButtons translateMouseButtons(int s)
{
Qt::MouseButtons ret = 0;