Skip to content

Commit

Permalink
Stop the main window from hiding when menu is requested.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarmack committed Jan 4, 2011
1 parent c13ceba commit fc08604
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Mangonel.cpp
Expand Up @@ -185,7 +185,15 @@ void Mangonel::showHide(bool type)

void Mangonel::focusOutEvent(QFocusEvent* event)
{
this->showHide();
if (event->reason() != Qt::PopupFocusReason)
this->showHide();
}

bool Mangonel::eventFilter(QObject *object, QEvent *event)
{
if (event->type() == QEvent::FocusOut)
return true;
return false;
}

void Mangonel::showConfig()
Expand All @@ -194,7 +202,9 @@ void Mangonel::showConfig()
ConfigDialog* dialog = new ConfigDialog(this);
dialog->setHotkey(shortcut.primary());
connect(dialog, SIGNAL(hotkeyChanged(QKeySequence)), this, SLOT(setHotkey(QKeySequence)));
installEventFilter(this);
int result = dialog->exec();
removeEventFilter(this);
this->activateWindow();
this->setFocus();
}
Expand Down
1 change: 1 addition & 0 deletions Mangonel.h
Expand Up @@ -72,6 +72,7 @@ class Mangonel : public Plasma::Dialog
void inputMethodEvent(QInputMethodEvent* event);
virtual void keyPressEvent(QKeyEvent* event);
virtual void focusOutEvent(QFocusEvent* event);
bool eventFilter(QObject *object, QEvent *event);
private slots:
void launch();
void getApp(QString query);
Expand Down

0 comments on commit fc08604

Please sign in to comment.