From 6aa7b8ff77a968a2ad11181d21812e3fe675ba23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 8 Feb 2011 16:22:18 +0100 Subject: Added setGeometry(), raise(), lower() and setParent() in XCB backend. --- src/plugins/platforms/xcb/qxcbwindow.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index bdb5fc1..caeb3fa 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -112,6 +112,11 @@ QXcbWindow::~QXcbWindow() void QXcbWindow::setGeometry(const QRect &rect) { QPlatformWindow::setGeometry(rect); + + const quint32 mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; + const quint32 values[] = { rect.x(), rect.y(), rect.width(), rect.height() }; + + xcb_configure_window(xcb_connection(), m_window, mask, values); } void QXcbWindow::setVisible(bool visible) @@ -137,8 +142,10 @@ WId QXcbWindow::winId() const return m_window; } -void QXcbWindow::setParent(const QPlatformWindow *) +void QXcbWindow::setParent(const QPlatformWindow *parent) { + QPoint topLeft = geometry().topLeft(); + xcb_reparent_window(xcb_connection(), window(), static_cast(parent)->window(), topLeft.x(), topLeft.y()); } void QXcbWindow::setWindowTitle(const QString &title) @@ -156,10 +163,16 @@ void QXcbWindow::setWindowTitle(const QString &title) void QXcbWindow::raise() { + const quint32 mask = XCB_CONFIG_WINDOW_STACK_MODE; + const quint32 values[] = { XCB_STACK_MODE_ABOVE }; + xcb_configure_window(xcb_connection(), m_window, mask, values); } void QXcbWindow::lower() { + const quint32 mask = XCB_CONFIG_WINDOW_STACK_MODE; + const quint32 values[] = { XCB_STACK_MODE_BELOW }; + xcb_configure_window(xcb_connection(), m_window, mask, values); } void QXcbWindow::requestActivateWindow() -- cgit v0.12