From 8dc16d620364c8cd38cabcb3d505bcee5ff7b713 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 4 Oct 2016 14:45:51 -0400 Subject: Try to fix a scaling issue with desktop backgrounds on 4K systems. --- src-qt5/core/lumina-desktop/LDesktopBackground.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src-qt5/core/lumina-desktop') diff --git a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp index dadbd848..3d33db71 100644 --- a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp +++ b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp @@ -38,7 +38,8 @@ void LDesktopBackground::setBackground(const QString& bgFile, const QString& for } else { mode = Qt::KeepAspectRatio; } - bgImage = bgImage.scaled(size(), mode); + if(bgImage.height() != this->height() && bgImage.width() != this->width() ){ bgImage = bgImage.scaled(size(), mode); } + //bgImage = bgImage.scaled(size(), mode); } // Calculate the offset -- cgit From caea68731fac0339e512457d6d2506b3f4e88a06 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 5 Oct 2016 08:20:21 -0400 Subject: Convert over the desktop/panel settings to be based on screen ID instead of screen number. It seems like X randomly assigns numbers to screens in some instances - resulting in multi-monitor arrays occasionally getting rotated/scrambled. After the automatic conversion of the settings to the new system (the first time the user logs into the updated version of Lumina), screen settings are tied to that particular monitor now (HDMI-0, DP-1, etc...) --- src-qt5/core/lumina-desktop/LDesktop.cpp | 6 ++++-- src-qt5/core/lumina-desktop/LDesktopPluginSpace.h | 3 +++ src-qt5/core/lumina-desktop/LPanel.cpp | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src-qt5/core/lumina-desktop') diff --git a/src-qt5/core/lumina-desktop/LDesktop.cpp b/src-qt5/core/lumina-desktop/LDesktop.cpp index 980b3e5e..8258dbb6 100644 --- a/src-qt5/core/lumina-desktop/LDesktop.cpp +++ b/src-qt5/core/lumina-desktop/LDesktop.cpp @@ -12,11 +12,13 @@ #include "LWinInfo.h" #include "JsonMenu.h" +#include + #define DEBUG 0 LDesktop::LDesktop(int deskNum, bool setdefault) : QObject(){ - - DPREFIX = "desktop-"+QString::number(deskNum)+"/"; + QString screenID = QApplication::screens().at(deskNum)->name(); + DPREFIX = "desktop-"+screenID+"/"; desktopnumber = deskNum; desktop = QApplication::desktop(); defaultdesktop = setdefault; //(desktop->screenGeometry(desktopnumber).x()==0); diff --git a/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h b/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h index 92226680..44765029 100644 --- a/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h +++ b/src-qt5/core/lumina-desktop/LDesktopPluginSpace.h @@ -183,6 +183,9 @@ private slots: } protected: + void paintEvent(QPaintEvent*){ + //do nothing here - the main plugin area should *always* be invisible + } //Need Drag and Drop functionality (internal movement) void dragEnterEvent(QDragEnterEvent *ev){ if(ev->mimeData()->hasFormat(MIMETYPE) ){ diff --git a/src-qt5/core/lumina-desktop/LPanel.cpp b/src-qt5/core/lumina-desktop/LPanel.cpp index bf063a31..b0abf498 100644 --- a/src-qt5/core/lumina-desktop/LPanel.cpp +++ b/src-qt5/core/lumina-desktop/LPanel.cpp @@ -6,6 +6,8 @@ //=========================================== #include "LPanel.h" #include "LSession.h" +#include + #include "panel-plugins/systemtray/LSysTray.h" #define DEBUG 0 @@ -26,7 +28,8 @@ LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){ screennum = scr; panelnum = num; //save for later screen = LSession::desktop(); - PPREFIX = "panel"+QString::number(screennum)+"."+QString::number(num)+"/"; + QString screenID = QApplication::screens().at(screennum)->name(); + PPREFIX = "panel_"+screenID+"."+QString::number(num)+"/"; defaultpanel = (LSession::handle()->screenGeom(screennum).x()==0 && num==0); horizontal=true; //use this by default initially hidden = false; //use this by default -- cgit From a68cd74ded1278b94f75248c9d38dedbe969f7e6 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 11 Oct 2016 07:49:34 -0400 Subject: Move a couple "delete" calls to "deleteLater()" within the desktop. --- src-qt5/core/lumina-desktop/LSession.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src-qt5/core/lumina-desktop') diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index 434bfd2d..9a985b3f 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -70,11 +70,11 @@ LSession::~LSession(){ if(this->isPrimaryProcess()){ //WM->stopWM(); for(int i=0; ideleteLater(); } //delete WM; - delete settingsmenu; - delete appmenu; + settingsmenu->deleteLater(); + appmenu->deleteLater(); delete currTranslator; if(mediaObj!=0){delete mediaObj;} } @@ -207,7 +207,7 @@ void LSession::CleanupSession(){ } evFilter->StopEventHandling(); //Stop the window manager - qDebug() << " - Stopping the window manager"; + //qDebug() << " - Stopping the window manager"; //WM->stopWM(); //Now close down the desktop qDebug() << " - Closing down the desktop elements"; -- cgit From dfa2c19bfa7c2d58194eac908c008cb8d2b0340d Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 11 Oct 2016 09:47:41 -0400 Subject: Add a "launch" option within the context menu for applauncher desktop plugins. Fixes #272 --- src-qt5/core/lumina-desktop/LXcbEventFilter.cpp | 2 +- src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp | 8 +++++++- src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.h | 1 + .../desktop-plugins/applauncher/AppLauncherPlugin.cpp | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src-qt5/core/lumina-desktop') diff --git a/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp b/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp index 3c92c050..ca7fb38d 100644 --- a/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp +++ b/src-qt5/core/lumina-desktop/LXcbEventFilter.cpp @@ -48,7 +48,7 @@ bool XCBEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag session->RootSizeChange(); }else if( ((xcb_property_notify_event_t*)ev)->window == QX11Info::appRootWindow() \ && ( ( ((xcb_property_notify_event_t*)ev)->atom == session->XCB->EWMH._NET_CURRENT_DESKTOP) )){ - qDebug() << "Got Workspace Change"; + //qDebug() << "Got Workspace Change"; session->emit WorkspaceChanged(); }else if( SysNotifyAtoms.contains( ((xcb_property_notify_event_t*)ev)->atom ) ){ //Update the status/list of all running windows diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp index 69505705..545ba430 100644 --- a/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp +++ b/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp @@ -33,6 +33,12 @@ LDPlugin::LDPlugin(QWidget *parent, QString id) : QFrame(parent){ void LDPlugin::setupMenu(){ menu->clear(); + //SPECIAL CONTEXT MENU OPTIONS FOR PARTICULAR PLUGIN TYPES + if(PLUGID.startsWith("applauncher::")){ + menu->addAction( LXDG::findIcon("quickopen",""), tr("Launch Item"), this, SIGNAL(PluginActivated()) ); + menu->addSeparator(); + } + //General Options menu->addAction( LXDG::findIcon("transform-move",""), tr("Start Moving Item"), this, SLOT(slotStartMove()) ); menu->addAction( LXDG::findIcon("transform-scale",""), tr("Start Resizing Item"), this, SLOT(slotStartResize()) ); menu->addSeparator(); @@ -54,4 +60,4 @@ void LDPlugin::setupMenu(){ } //Now make sure the plugin is the saved size right away this->resize( settings->value(prefix+"location/width").toInt(), settings->value(prefix+"location/height").toInt()); -}*/ \ No newline at end of file +}*/ diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.h b/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.h index 27fcaa24..820880ed 100644 --- a/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.h +++ b/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.h @@ -106,6 +106,7 @@ signals: void OpenDesktopMenu(); void CloseDesktopMenu(); void PluginResized(); + void PluginActivated(); //Signals for communication with the desktop layout system (not generally used by hand) void StartMoving(QString); //ID of plugin diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp index b74bbcb3..e9ef78cb 100644 --- a/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp +++ b/src-qt5/core/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp @@ -19,6 +19,7 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par watcher = new QFileSystemWatcher(this); connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT( loadButton()) ); + connect(this, SIGNAL(PluginActivated()), this, SLOT(buttonClicked()) ); //in case they use the context menu to launch it. QTimer::singleShot(200,this, SLOT(loadButton()) ); } -- cgit