diff options
-rw-r--r-- | libLumina/LuminaX11.cpp | 20 | ||||
-rw-r--r-- | lumina-desktop/LPanel.cpp | 5 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp | 1 |
3 files changed, 22 insertions, 4 deletions
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp index 699d7b99..6555a842 100644 --- a/libLumina/LuminaX11.cpp +++ b/libLumina/LuminaX11.cpp @@ -945,8 +945,24 @@ LXCB::WINDOWSTATE LXCB::WindowState(WId win){ // === SetAsSticky() === void LXCB::SetAsSticky(WId win){ - xcb_change_property( QX11Info::connection(), XCB_PROP_MODE_APPEND, win, EWMH._NET_WM_STATE, XCB_ATOM_ATOM, 32, 1, &(EWMH._NET_WM_STATE_STICKY) ); - xcb_flush(QX11Info::connection()); //apply it right away + //Need to send a client message event for the window so the WM picks it up + xcb_client_message_event_t event; + event.response_type = XCB_CLIENT_MESSAGE; + event.format = 32; + event.window = win; + event.type = EWMH._NET_WM_STATE; + event.data.data32[0] = 1; //set to enabled + event.data.data32[1] = EWMH._NET_WM_STATE_STICKY; + event.data.data32[2] = 0; + event.data.data32[3] = 0; + event.data.data32[4] = 0; + + xcb_send_event(QX11Info::connection(), 0, QX11Info::appRootWindow(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *) &event); + //xcb_ewmh_set_wm_state(&EWMH, win, 1, &EWMH._NET_WM_STATE_STICKY); + + //This method changes the property on the window directly - the WM is not aware of it + /*xcb_change_property( QX11Info::connection(), XCB_PROP_MODE_APPEND, win, EWMH._NET_WM_STATE, XCB_ATOM_ATOM, 32, 1, &(EWMH._NET_WM_STATE_STICKY) ); + xcb_flush(QX11Info::connection()); //apply it right away*/ } // === SetScreenWorkArea() === diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp index afef1e13..b94534b8 100644 --- a/lumina-desktop/LPanel.cpp +++ b/lumina-desktop/LPanel.cpp @@ -38,7 +38,7 @@ LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){ this->setAttribute(Qt::WA_AlwaysShowToolTips); this->setObjectName("LuminaPanelWidget"); panelArea->setObjectName("LuminaPanelPluginWidget"); - LX11::SetAsPanel(this->winId()); //set proper type of window for a panel since Qt can't do it + //LX11::SetAsPanel(this->winId()); //set proper type of window for a panel since Qt can't do it LSession::handle()->XCB->SetAsSticky(this->winId()); //LX11::SetAsSticky(this->winId()); layout = new QBoxLayout(QBoxLayout::LeftToRight); @@ -131,7 +131,8 @@ void LPanel::UpdatePanel(){ } //With QT5, we need to make sure to reset window properties on occasion LSession::handle()->XCB->SetAsSticky(this->winId()); - LX11::SetAsPanel(this->winId()); + //LX11::SetAsPanel(this->winId()); + //LX11::SetAsSticky(this->winId()); //Now update the appearance of the toolbar QString color = settings->value(PPREFIX+"color", "rgba(255,255,255,160)").toString(); QString style = "QWidget#LuminaPanelPluginWidget{ background: %1; border-radius: 3px; border: 1px solid %1; }"; diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp index 716a49ed..7e0a30f6 100644 --- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp +++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp @@ -124,6 +124,7 @@ void TrayIcon::paintEvent(QPaintEvent *event){ //qDebug() << " - Pix size:" << pix.size().width() << pix.size().height(); //qDebug() << " - Geom:" << this->geometry().x() << this->geometry().y() << this->geometry().width() << this->geometry().height(); if(!pix.isNull()){ + if(this->size() != pix.size()){ QTimer::singleShot(10, this, SLOT(updateIcon())); qDebug() << "-- Icon size mismatch"; } painter.drawPixmap(0,0,this->width(), this->height(), pix.scaled(this->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation) ); } //qDebug() << " - Done"; |