From 414e0336e670377cca626b8d1da469dfbb39df21 Mon Sep 17 00:00:00 2001 From: Konstantin Isakov Date: Fri, 3 Dec 2010 23:10:18 +0300 Subject: [PATCH] Don't attempt to translate the same word in scanpopup that is shown there already. This fixes repeated scanpopup triggerings under Windows. --- scanpopup.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scanpopup.cc b/scanpopup.cc index 721d187d..b2c7ea33 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -235,7 +235,16 @@ void ScanPopup::mouseHovered( 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() ) {