Merge lp:~timo-jyrinki/unity/ubuntu.5200 into lp:~ubuntu-desktop/unity/precise

Proposed by Timo Jyrinki
Status: Merged
Merged at revision: 715
Proposed branch: lp:~timo-jyrinki/unity/ubuntu.5200
Merge into: lp:~ubuntu-desktop/unity/precise
Diff against target: 762 lines (+265/-104)
16 files modified
AUTHORS (+1/-0)
CMakeLists.txt (+1/-1)
ChangeLog (+72/-0)
debian/changelog (+17/-0)
manual-tests/WindowButtons.txt (+14/-0)
plugins/unityshell/src/LauncherController.cpp (+1/-1)
plugins/unityshell/src/PanelMenuView.cpp (+3/-3)
plugins/unityshell/src/PluginAdapter.cpp (+91/-29)
plugins/unityshell/src/PluginAdapter.h (+6/-2)
plugins/unityshell/src/ResultRendererTile.cpp (+26/-24)
plugins/unityshell/src/WindowManager.cpp (+5/-0)
plugins/unityshell/src/WindowManager.h (+1/-0)
plugins/unityshell/src/unityshell.cpp (+16/-28)
plugins/unityshell/src/unityshell.h (+1/-1)
tests/test_launcher_controller.cpp (+10/-0)
tests/test_service_lens.c (+0/-15)
To merge this branch: bzr merge lp:~timo-jyrinki/unity/ubuntu.5200
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+162778@code.launchpad.net

Commit message

* New upstream release.
     - ResultRendererTile: fix a crash if row.renderer<TextureContainer*>()
       is null (LP: #926658)
     - Fix unity launcher vanishes when switching to mirrored displays
       (LP: #991637)
     - Fix window decorations being drawn when they should not be.
       This fixes icaclient window "dancing" (LP: #1083186) and
       hides decoration in a test case with Steam (LP: #1122478)
     - [multimonitor] Dash - Opening dash or HUD on one screen removes panel
       shadow on the other (LP: #892718)
     - Press Alt+F1, panel’s shadow dissapear (LP: #942965)
   * Cherry-pick a manual test for decorations fix

Description of the change

For didrocks.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

And looking good! sponsored :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AUTHORS'
--- AUTHORS 2012-11-12 12:20:38 +0000
+++ AUTHORS 2013-05-07 13:13:46 +0000
@@ -114,6 +114,7 @@
114 Thomi Richards <thomi.richards@canonical.com>, Ted Gould <ted@gould.cx>114 Thomi Richards <thomi.richards@canonical.com>, Ted Gould <ted@gould.cx>
115 Thomi Richards <thomi.richards@canonical.com>, Thomi Richards <thomir@gmail.com>115 Thomi Richards <thomi.richards@canonical.com>, Thomi Richards <thomir@gmail.com>
116 Thomi Richards <thomi.richards@canonical.com>, Tim Penhey <tim.penhey@canonical.com>116 Thomi Richards <thomi.richards@canonical.com>, Tim Penhey <tim.penhey@canonical.com>
117 Timo Jyrinki <timo.jyrinki@canonical.com>
117 Tim Penhey <tim.penhey@canonical.com>118 Tim Penhey <tim.penhey@canonical.com>
118 Tim Penhey <tim.penhey@canonical.com>, Gordon Allott <gord.allott@canonical.com>119 Tim Penhey <tim.penhey@canonical.com>, Gordon Allott <gord.allott@canonical.com>
119 Tim Penhey <tim.penhey@canonical.com>, Jason Smith <jason.smith@canonical.com>120 Tim Penhey <tim.penhey@canonical.com>, Jason Smith <jason.smith@canonical.com>
120121
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2012-11-12 12:20:38 +0000
+++ CMakeLists.txt 2013-05-07 13:13:46 +0000
@@ -8,7 +8,7 @@
8#8#
9set (PROJECT_NAME "unity")9set (PROJECT_NAME "unity")
10set (UNITY_MAJOR 5)10set (UNITY_MAJOR 5)
11set (UNITY_MINOR 18)11set (UNITY_MINOR 20)
12set (UNITY_MICRO 0)12set (UNITY_MICRO 0)
13set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}")13set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}")
14set (UNITY_API_VERSION "5.0")14set (UNITY_API_VERSION "5.0")
1515
=== modified file 'ChangeLog'
--- ChangeLog 2012-11-12 12:20:38 +0000
+++ ChangeLog 2013-05-07 13:13:46 +0000
@@ -1,3 +1,75 @@
12013-04-04 Marco Trevisan (Treviño) <mail@3v1n0.net>
2
3 UnityWindow: properly draw the panel shadow when a Nux window is focused or during WS switch
4
5 If a nux window is the active one, compiz won't draw it, so the code that is doing the
6 panelShadow drawing is excluded. We need to make sure that this will be executed
7 also in this case.
8
92013-04-04 Marco Trevisan (Treviño) <mail@3v1n0.net>
10
11 UnityShell: paint the panel shadow only if we don't have a mask set
12
132013-04-04 Marco Trevisan (Treviño) <mail@3v1n0.net>
14
15 UnityWindow: properly draw the panel shadow when a Nux window is focused or during WS switch
16
17 If a nux window is the active one, compiz won't draw it, so the code that is doing the panelShadow drawing is excluded. We need to make sure that this will be executed also in this case.
18
192013-04-03 Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>
20
21 Partial backport of Unity trunk revno. 2901 to fix where window decorations are being drawn when they should not be (LP: #1122478) (LP: #1083186).
22
232013-03-18 Chris Townsend <christopher.townsend@canonical.com>
24
25 Fix issue whare a window created without decorations would have decorations when maximizing and minimizing the window very quicly. This fix was taken from upstream Unity.
26
272013-02-18 Andrea Azzarone <azzaronea@gmail.com>
28
29 Backport fix for 991637.
30
31 Merged branch lp:~andyrock/unity/fix-991637-5.0
32
332013-02-14 Andrea Azzarone <azzaronea@gmail.com>
34
35 Backport fix for 991637.
36
372013-01-31 Marco Trevisan (Treviño) <mail@3v1n0.net>
38
39 ResultRendererTile: fix a crash if row.renderer<TextureContainer*>() is null
40
412013-01-30 Marco Trevisan (Treviño) <mail@3v1n0.net>
42
43 test_service_lens: 12.04 has not preview support, fix compilation
44
452013-01-30 Marco Trevisan (Treviño) <mail@3v1n0.net>
46
47 ResultRendererTile: Fix compilation issue.
48
492013-01-30 Marco Trevisan (Treviño) <mail@3v1n0.net>
50
51 merging with lp:unity/5.0
52
532012-07-21 Marco Trevisan (Treviño) <mail@3v1n0.net>
54
55 ResultRendererTile: don't crash in LoadIcon if row.renderer<TextureContainer*>() is null
56
572012-12-05 Brandon Schaefer <brandon.schaefer@canonical.com>
58
59 Change TimeUtil to use int64, so the buffer wont overflow within our lifetimes.. Fixes: https://bugs.launchpad.net/bugs/806248. Approved by Łukasz Zemczak.
60
612012-12-05 Brandon Schaefer <brandon.schaefer@canonical.com>
62
63 * Fix header
64
652012-12-03 Brandon Schaefer <brandon.schaefer@canonical.com>
66
67 * Fix TimeUtil and int32 buffer overflow, now uses an int64
68
692012-11-12 Timo Jyrinki <timo.jyrinki@canonical.com>
70
71 Release\ 5.18.0
72
12012-10-18 Andrea Azzarone <azzaronea@gmail.com>732012-10-18 Andrea Azzarone <azzaronea@gmail.com>
274
3 Use linear filtering to draw icons (when needed).. Fixes: https://bugs.launchpad.net/bugs/1036231. Approved by Marco Trevisan (Treviño).75 Use linear filtering to draw icons (when needed).. Fixes: https://bugs.launchpad.net/bugs/1036231. Approved by Marco Trevisan (Treviño).
476
=== modified file 'debian/changelog'
--- debian/changelog 2013-01-28 13:01:55 +0000
+++ debian/changelog 2013-05-07 13:13:46 +0000
@@ -1,3 +1,20 @@
1unity (5.20.0-0ubuntu1) UNRELEASED; urgency=low
2
3 * New upstream release.
4 - ResultRendererTile: fix a crash if row.renderer<TextureContainer*>()
5 is null (LP: #926658)
6 - Fix unity launcher vanishes when switching to mirrored displays
7 (LP: #991637)
8 - Fix window decorations being drawn when they should not be.
9 This fixes icaclient window "dancing" (LP: #1083186) and
10 hides decoration in a test case with Steam (LP: #1122478)
11 - [multimonitor] Dash - Opening dash or HUD on one screen removes panel
12 shadow on the other (LP: #892718)
13 - Press Alt+F1, panel’s shadow dissapear (LP: #942965)
14 * Cherry-pick a manual test for decorations fix
15
16 -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Fri, 12 Apr 2013 11:38:40 +0300
17
1unity (5.18.0-0ubuntu2) precise; urgency=low18unity (5.18.0-0ubuntu2) precise; urgency=low
219
3 [ Brandon Schaefer ]20 [ Brandon Schaefer ]
421
=== modified file 'manual-tests/WindowButtons.txt'
--- manual-tests/WindowButtons.txt 2012-04-13 22:03:13 +0000
+++ manual-tests/WindowButtons.txt 2013-05-07 13:13:46 +0000
@@ -9,3 +9,17 @@
99
10Expected Result:10Expected Result:
11 * The close window button should be shown as disabled (grayed)11 * The close window button should be shown as disabled (grayed)
12
13
14Custom window buttons and decorations always on desired windows
15---------------------------------------------------------------
16
17Actions:
18 * Start Steam on Ubuntu
19 * Maximize the Steam window
20 * Minimize the Steam window
21 * Un-minimize the Steam window
22 * Restore the Steam window
23
24Expected Result:
25 * Make sure that Steam does not have Ubuntu window decorations
1226
=== modified file 'plugins/unityshell/src/LauncherController.cpp'
--- plugins/unityshell/src/LauncherController.cpp 2012-09-11 10:38:44 +0000
+++ plugins/unityshell/src/LauncherController.cpp 2013-05-07 13:13:46 +0000
@@ -185,7 +185,7 @@
185 launchers[i] = nux::ObjectPtr<Launcher>(CreateLauncher(i));185 launchers[i] = nux::ObjectPtr<Launcher>(CreateLauncher(i));
186 }186 }
187187
188 int monitor = (num_launchers == 1) ? primary : i;188 int monitor = (num_launchers == 1 && num_monitors > 1) ? primary : i;
189189
190 if (launchers[i]->monitor() != monitor)190 if (launchers[i]->monitor() != monitor)
191 {191 {
192192
=== modified file 'plugins/unityshell/src/PanelMenuView.cpp'
--- plugins/unityshell/src/PanelMenuView.cpp 2012-04-27 11:42:56 +0000
+++ plugins/unityshell/src/PanelMenuView.cpp 2013-05-07 13:13:46 +0000
@@ -1083,7 +1083,7 @@
1083 // if we've just started tracking this window and it is maximized, let's1083 // if we've just started tracking this window and it is maximized, let's
1084 // make sure it's undecorated just in case it slipped by us earlier1084 // make sure it's undecorated just in case it slipped by us earlier
1085 // (I'm looking at you, Chromium!)1085 // (I'm looking at you, Chromium!)
1086 if (_is_maximized && wm->IsWindowDecorated(xid))1086 if (_is_maximized && wm->HasWindowDecorations(xid))
1087 {1087 {
1088 wm->Undecorate(xid);1088 wm->Undecorate(xid);
1089 _maximized_set.insert(xid);1089 _maximized_set.insert(xid);
@@ -1222,7 +1222,7 @@
1222 }1222 }
12231223
1224 // update the state of the window in the _decor_map1224 // update the state of the window in the _decor_map
1225 _decor_map[xid] = WindowManager::Default()->IsWindowDecorated(xid);1225 _decor_map[xid] = WindowManager::Default()->HasWindowDecorations(xid);
12261226
1227 if (_decor_map[xid])1227 if (_decor_map[xid])
1228 WindowManager::Default()->Undecorate(xid);1228 WindowManager::Default()->Undecorate(xid);
@@ -1716,7 +1716,7 @@
1716 {1716 {
1717 Window xid = bamf_window_get_xid(window);1717 Window xid = bamf_window_get_xid(window);
17181718
1719 _decor_map[xid] = WindowManager::Default()->IsWindowDecorated(xid);1719 _decor_map[xid] = WindowManager::Default()->HasWindowDecorations(xid);
17201720
1721 if (_decor_map[xid])1721 if (_decor_map[xid])
1722 WindowManager::Default()->Undecorate(xid);1722 WindowManager::Default()->Undecorate(xid);
17231723
=== modified file 'plugins/unityshell/src/PluginAdapter.cpp'
--- plugins/unityshell/src/PluginAdapter.cpp 2012-07-18 15:25:17 +0000
+++ plugins/unityshell/src/PluginAdapter.cpp 2013-05-07 13:13:46 +0000
@@ -1,6 +1,6 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*2/*
3 * Copyright (C) 2010 Canonical Ltd3 * Copyright (C) 2010-2012 Canonical Ltd
4 *4 *
5 * This program is free software: you can redistribute it and/or modify5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as6 * it under the terms of the GNU General Public License version 3 as
@@ -42,7 +42,6 @@
42#define MWM_HINTS_FUNCTIONS (1L << 0)42#define MWM_HINTS_FUNCTIONS (1L << 0)
43#define MWM_HINTS_DECORATIONS (1L << 1)43#define MWM_HINTS_DECORATIONS (1L << 1)
44#define MWM_HINTS_UNDECORATED_UNITY 0x8044#define MWM_HINTS_UNDECORATED_UNITY 0x80
45#define _XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS"
4645
47/* static */46/* static */
48PluginAdapter*47PluginAdapter*
@@ -151,13 +150,17 @@
151void150void
152PluginAdapter::NotifyNewDecorationState(guint32 xid)151PluginAdapter::NotifyNewDecorationState(guint32 xid)
153{152{
154 bool wasTracked = (_window_decoration_state.find (xid) != _window_decoration_state.end ());153 auto deco_state_it = _window_decoration_state.find(xid);
154 bool wasTracked = (deco_state_it != _window_decoration_state.end());
155 bool wasDecorated = false;155 bool wasDecorated = false;
156156
157 if (wasTracked)157 if (wasTracked)
158 {
158 wasDecorated = _window_decoration_state[xid];159 wasDecorated = _window_decoration_state[xid];
160 _window_decoration_state.erase(deco_state_it);
161 }
159162
160 bool decorated = IsWindowDecorated (xid);163 bool decorated = HasWindowDecorations(xid);
161164
162 if (decorated == wasDecorated)165 if (decorated == wasDecorated)
163 return;166 return;
@@ -415,44 +418,74 @@
415 return false;418 return false;
416}419}
417420
418bool421unsigned long
419PluginAdapter::IsWindowDecorated(guint32 xid)422PluginAdapter::GetMwnDecorations(Window window_id) const
420{423{
421 Display* display = m_Screen->dpy();424 Display* display = m_Screen->dpy();
422 Window win = xid;
423 Atom hints_atom = None;
424 MotifWmHints* hints = NULL;425 MotifWmHints* hints = NULL;
425 Atom type = None;426 Atom type = None;
426 gint format;427 gint format;
427 gulong nitems;428 gulong nitems;
428 gulong bytes_after;429 gulong bytes_after;
429 bool ret = true;430 unsigned long decorations = 0;
430431
431 hints_atom = XInternAtom(display, _XA_MOTIF_WM_HINTS, false);432 if (XGetWindowProperty(display, window_id, Atoms::mwmHints, 0,
432
433 if (XGetWindowProperty(display, win, hints_atom, 0,
434 sizeof(MotifWmHints) / sizeof(long), False,433 sizeof(MotifWmHints) / sizeof(long), False,
435 hints_atom, &type, &format, &nitems, &bytes_after,434 Atoms::mwmHints, &type, &format, &nitems, &bytes_after,
436 (guchar**)&hints) != Success)435 (guchar**)&hints) != Success)
437 return false;436 {
437 return decorations;
438 }
439
440 decorations |= (MwmDecorAll | MwmDecorTitle);
438441
439 if (!hints)442 if (!hints)
440 return ret;443 return decorations;
441444
442 /* Check for the presence of the high bit445 /* Check for the presence of the high bit
443 * if present, it means that we undecorated446 * if present, it means that we undecorated
444 * this window, so don't mark it as undecorated */447 * this window, so don't mark it as undecorated */
445 if (type == hints_atom && format != 0 &&448 if (type == Atoms::mwmHints && format != 0 && hints->flags & MWM_HINTS_DECORATIONS)
446 hints->flags & MWM_HINTS_DECORATIONS)
447 {449 {
448 /* Must have both bits set */450 decorations = hints->decorations;
449 _window_decoration_state[xid] = ret =
450 (hints->decorations & (MwmDecorAll | MwmDecorTitle)) ||
451 (hints->decorations & MWM_HINTS_UNDECORATED_UNITY);
452 }451 }
453452
454 XFree(hints);453 XFree(hints);
455 return ret;454 return decorations;
455}
456
457bool
458PluginAdapter::HasWindowDecorations(guint32 xid) const
459{
460 Window window_id = xid;
461 auto deco_state_it = _window_decoration_state.find(window_id);
462
463 if (deco_state_it != _window_decoration_state.end())
464 return deco_state_it->second;
465
466 unsigned long decorations = GetMwnDecorations(window_id);
467
468 /* Must have both bits set */
469 bool decorated = (decorations & (MwmDecorAll | MwmDecorTitle)) ||
470 (decorations & MWM_HINTS_UNDECORATED_UNITY);
471
472 _window_decoration_state[window_id] = decorated;
473 return decorated;
474}
475
476bool
477PluginAdapter::IsWindowDecorated(guint32 xid)
478{
479 Window window_id = xid;
480
481 bool decorated = GetMwnDecorations(window_id) & (MwmDecorAll | MwmDecorTitle);
482
483 if (decorated && GetCardinalProperty(window_id, Atoms::frameExtents).empty())
484 {
485 decorated = false;
486 }
487
488 return decorated;
456}489}
457490
458bool491bool
@@ -1023,7 +1056,6 @@
1023PluginAdapter::SetMwmWindowHints(Window xid, MotifWmHints* new_hints)1056PluginAdapter::SetMwmWindowHints(Window xid, MotifWmHints* new_hints)
1024{1057{
1025 Display* display = m_Screen->dpy();1058 Display* display = m_Screen->dpy();
1026 Atom hints_atom = None;
1027 MotifWmHints* data = NULL;1059 MotifWmHints* data = NULL;
1028 MotifWmHints* hints = NULL;1060 MotifWmHints* hints = NULL;
1029 Atom type = None;1061 Atom type = None;
@@ -1031,18 +1063,16 @@
1031 gulong nitems;1063 gulong nitems;
1032 gulong bytes_after;1064 gulong bytes_after;
10331065
1034 hints_atom = XInternAtom(display, _XA_MOTIF_WM_HINTS, false);
1035
1036 if (XGetWindowProperty(display,1066 if (XGetWindowProperty(display,
1037 xid,1067 xid,
1038 hints_atom, 0, sizeof(MotifWmHints) / sizeof(long),1068 Atoms::mwmHints, 0, sizeof(MotifWmHints) / sizeof(long),
1039 False, AnyPropertyType, &type, &format, &nitems,1069 False, AnyPropertyType, &type, &format, &nitems,
1040 &bytes_after, (guchar**)&data) != Success)1070 &bytes_after, (guchar**)&data) != Success)
1041 {1071 {
1042 return;1072 return;
1043 }1073 }
10441074
1045 if (type != hints_atom || !data)1075 if (type != Atoms::mwmHints || !data)
1046 {1076 {
1047 hints = new_hints;1077 hints = new_hints;
1048 }1078 }
@@ -1064,7 +1094,7 @@
10641094
1065 XChangeProperty(display,1095 XChangeProperty(display,
1066 xid,1096 xid,
1067 hints_atom, hints_atom, 32, PropModeReplace,1097 Atoms::mwmHints, Atoms::mwmHints, 32, PropModeReplace,
1068 (guchar*)hints, sizeof(MotifWmHints) / sizeof(long));1098 (guchar*)hints, sizeof(MotifWmHints) / sizeof(long));
10691099
1070 if (data)1100 if (data)
@@ -1074,6 +1104,9 @@
1074void1104void
1075PluginAdapter::Decorate(guint32 xid)1105PluginAdapter::Decorate(guint32 xid)
1076{1106{
1107 if (!HasWindowDecorations(xid))
1108 return;
1109
1077 MotifWmHints hints = { 0 };1110 MotifWmHints hints = { 0 };
10781111
1079 hints.flags = MWM_HINTS_DECORATIONS;1112 hints.flags = MWM_HINTS_DECORATIONS;
@@ -1085,6 +1118,9 @@
1085void1118void
1086PluginAdapter::Undecorate(guint32 xid)1119PluginAdapter::Undecorate(guint32 xid)
1087{1120{
1121 if (!IsWindowDecorated(xid))
1122 return;
1123
1088 MotifWmHints hints = { 0 };1124 MotifWmHints hints = { 0 };
10891125
1090 /* Set the high bit to indicate that we undecorated this1126 /* Set the high bit to indicate that we undecorated this
@@ -1319,3 +1355,29 @@
1319 .add("expo_active", IsExpoActive())1355 .add("expo_active", IsExpoActive())
1320 .add("viewport_switch_running", IsViewPortSwitchStarted());1356 .add("viewport_switch_running", IsViewPortSwitchStarted());
1321}1357}
1358
1359std::vector<long> PluginAdapter::GetCardinalProperty(Window window_id, Atom atom) const
1360{
1361 Atom type;
1362 int result, format;
1363 unsigned long n_items, bytes_after;
1364 long *buf = nullptr;
1365
1366 result = XGetWindowProperty(m_Screen->dpy(), window_id, atom, 0L, 65536, False,
1367 XA_CARDINAL, &type, &format, &n_items, &bytes_after,
1368 reinterpret_cast<unsigned char **>(&buf));
1369
1370 std::unique_ptr<long[], int(*)(void*)> buffer(buf, XFree);
1371
1372 if (result == Success && type == XA_CARDINAL && format == 32 && buffer && n_items > 0)
1373 {
1374 std::vector<long> values(n_items);
1375
1376 for (unsigned i = 0; i < n_items; ++i)
1377 values[i] = buffer[i];
1378
1379 return values;
1380 }
1381
1382 return std::vector<long>();
1383}
13221384
=== modified file 'plugins/unityshell/src/PluginAdapter.h'
--- plugins/unityshell/src/PluginAdapter.h 2012-04-27 11:42:56 +0000
+++ plugins/unityshell/src/PluginAdapter.h 2013-05-07 13:13:46 +0000
@@ -1,6 +1,6 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*2/*
3 * Copyright (C) 2010 Canonical Ltd3 * Copyright (C) 2010-2012 Canonical Ltd
4 *4 *
5 * This program is free software: you can redistribute it and/or modify5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as6 * it under the terms of the GNU General Public License version 3 as
@@ -125,6 +125,7 @@
125 bool IsWindowClosable(guint32 xid);125 bool IsWindowClosable(guint32 xid);
126 bool IsWindowMinimizable(guint32 xid);126 bool IsWindowMinimizable(guint32 xid);
127 bool IsWindowMaximizable(guint32 xid);127 bool IsWindowMaximizable(guint32 xid);
128 bool HasWindowDecorations(guint32 xid) const;
128129
129 void Restore(guint32 xid);130 void Restore(guint32 xid);
130 void RestoreAt(guint32 xid, int x, int y);131 void RestoreAt(guint32 xid, int x, int y);
@@ -174,6 +175,9 @@
174175
175 bool CheckWindowIntersection(nux::Geometry const& region, CompWindow* window);176 bool CheckWindowIntersection(nux::Geometry const& region, CompWindow* window);
176 void SetMwmWindowHints(Window xid, MotifWmHints* new_hints);177 void SetMwmWindowHints(Window xid, MotifWmHints* new_hints);
178 unsigned long GetMwnDecorations(Window xid) const;
179
180 std::vector<long> GetCardinalProperty(Window xid, Atom atom) const;
177181
178 CompScreen* m_Screen;182 CompScreen* m_Screen;
179 MultiActionList m_ExpoActionList;183 MultiActionList m_ExpoActionList;
@@ -193,7 +197,7 @@
193 bool _in_show_desktop;197 bool _in_show_desktop;
194 CompWindow* _last_focused_window;198 CompWindow* _last_focused_window;
195199
196 std::map<guint32, unsigned int> _window_decoration_state;200 mutable std::map<guint32, unsigned int> _window_decoration_state;
197201
198 static PluginAdapter* _default;202 static PluginAdapter* _default;
199};203};
200204
=== modified file 'plugins/unityshell/src/ResultRendererTile.cpp'
--- plugins/unityshell/src/ResultRendererTile.cpp 2012-04-25 12:09:59 +0000
+++ plugins/unityshell/src/ResultRendererTile.cpp 2013-05-07 13:13:46 +0000
@@ -21,14 +21,10 @@
21 */21 */
2222
2323
24#include <sstream> // for ostringstream
25#include "ResultRendererTile.h"24#include "ResultRendererTile.h"
2625
27#include <boost/algorithm/string.hpp>
28
29#include <pango/pango.h>26#include <pango/pango.h>
30#include <pango/pangocairo.h>27#include <pango/pangocairo.h>
31#include <gdk/gdk.h>
32#include <gtk/gtk.h>28#include <gtk/gtk.h>
3329
34#include <NuxCore/Logger.h>30#include <NuxCore/Logger.h>
@@ -51,6 +47,7 @@
51namespace47namespace
52{48{
53nux::logging::Logger logger("unity.dash.results");49nux::logging::Logger logger("unity.dash.results");
50const std::string DEFAULT_GICON = ". GThemedIcon text-x-preview";
5451
55const int FONT_SIZE = 10;52const int FONT_SIZE = 10;
56}53}
@@ -230,7 +227,7 @@
230227
231void ResultRendererTile::Preload(Result& row)228void ResultRendererTile::Preload(Result& row)
232{229{
233 if (row.renderer<TextureContainer*>() == nullptr)230 if (!row.renderer<TextureContainer*>())
234 {231 {
235 row.set_renderer(new TextureContainer());232 row.set_renderer(new TextureContainer());
236 LoadIcon(row);233 LoadIcon(row);
@@ -240,17 +237,25 @@
240237
241void ResultRendererTile::Unload(Result& row)238void ResultRendererTile::Unload(Result& row)
242{239{
243 TextureContainer *container = row.renderer<TextureContainer*>();240 delete row.renderer<TextureContainer*>();
244 delete container;
245 row.set_renderer<TextureContainer*>(nullptr);241 row.set_renderer<TextureContainer*>(nullptr);
246}242}
247243
248void ResultRendererTile::LoadIcon(Result& row)244void ResultRendererTile::LoadIcon(Result& row)
249{245{
246 auto container = row.renderer<TextureContainer*>();
247
248 if (!container)
249 {
250 LOG_ERROR(logger) << "No valid container for Result " << row.name() << " with URI "
251 << row.uri();
252 return;
253 }
254
250 Style& style = Style::Instance();255 Style& style = Style::Instance();
251 std::string const& icon_hint = row.icon_hint;256 std::string const& icon_hint = row.icon_hint;
252#define DEFAULT_GICON ". GThemedIcon text-x-preview"
253 std::string icon_name;257 std::string icon_name;
258
254 if (G_UNLIKELY(neko))259 if (G_UNLIKELY(neko))
255 {260 {
256 int tmp1 = style.GetTileIconSize() + (rand() % 16) - 8;261 int tmp1 = style.GetTileIconSize() + (rand() % 16) - 8;
@@ -266,28 +271,25 @@
266 icon_name = !icon_hint.empty() ? icon_hint : DEFAULT_GICON;271 icon_name = !icon_hint.empty() ? icon_hint : DEFAULT_GICON;
267 }272 }
268273
269274 auto slot = sigc::bind(sigc::mem_fun(this, &ResultRendererTile::IconLoaded), icon_hint, row);
270275
271 GIcon* icon = g_icon_new_for_string(icon_name.c_str(), NULL);276 if (icon_name.find("://") != std::string::npos)
272 TextureContainer* container = row.renderer<TextureContainer*>();
273
274 IconLoader::IconLoaderCallback slot = sigc::bind(sigc::mem_fun(this, &ResultRendererTile::IconLoaded), icon_hint, row);
275
276 if (g_strrstr(icon_name.c_str(), "://"))
277 {277 {
278 container->slot_handle = IconLoader::GetDefault().LoadFromURI(icon_name, style.GetTileIconSize(), slot);278 container->slot_handle = IconLoader::GetDefault().LoadFromURI(icon_name, style.GetTileIconSize(), slot);
279 }279 }
280 else if (G_IS_ICON(icon))
281 {
282 container->slot_handle = IconLoader::GetDefault().LoadFromGIconString(icon_name, style.GetTileIconSize(), slot);
283 }
284 else280 else
285 {281 {
286 container->slot_handle = IconLoader::GetDefault().LoadFromIconName(icon_name, style.GetTileIconSize(), slot);282 glib::Object<GIcon> icon(g_icon_new_for_string(icon_name.c_str(), nullptr));
283
284 if (G_IS_ICON(icon.RawPtr()))
285 {
286 container->slot_handle = IconLoader::GetDefault().LoadFromGIconString(icon_name, style.GetTileIconSize(), slot);
287 }
288 else
289 {
290 container->slot_handle = IconLoader::GetDefault().LoadFromIconName(icon_name, style.GetTileIconSize(), slot);
291 }
287 }292 }
288
289 if (icon != NULL)
290 g_object_unref(icon);
291}293}
292294
293nux::BaseTexture* ResultRendererTile::CreateTextureCallback(std::string const& texid,295nux::BaseTexture* ResultRendererTile::CreateTextureCallback(std::string const& texid,
294296
=== modified file 'plugins/unityshell/src/WindowManager.cpp'
--- plugins/unityshell/src/WindowManager.cpp 2012-07-18 15:25:17 +0000
+++ plugins/unityshell/src/WindowManager.cpp 2013-05-07 13:13:46 +0000
@@ -58,6 +58,11 @@
58 return true;58 return true;
59 }59 }
6060
61 bool HasWindowDecorations(guint32 xid) const
62 {
63 return true;
64 }
65
61 bool IsWindowOnCurrentDesktop(guint32 xid)66 bool IsWindowOnCurrentDesktop(guint32 xid)
62 {67 {
63 return true;68 return true;
6469
=== modified file 'plugins/unityshell/src/WindowManager.h'
--- plugins/unityshell/src/WindowManager.h 2012-07-18 15:25:17 +0000
+++ plugins/unityshell/src/WindowManager.h 2013-05-07 13:13:46 +0000
@@ -61,6 +61,7 @@
61 virtual bool IsWindowClosable(guint32 xid) = 0;61 virtual bool IsWindowClosable(guint32 xid) = 0;
62 virtual bool IsWindowMinimizable(guint32 xid) = 0;62 virtual bool IsWindowMinimizable(guint32 xid) = 0;
63 virtual bool IsWindowMaximizable(guint32 xid) = 0;63 virtual bool IsWindowMaximizable(guint32 xid) = 0;
64 virtual bool HasWindowDecorations(guint32 xid) const = 0;
6465
65 virtual void ShowDesktop() = 0;66 virtual void ShowDesktop() = 0;
6667
6768
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-11-12 12:20:38 +0000
+++ plugins/unityshell/src/unityshell.cpp 2013-05-07 13:13:46 +0000
@@ -592,18 +592,8 @@
592592
593 // compiz doesn't use the same method of tracking monitors as our toolkit593 // compiz doesn't use the same method of tracking monitors as our toolkit
594 // we need to make sure we properly associate with the right monitor594 // we need to make sure we properly associate with the right monitor
595 int current_monitor = -1;595 auto const& uscreen = UScreen::GetDefault();
596 auto monitors = UScreen::GetDefault()->GetMonitors();596 int current_monitor = uscreen->GetMonitorAtPosition(output->x(), output->y());
597 int i = 0;
598 for (auto monitor : monitors)
599 {
600 if (monitor.x == output->x() && monitor.y == output->y())
601 {
602 current_monitor = i;
603 break;
604 }
605 i++;
606 }
607597
608 if (!(launcher_controller_->IsOverlayOpen() && current_monitor == dash_monitor_)598 if (!(launcher_controller_->IsOverlayOpen() && current_monitor == dash_monitor_)
609 && panel_controller_->opacity() > 0.0f)599 && panel_controller_->opacity() > 0.0f)
@@ -671,18 +661,8 @@
671661
672 // compiz doesn't use the same method of tracking monitors as our toolkit662 // compiz doesn't use the same method of tracking monitors as our toolkit
673 // we need to make sure we properly associate with the right monitor663 // we need to make sure we properly associate with the right monitor
674 int current_monitor = -1;664 auto const& uscreen = UScreen::GetDefault();
675 auto monitors = UScreen::GetDefault()->GetMonitors();665 int current_monitor = uscreen->GetMonitorAtPosition(output->x(), output->y());
676 int i = 0;
677 for (auto monitor : monitors)
678 {
679 if (monitor.x == output->x() && monitor.y == output->y())
680 {
681 current_monitor = i;
682 break;
683 }
684 i++;
685 }
686666
687 if (!(launcher_controller_->IsOverlayOpen() && current_monitor == dash_monitor_)667 if (!(launcher_controller_->IsOverlayOpen() && current_monitor == dash_monitor_)
688 && panel_controller_->opacity() > 0.0f)668 && panel_controller_->opacity() > 0.0f)
@@ -2345,7 +2325,7 @@
2345 return "Unity";2325 return "Unity";
2346}2326}
23472327
2348bool isNuxWindow (CompWindow* value)2328bool isNuxWindow(CompWindow* value)
2349{2329{
2350 std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList();2330 std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList();
2351 auto id = value->id();2331 auto id = value->id();
@@ -2394,13 +2374,21 @@
2394 * fully covers the shell on its output. It does not include regular windows2374 * fully covers the shell on its output. It does not include regular windows
2395 * stacked above the shell like DnD icons or Onboard etc.2375 * stacked above the shell like DnD icons or Onboard etc.
2396 */2376 */
2397 if (isNuxWindow(window))2377 if (G_UNLIKELY(is_nux_window_))
2398 {2378 {
2399 if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)2379 if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
2400 {2380 {
2401 uScreen->nuxRegion += window->geometry();2381 uScreen->nuxRegion += window->geometry();
2402 uScreen->nuxRegion -= uScreen->fullscreenRegion;2382 uScreen->nuxRegion -= uScreen->fullscreenRegion;
2403 }2383 }
2384
2385 if (window->id() == screen->activeWindow() &&
2386 !(mask & PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK))
2387 {
2388 if (!mask)
2389 uScreen->paintPanelShadow(matrix);
2390 }
2391
2404 return false; // Ensure nux windows are never painted by compiz2392 return false; // Ensure nux windows are never painted by compiz
2405 }2393 }
2406 else if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)2394 else if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
@@ -2483,8 +2471,7 @@
2483 if (uScreen->doShellRepaint &&2471 if (uScreen->doShellRepaint &&
2484 !uScreen->forcePaintOnTop () &&2472 !uScreen->forcePaintOnTop () &&
2485 window == uScreen->firstWindowAboveShell &&2473 window == uScreen->firstWindowAboveShell &&
2486 !uScreen->fullscreenRegion.contains(window->geometry())2474 !uScreen->fullscreenRegion.contains(window->geometry()))
2487 )
2488 {2475 {
2489#ifdef USE_GLES2476#ifdef USE_GLES
2490 uScreen->paintDisplay();2477 uScreen->paintDisplay();
@@ -3154,6 +3141,7 @@
3154 , mMinimizeHandler()3141 , mMinimizeHandler()
3155 , mShowdesktopHandler(nullptr)3142 , mShowdesktopHandler(nullptr)
3156 , focusdesktop_handle_(0)3143 , focusdesktop_handle_(0)
3144 , is_nux_window_(isNuxWindow(window))
3157{3145{
3158 WindowInterface::setHandler(window);3146 WindowInterface::setHandler(window);
3159 GLWindowInterface::setHandler(gWindow);3147 GLWindowInterface::setHandler(gWindow);
31603148
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2012-09-11 10:38:44 +0000
+++ plugins/unityshell/src/unityshell.h 2013-05-07 13:13:46 +0000
@@ -434,8 +434,8 @@
434 unsigned int GetNoCoreInstanceMask ();434 unsigned int GetNoCoreInstanceMask ();
435435
436 compiz::WindowInputRemoverLock::Ptr GetInputRemover ();436 compiz::WindowInputRemoverLock::Ptr GetInputRemover ();
437
438 compiz::WindowInputRemoverLock::Weak input_remover_;437 compiz::WindowInputRemoverLock::Weak input_remover_;
438 bool is_nux_window_;
439};439};
440440
441441
442442
=== modified file 'tests/test_launcher_controller.cpp'
--- tests/test_launcher_controller.cpp 2012-07-26 13:12:26 +0000
+++ tests/test_launcher_controller.cpp 2013-05-07 13:13:46 +0000
@@ -111,6 +111,16 @@
111 }111 }
112}112}
113113
114TEST_F(TestLauncherController, MirroredMultimonitorSingleLauncherOnExternalMonitor)
115{
116 // See lp bug 991637
117 lc.multiple_launchers = false;
118 uscreen.SetPrimary(1);
119
120 ASSERT_EQ(lc.launchers().size(), 1);
121 ASSERT_EQ(lc.launcher().monitor(), 0);
122}
123
114TEST_F(TestLauncherController, MultimonitorSwitchToMultipleLaunchers)124TEST_F(TestLauncherController, MultimonitorSwitchToMultipleLaunchers)
115{125{
116 lc.multiple_launchers = false;126 lc.multiple_launchers = false;
117127
=== modified file 'tests/test_service_lens.c'
--- tests/test_service_lens.c 2011-12-08 08:48:10 +0000
+++ tests/test_service_lens.c 2013-05-07 13:13:46 +0000
@@ -8,7 +8,6 @@
8static void add_filters(ServiceLens *self);8static void add_filters(ServiceLens *self);
9static void on_search_changed(UnityScope* scope, UnityLensSearch *lens_search, UnitySearchType search_type, GCancellable *canc, ServiceLens* self);9static void on_search_changed(UnityScope* scope, UnityLensSearch *lens_search, UnitySearchType search_type, GCancellable *canc, ServiceLens* self);
10static UnityActivationResponse* on_activate_uri(UnityScope* scope, const char* uri, ServiceLens* self);10static UnityActivationResponse* on_activate_uri(UnityScope* scope, const char* uri, ServiceLens* self);
11static UnityPreview* on_preview_uri(UnityScope* scope, const char* uri, ServiceLens *self);
1211
13struct _ServiceLensPrivate12struct _ServiceLensPrivate
14{13{
@@ -59,8 +58,6 @@
59 G_CALLBACK(on_search_changed), self);58 G_CALLBACK(on_search_changed), self);
60 g_signal_connect(priv->scope, "activate-uri",59 g_signal_connect(priv->scope, "activate-uri",
61 G_CALLBACK(on_activate_uri), self);60 G_CALLBACK(on_activate_uri), self);
62 g_signal_connect(priv->scope, "preview-uri",
63 G_CALLBACK(on_preview_uri), self);
6461
65 /* Get ready to export and export */62 /* Get ready to export and export */
66 unity_lens_add_local_scope(priv->lens, priv->scope);63 unity_lens_add_local_scope(priv->lens, priv->scope);
@@ -183,18 +180,6 @@
183 return unity_activation_response_new(UNITY_HANDLED_TYPE_HIDE_DASH, "");180 return unity_activation_response_new(UNITY_HANDLED_TYPE_HIDE_DASH, "");
184}181}
185182
186static UnityPreview*
187on_preview_uri(UnityScope* scope, const char* uri, ServiceLens *self)
188{
189 gchar *genres[] = {"awesome"};
190 return (UnityPreview*)unity_track_preview_new(1, "Animus Vox",
191 "The Glitch Mob", "Drink The Sea",
192 404, genres, 1,
193 "file://music/the/track", "Play",
194 "", "play://music/the/track",
195 "preview://music/the/track", "pause://music/the/track");
196}
197
198ServiceLens*183ServiceLens*
199service_lens_new()184service_lens_new()
200{185{

Subscribers

People subscribed via source and target branches

to all changes: