From a89299c2e306998dd95ad837dd9c70239a766db2 Mon Sep 17 00:00:00 2001 From: Tvangeste Date: Mon, 28 Jan 2013 13:19:11 +0100 Subject: [PATCH] Revert "Use the same window flags for the scan window, on Win and Linux." Unfortunately, the change didn't work properly on KDE systems. This reverts commit 8a8c7cc7d7356495bf3ae53c0f01a266143e49ee. --- scanpopup.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scanpopup.cc b/scanpopup.cc index c9d2f7ae..9ebdbbcc 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -16,7 +16,16 @@ using std::wstring; -static Qt::WindowFlags popupWindowFlags = Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint; +/// We use different window flags under Windows and X11 due to slight differences +/// in their behavior on those platforms. +static Qt::WindowFlags popupWindowFlags = + +#ifdef Q_WS_WIN +Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint +#else +Qt::Popup +#endif +; ScanPopup::ScanPopup( QWidget * parent, Config::Class & cfg_, @@ -304,7 +313,14 @@ void ScanPopup::translateWord( QString const & word ) altModeExpirationTimer.stop(); inputWord = str; - engagePopup( false, true ); + engagePopup( false, +#ifdef Q_WS_WIN + true // We only focus popup under Windows when activated via Ctrl+C+C + // -- on Linux it already has an implicit focus +#else + false +#endif + ); } void ScanPopup::clipboardChanged( QClipboard::Mode m )