diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-03-02 16:53:33 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-03-06 19:54:57 +0000 |
commit | 8b0fcd871805465629c006fbf5867e0c8a6fdaf0 (patch) | |
tree | 1eb82693fd69533b18685063e0df2741ce567e8d /src/plugins/platforms/xcb/qxcbwindow.cpp | |
parent | 653bdcca8e683f5a3d485df885c0bed217a02a6b (diff) |
xcb: implement and deprecate QWidget::setWindowIconText()
This is a little-used feature which only affects how minimized icons
are displayed on certain older window managers, and is not necessary
even then. It has not been implemented in Qt 5 until now.
Task-number: QTBUG-44659
Change-Id: Ie6ead7a6f922878b349a096d905bf7f675dc2f31
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 222f6c1170..6d2f5276b3 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1393,10 +1393,22 @@ void QXcbWindow::setWindowTitle(const QString &title) xcb_flush(xcb_connection()); } +void QXcbWindow::setWindowIconText(const QString &title) +{ + const QByteArray ba = title.toUtf8(); + Q_XCB_CALL(xcb_change_property(xcb_connection(), + XCB_PROP_MODE_REPLACE, + m_window, + atom(QXcbAtom::_NET_WM_ICON_NAME), + atom(QXcbAtom::UTF8_STRING), + 8, + ba.length(), + ba.constData())); +} + void QXcbWindow::setWindowIcon(const QIcon &icon) { QVector<quint32> icon_data; - if (!icon.isNull()) { QList<QSize> availableSizes = icon.availableSizes(); if (availableSizes.isEmpty()) { @@ -1561,6 +1573,12 @@ void QXcbWindow::setWmWindowTypeStatic(QWindow *window, QXcbWindowFunctions::WmW window->setProperty(wm_window_type_property_id, QVariant::fromValue(static_cast<int>(windowTypes))); } +void QXcbWindow::setWindowIconTextStatic(QWindow *window, const QString &text) +{ + if (window->handle()) + static_cast<QXcbWindow *>(window->handle())->setWindowIconText(text); +} + QXcbWindowFunctions::WmWindowTypes QXcbWindow::wmWindowTypes() const { QXcbWindowFunctions::WmWindowTypes result(0); |