Made QWidget::setWindowOpacity work with the XCB platform plugin.
Ported the rather trivial implementation from Qt 4. Task-number: QTBUG-28477 Change-Id: I44e14a3c150af43c6b9b880242b655fe06084fd7 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
parent
49ba35b990
commit
0549a4b6f5
@ -1786,6 +1786,23 @@ static inline xcb_rectangle_t qRectToXCBRectangle(const QRect &r)
|
||||
return result;
|
||||
}
|
||||
|
||||
void QXcbWindow::setOpacity(qreal level)
|
||||
{
|
||||
if (!m_window)
|
||||
return;
|
||||
|
||||
quint32 value = qRound64(qBound(qreal(0), level, qreal(1)) * 0xffffffff);
|
||||
|
||||
Q_XCB_CALL(xcb_change_property(xcb_connection(),
|
||||
XCB_PROP_MODE_REPLACE,
|
||||
m_window,
|
||||
atom(QXcbAtom::_NET_WM_WINDOW_OPACITY),
|
||||
XCB_ATOM_CARDINAL,
|
||||
32,
|
||||
1,
|
||||
(uchar *)&value));
|
||||
}
|
||||
|
||||
void QXcbWindow::setMask(const QRegion ®ion)
|
||||
{
|
||||
if (!connection()->hasXShape())
|
||||
|
@ -109,6 +109,8 @@ public:
|
||||
|
||||
bool startSystemResize(const QPoint &pos, Qt::Corner corner);
|
||||
|
||||
void setOpacity(qreal level);
|
||||
|
||||
#if !defined(QT_NO_SHAPE)
|
||||
void setMask(const QRegion ®ion);
|
||||
#endif // !QT_NO_SHAPE
|
||||
|
Loading…
Reference in New Issue
Block a user