mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +00:00
Don't attempt to translate the same word in scanpopup that is shown there already.
This fixes repeated scanpopup triggerings under Windows.
This commit is contained in:
parent
21850685e1
commit
414e0336e6
11
scanpopup.cc
11
scanpopup.cc
|
@ -235,7 +235,16 @@ void ScanPopup::mouseHovered( QString const & str )
|
||||||
|
|
||||||
void ScanPopup::handleInputWord( QString const & str )
|
void ScanPopup::handleInputWord( QString const & str )
|
||||||
{
|
{
|
||||||
pendingInputWord = gd::toQString( Folding::trimWhitespaceOrPunct( gd::toWString( str ) ) );
|
QString sanitizedStr = gd::toQString( Folding::trimWhitespaceOrPunct( gd::toWString( str ) ) );
|
||||||
|
|
||||||
|
if ( isVisible() && sanitizedStr == inputWord )
|
||||||
|
{
|
||||||
|
// Attempt to translate the same word we already have shown in scan popup.
|
||||||
|
// Ignore it, as it is probably a spurious mouseover event.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pendingInputWord = sanitizedStr;
|
||||||
|
|
||||||
if ( !pendingInputWord.size() )
|
if ( !pendingInputWord.size() )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue