~ubuntu-branches/ubuntu/precise/unity-2d/precise-security

« back to all changes in this revision

Viewing changes to launcher/app/visibilitycontroller.cpp

  • Committer: Package Import Robot
  • Author(s): Didier Roche, Didier Roche, Aurélien Gâteau
  • Date: 2012-01-13 09:12:36 UTC
  • mfrom: (1.1.25)
  • Revision ID: package-import@ubuntu.com-20120113091236-844z32uco10hs6ym
Tags: 5.2.0-0ubuntu1
[ Didier Roche ]
* New upstream release:
  - Select quicklist items with just one right click (LP: #688830)
  - Launcher - Dragging and dropping a running application in to the Trash
    should quit the application and (if the app is pinned to the Launcher)
    un-pin the application from the Launcher (LP: #870143)
  - Dash - "See more..." line should be base-aligned with section header
    (LP: #748101)
  - right click on the dash icon should display a list of the lenses
    (LP: #868452)
  - Top Bar - rename the "Desktop" title in the Top Bar (displayed when no
    window has focus)  to "Ubuntu Desktop" (LP: #869873)
  - Application title on quicklist should be bold (or more visible)
    (LP: #900400)
  - unity-2d-launcher crashed with SIGSEGV  when opening a folder on a CD
    (LP: #831868)
  - unity-2d-places crashed with SIGSEGV in QScriptValue::call()
    (LP: #836498)
  - unity-2d-launcher crashed with SIGSEGV in geis_finish() (LP: #850893)
  - unity-2d-places crashed with SIGABRT in raise() (LP: #857575)
  - unity-2d-launcher crashed with SIGSEGV in exit() (LP: #859596)
  - [spread] layout broken since bzr revision 799 of lp:unity-2d
    (LP: #900895)
  - [workspace switcher] keyboard navigation of workspace switcher broken
    for accessibility (LP: #744978)
  - [spread] workspace switcher performance is poor, especially on low
    powered CPUs (LP: #745764)
  - Launcher - the rendering of the BFB and Lens squircle does not match the
    design (LP: #838708)
  - [dash] Huge performance hit when scrolling search results with
    accessibility enabled (LP: #862956)
  - DBUS_STARTER_ADDRESS and DBUS_STARTER_BUS_TYPE aren't always unset from
    environment making gedit and possibly others fail to start (LP: #873027)
  - Win Key can not be disabled in Unity-2d (LP: #873580)
  - [dash] Unity-2d dash very slow to open (LP: #881756)
  - [tests] LauncherViewTest hanging (LP: #894380)
  - [tests] Unit tests failing due to lack of Xserver (LP: #894381)
  - [launcher] Alt+F1 broken: does not give the focus to the launcher's
    content (LP: #901505)
  - [tests] Add Automated User Experience testing (LP: #903495)
  - [workspace switcher] Performance can be poor when using the opengl
    backend because of window texture sizes that are not limited
    (LP: #808716)
  - [dash] no way to unmaximize (LP: #860400)
  - [launcher] In non-composite mode, background is black (LP: #879288)
  - [dash] Unity 2D shows 'Search' instead of 'Run Command' on ALT + F2
    (LP: #883392)
  - [launcher] Removing icon from launcher makes it hide immediately
    (LP: #884410)
  - OpenGL disabled regardless of use-opengl setting (LP: #887957)
  - if libdir does not equal lib (LP: #888164)
  - [launcher] Launcher stuck open while mouse moved to left corner of panel
    (LP: #892004)
  - [dash] Long results label are truncated instead of elided and a few
    pixels of the next line is visible (LP: #901491)
  - [launcher] Dash icon missing in PPA (LP: #903182)
  - [launcher] Tile context menu should appear at mouse click down event
    (LP: #813036)
  - [launcher] Trash tile highlight is truncated top and bottom
    (LP: #876589)
  - [dash] Text highlighting color is wrong (LP: #880222)
  - [launcher] left edge of panel should not reveal launcher (LP: #891636)
  - [dash] Word "Filter results" has underline when highlighted
    (LP: #893061)
  - [launcher] Alt+F1, change desktop, Alt+F1, hit Esc: launcher doesn't
    give away focus (LP: #897640)
  - Top Bar - rename the "Desktop" title in the Top Bar (displayed when no
    window has focus)  to "Ubuntu Desktop" (LP: #869873)
  - [launcher] Show desktop doesn't show launcher (LP: #898161)
  - [launcher] Context menu/tooltip not positioned at Tile center
    (LP: #898349)
  - The QT_LAYOUT_DIRECTION string needs a translator comment (LP: #863058)
  - unity panel menus don't stay open when clicked on second monitor
    (LP: #869196)
  - Dash- More fixes to layout and alignments (LP: #906235)
* debian/control:
  - bump libunitycore build-dep to 5.0.

[ Aurélien Gâteau ]
* debian/control:
  - bump build-dep versions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
// unity-2d
30
30
#include <debug_p.h>
31
31
#include <unity2dpanel.h>
32
 
 
33
 
// libdconf-qt
34
 
#include "qconf.h"
 
32
#include <config.h>
35
33
 
36
34
// Qt
37
35
#include <QDBusConnection>
38
36
#include <QDBusServiceWatcher>
39
37
 
40
 
static const char* LAUNCHER_DCONF_SCHEMA = "com.canonical.Unity2d.Launcher";
41
 
 
42
38
VisibilityController::VisibilityController(Unity2dPanel* panel)
43
39
: QObject(panel)
44
40
, m_panel(panel)
45
 
, m_dconf_launcher(new QConf(LAUNCHER_DCONF_SCHEMA))
46
41
, m_dbusWatcher(new QDBusServiceWatcher(this))
47
42
{
48
43
    m_dbusWatcher->setConnection(QDBusConnection::sessionBus());
49
44
    m_dbusWatcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
50
45
 
51
 
    connect(m_dconf_launcher, SIGNAL(hideModeChanged(int)), SLOT(update()));
52
 
    connect(m_panel, SIGNAL(useStrutChanged(bool)), SLOT(update()));
 
46
    connect(&launcher2dConfiguration(), SIGNAL(hideModeChanged(int)), SLOT(update()));
53
47
    connect(m_panel, SIGNAL(manualSlidingChanged(bool)), SLOT(update()));
54
48
    connect(m_dbusWatcher, SIGNAL(serviceUnregistered(const QString&)), SLOT(slotServiceUnregistered(const QString&)));
55
49
    update();
57
51
 
58
52
VisibilityController::~VisibilityController()
59
53
{
60
 
    delete m_dconf_launcher;
61
54
}
62
55
 
63
 
void VisibilityController::update()
 
56
void VisibilityController::update(UpdateReason reason)
64
57
{
65
58
    if (!m_forceVisibleCountHash.isEmpty()) {
66
59
        return;
67
60
    }
68
 
    AutoHideMode mode = AutoHideMode(m_dconf_launcher->property("hideMode").toInt());
 
61
    AutoHideMode mode = AutoHideMode(launcher2dConfiguration().property("hideMode").toInt());
69
62
 
70
63
    setBehavior(0);
71
64
 
72
 
    /* Do not use any hiding controller if the panel is either:
73
 
        - being slid manually
74
 
        - locked in place (using struts)
75
 
    */
76
 
    if (!m_panel->manualSliding() && !m_panel->useStrut()) {
 
65
    /* Do not use any hiding controller if the panel is being slid manually */
 
66
    if (!m_panel->manualSliding()) {
77
67
        switch (mode) {
78
68
        case ManualHide:
 
69
            m_panel->setUseStrut(true);
 
70
            m_panel->slideIn();
79
71
            break;
80
72
        case AutoHide:
 
73
            m_panel->setUseStrut(false);
81
74
            setBehavior(new AutoHideBehavior(m_panel));
82
75
            break;
83
76
        case IntelliHide:
 
77
            m_panel->setUseStrut(false);
84
78
            setBehavior(new IntelliHideBehavior(m_panel));
 
79
            if (reason == UpdateFromForceVisibilityEnded && !m_panel->geometry().contains(QCursor::pos())) {
 
80
                // The first thing IntelliHideBehavior does is checking if there is
 
81
                // a window behind the panel, and if there is one, hide the panel immediately
 
82
                // This is correct for some cases, but in the case we come from an update because the
 
83
                // panel is not forced visible anymore and the mouse is not in the panel,
 
84
                // i.e. the launcher was visible and the user clicked in an action of the tile menu,
 
85
                // we should still give the user the wait 1 second before hiding behaviour.
 
86
                // To achieve this we tell the behaviour controller to show the panel
 
87
                // and simulate a mouse leave on the panel to start the hiding timer
 
88
                QMetaObject::invokeMethod(m_behavior.data(), "showPanel");
 
89
                QEvent e(QEvent::Leave);
 
90
                QCoreApplication::sendEvent(m_panel, &e);
 
91
            }
85
92
            break;
86
93
        }
87
94
    }
116
123
        UQ_WARNING << "Application" << service << "called endForceVisible() more than beginForceVisible().";
117
124
    }
118
125
    if (m_forceVisibleCountHash.isEmpty()) {
119
 
        update();
 
126
        update(UpdateFromForceVisibilityEnded);
120
127
    }
121
128
}
122
129
 
151
158
    m_forceVisibleCountHash.remove(service);
152
159
    m_dbusWatcher->removeWatchedService(service);
153
160
    if (m_forceVisibleCountHash.isEmpty()) {
154
 
        update();
 
161
        update(UpdateFromForceVisibilityEnded);
155
162
    }
156
163
}