~unity-2d-team/unity-2d/previews

« back to all changes in this revision

Viewing changes to launcher/app/launcherview.cpp

  • Committer: Tarmac
  • Author(s): Gerry Boland
  • Date: 2011-07-28 13:01:54 UTC
  • mfrom: (652.1.3 unity-2d)
  • Revision ID: ubuntu.builder@gmail.com-20110728130154-8hfaetrte7p3vomt
[launcher] Fixed failure to appear on first Alt+F1 keypress.

This was because QDeclarative::activateWindow() not reliable. Dash & Spread use forceActivateWindow() instead.
Instead of having a third copy of this method for the Launcher, I've moved it to Unity2DDeclarativeView and removed the copies from Dash & Spread.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
 
78
78
    /* Alt+F1 gives the keyboard focus to the launcher. */
79
79
    Hotkey* altF1 = HotkeyMonitor::instance().getHotkeyFor(Qt::Key_F1, Qt::AltModifier);
80
 
    connect(altF1, SIGNAL(pressed()), SLOT(activateWindow()));
 
80
    connect(altF1, SIGNAL(pressed()), SLOT(forceActivateWindow()));
81
81
 
82
82
    /* Alt+F2 shows the dash with the commands place entry activated. */
83
83
    Hotkey* altF2 = HotkeyMonitor::instance().getHotkeyFor(Qt::Key_F2, Qt::AltModifier);
96
96
}
97
97
 
98
98
void
99
 
LauncherView::activateWindow()
100
 
{
101
 
    QDeclarativeView::activateWindow();
102
 
}
103
 
 
104
 
void
105
99
LauncherView::focusInEvent(QFocusEvent* event)
106
100
{
107
101
    QDeclarativeView::focusInEvent(event);