diff --git a/shell/panelconfigview.cpp b/shell/panelconfigview.cpp index dee2acc86..e827f8497 100644 --- a/shell/panelconfigview.cpp +++ b/shell/panelconfigview.cpp @@ -20,6 +20,7 @@ #include "panelconfigview.h" #include "panelview.h" #include "panelshadows_p.h" +#include "shellcorona.h" #include #include @@ -35,9 +36,11 @@ #include #include -#include #include +#include +#include + //////////////////////////////PanelConfigView PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *panelView, QWindow *parent) : ConfigView(containment, parent), @@ -230,6 +233,30 @@ void PanelConfigView::focusOutEvent(QFocusEvent *ev) close(); } +void PanelConfigView::moveEvent(QMoveEvent *ev) +{ + if (!m_shellSurface) { + ShellCorona *c = qobject_cast(m_containment->corona()); + + if (c) { + using namespace KWayland::Client; + PlasmaShell *interface = c->waylandPlasmaShellInterface(); + if (!interface) { + return; + } + Surface *s = Surface::fromWindow(this); + if (!s) { + return; + } + m_shellSurface = interface->createSurface(s, this); + } + } + + if (m_shellSurface) { + m_shellSurface->setPosition(ev->pos()); + } +} + void PanelConfigView::setVisibilityMode(PanelView::VisibilityMode mode) { if (m_visibilityMode == mode) { diff --git a/shell/panelconfigview.h b/shell/panelconfigview.h index 98705d138..8be97d8a9 100644 --- a/shell/panelconfigview.h +++ b/shell/panelconfigview.h @@ -28,6 +28,7 @@ #include #include #include +#include #include class PanelView; @@ -36,6 +37,14 @@ namespace Plasma { class Containment; } +namespace KWayland +{ + namespace Client + { + class PlasmaShellSurface; + } +} + class PanelConfigView : public PlasmaQuick::ConfigView { Q_OBJECT @@ -53,14 +62,13 @@ public: protected: void showEvent(QShowEvent *ev); void hideEvent(QHideEvent *ev); + void focusOutEvent(QFocusEvent *ev); + void moveEvent(QMoveEvent *ev); public Q_SLOTS: void showAddWidgetDialog(); void addPanelSpacer(); -protected: - void focusOutEvent(QFocusEvent *ev); - protected Q_SLOTS: void syncGeometry(); void syncSlideLocation(); @@ -78,6 +86,7 @@ private: Plasma::Theme m_theme; QTimer m_deleteTimer; QTimer m_screenSyncTimer; + QPointer m_shellSurface; }; #endif // multiple inclusion guard