Commit 0ff5e8d0 authored by David Edmundson's avatar David Edmundson
Browse files

Make logout greeter share QMLEngine

Summary:
Gives a speed boost on multiple monitors where we have multiple views.
Also cleaned up some imports/paths used

Test Plan:
Grepped use of rootContext() referred to the right context
Used greeter to log out successfully

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D12891
parent e633a8c2
set(KSMSERVER_LOGOUT_GREETER_SRCS main.cpp ../shutdowndlg.cpp ../ksmserver_debug.cpp)
set(KSMSERVER_LOGOUT_GREETER_SRCS main.cpp shutdowndlg.cpp ../ksmserver_debug.cpp)
add_executable(ksmserver-logout-greeter ${KSMSERVER_LOGOUT_GREETER_SRCS})
target_link_libraries(ksmserver-logout-greeter
PW::KWorkspace
......
......@@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <QCommandLineParser>
#include <QDebug>
#include <QScreen>
#include "../shutdowndlg.h"
#include "shutdowndlg.h"
#include <KQuickAddons/QtQuickSettings>
......
......@@ -56,7 +56,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <KDeclarative/KDeclarative>
#include <KSharedConfig>
#include <KConfigGroup>
#include <KJob>
#include <stdio.h>
#include <netwm.h>
......@@ -77,7 +76,7 @@ Q_DECLARE_METATYPE(Solid::PowerManagement::SleepState)
KSMShutdownDlg::KSMShutdownDlg( QWindow* parent,
bool maysd, bool choose, KWorkSpace::ShutdownType sdtype,
KWayland::Client::PlasmaShell *plasmaShell)
: QQuickView(parent),
: QuickViewSharedEngine(parent),
m_result(false),
m_waylandPlasmaShell(plasmaShell)
// this is a WType_Popup on purpose. Do not change that! Not
......@@ -87,7 +86,7 @@ KSMShutdownDlg::KSMShutdownDlg( QWindow* parent,
setClearBeforeRendering(true);
setColor(QColor(Qt::transparent));
setResizeMode(QQuickView::SizeRootObjectToView);
setResizeMode(KQuickAddons::QuickViewSharedEngine::SizeRootObjectToView);
// Qt doesn't set this on unmanaged windows
//FIXME: or does it?
......@@ -196,7 +195,7 @@ void KSMShutdownDlg::init()
0.4,
(backgroundColor.value() > 128 ? 1.6 : 0.3),
1.7);
QQuickView::showFullScreen();
KQuickAddons::QuickViewSharedEngine::showFullScreen();
requestActivate();
KWindowSystem::setState(winId(), NET::SkipTaskbar|NET::SkipPager);
......@@ -206,7 +205,7 @@ void KSMShutdownDlg::init()
void KSMShutdownDlg::resizeEvent(QResizeEvent *e)
{
QQuickView::resizeEvent( e );
KQuickAddons::QuickViewSharedEngine::resizeEvent( e );
if( KWindowSystem::compositingActive()) {
//TODO: reenable window mask when we are without composite?
......@@ -230,7 +229,7 @@ bool KSMShutdownDlg::event(QEvent *e)
break;
}
}
return QQuickView::event(e);
return KQuickAddons::QuickViewSharedEngine::event(e);
}
void KSMShutdownDlg::setupWaylandIntegration()
......
......@@ -25,22 +25,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef SHUTDOWNDLG_H
#define SHUTDOWNDLG_H
#include <QQuickView>
#include <QPushButton>
#include <kquickaddons/quickviewsharedengine.h>
#include <kworkspace.h>
class QMenu;
class QTimer;
class QTimeLine;
class QLabel;
class LogoutEffect;
namespace Plasma
{
class Svg;
class FrameSvg;
}
namespace KWayland
{
namespace Client
......@@ -50,10 +37,8 @@ class PlasmaShellSurface;
}
}
class QQuickView;
// The confirmation dialog
class KSMShutdownDlg : public QQuickView
class KSMShutdownDlg : public KQuickAddons::QuickViewSharedEngine
{
Q_OBJECT
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment