[plasma/libplasma] src/plasmaquick: PlasmaShellWaylandIntegration: Expose openUnderCursor

Nicolas Fella <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit aa2935afeb6d14ed9a7db931edbc382296156fda by Nicolas Fella.
Committed on 22/07/2026 at 13:34.
Pushed by nicolasfella into branch 'master'.

PlasmaShellWaylandIntegration: Expose openUnderCursor

M  +17   -0    src/plasmaquick/plasmashellwaylandintegration.cpp
M  +7    -0    src/plasmaquick/plasmashellwaylandintegration.h

https://invent.kde.org/plasma/libplasma/-/commit/aa2935afeb6d14ed9a7db931edbc382296156fda

diff --git a/src/plasmaquick/plasmashellwaylandintegration.cpp b/src/plasmaquick/plasmashellwaylandintegration.cpp
index a6e4299f1..c3af1b75c 100644
--- a/src/plasmaquick/plasmashellwaylandintegration.cpp
+++ b/src/plasmaquick/plasmashellwaylandintegration.cpp
@@ -70,6 +70,7 @@ public:
     QtWayland::org_kde_plasma_surface::panel_behavior m_panelBehavior = QtWayland::org_kde_plasma_surface::panel_behavior_always_visible;
     QtWayland::org_kde_plasma_surface::role m_role = QtWayland::org_kde_plasma_surface::role_normal;
     bool m_takesFocus = false;
+    bool m_openUnderCursor = false;
     std::unique_ptr<PlasmaShellSurface> m_shellSurface;
 };
 
@@ -116,6 +117,10 @@ void PlasmaShellWaylandIntegrationPrivate::surfaceCreated()
         m_shellSurface->set_role(m_role);
         m_shellSurface->set_skip_switcher(true);
         m_shellSurface->set_skip_taskbar(true);
+
+        if (m_openUnderCursor) {
+            m_shellSurface->open_under_cursor();
+        }
     }
 }
 
@@ -211,4 +216,16 @@ void PlasmaShellWaylandIntegration::setTakesFocus(bool takesFocus)
     }
 }
 
+void PlasmaShellWaylandIntegration::openUnderCursor()
+{
+    if (d->m_openUnderCursor) {
+        return;
+    }
+    d->m_openUnderCursor = true;
+
+    if (d->m_shellSurface) {
+        d->m_shellSurface->open_under_cursor();
+    }
+}
+
 #include "moc_plasmashellwaylandintegration.cpp"
diff --git a/src/plasmaquick/plasmashellwaylandintegration.h b/src/plasmaquick/plasmashellwaylandintegration.h
index 782319e83..99e334e86 100644
--- a/src/plasmaquick/plasmashellwaylandintegration.h
+++ b/src/plasmaquick/plasmashellwaylandintegration.h
@@ -61,6 +61,13 @@ public:
      */
     void setTakesFocus(bool takesFocus);
 
+    /*!
+     * Request that the initial position of this surface will be under the cursor
+     *
+     * \since 6.8
+     */
+    void openUnderCursor();
+
     bool eventFilter(QObject *watched, QEvent *event) override;
 
 private:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.