From 5242cb7c20b20292783038b1f396bdbb4b7ac79a Mon Sep 17 00:00:00 2001 From: Ole-André Rodlie Date: Sat, 14 Apr 2018 19:40:07 +0200 Subject: lumina-desktop: Use smoothing when scaling wallpaper --- src-qt5/core/lumina-desktop/LDesktopBackground.cpp | 2 +- 1 file changed, 1 insertion(+), 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 6b458c24..22ee6dc4 100644 --- a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp +++ b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp @@ -46,7 +46,7 @@ QPixmap LDesktopBackground::setBackground(const QString& bgFile, const QString& } else { mode = Qt::KeepAspectRatio; } - if(bgImage.height() != geom.height() && bgImage.width() != geom.width() ){ bgImage = bgImage.scaled(geom.size(), mode); } + if(bgImage.height() != geom.height() && bgImage.width() != geom.width() ){ bgImage = bgImage.scaled(geom.size(), mode, Qt::SmoothTransformation); } //bgImage = bgImage.scaled(size(), mode); } -- cgit From 4c9bc199200fd4931dc1f0050c6111d1cc7fa3e0 Mon Sep 17 00:00:00 2001 From: Ole-André Rodlie Date: Sat, 14 Apr 2018 23:15:44 +0200 Subject: lumina-desktop: add basic clipboard support --- src-qt5/core/lumina-desktop/LSession.cpp | 20 ++++++++++++++++++++ src-qt5/core/lumina-desktop/LSession.h | 7 +++++++ 2 files changed, 27 insertions(+) (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 c1f49fc3..9ea377ba 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include "LXcbEventFilter.h" #include "BootSplash.h" @@ -72,6 +73,11 @@ LSession::LSession(int &argc, char ** argv) : LSingleApplication(argc, argv, "lu connect(this, SIGNAL(screenAdded(QScreen*)), this, SLOT(screensChanged()) ); connect(this, SIGNAL(screenRemoved(QScreen*)), this, SLOT(screensChanged()) ); connect(this, SIGNAL(primaryScreenChanged(QScreen*)), this, SLOT(screensChanged()) ); + + // Clipboard + ignoreClipboard = false; + qRegisterMetaType("QClipboard::Mode"); + connect(QApplication::clipboard(), SIGNAL(changed(QClipboard::Mode)), this, SLOT(handleClipboard(QClipboard::Mode))); } //end check for primary process } @@ -587,6 +593,20 @@ void LSession::SessionEnding(){ stopSystemTray(); //just in case it was not stopped properly earlier } +void LSession::handleClipboard(QClipboard::Mode mode){ + if (!ignoreClipboard) { + const QMimeData *mime = QApplication::clipboard()->mimeData(mode); + if (!mime) { return; } + if (mime->hasText()) { QMetaObject::invokeMethod(this, "storeClipboard", Qt::QueuedConnection, Q_ARG(QString, mime->text()), Q_ARG(QClipboard::Mode, mode)); } + } +} + +void LSession::storeClipboard(QString text, QClipboard::Mode mode){ + ignoreClipboard = true; + QApplication::clipboard()->setText(text, mode); + ignoreClipboard = false; +} + //=============== // SYSTEM ACCESS //=============== diff --git a/src-qt5/core/lumina-desktop/LSession.h b/src-qt5/core/lumina-desktop/LSession.h index a25f3c15..824eede7 100644 --- a/src-qt5/core/lumina-desktop/LSession.h +++ b/src-qt5/core/lumina-desktop/LSession.h @@ -21,6 +21,7 @@ #include #include #include +#include #include "Globals.h" #include "AppMenu.h" @@ -141,6 +142,8 @@ private: int VersionStringToNumber(QString version); + bool ignoreClipboard; // flag for (handle/store)Clipboard + public slots: void StartLogout(); void StartShutdown(bool skipupdates = false); @@ -170,6 +173,10 @@ private slots: void SessionEnding(); + // Clipboard + void handleClipboard(QClipboard::Mode mode); + void storeClipboard(QString text, QClipboard::Mode mode); + signals: //System Tray Signals void VisualTrayAvailable(); //new Visual Tray Plugin can be registered -- cgit From 33a0bc31c14d37ae835d6096e9c4d66cd2e71901 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 17 Apr 2018 08:39:05 -0400 Subject: Fix up the clipboard persistance. When moving the owner of the clipboard over to the desktop session, we need to copy *all* of the data on the clipboard, not just the text. Very often, text on the clipboard is "paired" with control codes or alternate info in other mimetype fields. --- src-qt5/core/lumina-desktop/LSession.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 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 9ea377ba..fe399e40 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -594,10 +594,21 @@ void LSession::SessionEnding(){ } void LSession::handleClipboard(QClipboard::Mode mode){ - if (!ignoreClipboard) { + if ( !ignoreClipboard && mode == QClipboard::Clipboard ){ //only support Clipboard const QMimeData *mime = QApplication::clipboard()->mimeData(mode); - if (!mime) { return; } - if (mime->hasText()) { QMetaObject::invokeMethod(this, "storeClipboard", Qt::QueuedConnection, Q_ARG(QString, mime->text()), Q_ARG(QClipboard::Mode, mode)); } + if (mime==NULL) { return; } + if (mime->hasText() && !QApplication::clipboard()->ownsClipboard()) { + //preserve the entire mimeData set, not just the text + //Note that even when we want to "save" the test, we should keep the whole thing + // this preserves formatting codes and more that apps might need + QMimeData *copy = new QMimeData(); + QStringList fmts = mime->formats(); + for(int i=0; isetData(fmts[i], mime->data(fmts[i])); } + ignoreClipboard = true; + QApplication::clipboard()->setMimeData(copy, mode); + ignoreClipboard = false; + //QMetaObject::invokeMethod(this, "storeClipboard", Qt::QueuedConnection, Q_ARG(QString, mime->text()), Q_ARG(QClipboard::Mode, mode)); + } } } -- cgit From 5f38bf70d288b74648ba39b84dd344b0182e8799 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 17 Apr 2018 10:59:01 -0400 Subject: Cleanup where icons get installed: Instead of putting them in the older "pixmaps" directory, place them into the icons/hicolor/scalable/apps dir so that the Qt icon from theme stuff can find it (older dir no longer supported by Qt and most modern theme engines) --- src-qt5/core/lumina-desktop/lumina-desktop.pro | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src-qt5/core/lumina-desktop') diff --git a/src-qt5/core/lumina-desktop/lumina-desktop.pro b/src-qt5/core/lumina-desktop/lumina-desktop.pro index e36d11a2..cc4b63ae 100644 --- a/src-qt5/core/lumina-desktop/lumina-desktop.pro +++ b/src-qt5/core/lumina-desktop/lumina-desktop.pro @@ -69,9 +69,7 @@ RESOURCES+= Lumina-DE.qrc desktop.path = $${L_SESSDIR} desktop.files = Lumina-DE.desktop -icons.files = Lumina-DE.png \ - Insight-FileManager.png -icons.path = $${L_SHAREDIR}/pixmaps +icons.files = Lumina-DE.png fluxconf.files = fluxboxconf/fluxbox-init-rc \ fluxboxconf/fluxbox-keys -- cgit From 7bd2cbddd66f444570cd4d88d178aca89e37ef42 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 17 Apr 2018 13:43:15 -0400 Subject: Clean up the default fluxbox key bindings: Modify the following shortcuts: Ctrl+mouse wheel -> Ctrl+Alt+mouse wheel (change workspace) Alt+[Left/Right arrow] -> Ctrl+Alt+[Left/Right arrow] (tile windows left/right) Remove the following shortcuts: Ctrl+Tab, Ctrl+Shift+Tab (next/previous group - already have Alt+Tab shortcuts) Win+Tab, Win+Shift+Tab (next/previous Fluxbox tabs - not used almost at all) Win+[Left/Right] (Send to prev/next workspace - does not work at the moment anyway) Win+Ctrl+[Left/Right] (Take to prev/next workspace - does not work at the moment anyway) Add the following shortcut: Win+Space: (show start menu) - This will not work if the 115 shortcut is functional (115 takes precendence), but if the Win key is bound to something else this shortcut will become available for launching the start menu. --- .../core/lumina-desktop/fluxboxconf/fluxbox-keys | 25 ++++++---------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'src-qt5/core/lumina-desktop') diff --git a/src-qt5/core/lumina-desktop/fluxboxconf/fluxbox-keys b/src-qt5/core/lumina-desktop/fluxboxconf/fluxbox-keys index d3ee64ef..82d31e9c 100644 --- a/src-qt5/core/lumina-desktop/fluxboxconf/fluxbox-keys +++ b/src-qt5/core/lumina-desktop/fluxboxconf/fluxbox-keys @@ -49,16 +49,10 @@ OnTitlebar Mouse3 :WindowMenu # alt-tab Mod1 Tab :NextWindow (workspace=[current]) (workspace=[current]) !! FBCV13 !! Mod1 Shift Tab :PrevWindow (workspace=[current]) (workspace=[current]) !! FBCV13 !! -Control Tab :NextGroup (workspace=[current]) (workspace=[current]) -Control Shift Tab :PrevGroup (workspace=[current]) (workspace=[current]) - -# cycle through tabs in the current window -Mod4 Tab :NextTab -Mod4 Shift Tab :PrevTab # Arrange/Tile Current windows -Mod1 Left :ArrangeWindowsStackRight (Layer=Normal) -Mod1 Right :ArrangeWindowsStackLeft (Layer=Normal) +Mod1 Control Left :ArrangeWindowsStackRight (Layer=Normal) +Mod1 Control Right :ArrangeWindowsStackLeft (Layer=Normal) # go to a specific tab in the current window Mod4 1 :Tab 1 @@ -84,14 +78,6 @@ Mod1 F9 :If {Matches (Layer=Normal)} {Minimize} Mod1 F10 :If {Matches (Layer=Normal)} {Maximize} Mod1 F11 :If {Matches (Layer=Normal)} {Fullscreen} -# send the current window to previous/next workspace -Mod4 Left :If {Matches (Layer=Normal)} {SendToPrevWorkspace} -Mod4 Right :If {Matches (Layer=Normal)} {SendToNextWorkspace} - -# send the current window and follow it to previous/next workspace -Control Mod4 Left :If {Matches (Layer=Normal)} {TakeToPrevWorkspace} -Control Mod4 Right :If {Matches (Layer=Normal)} {TakeToNextWorkspace} - # change to a specific workspace Control F1 :Workspace 1 Control F2 :Workspace 2 @@ -109,9 +95,9 @@ Control F12 :Workspace 12 Control Mod1 Left :PrevWorkspace Control Mod1 Right :NextWorkspace -# Control + MouseWheel to change workspaces -Control Mouse4 :PrevWorkspace -Control Mouse5 :NextWorkspace +# Control+Alt + MouseWheel to change workspaces +Control Mod1 Mouse4 :PrevWorkspace +Control Mod1 Mouse5 :NextWorkspace # send the current window to a specific workspace Mod4 F1 :SendToWorkspace 1 @@ -152,3 +138,4 @@ Mod1 Home :Exec lumina-open -brightnessup Mod1 End :Exec lumina-open -brightnessdown F12 :Exec lumina-terminal -toggle 115 :Exec lumina-desktop --show-start +Mod4 space :Exec lumina-desktop --show-start -- cgit