diff --git a/src/client/plasmawindowmanagement.h b/src/client/plasmawindowmanagement.h --- a/src/client/plasmawindowmanagement.h +++ b/src/client/plasmawindowmanagement.h @@ -403,6 +403,19 @@ * Requests to send the window to virtual @p desktop. **/ void requestVirtualDesktop(quint32 desktop); + + /** + * Requests the window at this model row index have its keep above state toggled. + * @since 5.35 + */ + void requestToggleKeepAbove(); + + /** + * Requests the window at this model row index have its keep below state toggled. + * @since 5.35 + */ + void requestToggleKeepBelow(); + /** * Requests the window at this model row index have its minimized state toggled. */ diff --git a/src/client/plasmawindowmanagement.cpp b/src/client/plasmawindowmanagement.cpp --- a/src/client/plasmawindowmanagement.cpp +++ b/src/client/plasmawindowmanagement.cpp @@ -882,6 +882,32 @@ org_kde_plasma_window_set_virtual_desktop(d->window, desktop); } +void PlasmaWindow::requestToggleKeepAbove() +{ + if (d->keepAbove) { + org_kde_plasma_window_set_state(d->window, + ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE, + 0); + } else { + org_kde_plasma_window_set_state(d->window, + ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE, + ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_ABOVE); + } +} + +void PlasmaWindow::requestToggleKeepBelow() +{ + if (d->keepBelow) { + org_kde_plasma_window_set_state(d->window, + ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW, + 0); + } else { + org_kde_plasma_window_set_state(d->window, + ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW, + ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_KEEP_BELOW); + } +} + void PlasmaWindow::requestToggleMinimized() { if (d->minimized) {