Commit 178f0755 authored by Kevin Funk's avatar Kevin Funk
Browse files

Fix behavior of active tooltips via keyboard invocation

Before this patch, it appeared like the 'Alt' key got stuck inside
KDevelop when for example switching between applications (via Alt+Tab).
When returning to KDevelop, the 'source browse mode' would still be enabled
and leaded to odd behavior.
parent d60d3597
......@@ -154,8 +154,10 @@ bool BrowseManager::eventFilter(QObject * watched, QEvent * event) {
}
QFocusEvent* focusEvent = dynamic_cast<QFocusEvent*>(event);
//Eventually stop key-browsing
if(keyEvent && m_browsingByKey && keyEvent->key() == m_browsingByKey && keyEvent->type() == QEvent::KeyRelease) {
if((keyEvent && m_browsingByKey && keyEvent->key() == m_browsingByKey && keyEvent->type() == QEvent::KeyRelease)
|| (focusEvent && focusEvent->lostFocus())) {
if(!m_browsing)
m_plugin->setAllowBrowsing(false);
m_browsingByKey = 0;
......
......@@ -66,6 +66,8 @@ ActiveToolTip::ActiveToolTip(QWidget *parent, const QPoint& position)
p.setColor(QPalette::Text, p.color(QPalette::ToolTipText));
setPalette(p);
setWindowFlags(Qt::WindowDoesNotAcceptFocus | windowFlags());
qApp->installEventFilter(this);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment