forked from quickshell/quickshell
layershell: fix protocol error on popup attachment
This commit is contained in:
parent
5f9bb9b46c
commit
7a15495e3f
4 changed files with 16 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
#include "surface.hpp"
|
||||
#include <any>
|
||||
|
||||
#include <private/qwaylanddisplay_p.h>
|
||||
#include <private/qwaylandscreen_p.h>
|
||||
|
@ -165,3 +166,14 @@ QSize constrainedSize(const Anchors& anchors, const QSize& size) noexcept {
|
|||
anchors.verticalConstraint() ? 0 : size.height()
|
||||
);
|
||||
}
|
||||
|
||||
void QSWaylandLayerSurface::attachPopup(QtWaylandClient::QWaylandShellSurface* popup) {
|
||||
std::any role = popup->surfaceRole();
|
||||
|
||||
if (auto* popupRole = std::any_cast<::xdg_popup*>(&role)) { // NOLINT
|
||||
this->get_popup(*popupRole);
|
||||
} else {
|
||||
qWarning() << "Cannot attach popup" << popup << "to shell surface" << this
|
||||
<< "as the popup is not an xdg_popup.";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue