Skip to content

Commit

Permalink
fix: popup can't reopen
Browse files Browse the repository at this point in the history
Failed to call close because of output's check.
The Menu is reopen when right click the plugin surface, so we
deliverMouseEvent before close window.

Issue: linuxdeepin/developer-center#9959
  • Loading branch information
18202781743 authored and deepin-bot[bot] committed Jul 25, 2024
1 parent 849f7ad commit 62fd24d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions frame/utility_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ bool X11Utility::grabMouse(QWindow *target, bool grab)
auto filter = new MouseGrabEventFilter(target);
qApp->installEventFilter(filter);
QObject::connect(filter, &MouseGrabEventFilter::outsideMousePressed, target, [filter, target] () {
qCDebug(dsLog) << "ungrab mouse for the window:" << target->winId();
target->close();
qApp->removeEventFilter(filter);
qCDebug(dsLog) << "ungrab mouse for the window:" << target->winId();
target->setMouseGrabEnabled(false);
target->close();
filter->deleteLater();
});
return target->setMouseGrabEnabled(grab);
Expand Down Expand Up @@ -106,8 +106,8 @@ void MouseGrabEventFilter::mousePressEvent(QMouseEvent *e)
const auto pos = e->globalPosition();
if ((e->position().toPoint().isNull() && !pos.isNull()) ||
!bounding.contains(pos.toPoint())) {
emit outsideMousePressed();
instance()->deliverMouseEvent(e->button(), pos.x(), pos.y());
emit outsideMousePressed();
return;
}
}
Expand Down
2 changes: 1 addition & 1 deletion panels/dock/tray/ShellSurfaceItemProxy.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ShellSurfaceItem {
}
function closeShellSurface()
{
if (surface && shellSurface && output.window && output.window.visible) {
if (surface && shellSurface) {
DockCompositor.closeShellSurface(shellSurface)
}
}
Expand Down

0 comments on commit 62fd24d

Please sign in to comment.