~stolowski/unity-2d/always-show-menubar-option

« back to all changes in this revision

Viewing changes to panel/applets/appname/appnameapplet.cpp

  • Committer: Pawel Stolowski
  • Date: 2012-03-22 09:41:31 UTC
  • Revision ID: pawel.stolowski@canonical.com-20120322094131-1gbxt7e3kfhblcij
Update panel widgets on menubar-always-visible change, so that change of that setting is immediately visible to user.
Use Qt::Queued connection to avoid panel deadlock on menubar-always-visibile change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
 
293
293
    connect(DashClient::instance(), SIGNAL(alwaysFullScreenChanged()), SLOT(updateWidgets()));
294
294
    connect(DashClient::instance(), SIGNAL(dashDisconnected()), SLOT(updateWidgets()));
295
 
    connect(&panel2dConfiguration(), SIGNAL(menubarAlwaysVisibleChanged(bool)), SLOT(updateMenuBarAlwaysVisible()));
 
295
    // use queued connection, otherwise panel will deadlock for some reason
 
296
    connect(&panel2dConfiguration(), SIGNAL(menubarAlwaysVisibleChanged(bool)), SLOT(updateMenuBarAlwaysVisible()), Qt::QueuedConnection);
296
297
 
297
298
    QHBoxLayout* layout = new QHBoxLayout(this);
298
299
    layout->setMargin(0);
306
307
    }
307
308
 
308
309
    updateMenuBarAlwaysVisible();
309
 
    updateWidgets();
310
310
}
311
311
 
312
312
AppNameApplet::~AppNameApplet()
317
317
void AppNameApplet::updateMenuBarAlwaysVisible()
318
318
{
319
319
    d->m_menubarAlwaysVisible = panel2dConfiguration().property("menubarAlwaysVisible").toBool();
 
320
    updateWidgets();
320
321
}
321
322
 
322
323
void AppNameApplet::updateWidgets()