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

« back to all changes in this revision

Viewing changes to places/app/dashdeclarativeview.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:
18
18
#include "dashadaptor.h"
19
19
 
20
20
// unity-2d
 
21
#include <dashsettings.h>
21
22
#include <launcherclient.h>
 
23
#include <screeninfo.h>
22
24
 
23
25
// Qt
24
26
#include <QDesktopWidget>
36
38
 
37
39
#include <config.h>
38
40
 
39
 
static const int DASH_MIN_SCREEN_WIDTH = 1280;
40
 
static const int DASH_MIN_SCREEN_HEIGHT = 1084;
41
 
 
42
 
static const int DASH_DESKTOP_WIDTH = 989;
 
41
static const int DASH_DESKTOP_WIDTH = 996;
43
42
static const int DASH_DESKTOP_COLLAPSED_HEIGHT = 115;
44
 
static const int DASH_DESKTOP_EXPANDED_HEIGHT = 606;
 
43
static const int DASH_DESKTOP_EXPANDED_HEIGHT = 615;
45
44
 
46
45
static const char* DASH_DBUS_SERVICE = "com.canonical.Unity2d.Dash";
47
46
static const char* DASH_DBUS_OBJECT_PATH = "/Dash";
58
57
 
59
58
    QDesktopWidget* desktop = QApplication::desktop();
60
59
    connect(desktop, SIGNAL(resized(int)), SIGNAL(screenGeometryChanged()));
61
 
    connect(desktop, SIGNAL(resized(int)), SIGNAL(updateDashModeDependingOnScreenGeometry()));
 
60
    connect(desktop, SIGNAL(resized(int)), SLOT(updateDashModeDependingOnScreenGeometry()));
62
61
    connect(desktop, SIGNAL(workAreaResized(int)), SLOT(onWorkAreaResized(int)));
63
62
 
64
63
    updateSize();
72
71
    }
73
72
 
74
73
    updateSize();
75
 
    availableGeometryChanged();
76
 
}
77
 
 
78
 
 
79
 
static int getenvInt(const char* name, int defaultValue)
80
 
{
81
 
    QByteArray stringValue = qgetenv(name);
82
 
    bool ok;
83
 
    int value = stringValue.toInt(&ok);
84
 
    return ok ? value : defaultValue;
85
74
}
86
75
 
87
76
void
88
77
DashDeclarativeView::updateDashModeDependingOnScreenGeometry()
89
78
{
90
79
    QRect rect = QApplication::desktop()->screenGeometry(this);
91
 
    static int minWidth = getenvInt("DASH_MIN_SCREEN_WIDTH", DASH_MIN_SCREEN_WIDTH);
92
 
    static int minHeight = getenvInt("DASH_MIN_SCREEN_HEIGHT", DASH_MIN_SCREEN_HEIGHT);
93
 
    if (rect.width() < minWidth && rect.height() < minHeight) {
 
80
    QSize minSize = Unity2d::DashSettings::minimumSizeForDesktop();
 
81
    if (rect.width() < minSize.width() && rect.height() < minSize.height()) {
94
82
        setDashMode(FullScreenMode);
95
83
    } else {
96
84
        setDashMode(DesktopMode);
110
98
void
111
99
DashDeclarativeView::fitToAvailableSpace()
112
100
{
113
 
    QRect rect = availableGeometry();
 
101
    QRect rect = ScreenInfo::instance()->panelsFreeGeometry();
114
102
    move(rect.topLeft());
115
103
    setFixedSize(rect.size());
116
104
}
118
106
void
119
107
DashDeclarativeView::resizeToDesktopModeSize()
120
108
{
121
 
    QRect rect = availableGeometry();
 
109
    QRect rect = ScreenInfo::instance()->panelsFreeGeometry();
122
110
    int screenRight = rect.right();
123
111
 
124
112
    rect.setWidth(qMin(DASH_DESKTOP_WIDTH, rect.width()));
180
168
        } else {
181
169
            hide();
182
170
            m_launcherClient->endForceVisible();
 
171
            QMetaObject::invokeMethod( rootObject(), "deactivateAllLenses", Qt::AutoConnection);
183
172
        }
184
173
        activeChanged(m_active);
185
174
    }
259
248
    setActive(true);
260
249
}
261
250
 
262
 
const QRect
263
 
DashDeclarativeView::screenGeometry() const
264
 
{
265
 
    QDesktopWidget* desktop = QApplication::desktop();
266
 
    return desktop->screenGeometry(this);
267
 
}
268
 
 
269
 
QRect
270
 
DashDeclarativeView::availableGeometry() const
271
 
{
272
 
    QRect screenRect = QApplication::desktop()->screenGeometry(this);
273
 
    QRect availableRect = QApplication::desktop()->availableGeometry(this);
274
 
 
275
 
    QRect availableGeometry(
276
 
        LauncherClient::MaximumWidth,
277
 
        availableRect.top(),
278
 
        screenRect.width() - LauncherClient::MaximumWidth,
279
 
        availableRect.height()
280
 
        );
281
 
    if (QApplication::isRightToLeft()) {
282
 
        availableGeometry.moveLeft(0);
283
 
    }
284
 
    return availableGeometry;
285
 
}
286
 
 
287
251
void
288
252
DashDeclarativeView::keyPressEvent(QKeyEvent* event)
289
253
{