aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/LPanel.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-01-05 14:31:43 -0500
committerKen Moore <ken@pcbsd.org>2015-01-05 14:31:43 -0500
commitebd5faf993fd3ea8f6e929df6f3288cfa1d4b752 (patch)
treeb6fd32a17f6a138c804884bf2cde0dde8ab09aa8 /lumina-desktop/LPanel.cpp
parentQuick checkpoint of additional XCB improvements/fixes. Still having an issue ... (diff)
downloadlumina-ebd5faf993fd3ea8f6e929df6f3288cfa1d4b752.tar.gz
lumina-ebd5faf993fd3ea8f6e929df6f3288cfa1d4b752.tar.bz2
lumina-ebd5faf993fd3ea8f6e929df6f3288cfa1d4b752.zip
Clean up the Panel/Taskmanager XCB usage quite a bit. Now the panel is "seen" by fluxbox when a window is maximized, and the task manager works with the highly asynchronous XCB events.
Diffstat (limited to 'lumina-desktop/LPanel.cpp')
-rw-r--r--lumina-desktop/LPanel.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp
index 5e47dd6b..8caaa8e9 100644
--- a/lumina-desktop/LPanel.cpp
+++ b/lumina-desktop/LPanel.cpp
@@ -31,21 +31,26 @@ LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){
qDebug() << " -- Setup Panel";
this->setContentsMargins(0,0,0,0);
this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- this->setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint );
- this->setFocusPolicy(Qt::NoFocus);
+ this->setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint );
+
this->setWindowTitle("");
- //this->setAttribute(Qt::WA_X11NetWmWindowTypeDock); //Reserve as panel/dock
- 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
- LSession::handle()->XCB->SetAsSticky(this->winId());
- //LX11::SetAsSticky(this->winId());
layout = new QBoxLayout(QBoxLayout::LeftToRight);
layout->setContentsMargins(0,0,0,0);
layout->setSpacing(1);
//layout->setSizeConstraint(QLayout::SetFixedSize);
panelArea->setLayout(layout);
+ //Set special window flags on the panel for proper usage
+ this->show();
+ this->setFocusPolicy(Qt::NoFocus);
+ //panels cannot get keyboard focus otherwise it upsets the task manager window detection
+ this->setAttribute(Qt::WA_X11DoNotAcceptFocus);
+ this->setAttribute(Qt::WA_X11NetWmWindowTypeDock);
+ this->setAttribute(Qt::WA_AlwaysShowToolTips);
+ LSession::handle()->XCB->SetAsSticky(this->winId());
+ //LSession::handle()->XCB->SetAsPanel(this->winId()); //make sure this happens after Qt creates the window first
+
QTimer::singleShot(1,this, SLOT(UpdatePanel()) ); //start this in a new thread
connect(screen, SIGNAL(resized(int)), this, SLOT(UpdatePanel()) ); //in case the screen resolution changes
}
@@ -131,7 +136,11 @@ void LPanel::UpdatePanel(){
}
//With QT5, we need to make sure to reset window properties on occasion
//LSession::handle()->XCB->SetAsSticky(this->winId());
-
+ //First test/update all the window attributes as necessary
+ //if(!this->testAttribute(Qt::WA_X11DoNotAcceptFocus)){ this->setAttribute(Qt::WA_X11DoNotAcceptFocus); }
+ //if(!this->testAttribute(Qt::WA_X11NetWmWindowTypeDock)){ this->setAttribute(Qt::WA_X11NetWmWindowTypeDock); }
+ //if(!this->testAttribute(Qt::WA_AlwaysShowToolTips)){ this->setAttribute(Qt::WA_AlwaysShowToolTips); }
+
//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; }";
bgstack15