aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-04-28 08:51:29 -0400
committerKen Moore <ken@ixsystems.com>2017-04-28 08:51:29 -0400
commit6c11dcb018ad7faf4588d8a17f0bc8911d99a7f8 (patch)
tree5d6d10f8e78386254d06339a4d6a1690a72400ce /src-qt5/core/lumina-desktop
parentEnable lumina-mediaplayer in the default build of Lumina's "desktop-utils". (diff)
downloadlumina-6c11dcb018ad7faf4588d8a17f0bc8911d99a7f8.tar.gz
lumina-6c11dcb018ad7faf4588d8a17f0bc8911d99a7f8.tar.bz2
lumina-6c11dcb018ad7faf4588d8a17f0bc8911d99a7f8.zip
Clean up the automatic DPI scaling support in Lumina.
This needs to be set for applications, but not the desktop itself (since there are so many pixel-specific calculations that need to be performed).
Diffstat (limited to 'src-qt5/core/lumina-desktop')
-rw-r--r--src-qt5/core/lumina-desktop/LSession.cpp1
-rw-r--r--src-qt5/core/lumina-desktop/main.cpp1
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp12
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp4
4 files changed, 11 insertions, 7 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp
index 3088696f..bdc4f4d3 100644
--- a/src-qt5/core/lumina-desktop/LSession.cpp
+++ b/src-qt5/core/lumina-desktop/LSession.cpp
@@ -168,6 +168,7 @@ void LSession::setupSession(){
connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(watcherChange(QString)) );
connect(this, SIGNAL(aboutToQuit()), this, SLOT(SessionEnding()) );
if(DEBUG){ qDebug() << " - Init Finished:" << timer->elapsed(); delete timer;}
+ setenv("QT_AUTO_SCREEN_SCALE_FACTOR","1",true); //Enable the automatic Qt5 DPI scaling for apps
for(int i=0; i<4; i++){ LSession::processEvents(); } //Again, just a few event loops here so thing can settle before we close the splash screen
//launchStartupApps();
QTimer::singleShot(500, this, SLOT(launchStartupApps()) );
diff --git a/src-qt5/core/lumina-desktop/main.cpp b/src-qt5/core/lumina-desktop/main.cpp
index b42a3816..5eb58aa9 100644
--- a/src-qt5/core/lumina-desktop/main.cpp
+++ b/src-qt5/core/lumina-desktop/main.cpp
@@ -73,6 +73,7 @@ int main(int argc, char ** argv)
setenv("DESKTOP_SESSION","Lumina",1);
setenv("XDG_CURRENT_DESKTOP","Lumina",1);
unsetenv("QT_QPA_PLATFORMTHEME"); //causes issues with Lumina themes - not many people have this by default...
+ unsetenv("QT_AUTO_SCREEN_SCALE_FACTOR"); //causes pixel-specific scaling issues with the desktop - turn this on after-the-fact for other apps
//Startup the session
LSession a(argc, argv);
if(!a.isPrimaryProcess()){ return 0; }
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp
index a71fd57e..edd0a4eb 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemtray/LSysTray.cpp
@@ -80,6 +80,7 @@ void LSysTray::checkAll(){
if(!isRunning || stopping || checking){ pending = true; return; } //Don't check if not running at the moment
checking = true;
pending = false;
+ bool listChanged = false;
//Make sure this tray should handle the windows (was not disabled in the backend)
bool TrayRunning = LSession::handle()->registerVisualTray(this->winId());
//qDebug() << "System Tray: Check tray apps";
@@ -94,6 +95,7 @@ void LSysTray::checkAll(){
LI->removeWidget(cont);
cont->deleteLater();
i--; //List size changed
+ listChanged = true;
//Re-adjust the maximum widget size to account for what is left
if(this->layout()->direction()==QBoxLayout::LeftToRight){
this->setMaximumSize( trayIcons.length()*this->height(), 10000);
@@ -103,7 +105,7 @@ void LSysTray::checkAll(){
}else{
//Tray Icon already exists
//qDebug() << " - SysTray: Update Icon";
- trayIcons[i]->update();
+ //trayIcons[i]->repaint();
wins.removeAt(index); //Already found - remove from the list
}
}
@@ -139,13 +141,14 @@ void LSysTray::checkAll(){
continue;
}
LI->update(); //make sure there is no blank space in the layout
+ listChanged = true;
}
- /*if(listChanged){
+ if(listChanged){
//Icons got moved around: be sure to re-draw all of them to fix visuals
for(int i=0; i<trayIcons.length(); i++){
- trayIcons[i]->update();
+ trayIcons[i]->repaint();
}
- }*/
+ }
//qDebug() << " - System Tray: check done";
checking = false;
if(pending){ QTimer::singleShot(0,this, SLOT(checkAll()) ); }
@@ -164,4 +167,3 @@ void LSysTray::UpdateTrayWindow(WId win){
//qDebug() << "System Tray: Missing Window - check all";
QTimer::singleShot(0,this, SLOT(checkAll()) );
}
-
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
index 9fdbce50..be20b78e 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemtray/TrayIcon.cpp
@@ -100,8 +100,8 @@ void TrayIcon::paintEvent(QPaintEvent *event){
//qDebug() << " - Get image:" << AID;
QPixmap pix = LSession::handle()->XCB->TrayImage(AID); //= WIN->icon().pixmap(this->size());
- //qDebug() << " - Pix size:" << pix.size().width() << pix.size().height();
- //qDebug() << " - Geom:" << this->geometry().x() << this->geometry().y() << this->geometry().width() << this->geometry().height();
+ 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())); }
painter.drawPixmap(0,0,this->width(), this->height(), pix.scaled(this->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation) );
bgstack15