aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libLumina/LuminaX11.cpp6
-rw-r--r--lumina-desktop/LDesktop.cpp37
-rw-r--r--lumina-desktop/LPanel.cpp2
-rw-r--r--lumina-desktop/LSession.cpp2
-rw-r--r--lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp4
5 files changed, 30 insertions, 21 deletions
diff --git a/libLumina/LuminaX11.cpp b/libLumina/LuminaX11.cpp
index 89c138ca..429a8ba5 100644
--- a/libLumina/LuminaX11.cpp
+++ b/libLumina/LuminaX11.cpp
@@ -716,11 +716,11 @@ WId LX11::startSystemTray(int screen){
//Get the appropriate atom for this screen
QString str = QString("_NET_SYSTEM_TRAY_S%1").arg(QString::number(screen));
- qDebug() << "Default Screen Atom Name:" << str;
+ //qDebug() << "Default Screen Atom Name:" << str;
Atom _NET_SYSTEM_TRAY_S = XInternAtom(disp,str.toLatin1(),false);
//Make sure that there is no other system tray running
if(XGetSelectionOwner(disp, _NET_SYSTEM_TRAY_S) != None){
- qWarning() << "An alternate system tray is currently in use";
+ qWarning() << " - An alternate system tray is currently in use";
return 0;
}
//Create a simple window to register as the tray (not visible - just off the screen)
@@ -729,7 +729,7 @@ WId LX11::startSystemTray(int screen){
XSetSelectionOwner(disp, _NET_SYSTEM_TRAY_S, LuminaSessionTrayID, CurrentTime);
//Make sure that it was registered properly
if(XGetSelectionOwner(disp, _NET_SYSTEM_TRAY_S) != LuminaSessionTrayID){
- qWarning() << "Could not register the system tray";
+ qWarning() << " - Could not register the system tray";
XDestroyWindow(disp, LuminaSessionTrayID);
return 0;
}
diff --git a/lumina-desktop/LDesktop.cpp b/lumina-desktop/LDesktop.cpp
index 1cece0b5..eed9fa9c 100644
--- a/lumina-desktop/LDesktop.cpp
+++ b/lumina-desktop/LDesktop.cpp
@@ -11,7 +11,7 @@
#include <LuminaX11.h>
#include "LWinInfo.h"
-#define DEBUG 1
+#define DEBUG 0
LDesktop::LDesktop(int deskNum, bool setdefault) : QObject(){
@@ -107,8 +107,8 @@ void LDesktop::SystemApplication(QAction* act){
}
void LDesktop::checkResolution(){
- //Compare the current screen resolution with the last one used/saved
- //NOTE: This should only be performed after all the elements have been initialized/created.
+ //Compare the current screen resolution with the last one used/saved and adjust config values *only*
+
int oldWidth = settings->value(DPREFIX+"screen/lastWidth",-1).toInt();
int oldHeight = settings->value(DPREFIX+"screen/lastHeight",-1).toInt();
QRect scrn = LSession::desktop()->screenGeometry(desktopnumber);
@@ -125,18 +125,29 @@ void LDesktop::checkResolution(){
// and forward that on to all the interface elements
double xscale = scrn.width()/((double) oldWidth);
double yscale = scrn.height()/((double) oldHeight);
- //Update any panels
- for(int i=0; i<PANELS.length(); i++){
- PANELS[i]->scalePanel(xscale, yscale);
+ if(DEBUG){
+ qDebug() << "Screen Resolution Changed:" << desktopnumber;
+ qDebug() << " - Old:" << QString::number(oldWidth)+"x"+QString::number(oldHeight);
+ qDebug() << " - New:" << QString::number(scrn.width())+"x"+QString::number(scrn.height());
+ qDebug() << " - Scale Factors:" << xscale << yscale;
+ }
+ //Update any panels in the config file
+ for(int i=0; i<4; i++){
+ QString PPREFIX = "panel"+QString::number(desktopnumber)+"."+QString::number(i)+"/";
+ int ht = settings->value(PPREFIX+"height",-1).toInt();
+ if(ht<1){ continue; } //no panel height defined
+ QString loc = settings->value(PPREFIX+"location","top").toString().toLower();
+ if(loc=="top" || loc=="bottom"){
+ settings->setValue(PPREFIX+"height", (int) ht*yscale); //vertical dimension
+ }else{
+ settings->setValue(PPREFIX+"height", (int) ht*xscale); //horizontal dimension
+ }
}
//Update any desktop plugins
- for(int i=0; i<PLUGINS.length(); i++){
+ /*for(int i=0; i<PLUGINS.length(); i++){
PLUGINS[i]->scalePlugin(xscale, yscale);
- }
- //QTimer::singleShot(1,this, SLOT(UpdateDesktop()) );
- //QTimer::singleShot(2,this, SLOT(UpdatePanels()) );
+ }*/
}
- LSession::processEvents();
issyncing = false;
}
@@ -162,6 +173,7 @@ void LDesktop::CreateDesktopPluginContainer(LDPlugin *plug){
// =====================
void LDesktop::InitDesktop(){
//This is called *once* during the main initialization routines
+ checkResolution(); //Adjust the desktop config file first (if necessary)
if(DEBUG){ qDebug() << "Init Desktop:" << desktopnumber; }
connect(desktop, SIGNAL(resized(int)), this, SLOT(UpdateGeometry(int)));
if(DEBUG){ qDebug() << "Desktop #"<<desktopnumber<<" -> "<< desktop->screenGeometry(desktopnumber).x() << desktop->screenGeometry(desktopnumber).y() << desktop->screenGeometry(desktopnumber).width() << desktop->screenGeometry(desktopnumber).height(); }
@@ -202,9 +214,6 @@ void LDesktop::InitDesktop(){
QTimer::singleShot(0,this, SLOT(UpdateBackground()) );
QTimer::singleShot(1,this, SLOT(UpdateDesktop()) );
QTimer::singleShot(2,this, SLOT(UpdatePanels()) );
- //UpdatePanels();
- //UpdateDesktop();
- //checkResolution();
}
void LDesktop::SettingsChanged(){
diff --git a/lumina-desktop/LPanel.cpp b/lumina-desktop/LPanel.cpp
index a3b0fc43..84c18bf2 100644
--- a/lumina-desktop/LPanel.cpp
+++ b/lumina-desktop/LPanel.cpp
@@ -8,7 +8,7 @@
#include "LSession.h"
#include "panel-plugins/systemtray/LSysTray.h"
-#define DEBUG 1
+#define DEBUG 0
LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){
//Take care of inputs
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp
index e2424fcd..5b223ad7 100644
--- a/lumina-desktop/LSession.cpp
+++ b/lumina-desktop/LSession.cpp
@@ -24,7 +24,7 @@
#include <X11/extensions/Xdamage.h>
#ifndef DEBUG
-#define DEBUG 1
+#define DEBUG 0
#endif
XCBEventFilter *evFilter = 0;
diff --git a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
index a35db4d7..e9e45872 100644
--- a/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
+++ b/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
@@ -110,10 +110,10 @@ 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"; }
+ if(this->size() != pix.size()){ QTimer::singleShot(10, this, SLOT(updateIcon())); }
painter.drawPixmap(0,0,this->width(), this->height(), pix.scaled(this->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation) );
}else{
- qDebug() << " - - No Tray Icon/Image found!" << "ID:" << AID;
+ qWarning() << " - - No Tray Icon/Image found!" << "ID:" << AID;
}
//qDebug() << " - Done";
}
bgstack15