Merge branch 'goldendict:master' into staged

This commit is contained in:
xiaoyifang 2022-05-26 07:12:25 +08:00 committed by GitHub
commit 2bccf038b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2980,7 +2980,19 @@ void MainWindow::hotKeyActivated( int hk )
toggleMainWindow(); toggleMainWindow();
else else
if ( scanPopup.get() ) if ( scanPopup.get() )
{
#ifdef HAVE_X11
// When the user requests translation with the Ctrl+C+C hotkey in certain apps
// on some GNU/Linux systems, GoldenDict appears to handle Ctrl+C+C before the
// active application finishes handling Ctrl+C. As a result, GoldenDict finds
// the clipboard empty, silently cancels the translation request, and users report
// that Ctrl+C+C is broken in these apps. Slightly delay handling the clipboard
// hotkey to give the active application more time and thus work around the issue.
QTimer::singleShot( 10, scanPopup.get(), SLOT( translateWordFromClipboard() ) );
#else
scanPopup->translateWordFromClipboard(); scanPopup->translateWordFromClipboard();
#endif
}
} }
void MainWindow::prepareNewReleaseChecks() void MainWindow::prepareNewReleaseChecks()