fix: can not click popup menu
also remove useless code in popup sync: https://github.com/vioken/waylib/pull/265/
This commit is contained in:
parent
649f6177b1
commit
eba72f766e
|
|
@ -217,7 +217,7 @@ Item {
|
|||
}
|
||||
padding: 0
|
||||
background: null
|
||||
closePolicy: Popup.CloseOnPressOutside
|
||||
closePolicy: Popup.NoAutoClose
|
||||
|
||||
XdgSurface {
|
||||
id: popupSurfaceItem
|
||||
|
|
@ -237,11 +237,6 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
if (waylandSurface)
|
||||
waylandSurface.surface.unmap()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ Item {
|
|||
}
|
||||
padding: 0
|
||||
background: null
|
||||
closePolicy: Popup.CloseOnPressOutside
|
||||
closePolicy: Popup.NoAutoClose
|
||||
|
||||
XdgSurface {
|
||||
id: popupSurfaceItem
|
||||
|
|
@ -200,11 +200,6 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
if (waylandSurface)
|
||||
waylandSurface.surface.unmap()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include <WServer>
|
||||
#include <WOutput>
|
||||
#include <WSurfaceItem>
|
||||
#include <wxdgsurface.h>
|
||||
|
||||
#include <qwbackend.h>
|
||||
#include <qwdisplay.h>
|
||||
|
|
@ -383,10 +384,16 @@ bool Helper::afterHandleEvent(WSeat *seat, WSurface *watched, QObject *surfaceIt
|
|||
|
||||
if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::TouchBegin) {
|
||||
// surfaceItem is qml type: XdgSurfaceItem or LayerSurfaceItem
|
||||
auto toplevelSurface = qvariant_cast<WToplevelSurface*>(surfaceItem->property("surface"));
|
||||
auto *toplevelSurface = qvariant_cast<WToplevelSurface*>(surfaceItem->property("surface"));
|
||||
if (!toplevelSurface)
|
||||
return false;
|
||||
Q_ASSERT(toplevelSurface->surface() == watched);
|
||||
if (auto *xdgSurface = qvariant_cast<WXdgSurface*>(surfaceItem->property("surface"))) {
|
||||
// TODO(waylib): popupSurface should not inherit WToplevelSurface
|
||||
if (xdgSurface->isPopup()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
setActivateSurface(toplevelSurface);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue