diff --git a/src/server/plasmashell_interface.cpp b/src/server/plasmashell_interface.cpp index 981dfc096bdbe3f9a624266e6be6bcc2eaa6c7b1..55d4a1c81e89b2a19637d593ebf0a04ffe594301 100644 --- a/src/server/plasmashell_interface.cpp +++ b/src/server/plasmashell_interface.cpp @@ -42,6 +42,7 @@ public: QPoint m_globalPos; PlasmaShellSurfaceInterface::Role m_role = PlasmaShellSurfaceInterface::Role::Normal; PlasmaShellSurfaceInterface::PanelBehavior m_panelBehavior = PlasmaShellSurfaceInterface::PanelBehavior::AlwaysVisible; + OutputInterface *m_output = nullptr; bool m_positionSet = false; bool m_skipTaskbar = false; bool m_skipSwitcher = false; @@ -132,8 +133,8 @@ void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_destroy_resource void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_output(Resource *resource, struct ::wl_resource *output) { Q_UNUSED(resource) - Q_UNUSED(output) - // TODO: implement + m_output = OutputInterface::get(output); + Q_EMIT q->outputChanged(); } void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_position(Resource *resource, int32_t x, int32_t y) @@ -267,6 +268,11 @@ PlasmaShellSurfaceInterface::Role PlasmaShellSurfaceInterface::role() const return d->m_role; } +OutputInterface *PlasmaShellSurfaceInterface::output() const +{ + return d->m_output; +} + bool PlasmaShellSurfaceInterface::isPositionSet() const { return d->m_positionSet; diff --git a/src/server/plasmashell_interface.h b/src/server/plasmashell_interface.h index 4bafcb0a7544e479ff82a6a60bd385e0ccf684ab..3e9687e5dbb05cca09dcda1f5dabd7ff9ddb37b1 100644 --- a/src/server/plasmashell_interface.h +++ b/src/server/plasmashell_interface.h @@ -17,6 +17,7 @@ namespace KWaylandServer { class Display; class SurfaceInterface; +class OutputInterface; class PlasmaShellSurfaceInterface; class PlasmaShellInterfacePrivate; @@ -73,6 +74,10 @@ public: * @returns Whether a global position has been requested. */ bool isPositionSet() const; + /** + * @returns the requested output. + */ + OutputInterface *output() const; /** * Describes possible roles this PlasmaShellSurfaceInterface can have. @@ -159,6 +164,10 @@ Q_SIGNALS: * A change of global position has been requested. */ void positionChanged(); + /** + * A change of the output has been requested. + */ + void outputChanged(); /** * A change of the role has been requested. */