support window move with the shell interface

wilder-5.14
Marco Martin 11 years ago
parent 9ac2fd0636
commit 7763a9c956
  1. 29
      shell/panelconfigview.cpp
  2. 15
      shell/panelconfigview.h

@ -20,6 +20,7 @@
#include "panelconfigview.h"
#include "panelview.h"
#include "panelshadows_p.h"
#include "shellcorona.h"
#include <QDebug>
#include <QDir>
@ -35,9 +36,11 @@
#include <KWindowSystem>
#include <Plasma/Containment>
#include <Plasma/Corona>
#include <Plasma/PluginLoader>
#include <KWayland/Client/plasmashell.h>
#include <KWayland/Client/surface.h>
//////////////////////////////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<ShellCorona *>(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) {

@ -28,6 +28,7 @@
#include <QJSValue>
#include <QQmlListProperty>
#include <QStandardItemModel>
#include <QPointer>
#include <Plasma/Theme>
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<KWayland::Client::PlasmaShellSurface> m_shellSurface;
};
#endif // multiple inclusion guard

Loading…
Cancel
Save