Permalink
Browse files

Make sure MainWindow has focus when we returned from a child QWidget

On a mac, if you simply delete the child QWidget, the focus isn't returned, making all keyboard presses simply doing "beep". Earlier fix done in b2dcd7b didn't help under all circumstances.

Fixes #10587
  • Loading branch information...
jyavenard committed Jul 17, 2013
1 parent 26e59c9 commit 995db9d284a40d695271302a0fa812d9353b9faa
Showing with 6 additions and 8 deletions.
  1. +6 −8 mythtv/libs/libmythui/mythmainwindow.cpp
@@ -1326,14 +1326,13 @@ void MythMainWindow::attach(QWidget *child)
currentWidget()->setEnabled(false);
d->widgetList.push_back(child);
#ifndef Q_OS_MAC
child->winId();
#endif
child->raise();
child->setFocus();
child->setMouseTracking(true);
}
void MythMainWindow::detach(QWidget *child)
{
std::vector<QWidget*>::iterator it =
@@ -1347,13 +1346,12 @@ void MythMainWindow::detach(QWidget *child)
d->widgetList.erase(it);
QWidget *current = currentWidget();
if (!current)
current = this;
if (current)
{
current->setEnabled(true);
current->setFocus();
current->setMouseTracking(true);
}
current->setEnabled(true);
current->setFocus();
current->setMouseTracking(true);
if (d->exitingtomain)
{

0 comments on commit 995db9d

Please sign in to comment.