From 716acdb8f4c2b000fae7cb28dcedefdbd504038a Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 3 Apr 2022 03:40:43 +0300 Subject: [PATCH] plasma: partially port plasma-desktop shell to QDesktopWidget Signed-off-by: Ivailo Monev --- plasma/shells/plasma-desktop/controllerwindow.cpp | 7 ++----- plasma/shells/plasma-desktop/controllerwindow.h | 5 ----- plasma/shells/plasma-desktop/scripting/desktopscriptengine.cpp | 7 +++---- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/plasma/shells/plasma-desktop/controllerwindow.cpp b/plasma/shells/plasma-desktop/controllerwindow.cpp index 66ba1afb..1af537d5 100644 --- a/plasma/shells/plasma-desktop/controllerwindow.cpp +++ b/plasma/shells/plasma-desktop/controllerwindow.cpp @@ -22,6 +22,7 @@ #include "controllerwindow.h" #include +#include #include #include @@ -40,8 +41,6 @@ #include "widgetsexplorer/widgetexplorer.h" #include "panelshadows.h" -#include - ControllerWindow::ControllerWindow(QWidget* parent) : QWidget(parent), m_location(Plasma::Floating), @@ -76,9 +75,7 @@ ControllerWindow::ControllerWindow(QWidget* parent) connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(closeIfNotFocussed())); connect(m_background, SIGNAL(repaintNeeded()), SLOT(backgroundChanged())); - Kephal::Screens *screens = Kephal::Screens::self(); - connect(screens, SIGNAL(screenResized(Kephal::Screen*,QSize,QSize)), - this, SLOT(adjustAndSetMaxSize())); + connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(adjustAndSetMaxSize())); m_adjustViewTimer = new QTimer(this); m_adjustViewTimer->setSingleShot(true); connect(m_adjustViewTimer, SIGNAL(timeout()), this, SLOT(syncToGraphicsWidget())); diff --git a/plasma/shells/plasma-desktop/controllerwindow.h b/plasma/shells/plasma-desktop/controllerwindow.h index 982ff642..674ff069 100644 --- a/plasma/shells/plasma-desktop/controllerwindow.h +++ b/plasma/shells/plasma-desktop/controllerwindow.h @@ -36,11 +36,6 @@ namespace Plasma class Dialog; } // namespace Plasma -namespace Kephal -{ - class Screen; -} - class PanelShadows; class ControllerWindow : public QWidget diff --git a/plasma/shells/plasma-desktop/scripting/desktopscriptengine.cpp b/plasma/shells/plasma-desktop/scripting/desktopscriptengine.cpp index e1daacc1..443efb37 100644 --- a/plasma/shells/plasma-desktop/scripting/desktopscriptengine.cpp +++ b/plasma/shells/plasma-desktop/scripting/desktopscriptengine.cpp @@ -19,10 +19,10 @@ #include "desktopscriptengine.h" +#include +#include #include -#include - #include #include @@ -52,9 +52,8 @@ int DesktopScriptEngine::defaultPanelScreen() const { if (m_startup) { return ScriptEngine::defaultPanelScreen(); - } else { - return Kephal::ScreenUtils::screenId(QCursor::pos()); } + return QApplication::desktop()->screenNumber(QCursor::pos()); } } -- 2.11.0