mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-07-14 19:14:23 -04:00
Add a (temporary) way to attach popups to layer surfaces
The new API is temporary. It's needed to help us with porting plasma to the layer shell protocol until Qt 6.6 is released, which includes QWaylandShellSurface::attachPopup().
This commit is contained in:
@ -6,6 +6,9 @@
|
||||
|
||||
#include "window.h"
|
||||
#include "../qwaylandlayershellintegration_p.h"
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
|
||||
#include "../qwaylandlayersurface_p.h"
|
||||
#endif
|
||||
|
||||
#include <layershellqt_logging.h>
|
||||
|
||||
@ -121,6 +124,21 @@ void Window::setDesiredOutput(QScreen *output)
|
||||
d->desiredOutput = output;
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
|
||||
void Window::attachPopup(QWindow *window, xdg_popup *popup)
|
||||
{
|
||||
auto waylandWindow = dynamic_cast<QtWaylandClient::QWaylandWindow *>(window->handle());
|
||||
if (!waylandWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto shellSurface = dynamic_cast<QWaylandLayerSurface *>(waylandWindow->shellSurface());
|
||||
if (shellSurface) {
|
||||
shellSurface->get_popup(popup);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Window::Window(QWindow *window)
|
||||
: QObject(window)
|
||||
, d(new WindowPrivate(window))
|
||||
|
Reference in New Issue
Block a user