Skip to content

Commit 258bf0b

Browse files
committed
fix: [desktop] When the content menu pops up, the input method can still 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
1 parent f619e60 commit 258bf0b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/plugins/desktop/core/ddplugin-canvas/view/canvasview.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ void CanvasView::contextMenuEvent(QContextMenuEvent *event)
349349
bool isEmptyArea = !index.isValid();
350350
Qt::ItemFlags flags;
351351

352+
if (WindowUtils::isWayLand())
353+
setAttribute(Qt::WA_InputMethodEnabled, false);
352354
if (isEmptyArea) {
353355
d->menuProxy->showEmptyAreaMenu(flags, gridPos);
354356
} else {
@@ -359,6 +361,8 @@ void CanvasView::contextMenuEvent(QContextMenuEvent *event)
359361
flags = model()->flags(index);
360362
d->menuProxy->showNormalMenu(index, flags, gridPos);
361363
}
364+
if (WindowUtils::isWayLand())
365+
setAttribute(Qt::WA_InputMethodEnabled, true);
362366
}
363367

364368
void CanvasView::startDrag(Qt::DropActions supportedActions)

0 commit comments

Comments
 (0)