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
1=== modified file 'AUTHORS'
2--- AUTHORS 2012-11-12 12:20:38 +0000
3+++ AUTHORS 2013-05-07 13:13:46 +0000
4@@ -114,6 +114,7 @@
5 Thomi Richards <thomi.richards@canonical.com>, Ted Gould <ted@gould.cx>
6 Thomi Richards <thomi.richards@canonical.com>, Thomi Richards <thomir@gmail.com>
7 Thomi Richards <thomi.richards@canonical.com>, Tim Penhey <tim.penhey@canonical.com>
8+ Timo Jyrinki <timo.jyrinki@canonical.com>
9 Tim Penhey <tim.penhey@canonical.com>
10 Tim Penhey <tim.penhey@canonical.com>, Gordon Allott <gord.allott@canonical.com>
11 Tim Penhey <tim.penhey@canonical.com>, Jason Smith <jason.smith@canonical.com>
12
13=== modified file 'CMakeLists.txt'
14--- CMakeLists.txt 2012-11-12 12:20:38 +0000
15+++ CMakeLists.txt 2013-05-07 13:13:46 +0000
16@@ -8,7 +8,7 @@
17 #
18 set (PROJECT_NAME "unity")
19 set (UNITY_MAJOR 5)
20-set (UNITY_MINOR 18)
21+set (UNITY_MINOR 20)
22 set (UNITY_MICRO 0)
23 set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}")
24 set (UNITY_API_VERSION "5.0")
25
26=== modified file 'ChangeLog'
27--- ChangeLog 2012-11-12 12:20:38 +0000
28+++ ChangeLog 2013-05-07 13:13:46 +0000
29@@ -1,3 +1,75 @@
30+2013-04-04 Marco Trevisan (Treviño) <mail@3v1n0.net>
31+
32+ UnityWindow: properly draw the panel shadow when a Nux window is focused or during WS switch
33+
34+ If a nux window is the active one, compiz won't draw it, so the code that is doing the
35+ panelShadow drawing is excluded. We need to make sure that this will be executed
36+ also in this case.
37+
38+2013-04-04 Marco Trevisan (Treviño) <mail@3v1n0.net>
39+
40+ UnityShell: paint the panel shadow only if we don't have a mask set
41+
42+2013-04-04 Marco Trevisan (Treviño) <mail@3v1n0.net>
43+
44+ UnityWindow: properly draw the panel shadow when a Nux window is focused or during WS switch
45+
46+ 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.
47+
48+2013-04-03 Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>
49+
50+ Partial backport of Unity trunk revno. 2901 to fix where window decorations are being drawn when they should not be (LP: #1122478) (LP: #1083186).
51+
52+2013-03-18 Chris Townsend <christopher.townsend@canonical.com>
53+
54+ 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.
55+
56+2013-02-18 Andrea Azzarone <azzaronea@gmail.com>
57+
58+ Backport fix for 991637.
59+
60+ Merged branch lp:~andyrock/unity/fix-991637-5.0
61+
62+2013-02-14 Andrea Azzarone <azzaronea@gmail.com>
63+
64+ Backport fix for 991637.
65+
66+2013-01-31 Marco Trevisan (Treviño) <mail@3v1n0.net>
67+
68+ ResultRendererTile: fix a crash if row.renderer<TextureContainer*>() is null
69+
70+2013-01-30 Marco Trevisan (Treviño) <mail@3v1n0.net>
71+
72+ test_service_lens: 12.04 has not preview support, fix compilation
73+
74+2013-01-30 Marco Trevisan (Treviño) <mail@3v1n0.net>
75+
76+ ResultRendererTile: Fix compilation issue.
77+
78+2013-01-30 Marco Trevisan (Treviño) <mail@3v1n0.net>
79+
80+ merging with lp:unity/5.0
81+
82+2012-07-21 Marco Trevisan (Treviño) <mail@3v1n0.net>
83+
84+ ResultRendererTile: don't crash in LoadIcon if row.renderer<TextureContainer*>() is null
85+
86+2012-12-05 Brandon Schaefer <brandon.schaefer@canonical.com>
87+
88+ Change TimeUtil to use int64, so the buffer wont overflow within our lifetimes.. Fixes: https://bugs.launchpad.net/bugs/806248. Approved by Łukasz Zemczak.
89+
90+2012-12-05 Brandon Schaefer <brandon.schaefer@canonical.com>
91+
92+ * Fix header
93+
94+2012-12-03 Brandon Schaefer <brandon.schaefer@canonical.com>
95+
96+ * Fix TimeUtil and int32 buffer overflow, now uses an int64
97+
98+2012-11-12 Timo Jyrinki <timo.jyrinki@canonical.com>
99+
100+ Release\ 5.18.0
101+
102 2012-10-18 Andrea Azzarone <azzaronea@gmail.com>
103
104 Use linear filtering to draw icons (when needed).. Fixes: https://bugs.launchpad.net/bugs/1036231. Approved by Marco Trevisan (Treviño).
105
106=== modified file 'debian/changelog'
107--- debian/changelog 2013-01-28 13:01:55 +0000
108+++ debian/changelog 2013-05-07 13:13:46 +0000
109@@ -1,3 +1,20 @@
110+unity (5.20.0-0ubuntu1) UNRELEASED; urgency=low
111+
112+ * New upstream release.
113+ - ResultRendererTile: fix a crash if row.renderer<TextureContainer*>()
114+ is null (LP: #926658)
115+ - Fix unity launcher vanishes when switching to mirrored displays
116+ (LP: #991637)
117+ - Fix window decorations being drawn when they should not be.
118+ This fixes icaclient window "dancing" (LP: #1083186) and
119+ hides decoration in a test case with Steam (LP: #1122478)
120+ - [multimonitor] Dash - Opening dash or HUD on one screen removes panel
121+ shadow on the other (LP: #892718)
122+ - Press Alt+F1, panel’s shadow dissapear (LP: #942965)
123+ * Cherry-pick a manual test for decorations fix
124+
125+ -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Fri, 12 Apr 2013 11:38:40 +0300
126+
127 unity (5.18.0-0ubuntu2) precise; urgency=low
128
129 [ Brandon Schaefer ]
130
131=== modified file 'manual-tests/WindowButtons.txt'
132--- manual-tests/WindowButtons.txt 2012-04-13 22:03:13 +0000
133+++ manual-tests/WindowButtons.txt 2013-05-07 13:13:46 +0000
134@@ -9,3 +9,17 @@
135
136 Expected Result:
137 * The close window button should be shown as disabled (grayed)
138+
139+
140+Custom window buttons and decorations always on desired windows
141+---------------------------------------------------------------
142+
143+Actions:
144+ * Start Steam on Ubuntu
145+ * Maximize the Steam window
146+ * Minimize the Steam window
147+ * Un-minimize the Steam window
148+ * Restore the Steam window
149+
150+Expected Result:
151+ * Make sure that Steam does not have Ubuntu window decorations
152
153=== modified file 'plugins/unityshell/src/LauncherController.cpp'
154--- plugins/unityshell/src/LauncherController.cpp 2012-09-11 10:38:44 +0000
155+++ plugins/unityshell/src/LauncherController.cpp 2013-05-07 13:13:46 +0000
156@@ -185,7 +185,7 @@
157 launchers[i] = nux::ObjectPtr<Launcher>(CreateLauncher(i));
158 }
159
160- int monitor = (num_launchers == 1) ? primary : i;
161+ int monitor = (num_launchers == 1 && num_monitors > 1) ? primary : i;
162
163 if (launchers[i]->monitor() != monitor)
164 {
165
166=== modified file 'plugins/unityshell/src/PanelMenuView.cpp'
167--- plugins/unityshell/src/PanelMenuView.cpp 2012-04-27 11:42:56 +0000
168+++ plugins/unityshell/src/PanelMenuView.cpp 2013-05-07 13:13:46 +0000
169@@ -1083,7 +1083,7 @@
170 // if we've just started tracking this window and it is maximized, let's
171 // make sure it's undecorated just in case it slipped by us earlier
172 // (I'm looking at you, Chromium!)
173- if (_is_maximized && wm->IsWindowDecorated(xid))
174+ if (_is_maximized && wm->HasWindowDecorations(xid))
175 {
176 wm->Undecorate(xid);
177 _maximized_set.insert(xid);
178@@ -1222,7 +1222,7 @@
179 }
180
181 // update the state of the window in the _decor_map
182- _decor_map[xid] = WindowManager::Default()->IsWindowDecorated(xid);
183+ _decor_map[xid] = WindowManager::Default()->HasWindowDecorations(xid);
184
185 if (_decor_map[xid])
186 WindowManager::Default()->Undecorate(xid);
187@@ -1716,7 +1716,7 @@
188 {
189 Window xid = bamf_window_get_xid(window);
190
191- _decor_map[xid] = WindowManager::Default()->IsWindowDecorated(xid);
192+ _decor_map[xid] = WindowManager::Default()->HasWindowDecorations(xid);
193
194 if (_decor_map[xid])
195 WindowManager::Default()->Undecorate(xid);
196
197=== modified file 'plugins/unityshell/src/PluginAdapter.cpp'
198--- plugins/unityshell/src/PluginAdapter.cpp 2012-07-18 15:25:17 +0000
199+++ plugins/unityshell/src/PluginAdapter.cpp 2013-05-07 13:13:46 +0000
200@@ -1,6 +1,6 @@
201 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
202 /*
203- * Copyright (C) 2010 Canonical Ltd
204+ * Copyright (C) 2010-2012 Canonical Ltd
205 *
206 * This program is free software: you can redistribute it and/or modify
207 * it under the terms of the GNU General Public License version 3 as
208@@ -42,7 +42,6 @@
209 #define MWM_HINTS_FUNCTIONS (1L << 0)
210 #define MWM_HINTS_DECORATIONS (1L << 1)
211 #define MWM_HINTS_UNDECORATED_UNITY 0x80
212-#define _XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS"
213
214 /* static */
215 PluginAdapter*
216@@ -151,13 +150,17 @@
217 void
218 PluginAdapter::NotifyNewDecorationState(guint32 xid)
219 {
220- bool wasTracked = (_window_decoration_state.find (xid) != _window_decoration_state.end ());
221+ auto deco_state_it = _window_decoration_state.find(xid);
222+ bool wasTracked = (deco_state_it != _window_decoration_state.end());
223 bool wasDecorated = false;
224
225 if (wasTracked)
226+ {
227 wasDecorated = _window_decoration_state[xid];
228+ _window_decoration_state.erase(deco_state_it);
229+ }
230
231- bool decorated = IsWindowDecorated (xid);
232+ bool decorated = HasWindowDecorations(xid);
233
234 if (decorated == wasDecorated)
235 return;
236@@ -415,44 +418,74 @@
237 return false;
238 }
239
240-bool
241-PluginAdapter::IsWindowDecorated(guint32 xid)
242+unsigned long
243+PluginAdapter::GetMwnDecorations(Window window_id) const
244 {
245 Display* display = m_Screen->dpy();
246- Window win = xid;
247- Atom hints_atom = None;
248 MotifWmHints* hints = NULL;
249 Atom type = None;
250 gint format;
251 gulong nitems;
252 gulong bytes_after;
253- bool ret = true;
254-
255- hints_atom = XInternAtom(display, _XA_MOTIF_WM_HINTS, false);
256-
257- if (XGetWindowProperty(display, win, hints_atom, 0,
258+ unsigned long decorations = 0;
259+
260+ if (XGetWindowProperty(display, window_id, Atoms::mwmHints, 0,
261 sizeof(MotifWmHints) / sizeof(long), False,
262- hints_atom, &type, &format, &nitems, &bytes_after,
263+ Atoms::mwmHints, &type, &format, &nitems, &bytes_after,
264 (guchar**)&hints) != Success)
265- return false;
266+ {
267+ return decorations;
268+ }
269+
270+ decorations |= (MwmDecorAll | MwmDecorTitle);
271
272 if (!hints)
273- return ret;
274+ return decorations;
275
276 /* Check for the presence of the high bit
277 * if present, it means that we undecorated
278 * this window, so don't mark it as undecorated */
279- if (type == hints_atom && format != 0 &&
280- hints->flags & MWM_HINTS_DECORATIONS)
281+ if (type == Atoms::mwmHints && format != 0 && hints->flags & MWM_HINTS_DECORATIONS)
282 {
283- /* Must have both bits set */
284- _window_decoration_state[xid] = ret =
285- (hints->decorations & (MwmDecorAll | MwmDecorTitle)) ||
286- (hints->decorations & MWM_HINTS_UNDECORATED_UNITY);
287+ decorations = hints->decorations;
288 }
289
290 XFree(hints);
291- return ret;
292+ return decorations;
293+}
294+
295+bool
296+PluginAdapter::HasWindowDecorations(guint32 xid) const
297+{
298+ Window window_id = xid;
299+ auto deco_state_it = _window_decoration_state.find(window_id);
300+
301+ if (deco_state_it != _window_decoration_state.end())
302+ return deco_state_it->second;
303+
304+ unsigned long decorations = GetMwnDecorations(window_id);
305+
306+ /* Must have both bits set */
307+ bool decorated = (decorations & (MwmDecorAll | MwmDecorTitle)) ||
308+ (decorations & MWM_HINTS_UNDECORATED_UNITY);
309+
310+ _window_decoration_state[window_id] = decorated;
311+ return decorated;
312+}
313+
314+bool
315+PluginAdapter::IsWindowDecorated(guint32 xid)
316+{
317+ Window window_id = xid;
318+
319+ bool decorated = GetMwnDecorations(window_id) & (MwmDecorAll | MwmDecorTitle);
320+
321+ if (decorated && GetCardinalProperty(window_id, Atoms::frameExtents).empty())
322+ {
323+ decorated = false;
324+ }
325+
326+ return decorated;
327 }
328
329 bool
330@@ -1023,7 +1056,6 @@
331 PluginAdapter::SetMwmWindowHints(Window xid, MotifWmHints* new_hints)
332 {
333 Display* display = m_Screen->dpy();
334- Atom hints_atom = None;
335 MotifWmHints* data = NULL;
336 MotifWmHints* hints = NULL;
337 Atom type = None;
338@@ -1031,18 +1063,16 @@
339 gulong nitems;
340 gulong bytes_after;
341
342- hints_atom = XInternAtom(display, _XA_MOTIF_WM_HINTS, false);
343-
344 if (XGetWindowProperty(display,
345 xid,
346- hints_atom, 0, sizeof(MotifWmHints) / sizeof(long),
347+ Atoms::mwmHints, 0, sizeof(MotifWmHints) / sizeof(long),
348 False, AnyPropertyType, &type, &format, &nitems,
349 &bytes_after, (guchar**)&data) != Success)
350 {
351 return;
352 }
353
354- if (type != hints_atom || !data)
355+ if (type != Atoms::mwmHints || !data)
356 {
357 hints = new_hints;
358 }
359@@ -1064,7 +1094,7 @@
360
361 XChangeProperty(display,
362 xid,
363- hints_atom, hints_atom, 32, PropModeReplace,
364+ Atoms::mwmHints, Atoms::mwmHints, 32, PropModeReplace,
365 (guchar*)hints, sizeof(MotifWmHints) / sizeof(long));
366
367 if (data)
368@@ -1074,6 +1104,9 @@
369 void
370 PluginAdapter::Decorate(guint32 xid)
371 {
372+ if (!HasWindowDecorations(xid))
373+ return;
374+
375 MotifWmHints hints = { 0 };
376
377 hints.flags = MWM_HINTS_DECORATIONS;
378@@ -1085,6 +1118,9 @@
379 void
380 PluginAdapter::Undecorate(guint32 xid)
381 {
382+ if (!IsWindowDecorated(xid))
383+ return;
384+
385 MotifWmHints hints = { 0 };
386
387 /* Set the high bit to indicate that we undecorated this
388@@ -1319,3 +1355,29 @@
389 .add("expo_active", IsExpoActive())
390 .add("viewport_switch_running", IsViewPortSwitchStarted());
391 }
392+
393+std::vector<long> PluginAdapter::GetCardinalProperty(Window window_id, Atom atom) const
394+{
395+ Atom type;
396+ int result, format;
397+ unsigned long n_items, bytes_after;
398+ long *buf = nullptr;
399+
400+ result = XGetWindowProperty(m_Screen->dpy(), window_id, atom, 0L, 65536, False,
401+ XA_CARDINAL, &type, &format, &n_items, &bytes_after,
402+ reinterpret_cast<unsigned char **>(&buf));
403+
404+ std::unique_ptr<long[], int(*)(void*)> buffer(buf, XFree);
405+
406+ if (result == Success && type == XA_CARDINAL && format == 32 && buffer && n_items > 0)
407+ {
408+ std::vector<long> values(n_items);
409+
410+ for (unsigned i = 0; i < n_items; ++i)
411+ values[i] = buffer[i];
412+
413+ return values;
414+ }
415+
416+ return std::vector<long>();
417+}
418
419=== modified file 'plugins/unityshell/src/PluginAdapter.h'
420--- plugins/unityshell/src/PluginAdapter.h 2012-04-27 11:42:56 +0000
421+++ plugins/unityshell/src/PluginAdapter.h 2013-05-07 13:13:46 +0000
422@@ -1,6 +1,6 @@
423 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
424 /*
425- * Copyright (C) 2010 Canonical Ltd
426+ * Copyright (C) 2010-2012 Canonical Ltd
427 *
428 * This program is free software: you can redistribute it and/or modify
429 * it under the terms of the GNU General Public License version 3 as
430@@ -125,6 +125,7 @@
431 bool IsWindowClosable(guint32 xid);
432 bool IsWindowMinimizable(guint32 xid);
433 bool IsWindowMaximizable(guint32 xid);
434+ bool HasWindowDecorations(guint32 xid) const;
435
436 void Restore(guint32 xid);
437 void RestoreAt(guint32 xid, int x, int y);
438@@ -174,6 +175,9 @@
439
440 bool CheckWindowIntersection(nux::Geometry const& region, CompWindow* window);
441 void SetMwmWindowHints(Window xid, MotifWmHints* new_hints);
442+ unsigned long GetMwnDecorations(Window xid) const;
443+
444+ std::vector<long> GetCardinalProperty(Window xid, Atom atom) const;
445
446 CompScreen* m_Screen;
447 MultiActionList m_ExpoActionList;
448@@ -193,7 +197,7 @@
449 bool _in_show_desktop;
450 CompWindow* _last_focused_window;
451
452- std::map<guint32, unsigned int> _window_decoration_state;
453+ mutable std::map<guint32, unsigned int> _window_decoration_state;
454
455 static PluginAdapter* _default;
456 };
457
458=== modified file 'plugins/unityshell/src/ResultRendererTile.cpp'
459--- plugins/unityshell/src/ResultRendererTile.cpp 2012-04-25 12:09:59 +0000
460+++ plugins/unityshell/src/ResultRendererTile.cpp 2013-05-07 13:13:46 +0000
461@@ -21,14 +21,10 @@
462 */
463
464
465-#include <sstream> // for ostringstream
466 #include "ResultRendererTile.h"
467
468-#include <boost/algorithm/string.hpp>
469-
470 #include <pango/pango.h>
471 #include <pango/pangocairo.h>
472-#include <gdk/gdk.h>
473 #include <gtk/gtk.h>
474
475 #include <NuxCore/Logger.h>
476@@ -51,6 +47,7 @@
477 namespace
478 {
479 nux::logging::Logger logger("unity.dash.results");
480+const std::string DEFAULT_GICON = ". GThemedIcon text-x-preview";
481
482 const int FONT_SIZE = 10;
483 }
484@@ -230,7 +227,7 @@
485
486 void ResultRendererTile::Preload(Result& row)
487 {
488- if (row.renderer<TextureContainer*>() == nullptr)
489+ if (!row.renderer<TextureContainer*>())
490 {
491 row.set_renderer(new TextureContainer());
492 LoadIcon(row);
493@@ -240,17 +237,25 @@
494
495 void ResultRendererTile::Unload(Result& row)
496 {
497- TextureContainer *container = row.renderer<TextureContainer*>();
498- delete container;
499+ delete row.renderer<TextureContainer*>();
500 row.set_renderer<TextureContainer*>(nullptr);
501 }
502
503 void ResultRendererTile::LoadIcon(Result& row)
504 {
505+ auto container = row.renderer<TextureContainer*>();
506+
507+ if (!container)
508+ {
509+ LOG_ERROR(logger) << "No valid container for Result " << row.name() << " with URI "
510+ << row.uri();
511+ return;
512+ }
513+
514 Style& style = Style::Instance();
515 std::string const& icon_hint = row.icon_hint;
516-#define DEFAULT_GICON ". GThemedIcon text-x-preview"
517 std::string icon_name;
518+
519 if (G_UNLIKELY(neko))
520 {
521 int tmp1 = style.GetTileIconSize() + (rand() % 16) - 8;
522@@ -266,28 +271,25 @@
523 icon_name = !icon_hint.empty() ? icon_hint : DEFAULT_GICON;
524 }
525
526-
527-
528- GIcon* icon = g_icon_new_for_string(icon_name.c_str(), NULL);
529- TextureContainer* container = row.renderer<TextureContainer*>();
530-
531- IconLoader::IconLoaderCallback slot = sigc::bind(sigc::mem_fun(this, &ResultRendererTile::IconLoaded), icon_hint, row);
532-
533- if (g_strrstr(icon_name.c_str(), "://"))
534+ auto slot = sigc::bind(sigc::mem_fun(this, &ResultRendererTile::IconLoaded), icon_hint, row);
535+
536+ if (icon_name.find("://") != std::string::npos)
537 {
538 container->slot_handle = IconLoader::GetDefault().LoadFromURI(icon_name, style.GetTileIconSize(), slot);
539 }
540- else if (G_IS_ICON(icon))
541- {
542- container->slot_handle = IconLoader::GetDefault().LoadFromGIconString(icon_name, style.GetTileIconSize(), slot);
543- }
544 else
545 {
546- container->slot_handle = IconLoader::GetDefault().LoadFromIconName(icon_name, style.GetTileIconSize(), slot);
547+ glib::Object<GIcon> icon(g_icon_new_for_string(icon_name.c_str(), nullptr));
548+
549+ if (G_IS_ICON(icon.RawPtr()))
550+ {
551+ container->slot_handle = IconLoader::GetDefault().LoadFromGIconString(icon_name, style.GetTileIconSize(), slot);
552+ }
553+ else
554+ {
555+ container->slot_handle = IconLoader::GetDefault().LoadFromIconName(icon_name, style.GetTileIconSize(), slot);
556+ }
557 }
558-
559- if (icon != NULL)
560- g_object_unref(icon);
561 }
562
563 nux::BaseTexture* ResultRendererTile::CreateTextureCallback(std::string const& texid,
564
565=== modified file 'plugins/unityshell/src/WindowManager.cpp'
566--- plugins/unityshell/src/WindowManager.cpp 2012-07-18 15:25:17 +0000
567+++ plugins/unityshell/src/WindowManager.cpp 2013-05-07 13:13:46 +0000
568@@ -58,6 +58,11 @@
569 return true;
570 }
571
572+ bool HasWindowDecorations(guint32 xid) const
573+ {
574+ return true;
575+ }
576+
577 bool IsWindowOnCurrentDesktop(guint32 xid)
578 {
579 return true;
580
581=== modified file 'plugins/unityshell/src/WindowManager.h'
582--- plugins/unityshell/src/WindowManager.h 2012-07-18 15:25:17 +0000
583+++ plugins/unityshell/src/WindowManager.h 2013-05-07 13:13:46 +0000
584@@ -61,6 +61,7 @@
585 virtual bool IsWindowClosable(guint32 xid) = 0;
586 virtual bool IsWindowMinimizable(guint32 xid) = 0;
587 virtual bool IsWindowMaximizable(guint32 xid) = 0;
588+ virtual bool HasWindowDecorations(guint32 xid) const = 0;
589
590 virtual void ShowDesktop() = 0;
591
592
593=== modified file 'plugins/unityshell/src/unityshell.cpp'
594--- plugins/unityshell/src/unityshell.cpp 2012-11-12 12:20:38 +0000
595+++ plugins/unityshell/src/unityshell.cpp 2013-05-07 13:13:46 +0000
596@@ -592,18 +592,8 @@
597
598 // compiz doesn't use the same method of tracking monitors as our toolkit
599 // we need to make sure we properly associate with the right monitor
600- int current_monitor = -1;
601- auto monitors = UScreen::GetDefault()->GetMonitors();
602- int i = 0;
603- for (auto monitor : monitors)
604- {
605- if (monitor.x == output->x() && monitor.y == output->y())
606- {
607- current_monitor = i;
608- break;
609- }
610- i++;
611- }
612+ auto const& uscreen = UScreen::GetDefault();
613+ int current_monitor = uscreen->GetMonitorAtPosition(output->x(), output->y());
614
615 if (!(launcher_controller_->IsOverlayOpen() && current_monitor == dash_monitor_)
616 && panel_controller_->opacity() > 0.0f)
617@@ -671,18 +661,8 @@
618
619 // compiz doesn't use the same method of tracking monitors as our toolkit
620 // we need to make sure we properly associate with the right monitor
621- int current_monitor = -1;
622- auto monitors = UScreen::GetDefault()->GetMonitors();
623- int i = 0;
624- for (auto monitor : monitors)
625- {
626- if (monitor.x == output->x() && monitor.y == output->y())
627- {
628- current_monitor = i;
629- break;
630- }
631- i++;
632- }
633+ auto const& uscreen = UScreen::GetDefault();
634+ int current_monitor = uscreen->GetMonitorAtPosition(output->x(), output->y());
635
636 if (!(launcher_controller_->IsOverlayOpen() && current_monitor == dash_monitor_)
637 && panel_controller_->opacity() > 0.0f)
638@@ -2345,7 +2325,7 @@
639 return "Unity";
640 }
641
642-bool isNuxWindow (CompWindow* value)
643+bool isNuxWindow(CompWindow* value)
644 {
645 std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList();
646 auto id = value->id();
647@@ -2394,13 +2374,21 @@
648 * fully covers the shell on its output. It does not include regular windows
649 * stacked above the shell like DnD icons or Onboard etc.
650 */
651- if (isNuxWindow(window))
652+ if (G_UNLIKELY(is_nux_window_))
653 {
654 if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
655 {
656 uScreen->nuxRegion += window->geometry();
657 uScreen->nuxRegion -= uScreen->fullscreenRegion;
658 }
659+
660+ if (window->id() == screen->activeWindow() &&
661+ !(mask & PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK))
662+ {
663+ if (!mask)
664+ uScreen->paintPanelShadow(matrix);
665+ }
666+
667 return false; // Ensure nux windows are never painted by compiz
668 }
669 else if (mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK)
670@@ -2483,8 +2471,7 @@
671 if (uScreen->doShellRepaint &&
672 !uScreen->forcePaintOnTop () &&
673 window == uScreen->firstWindowAboveShell &&
674- !uScreen->fullscreenRegion.contains(window->geometry())
675- )
676+ !uScreen->fullscreenRegion.contains(window->geometry()))
677 {
678 #ifdef USE_GLES
679 uScreen->paintDisplay();
680@@ -3154,6 +3141,7 @@
681 , mMinimizeHandler()
682 , mShowdesktopHandler(nullptr)
683 , focusdesktop_handle_(0)
684+ , is_nux_window_(isNuxWindow(window))
685 {
686 WindowInterface::setHandler(window);
687 GLWindowInterface::setHandler(gWindow);
688
689=== modified file 'plugins/unityshell/src/unityshell.h'
690--- plugins/unityshell/src/unityshell.h 2012-09-11 10:38:44 +0000
691+++ plugins/unityshell/src/unityshell.h 2013-05-07 13:13:46 +0000
692@@ -434,8 +434,8 @@
693 unsigned int GetNoCoreInstanceMask ();
694
695 compiz::WindowInputRemoverLock::Ptr GetInputRemover ();
696-
697 compiz::WindowInputRemoverLock::Weak input_remover_;
698+ bool is_nux_window_;
699 };
700
701
702
703=== modified file 'tests/test_launcher_controller.cpp'
704--- tests/test_launcher_controller.cpp 2012-07-26 13:12:26 +0000
705+++ tests/test_launcher_controller.cpp 2013-05-07 13:13:46 +0000
706@@ -111,6 +111,16 @@
707 }
708 }
709
710+TEST_F(TestLauncherController, MirroredMultimonitorSingleLauncherOnExternalMonitor)
711+{
712+ // See lp bug 991637
713+ lc.multiple_launchers = false;
714+ uscreen.SetPrimary(1);
715+
716+ ASSERT_EQ(lc.launchers().size(), 1);
717+ ASSERT_EQ(lc.launcher().monitor(), 0);
718+}
719+
720 TEST_F(TestLauncherController, MultimonitorSwitchToMultipleLaunchers)
721 {
722 lc.multiple_launchers = false;
723
724=== modified file 'tests/test_service_lens.c'
725--- tests/test_service_lens.c 2011-12-08 08:48:10 +0000
726+++ tests/test_service_lens.c 2013-05-07 13:13:46 +0000
727@@ -8,7 +8,6 @@
728 static void add_filters(ServiceLens *self);
729 static void on_search_changed(UnityScope* scope, UnityLensSearch *lens_search, UnitySearchType search_type, GCancellable *canc, ServiceLens* self);
730 static UnityActivationResponse* on_activate_uri(UnityScope* scope, const char* uri, ServiceLens* self);
731-static UnityPreview* on_preview_uri(UnityScope* scope, const char* uri, ServiceLens *self);
732
733 struct _ServiceLensPrivate
734 {
735@@ -59,8 +58,6 @@
736 G_CALLBACK(on_search_changed), self);
737 g_signal_connect(priv->scope, "activate-uri",
738 G_CALLBACK(on_activate_uri), self);
739- g_signal_connect(priv->scope, "preview-uri",
740- G_CALLBACK(on_preview_uri), self);
741
742 /* Get ready to export and export */
743 unity_lens_add_local_scope(priv->lens, priv->scope);
744@@ -183,18 +180,6 @@
745 return unity_activation_response_new(UNITY_HANDLED_TYPE_HIDE_DASH, "");
746 }
747
748-static UnityPreview*
749-on_preview_uri(UnityScope* scope, const char* uri, ServiceLens *self)
750-{
751- gchar *genres[] = {"awesome"};
752- return (UnityPreview*)unity_track_preview_new(1, "Animus Vox",
753- "The Glitch Mob", "Drink The Sea",
754- 404, genres, 1,
755- "file://music/the/track", "Play",
756- "", "play://music/the/track",
757- "preview://music/the/track", "pause://music/the/track");
758-}
759-
760 ServiceLens*
761 service_lens_new()
762 {

Subscribers

People subscribed via source and target branches

to all changes: