Skip to content

Commit

Permalink
fix: [desktop] When the content menu pops up, the input method can st…
Browse files Browse the repository at this point in the history
…ill be used.

1. When the wayland menu pops up, there is no focus on seizing, causing the
input method to not disappear.
2. In the Wayland mode, when the menu pops up, the input method is disabled

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-259639.html
  • Loading branch information
GongHeng2017 committed Jun 20, 2024
1 parent f619e60 commit 258bf0b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/desktop/core/ddplugin-canvas/view/canvasview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ void CanvasView::contextMenuEvent(QContextMenuEvent *event)
bool isEmptyArea = !index.isValid();
Qt::ItemFlags flags;

if (WindowUtils::isWayLand())
setAttribute(Qt::WA_InputMethodEnabled, false);
if (isEmptyArea) {
d->menuProxy->showEmptyAreaMenu(flags, gridPos);
} else {
Expand All @@ -359,6 +361,8 @@ void CanvasView::contextMenuEvent(QContextMenuEvent *event)
flags = model()->flags(index);
d->menuProxy->showNormalMenu(index, flags, gridPos);
}
if (WindowUtils::isWayLand())
setAttribute(Qt::WA_InputMethodEnabled, true);
}

void CanvasView::startDrag(Qt::DropActions supportedActions)
Expand Down

0 comments on commit 258bf0b

Please sign in to comment.