Skip to content

[222_48] : fix macOS shortcut issue #2935

Open
git-lakshy wants to merge 2 commits intoMoganLab:mainfrom
git-lakshy:exp4
Open

[222_48] : fix macOS shortcut issue #2935
git-lakshy wants to merge 2 commits intoMoganLab:mainfrom
git-lakshy:exp4

Conversation

@git-lakshy
Copy link
Contributor

@git-lakshy git-lakshy commented Mar 5, 2026

fixes #2894

How to test

  1. Open Mogan on macOS
  2. Open the file dialog (File > Save or similar actions)
  3. The keyboard shortcuts should work properly:
    • Command+V (paste)
    • Command+C (copy)
    • Other standard macOS shortcuts

Fix macOS file chooser dialog keyboard shortcuts

What

Fixed issue #2894: keyboard shortcuts (Command+V, Command+C, etc.) not working in the file chooser dialog on macOS.

Why

when Qt uses native file dialog on macOS, it has a keyboard shortcut issue that prevents users from using standard macOS shortcuts for copy/paste operations, negatively impacting user experience.

SCreenshot

image

@git-lakshy git-lakshy changed the title WIP : fix macOS paste issue [222_48] : fix macOS shortcut issue Mar 5, 2026
@git-lakshy git-lakshy marked this pull request as ready for review March 5, 2026 08:10
Copilot AI review requested due to automatic review settings March 5, 2026 08:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses macOS-native QFileDialog keyboard shortcut handling by forcing Qt’s non-native file dialog implementation on macOS, improving copy/paste and other standard shortcut behavior in file chooser dialogs.

Changes:

  • Force QFileDialog::DontUseNativeDialog on macOS in qt_chooser_widget_rep::perform_dialog().
  • Add a developer note (devel/222_48.md) with problem statement and manual test steps for issue #2894.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Plugins/Qt/qt_chooser_widget.cpp Disables the native macOS file dialog to restore standard keyboard shortcuts.
devel/222_48.md Documents the issue context and provides macOS testing instructions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +289 to +293
#ifdef OS_MACOS
// Use Qt's custom dialog on macOS to fix keyboard shortcuts
// (Command+V, Command+C, etc.)
dialog->setOption (QFileDialog::DontUseNativeDialog, true);
#endif
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function header comment above this block says the chooser uses a native dialog on macOS/Windows, but this change explicitly forces a non-native QFileDialog on macOS. Please update that header comment (and consider rewording the inline comment from “custom dialog” to “non-native dialog”) so the documentation stays accurate for future maintenance.

Copilot uses AI. Check for mistakes.
Fixed issue #2894: keyboard shortcuts (Command+V, Command+C, etc.) not working in the file chooser dialog on macOS.

### Why
when Qt uses native file dialog on macOS, it has a keyboard shortcut issue that prevents users from using standard macOS shortcuts for copy/paste operations, negatively impacting user experience.
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentence casing: start this sentence with a capital letter ("When") since it begins a new paragraph.

Suggested change
when Qt uses native file dialog on macOS, it has a keyboard shortcut issue that prevents users from using standard macOS shortcuts for copy/paste operations, negatively impacting user experience.
When Qt uses native file dialog on macOS, it has a keyboard shortcut issue that prevents users from using standard macOS shortcuts for copy/paste operations, negatively impacting user experience.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

在 macOS 平台保存文件的对话框中无法使用 Command v 粘贴

2 participants