aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-07-17 13:08:16 -0400
committerKen Moore <moorekou@gmail.com>2015-07-17 13:08:16 -0400
commit96bcdec1f14e8f880b0ef053c5436af3662b19b8 (patch)
treeef33e6d0220a92ca308f58dd2ad3e5ba48a6fc48
parentMerge branch 'master' of github.com:pcbsd/lumina (diff)
downloadlumina-96bcdec1f14e8f880b0ef053c5436af3662b19b8.tar.gz
lumina-96bcdec1f14e8f880b0ef053c5436af3662b19b8.tar.bz2
lumina-96bcdec1f14e8f880b0ef053c5436af3662b19b8.zip
Commit some quick fixes:
1) Switch some X11->XCB functions around (SetAsDesktop(), SetDisableWMActions()). 2) Fix up some QtQuick plugin detection routines (now it will properly see the user's quickplugins if any). 3) Connect the status change signal/slots for QtQuick plugins to try and detect script failures and remove the script (still not working reliably).
-rw-r--r--libLumina/LuminaUtils.cpp10
-rw-r--r--libLumina/LuminaX11.cpp17
-rw-r--r--libLumina/LuminaX11.h2
-rw-r--r--lumina-desktop/LDesktop.cpp6
-rw-r--r--lumina-desktop/LPanel.cpp15
-rw-r--r--lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h3
6 files changed, 39 insertions, 14 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp
index 5f5e5e11..9d1eaf0d 100644
--- a/libLumina/LuminaUtils.cpp
+++ b/libLumina/LuminaUtils.cpp
@@ -202,19 +202,24 @@ QStringList LUtils::listQuickPlugins(){
QDir dir(QDir::homePath()+"/.lumina/quickplugins");
QStringList files = dir.entryList(QStringList() << "quick-*.qml", QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
dir.cd(LOS::LuminaShare()+"quickplugins");
- files << files = dir.entryList(QStringList() << "quick-*.qml", QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
+ files << dir.entryList(QStringList() << "quick-*.qml", QDir::Files | QDir::NoDotAndDotDot, QDir::Name);
for(int i=0; i<files.length(); i++){
files[i] = files[i].section("quick-",1,100).section(".qml",0,0); //just grab the ID out of the middle of the filename
}
files.removeDuplicates();
+ //qDebug() << "Found Quick Plugins:" << files;
return files;
}
QStringList LUtils::infoQuickPlugin(QString ID){ //Returns: [Name, Description, Icon]
+ //qDebug() << "Find Quick Info:" << ID;
QString path = findQuickPluginFile(ID);
+ //qDebug() << " - path:" << path;
if(path.isEmpty()){ return QStringList(); } //invalid ID
- QStringList contents = LUtils::readFile(path).filter("//").filter("=").filter("Plugin");
+ QStringList contents = LUtils::readFile(path);
if(contents.isEmpty()){ return QStringList(); } //invalid file (unreadable)
+ contents = contents.filter("//").filter("=").filter("Plugin"); //now just grab the comments
+ //qDebug() << " - Filtered Contents:" << contents;
QStringList info; info << "" << "" << "";
for(int i=0; i<contents.length(); i++){
if(contents[i].contains("Plugin-Name=")){ info[0] = contents[i].section("Plugin-Name=",1,1).simplified(); }
@@ -223,6 +228,7 @@ QStringList LUtils::infoQuickPlugin(QString ID){ //Returns: [Name, Description,
}
if(info[0].isEmpty()){ info[0]=ID; }
if(info[2].isEmpty()){ info[2]="preferences-plugin"; }
+ //qDebug() << " - info:" << info;
return info;
}
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp
index 770f64db..cdbb038f 100644
--- a/libLumina/LuminaX11.cpp
+++ b/libLumina/LuminaX11.cpp
@@ -1183,9 +1183,18 @@ void LXCB::SetAsSticky(WId win){
xcb_flush(QX11Info::connection()); //apply it right away*/
}
+// === SetDisableWMActions() ===
+void LXCB::SetDisableWMActions(WId win){
+ //This disables all the various control that a WM allows for the window (except for allowing the "Sticky" state)
+ xcb_atom_t list[1];
+ list[0] = EWMH._NET_WM_ACTION_STICK;
+ xcb_ewmh_set_wm_allowed_actions(&EWMH, win, 1, list);
+}
+
// === SetAsPanel() ===
void LXCB::SetAsPanel(WId win){
if(win==0){ return; }
+ SetDisableWMActions(win); //also need to disable WM actions for this window
//Disable Input focus (panel activation ruins task manager window detection routines)
// - Disable Input flag in WM_HINTS
xcb_icccm_wm_hints_t hints;
@@ -1262,6 +1271,14 @@ void LXCB::SetAsPanel(WId win){
}
+void LXCB::SetAsDesktop(WId win){
+ if(win==0){ return; }
+ SetDisableWMActions(win); //also need to disable WM actions for this window
+ xcb_atom_t list[1];
+ list[0] = EWMH._NET_WM_WINDOW_TYPE_DESKTOP;
+ xcb_ewmh_set_wm_window_type(&EWMH, win, 1, list);
+}
+
// === CloseWindow() ===
void LXCB::CloseWindow(WId win){
if(win==0){ return; }
diff --git a/libLumina/LuminaX11.h b/libLumina/LuminaX11.h
index 468045d1..d098a740 100644
--- a/libLumina/LuminaX11.h
+++ b/libLumina/LuminaX11.h
@@ -145,7 +145,9 @@ public:
//Window Modification
void SetAsSticky(WId); //Stick to all workspaces
+ void SetDisableWMActions(WId); //Disable WM control (shortcuts/automatic functions)
void SetAsPanel(WId); //Adjust all the window flags for a proper panel (cannot be done through Qt)
+ void SetAsDesktop(WId); //Adjust window flags to set as the desktop
void CloseWindow(WId); //request that the window be closed
void KillClient(WId); //Force the application that created the window to close
void MinimizeWindow(WId); //request that the window be unmapped/minimized
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp
index 7f7105f3..7b21b862 100644
--- a/lumina-desktop/LDesktop.cpp
+++ b/lumina-desktop/LDesktop.cpp
@@ -292,8 +292,8 @@ void LDesktop::InitDesktop(){
bgWindow = new QWidget();
bgWindow->setObjectName("bgWindow");
bgWindow->setContextMenuPolicy(Qt::CustomContextMenu);
- bgWindow->setWindowFlags(Qt::FramelessWindowHint);
- LX11::SetAsDesktop(bgWindow->winId());
+ bgWindow->setWindowFlags(Qt::WindowStaysOnBottomHint | Qt::CustomizeWindowHint | Qt::FramelessWindowHint);
+ LSession::handle()->XCB->SetAsDesktop(bgWindow->winId());
bgWindow->setGeometry(desktop->screenGeometry(desktopnumber));
connect(bgWindow, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowMenu()) );
if(DEBUG){ qDebug() << "Create bgDesktop"; }
@@ -647,6 +647,8 @@ void LDesktop::UpdateDesktopPluginArea(){
for(int i=0; i<PANELS.length(); i++){ PANELS[i]->update(); }
//Also need to re-arrange any desktop plugins to ensure that nothing is out of the screen area
AlignDesktopPlugins();
+ //Make sure to re-disable any WM control flags
+ LSession::handle()->XCB->SetDisableWMActions(bgWindow->winId());
}
void LDesktop::UpdateBackground(){
diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp
index 11a5a988..94db8ce0 100644
--- a/lumina-desktop/LPanel.cpp
+++ b/lumina-desktop/LPanel.cpp
@@ -38,7 +38,8 @@ LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){
this->setAttribute(Qt::WA_X11DoNotAcceptFocus);
this->setAttribute(Qt::WA_X11NetWmWindowTypeDock);
this->setAttribute(Qt::WA_AlwaysShowToolTips);
- this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
+ this->setWindowFlags(Qt::FramelessWindowHint | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint);
+ //this->setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint);
this->setWindowTitle("LuminaPanel");
this->setObjectName("LuminaPanelBackgroundWidget");
@@ -51,11 +52,9 @@ LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){
panelArea->setLayout(layout);
//Set special window flags on the panel for proper usage
this->show();
- //this->setFocusPolicy(Qt::NoFocus);
+ LSession::handle()->XCB->SetAsPanel(this->winId());
LSession::handle()->XCB->SetAsSticky(this->winId());
- //LSession::handle()->XCB->SetAsPanel(this->winId());
- LX11::SetAsPanel(this->winId());
-
+
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
}
@@ -188,12 +187,8 @@ void LPanel::UpdatePanel(){
}
}
//With QT5, we need to make sure to reset window properties on occasion
+ //LSession::handle()->XCB->SetDisableWMActions(this->winId()); //ensure no WM actions
//LSession::handle()->XCB->SetAsSticky(this->winId());
- //LX11::SetAsPanel(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
if(settings->value(PPREFIX+"customcolor", false).toBool()){
diff --git a/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h b/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h
index 3a14b26c..0e6cda2f 100644
--- a/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h
+++ b/lumina-desktop/desktop-plugins/quickcontainer/QuickDPlugin.h
@@ -23,8 +23,10 @@ public:
this->layout()->setContentsMargins(0,0,0,0);
container = new QQuickWidget(this);
container->setResizeMode(QQuickWidget::SizeRootObjectToView);
+ connect(container, SIGNAL(statusChanged(QQuickWidget::Status)), this, SLOT(statusChange(QQuickWidget::Status)) );
this->layout()->addWidget(container);
container->setSource(QUrl::fromLocalFile( LUtils::findQuickPluginFile(ID.section("---",0,0)) ));
+ QApplication::processEvents(); //to check for errors right away
this->setInitialSize(container->initialSize().width(), container->initialSize().height());
}
@@ -37,6 +39,7 @@ private slots:
void statusChange(QQuickWidget::Status status){
if(status == QQuickWidget::Error){
qDebug() << "Quick Widget Error:" << this->ID();
+ container->setSource(QUrl()); //clear out the script - experienced an error
}
}
bgstack15