Merge lp:~3v1n0/unity/fix-nvidia-glDrawArrays-crash-5.0 into lp:unity

Proposed by Marco Trevisan (Treviño) on 2012-08-01
Status: Superseded
Proposed branch: lp:~3v1n0/unity/fix-nvidia-glDrawArrays-crash-5.0
Merge into: lp:unity
Prerequisite: lp:~thumper/unity/regional-damage-sru
Diff against target: 892 lines (+477/-136) (has conflicts)
10 files modified
launcher/EdgeBarrierController.cpp (+31/-1)
launcher/EdgeBarrierController.h (+6/-0)
launcher/LauncherController.cpp (+24/-113)
launcher/LauncherIcon.cpp (+10/-8)
plugins/unityshell/src/LauncherControllerPrivate.h (+160/-0)
plugins/unityshell/src/unityshell.cpp (+14/-0)
tests/CMakeLists.txt (+16/-1)
tests/test_launcher_controller.cpp (+205/-0)
unity-shared/UScreen.cpp (+4/-3)
unity-shared/UScreen.h (+7/-10)
Text conflict in AUTHORS
Text conflict in CMakeLists.txt
Text conflict in ChangeLog
Text conflict in UnityCore/GLibSignal.h
Text conflict in dash/DashController.cpp
Text conflict in dash/DashView.cpp
Text conflict in dash/PlacesGroup.cpp
Text conflict in dash/ResultViewGrid.cpp
Text conflict in dash/ResultViewGrid.h
Text conflict in hud/HudButton.cpp
Text conflict in hud/HudButton.h
Text conflict in hud/HudController.cpp
Text conflict in hud/HudController.h
Path conflict: hud/HudPrivate.cpp / plugins/unityshell/src/HudPrivate.cpp
Path conflict: hud/HudPrivate.h / plugins/unityshell/src/HudPrivate.h
Text conflict in hud/HudView.cpp
Text conflict in hud/HudView.h
Text conflict in launcher/AbstractLauncherIcon.h
Text conflict in launcher/BamfLauncherIcon.cpp
Text conflict in launcher/BamfLauncherIcon.h
Text conflict in launcher/DeviceLauncherIcon.cpp
Text conflict in launcher/DeviceLauncherIcon.h
Text conflict in launcher/DeviceLauncherSection.cpp
Text conflict in launcher/DeviceLauncherSection.h
Text conflict in launcher/DndData.cpp
Text conflict in launcher/EdgeBarrierController.cpp
Text conflict in launcher/EdgeBarrierController.h
Text conflict in launcher/Launcher.cpp
Text conflict in launcher/Launcher.h
Text conflict in launcher/LauncherController.cpp
Path conflict: launcher/LauncherControllerPrivate.h / plugins/unityshell/src/LauncherControllerPrivate.h
Text conflict in launcher/LauncherIcon.cpp
Text conflict in launcher/LauncherIcon.h
Text conflict in launcher/QuicklistView.cpp
Text conflict in launcher/QuicklistView.h
Text conflict in launcher/SimpleLauncherIcon.cpp
Text conflict in launcher/SimpleLauncherIcon.h
Text conflict in launcher/SoftwareCenterLauncherIcon.cpp
Text conflict in launcher/StandaloneLauncher.cpp
Text conflict in launcher/SwitcherController.cpp
Text conflict in launcher/SwitcherController.h
Text conflict in launcher/SwitcherView.h
Text conflict in manual-tests/Dash.txt
Text conflict in manual-tests/Launcher.txt
Text conflict in manual-tests/SoftwareCenter.txt
Text conflict in manual-tests/Switcher.txt
Text conflict in manual-tests/WindowButtons.txt
Text conflict in manual-tests/WindowManagement.txt
Text conflict in panel/PanelView.cpp
Text conflict in plugins/unityshell/src/LauncherControllerPrivate.h
Text conflict in plugins/unityshell/src/ScreenEffectFramebufferObject.cpp
Text conflict in plugins/unityshell/src/compizminimizedwindowhandler.h
Text conflict in plugins/unityshell/src/unityshell.cpp
Text conflict in plugins/unityshell/src/unityshell.h
Conflict adding files to standalone-clients.  Created directory.
Conflict because standalone-clients is not versioned, but has versioned children.  Versioned directory.
Contents conflict in standalone-clients/CMakeLists.txt
Text conflict in tests/CMakeLists.txt
Conflict adding files to tests/autopilot/autopilot.  Created directory.
Conflict because tests/autopilot/autopilot is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to tests/autopilot/autopilot/emulators.  Created directory.
Conflict because tests/autopilot/autopilot/emulators is not versioned, but has versioned children.  Versioned directory.
Contents conflict in tests/autopilot/autopilot/emulators/bamf.py
Contents conflict in tests/autopilot/autopilot/keybindings.py
Contents conflict in tests/autopilot/autopilot/utilities.py
Text conflict in tests/autopilot/unity/emulators/__init__.py
Text conflict in tests/autopilot/unity/emulators/dash.py
Text conflict in tests/autopilot/unity/emulators/hud.py
Text conflict in tests/autopilot/unity/emulators/icons.py
Text conflict in tests/autopilot/unity/emulators/launcher.py
Text conflict in tests/autopilot/unity/emulators/tooltip.py
Text conflict in tests/autopilot/unity/emulators/window_manager.py
Text conflict in tests/autopilot/unity/tests/__init__.py
Text conflict in tests/autopilot/unity/tests/test_command_lens.py
Text conflict in tests/autopilot/unity/tests/test_dash.py
Text conflict in tests/autopilot/unity/tests/test_home_lens.py
Text conflict in tests/autopilot/unity/tests/test_hud.py
Text conflict in tests/autopilot/unity/tests/test_ibus.py
Contents conflict in tests/autopilot/unity/tests/test_launcher.py
Text conflict in tests/autopilot/unity/tests/test_panel.py
Text conflict in tests/autopilot/unity/tests/test_quicklist.py
Text conflict in tests/autopilot/unity/tests/test_shortcut_hint.py
Text conflict in tests/autopilot/unity/tests/test_switcher.py
Text conflict in tests/test_hud_button.cpp
Conflict adding file tests/test_hud_controller.cpp.  Moved existing file to tests/test_hud_controller.cpp.moved.
Text conflict in tests/test_hud_private.cpp
Conflict adding file tests/test_hud_view.cpp.  Moved existing file to tests/test_hud_view.cpp.moved.
Text conflict in tests/test_im_text_entry.cpp
Text conflict in tests/test_launcher_controller.cpp
Text conflict in tests/test_main.cpp
Conflict adding file tests/test_resultviewgrid.cpp.  Moved existing file to tests/test_resultviewgrid.cpp.moved.
Text conflict in tests/test_switcher_controller.cpp
Text conflict in unity-shared/IMTextEntry.cpp
Text conflict in unity-shared/IMTextEntry.h
Text conflict in unity-shared/IconTexture.h
Text conflict in unity-shared/OverlayRenderer.cpp
Text conflict in unity-shared/PluginAdapterCompiz.cpp
Text conflict in unity-shared/SearchBar.cpp
Text conflict in unity-shared/StaticCairoText.cpp
Text conflict in unity-shared/StaticCairoText.h
Text conflict in unity-shared/UBusMessages.h
Text conflict in unity-shared/UScreen.cpp
Text conflict in unity-shared/UScreen.h
Text conflict in unity-shared/UnityWindowView.h
Text conflict in unity-shared/WindowManager.cpp
Text conflict in unity-shared/WindowManager.h
To merge this branch: bzr merge lp:~3v1n0/unity/fix-nvidia-glDrawArrays-crash-5.0
Reviewer Review Type Date Requested Status
Łukasz Zemczak 2012-08-01 Needs Information on 2012-08-01
Review via email: mp+117553@code.launchpad.net

This proposal has been superseded by a proposal from 2012-08-01.

Commit message

unityshell: fix the nvidia crash on glDrawArrays disabling/enabling the client state on nuxPrologue/Epilogue

Description of the change

Fix some crashes with the NVIDIA driver, happening on glDrawArray call.
Thanks to Sam for the hint.

To post a comment you must log in.
2396. By Marco Trevisan (Treviño) on 2012-08-01

Ooops, remove badly committed changes

Łukasz Zemczak (sil2100) wrote :

I see a LOT of conflicts - the diff generated by this branch is also terrible. Is it all just because the prerequisite branch is not yet merged?

review: Needs Information
Marco Trevisan (Treviño) (3v1n0) wrote :

sil, I forgot to make this request against the correct branch (lp:unity/5.0), this MR is already superseded, follow the top link to get the new request ;)

Unmerged revisions

2396. By Marco Trevisan (Treviño) on 2012-08-01

Ooops, remove badly committed changes

2395. By Marco Trevisan (Treviño) on 2012-08-01

unityshell: fix the nvidia crash on glDrawArrays disabling/enabling the client state on nuxPrologue/Epilogue

2394. By Marco Trevisan (Treviño) on 2012-08-01

Merge with duflu branch

2393. By Marco Trevisan (Treviño) on 2012-07-27

LauncherController: Rewritten EnsureLaunchers() added tests, fix a crash caused by invalid barrier subscriptions.. Fixes: https://bugs.launchpad.net/bugs/1020075. Approved by Andrea Azzarone.

2392. By Łukasz Zemczak on 2012-07-19

Release\ 5.14.0

2391. By Gary Lasker on 2012-07-18

manual-tests/SoftwareCenter.txt: added tests for Ubuntu Software Center/Unity launcher integration feature. Fixes: . Approved by Marco Trevisan (Treviño), Brandon Schaefer, Christopher Lee.

2390. By Andrea Azzarone on 2012-07-17

Backport lp:~thomir/unity/fix-for-754565. Fixes: https://bugs.launchpad.net/bugs/754565. Approved by Marco Trevisan (Treviño).

2389. By Bilal Akhtar on 2012-07-17

SoftwareCenterLauncherIcon: avoid the "Waiting to Install" tooltip to stay after installation

Be consistent with auto-hiding launcher.. Fixes: https://bugs.launchpad.net/bugs/925014, https://bugs.launchpad.net/bugs/1002440, https://bugs.launchpad.net/bugs/1012896. Approved by Marco Trevisan (Treviño), Brandon Schaefer, Thomi Richards.

2388. By Andrea Azzarone on 2012-07-17

Backport lp:~andyrock/unity/fix-987955. Fixes: https://bugs.launchpad.net/bugs/987955. Approved by Marco Trevisan (Treviño).

2387. By Brandon Schaefer on 2012-07-16

Scale mode now does not skip the first super to open the dash.. Fixes: https://bugs.launchpad.net/bugs/1023811. Approved by Marco Trevisan (Treviño).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/EdgeBarrierController.cpp'
2--- launcher/EdgeBarrierController.cpp 2012-08-01 00:58:23 +0000
3+++ launcher/EdgeBarrierController.cpp 2012-08-01 00:58:26 +0000
4@@ -65,7 +65,7 @@
5 {
6 UScreen *uscreen = UScreen::GetDefault();
7
8- auto monitors = uscreen->GetMonitors();
9+ auto const& monitors = uscreen->GetMonitors();
10 ResizeBarrierList(monitors);
11
12 uscreen->changed.connect([&](int primary, std::vector<nux::Geometry>& layout) {
13@@ -147,15 +147,24 @@
14 }
15
16 float decay_responsiveness_mult = ((parent_->options()->edge_responsiveness() - 1) * .3f) + 1;
17+<<<<<<< TREE
18 decaymulator_.rate_of_decay = parent_->options()->edge_decay_rate() * decay_responsiveness_mult;
19
20+=======
21+ decaymulator_->rate_of_decay = parent_->options()->edge_decay_rate() * decay_responsiveness_mult;
22+
23+>>>>>>> MERGE-SOURCE
24 float overcome_responsiveness_mult = ((parent_->options()->edge_responsiveness() - 1) * 1.0f) + 1;
25 edge_overcome_pressure_ = parent_->options()->edge_overcome_pressure() * overcome_responsiveness_mult;
26 }
27
28 void EdgeBarrierController::Impl::OnPointerBarrierEvent(PointerBarrierWrapper* owner, BarrierEvent::Ptr event)
29 {
30+<<<<<<< TREE
31 unsigned int monitor = owner->index;
32+=======
33+ unsigned monitor = owner->index;
34+>>>>>>> MERGE-SOURCE
35 bool process = true;
36
37 if (monitor < subscribers_.size())
38@@ -206,8 +215,14 @@
39 }
40
41 EdgeBarrierController::EdgeBarrierController()
42+<<<<<<< TREE
43 : pimpl(new Impl(this))
44 {}
45+=======
46+ : sticky_edges(false)
47+ , pimpl(new Impl(this))
48+{}
49+>>>>>>> MERGE-SOURCE
50
51 EdgeBarrierController::~EdgeBarrierController()
52 {}
53@@ -230,6 +245,7 @@
54
55 auto const& monitors = UScreen::GetDefault()->GetMonitors();
56 pimpl->subscribers_[monitor] = nullptr;
57+<<<<<<< TREE
58 pimpl->ResizeBarrierList(monitors);
59 pimpl->SetupBarriers(monitors);
60 }
61@@ -246,6 +262,20 @@
62 {
63 pimpl->OnPointerBarrierEvent(owner, event);
64 }
65+=======
66+ pimpl->ResizeBarrierList(monitors);
67+ pimpl->SetupBarriers(monitors);
68+}
69+
70+EdgeBarrierSubscriber* EdgeBarrierController::GetSubscriber(unsigned int monitor)
71+{
72+ if (monitor >= pimpl->subscribers_.size())
73+ return nullptr;
74+
75+ return pimpl->subscribers_[monitor];
76+}
77+
78+>>>>>>> MERGE-SOURCE
79
80 }
81 }
82
83=== modified file 'launcher/EdgeBarrierController.h'
84--- launcher/EdgeBarrierController.h 2012-07-25 23:18:17 +0000
85+++ launcher/EdgeBarrierController.h 2012-08-01 00:58:26 +0000
86@@ -41,12 +41,18 @@
87 nux::RWProperty<bool> sticky_edges;
88 nux::Property<launcher::Options::Ptr> options;
89
90+<<<<<<< TREE
91 void Subscribe(EdgeBarrierSubscriber* subscriber, unsigned int monitor);
92 void Unsubscribe(EdgeBarrierSubscriber* subscriber, unsigned int monitor);
93 EdgeBarrierSubscriber* GetSubscriber(unsigned int monitor);
94
95 protected:
96 void ProcessBarrierEvent(PointerBarrierWrapper* owner, BarrierEvent::Ptr event);
97+=======
98+ void Subscribe(EdgeBarrierSubscriber* subscriber, unsigned int monitor);
99+ void Unsubscribe(EdgeBarrierSubscriber* subscriber, unsigned int monitor);
100+ EdgeBarrierSubscriber* GetSubscriber(unsigned int monitor);
101+>>>>>>> MERGE-SOURCE
102
103 private:
104 struct Impl;
105
106=== modified file 'launcher/LauncherController.cpp'
107--- launcher/LauncherController.cpp 2012-08-01 00:58:23 +0000
108+++ launcher/LauncherController.cpp 2012-08-01 00:58:26 +0000
109@@ -26,21 +26,36 @@
110 #include <Nux/BaseWindow.h>
111 #include <NuxCore/Logger.h>
112
113-#include "LauncherOptions.h"
114 #include "BamfLauncherIcon.h"
115+#include "BFBLauncherIcon.h"
116 #include "DesktopLauncherIcon.h"
117 #include "DeviceLauncherIcon.h"
118 #include "FavoriteStore.h"
119 #include "HudLauncherIcon.h"
120 #include "LauncherController.h"
121-#include "LauncherControllerPrivate.h"
122+<<<<<<< TREE
123+#include "LauncherControllerPrivate.h"
124+=======
125+#include "LauncherControllerPrivate.h"
126+#include "LauncherOptions.h"
127+>>>>>>> MERGE-SOURCE
128 #include "SoftwareCenterLauncherIcon.h"
129+<<<<<<< TREE
130 #include "unity-shared/WindowManager.h"
131+=======
132+#include "TimeUtil.h"
133+>>>>>>> MERGE-SOURCE
134 #include "TrashLauncherIcon.h"
135+<<<<<<< TREE
136 #include "BFBLauncherIcon.h"
137 #include "unity-shared/UScreen.h"
138 #include "unity-shared/UBusMessages.h"
139 #include "unity-shared/TimeUtil.h"
140+=======
141+#include "UBusMessages.h"
142+#include "UScreen.h"
143+#include "WindowManager.h"
144+>>>>>>> MERGE-SOURCE
145
146 namespace unity
147 {
148@@ -90,122 +105,12 @@
149
150 GDBusInterfaceVTable Controller::Impl::interface_vtable =
151 { Controller::Impl::OnDBusMethodCall, NULL, NULL};
152+
153 =======
154 }
155 }
156
157-class Controller::Impl
158-{
159-public:
160- Impl(Display* display, Controller* parent);
161- ~Impl();
162-
163- void UpdateNumWorkspaces(int workspaces);
164-
165- Launcher* CreateLauncher(int monitor);
166-
167- void Save();
168- void SortAndUpdate();
169-
170- nux::ObjectPtr<Launcher> CurrentLauncher();
171-
172- void OnIconAdded(AbstractLauncherIcon::Ptr icon);
173- void OnIconRemoved(AbstractLauncherIcon::Ptr icon);
174-
175- void OnLauncherAddRequest(char* path, AbstractLauncherIcon::Ptr before);
176- void OnLauncherAddRequestSpecial(std::string const& path, AbstractLauncherIcon::Ptr before, std::string const& aptdaemon_trans_id, std::string const& icon_path,
177- int icon_x, int icon_y, int icon_size);
178- void OnLauncherRemoveRequest(AbstractLauncherIcon::Ptr icon);
179- void OnSCIconAnimationComplete(AbstractLauncherIcon::Ptr icon);
180-
181- void OnLauncherEntryRemoteAdded(LauncherEntryRemote::Ptr const& entry);
182- void OnLauncherEntryRemoteRemoved(LauncherEntryRemote::Ptr const& entry);
183-
184- void OnFavoriteStoreFavoriteAdded(std::string const& entry, std::string const& pos, bool before);
185- void OnFavoriteStoreFavoriteRemoved(std::string const& entry);
186- void OnFavoriteStoreReordered();
187-
188-
189- void InsertExpoAction();
190- void RemoveExpoAction();
191-
192- void InsertDesktopIcon();
193- void RemoveDesktopIcon();
194-
195- void SendHomeActivationRequest();
196-
197- int MonitorWithMouse();
198-
199- void InsertTrash();
200-
201- void RegisterIcon(AbstractLauncherIcon::Ptr icon);
202-
203- AbstractLauncherIcon::Ptr CreateFavorite(const char* file_path);
204-
205- SoftwareCenterLauncherIcon::Ptr CreateSCLauncherIcon(std::string const& file_path, std::string const& aptdaemon_trans_id, std::string const& icon_path);
206-
207- void SetupBamf();
208-
209- void EnsureLaunchers(int primary, std::vector<nux::Geometry> const& monitors);
210-
211- void OnExpoActivated();
212-
213- void OnScreenChanged(int primary_monitor, std::vector<nux::Geometry>& monitors);
214-
215- void OnWindowFocusChanged (guint32 xid);
216-
217- void OnViewOpened(BamfMatcher* matcher, BamfView* view);
218-
219- void ReceiveMouseDownOutsideArea(int x, int y, unsigned long button_flags, unsigned long key_flags);
220-
221- void ReceiveLauncherKeyPress(unsigned long eventType,
222- unsigned long keysym,
223- unsigned long state,
224- const char* character,
225- unsigned short keyCount);
226-
227- Controller* parent_;
228- glib::Object<BamfMatcher> matcher_;
229- glib::Signal<void, BamfMatcher*, BamfView*> view_opened_signal_;
230- LauncherModel::Ptr model_;
231- nux::ObjectPtr<Launcher> launcher_;
232- nux::ObjectPtr<Launcher> keyboard_launcher_;
233- int sort_priority_;
234- DeviceLauncherSection device_section_;
235- LauncherEntryRemoteModel remote_model_;
236- AbstractLauncherIcon::Ptr expo_icon_;
237- AbstractLauncherIcon::Ptr desktop_icon_;
238- int num_workspaces_;
239- bool show_desktop_icon_;
240- Display* display_;
241-
242- guint bamf_timer_handler_id_;
243- guint launcher_key_press_handler_id_;
244- guint launcher_label_show_handler_id_;
245- guint launcher_hide_handler_id_;
246-
247- bool launcher_open;
248- bool launcher_keynav;
249- bool launcher_grabbed;
250- bool reactivate_keynav;
251- int reactivate_index;
252- bool keynav_restore_window_;
253-
254- UBusManager ubus;
255-
256- int launcher_key_press_time_;
257-
258- ui::EdgeBarrierController::Ptr edge_barriers_;
259-
260- LauncherList launchers;
261-
262- sigc::connection on_expoicon_activate_connection_;
263- sigc::connection launcher_key_press_connection_;
264- sigc::connection launcher_event_outside_connection_;
265-};
266-
267 >>>>>>> MERGE-SOURCE
268-
269 Controller::Impl::Impl(Display* display, Controller* parent)
270 : parent_(parent)
271 , model_(new LauncherModel())
272@@ -214,7 +119,13 @@
273 , device_section_(volume_monitor_)
274 , show_desktop_icon_(false)
275 , display_(display)
276+<<<<<<< TREE
277 , matcher_(bamf_matcher_get_default())
278+=======
279+ , launcher_key_press_handler_id_(0)
280+ , launcher_label_show_handler_id_(0)
281+ , launcher_hide_handler_id_(0)
282+>>>>>>> MERGE-SOURCE
283 {
284 edge_barriers_.options = parent_->options();
285
286
287=== modified file 'launcher/LauncherIcon.cpp'
288--- launcher/LauncherIcon.cpp 2012-08-01 00:58:23 +0000
289+++ launcher/LauncherIcon.cpp 2012-08-01 00:58:26 +0000
290@@ -623,19 +623,12 @@
291
292 <<<<<<< TREE
293 void LauncherIcon::RecvMouseDown(int button, int monitor, unsigned long key_flags)
294-=======
295-void LauncherIcon::RecvMouseDown(int button, unsigned long key_flags, int monitor)
296->>>>>>> MERGE-SOURCE
297 {
298 if (button == 3)
299 OpenQuicklist();
300 }
301
302-<<<<<<< TREE
303 void LauncherIcon::RecvMouseUp(int button, int monitor, unsigned long key_flags)
304-=======
305-void LauncherIcon::RecvMouseUp(int button, unsigned long key_flags, int monitor)
306->>>>>>> MERGE-SOURCE
307 {
308 if (button == 3)
309 {
310@@ -644,9 +637,18 @@
311 }
312 }
313
314-<<<<<<< TREE
315 void LauncherIcon::RecvMouseClick(int button, int monitor, unsigned long key_flags)
316 =======
317+void LauncherIcon::RecvMouseDown(int button, unsigned long key_flags, int monitor)
318+{
319+}
320+
321+void LauncherIcon::RecvMouseUp(int button, unsigned long key_flags, int monitor)
322+{
323+ if (button == 3)
324+ OpenQuicklist(false, monitor);
325+}
326+
327 void LauncherIcon::RecvMouseClick(int button, unsigned long key_flags, int monitor)
328 >>>>>>> MERGE-SOURCE
329 {
330
331=== renamed file 'launcher/LauncherControllerPrivate.h' => 'plugins/unityshell/src/LauncherControllerPrivate.h'
332--- launcher/LauncherControllerPrivate.h 2012-07-25 13:42:41 +0000
333+++ plugins/unityshell/src/LauncherControllerPrivate.h 2012-08-01 00:58:26 +0000
334@@ -1,3 +1,4 @@
335+<<<<<<< TREE
336 /*
337 * Copyright 2012 Canonical Ltd.
338 *
339@@ -161,3 +162,162 @@
340 } // unity namespace
341
342 #endif
343+=======
344+/*
345+ * Copyright 2012 Canonical Ltd.
346+ *
347+ * This program is free software: you can redistribute it and/or modify it
348+ * under the terms of the GNU General Public License version 3, as published
349+ * by the Free Software Foundation.
350+ *
351+ * This program is distributed in the hope that it will be useful, but
352+ * WITHOUT ANY WARRANTY; without even the implied warranties of
353+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
354+ * PURPOSE. See the GNU General Public License for more details.
355+ *
356+ * You should have received a copy of the GNU General Public License
357+ * version 3 along with this program. If not, see
358+ * <http://www.gnu.org/licenses/>
359+ *
360+ * Authored by: Jason Smith <jason.smith@canonical.com>
361+ * Tim Penhey <tim.penhey@canonical.com>
362+ * Marco Trevisan (Treviño) <marco.trevisan@canonical.com>
363+ *
364+ */
365+
366+#ifndef LAUNCHER_CONTROLLER_PRIVATE_H
367+#define LAUNCHER_CONTROLLER_PRIVATE_H
368+
369+#include <Nux/Nux.h>
370+
371+#include "AbstractLauncherIcon.h"
372+#include "DeviceLauncherSection.h"
373+#include "EdgeBarrierController.h"
374+#include "LauncherController.h"
375+#include "Launcher.h"
376+#include "LauncherEntryRemote.h"
377+#include "LauncherEntryRemoteModel.h"
378+#include "LauncherModel.h"
379+#include "SoftwareCenterLauncherIcon.h"
380+#include "UBusWrapper.h"
381+
382+namespace unity
383+{
384+namespace launcher
385+{
386+
387+class Controller::Impl
388+{
389+public:
390+ Impl(Display* display, Controller* parent);
391+ ~Impl();
392+
393+ void UpdateNumWorkspaces(int workspaces);
394+
395+ Launcher* CreateLauncher(int monitor);
396+
397+ void Save();
398+ void SortAndUpdate();
399+
400+ nux::ObjectPtr<Launcher> CurrentLauncher();
401+
402+ void OnIconAdded(AbstractLauncherIcon::Ptr icon);
403+ void OnIconRemoved(AbstractLauncherIcon::Ptr icon);
404+
405+ void OnLauncherAddRequest(char* path, AbstractLauncherIcon::Ptr before);
406+ void OnLauncherAddRequestSpecial(std::string const& path, AbstractLauncherIcon::Ptr before, std::string const& aptdaemon_trans_id, std::string const& icon_path,
407+ int icon_x, int icon_y, int icon_size);
408+ void OnLauncherRemoveRequest(AbstractLauncherIcon::Ptr icon);
409+ void OnSCIconAnimationComplete(AbstractLauncherIcon::Ptr icon);
410+
411+ void OnLauncherEntryRemoteAdded(LauncherEntryRemote::Ptr const& entry);
412+ void OnLauncherEntryRemoteRemoved(LauncherEntryRemote::Ptr const& entry);
413+
414+ void OnFavoriteStoreFavoriteAdded(std::string const& entry, std::string const& pos, bool before);
415+ void OnFavoriteStoreFavoriteRemoved(std::string const& entry);
416+ void OnFavoriteStoreReordered();
417+
418+
419+ void InsertExpoAction();
420+ void RemoveExpoAction();
421+
422+ void InsertDesktopIcon();
423+ void RemoveDesktopIcon();
424+
425+ void SendHomeActivationRequest();
426+
427+ int MonitorWithMouse();
428+
429+ void InsertTrash();
430+
431+ void RegisterIcon(AbstractLauncherIcon::Ptr icon);
432+
433+ AbstractLauncherIcon::Ptr CreateFavorite(const char* file_path);
434+
435+ SoftwareCenterLauncherIcon::Ptr CreateSCLauncherIcon(std::string const& file_path, std::string const& aptdaemon_trans_id, std::string const& icon_path);
436+
437+ void SetupBamf();
438+
439+ void EnsureLaunchers(int primary, std::vector<nux::Geometry> const& monitors);
440+
441+ void OnExpoActivated();
442+
443+ void OnScreenChanged(int primary_monitor, std::vector<nux::Geometry>& monitors);
444+
445+ void OnWindowFocusChanged (guint32 xid);
446+
447+ void OnViewOpened(BamfMatcher* matcher, BamfView* view);
448+
449+ void ReceiveMouseDownOutsideArea(int x, int y, unsigned long button_flags, unsigned long key_flags);
450+
451+ void ReceiveLauncherKeyPress(unsigned long eventType,
452+ unsigned long keysym,
453+ unsigned long state,
454+ const char* character,
455+ unsigned short keyCount);
456+
457+ Controller* parent_;
458+ glib::Object<BamfMatcher> matcher_;
459+ glib::Signal<void, BamfMatcher*, BamfView*> view_opened_signal_;
460+ LauncherModel::Ptr model_;
461+ nux::ObjectPtr<Launcher> launcher_;
462+ nux::ObjectPtr<Launcher> keyboard_launcher_;
463+ int sort_priority_;
464+ DeviceLauncherSection device_section_;
465+ LauncherEntryRemoteModel remote_model_;
466+ AbstractLauncherIcon::Ptr expo_icon_;
467+ AbstractLauncherIcon::Ptr desktop_icon_;
468+ int num_workspaces_;
469+ bool show_desktop_icon_;
470+ Display* display_;
471+
472+ guint bamf_timer_handler_id_;
473+ guint launcher_key_press_handler_id_;
474+ guint launcher_label_show_handler_id_;
475+ guint launcher_hide_handler_id_;
476+
477+ bool launcher_open;
478+ bool launcher_keynav;
479+ bool launcher_grabbed;
480+ bool reactivate_keynav;
481+ int reactivate_index;
482+ bool keynav_restore_window_;
483+
484+ UBusManager ubus;
485+
486+ int launcher_key_press_time_;
487+
488+ ui::EdgeBarrierController edge_barriers_;
489+
490+ LauncherList launchers;
491+
492+ sigc::connection on_expoicon_activate_connection_;
493+ sigc::connection launcher_key_press_connection_;
494+ sigc::connection launcher_event_outside_connection_;
495+};
496+
497+} // launcher namespace
498+} // unity namespace
499+
500+#endif
501+>>>>>>> MERGE-SOURCE
502
503=== modified file 'plugins/unityshell/src/unityshell.cpp'
504--- plugins/unityshell/src/unityshell.cpp 2012-08-01 00:58:23 +0000
505+++ plugins/unityshell/src/unityshell.cpp 2012-08-01 00:58:26 +0000
506@@ -515,6 +515,15 @@
507
508 glMatrixMode(GL_MODELVIEW);
509 glPushMatrix();
510+
511+ /* This is needed to Fix a crash in glDrawArrays with the NVIDIA driver
512+ * see bugs #1031554 and #982626.
513+ * The NVIDIA driver looks to see if the legacy GL_VERTEX_ARRAY,
514+ * GL_TEXTURE_COORDINATES_ARRAY and other such client states are enabled
515+ * first before checking if a vertex buffer is bound and will prefer the
516+ * client buffers over the the vertex buffer object. */
517+ glDisableClientState(GL_VERTEX_ARRAY);
518+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
519 #endif
520
521 glGetError();
522@@ -544,6 +553,11 @@
523 glReadBuffer(GL_BACK);
524
525 glPopAttrib();
526+
527+ /* Re-enable the client states that have been disabled in nuxPrologue , for
528+ * NVIDIA compatibility reasons */
529+ glEnableClientState(GL_VERTEX_ARRAY);
530+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
531 #else
532 #ifdef USE_GLES
533 glDepthRangef(0, 1);
534
535=== modified file 'tests/CMakeLists.txt'
536--- tests/CMakeLists.txt 2012-08-01 00:58:23 +0000
537+++ tests/CMakeLists.txt 2012-08-01 00:58:26 +0000
538@@ -254,6 +254,7 @@
539 =======
540 test_im_text_entry.cpp
541 test_hud_view.cpp
542+ test_launcher_controller.cpp
543 test_keyboard_util.cpp
544 test_resultviewgrid.cpp
545 >>>>>>> MERGE-SOURCE
546@@ -355,13 +356,21 @@
547 ${UNITY_SRC}/AbstractPlacesGroup.cpp
548 ${UNITY_SRC}/Animator.cpp
549 ${UNITY_SRC}/BackgroundEffectHelper.cpp
550+ ${UNITY_SRC}/BamfLauncherIcon.cpp
551+ ${UNITY_SRC}/BFBLauncherIcon.cpp
552 ${UNITY_SRC}/CairoBaseWindow.cpp
553 ${UNITY_SRC}/DashSettings.cpp
554 ${UNITY_SRC}/DashStyle.cpp
555 ${UNITY_SRC}/DashViewPrivate.cpp
556 ${UNITY_SRC}/Decaymulator.cpp
557+ ${UNITY_SRC}/DesktopLauncherIcon.cpp
558+ ${UNITY_SRC}/DeviceLauncherIcon.cpp
559+ ${UNITY_SRC}/DeviceLauncherSection.cpp
560+ ${UNITY_SRC}/DevicesSettings.cpp
561 ${UNITY_SRC}/DNDCollectionWindow.cpp
562 ${UNITY_SRC}/DndData.cpp
563+ ${UNITY_SRC}/EdgeBarrierController.cpp
564+ ${UNITY_SRC}/FavoriteStore.cpp
565 ${UNITY_SRC}/GeisAdapter.cpp
566 ${UNITY_SRC}/IconLoader.cpp
567 ${UNITY_SRC}/IconRenderer.cpp
568@@ -374,16 +383,21 @@
569 ${UNITY_SRC}/HudController.cpp
570 ${UNITY_SRC}/HudIcon.cpp
571 ${UNITY_SRC}/HudIconTextureSource.cpp
572+ ${UNITY_SRC}/HudLauncherIcon.cpp
573 ${UNITY_SRC}/HudPrivate.cpp
574 ${UNITY_SRC}/HudView.cpp
575+ ${UNITY_SRC}/IntrospectableWrappers.cpp
576 ${UNITY_SRC}/LayoutSystem.cpp
577 ${UNITY_SRC}/Launcher.cpp
578 ${UNITY_SRC}/LauncherDragWindow.cpp
579+ ${UNITY_SRC}/LauncherController.cpp
580 ${UNITY_SRC}/LauncherEntryRemote.cpp
581+ ${UNITY_SRC}/LauncherEntryRemoteModel.cpp
582 ${UNITY_SRC}/LauncherHideMachine.cpp
583 ${UNITY_SRC}/LauncherHoverMachine.cpp
584 ${UNITY_SRC}/LauncherIcon.cpp
585 ${UNITY_SRC}/LauncherModel.cpp
586+ ${UNITY_SRC}/LauncherOptions.cpp
587 ${UNITY_SRC}/KeyboardUtil.cpp
588 ${UNITY_SRC}/OverlayRenderer.cpp
589 ${UNITY_SRC}/JSONParser.cpp
590@@ -407,6 +421,7 @@
591 ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
592 ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
593 ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
594+ ${UNITY_SRC}/SoftwareCenterLauncherIcon.cpp
595 ${UNITY_SRC}/SpacerLauncherIcon.cpp
596 ${UNITY_SRC}/TextureCache.cpp
597 ${UNITY_SRC}/UBusWrapper.cpp
598@@ -418,7 +433,7 @@
599 ${UNITY_SRC}/ResultView.cpp
600 ${UNITY_SRC}/ResultViewGrid.cpp
601 ${UNITY_SRC}/ResultRenderer.cpp
602- ${UNITY_SRC}/IntrospectableWrappers.cpp
603+ ${UNITY_SRC}/TrashLauncherIcon.cpp
604 >>>>>>> MERGE-SOURCE
605 )
606 target_link_libraries(test-gtest gtest gmock ${LIBS})
607
608=== modified file 'tests/test_launcher_controller.cpp'
609--- tests/test_launcher_controller.cpp 2012-07-26 13:09:16 +0000
610+++ tests/test_launcher_controller.cpp 2012-08-01 00:58:26 +0000
611@@ -1,3 +1,4 @@
612+<<<<<<< TREE
613 /*
614 * Copyright 2012 Canonical Ltd.
615 *
616@@ -200,3 +201,207 @@
617 }
618
619 }
620+=======
621+/*
622+ * Copyright 2012 Canonical Ltd.
623+ *
624+ * This program is free software: you can redistribute it and/or modify it
625+ * under the terms of the GNU General Public License version 3, as published
626+ * by the Free Software Foundation.
627+ *
628+ * This program is distributed in the hope that it will be useful, but
629+ * WITHOUT ANY WARRANTY; without even the implied warranties of
630+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
631+ * PURPOSE. See the GNU General Public License for more details.
632+ *
633+ * You should have received a copy of the GNU General Public License
634+ * version 3 along with this program. If not, see
635+ * <http://www.gnu.org/licenses/>
636+ *
637+ * Authored by: Marco Trevisan (Treviño) <marco.trevisan@canonical.com>
638+ */
639+
640+#include <gmock/gmock.h>
641+#include "test_uscreen_mock.h"
642+
643+#include "FavoriteStore.h"
644+#include "LauncherController.h"
645+#include "LauncherControllerPrivate.h"
646+#include "PanelStyle.h"
647+#include "DashSettings.h"
648+
649+using namespace unity::launcher;
650+using namespace testing;
651+
652+namespace unity
653+{
654+
655+class MockFavoriteStore : public FavoriteStore
656+{
657+public:
658+ FavoriteList const& GetFavorites()
659+ {
660+ return fav_list_;
661+ };
662+
663+ void AddFavorite(std::string const& desktop_path, int position) {};
664+ void RemoveFavorite(std::string const& desktop_path) {};
665+ void MoveFavorite(std::string const& desktop_path, int position) {};
666+ void SetFavorites(FavoriteList const& desktop_paths) {};
667+
668+private:
669+ FavoriteList fav_list_;
670+};
671+
672+namespace launcher
673+{
674+class TestLauncherController : public testing::Test
675+{
676+public:
677+ TestLauncherController()
678+ : lc(nux::GetGraphicsDisplay()->GetX11Display())
679+ {}
680+
681+ virtual void SetUp()
682+ {
683+ lc.options = std::make_shared<Options>();
684+ lc.multiple_launchers = true;
685+ }
686+
687+protected:
688+ ui::EdgeBarrierController &GetBarrierController()
689+ {
690+ return lc.pimpl->edge_barriers_;
691+ }
692+
693+ MockUScreen uscreen;
694+ dash::Settings settings;
695+ panel::Style panel_style;
696+ GeisAdapter geis_adapter;
697+ MockFavoriteStore favorite_store;
698+ Controller lc;
699+};
700+}
701+
702+TEST_F(TestLauncherController, Construction)
703+{
704+ EXPECT_NE(lc.options(), nullptr);
705+ EXPECT_TRUE(lc.multiple_launchers());
706+}
707+
708+TEST_F(TestLauncherController, MultimonitorMultipleLaunchers)
709+{
710+ lc.multiple_launchers = true;
711+ uscreen.SetupFakeMultiMonitor();
712+
713+ ASSERT_EQ(lc.launchers().size(), max_num_monitors);
714+
715+ for (int i = 0; i < max_num_monitors; ++i)
716+ {
717+ EXPECT_EQ(lc.launchers()[i]->monitor(), i);
718+ }
719+}
720+
721+TEST_F(TestLauncherController, MultimonitorSingleLauncher)
722+{
723+ lc.multiple_launchers = false;
724+ uscreen.SetupFakeMultiMonitor(0, false);
725+
726+ for (int i = 0; i < max_num_monitors; ++i)
727+ {
728+ uscreen.SetPrimary(i);
729+ ASSERT_EQ(lc.launchers().size(), 1);
730+ EXPECT_EQ(lc.launcher().monitor(), i);
731+ }
732+}
733+
734+TEST_F(TestLauncherController, MultimonitorSwitchToMultipleLaunchers)
735+{
736+ lc.multiple_launchers = false;
737+ uscreen.SetupFakeMultiMonitor();
738+
739+ ASSERT_EQ(lc.launchers().size(), 1);
740+
741+ lc.multiple_launchers = true;
742+ EXPECT_EQ(lc.launchers().size(), max_num_monitors);
743+}
744+
745+TEST_F(TestLauncherController, MultimonitorSwitchToSingleLauncher)
746+{
747+ lc.multiple_launchers = true;
748+ int primary = 3;
749+ uscreen.SetupFakeMultiMonitor(primary);
750+
751+ ASSERT_EQ(lc.launchers().size(), max_num_monitors);
752+
753+ lc.multiple_launchers = false;
754+ EXPECT_EQ(lc.launchers().size(), 1);
755+ EXPECT_EQ(lc.launcher().monitor(), primary);
756+}
757+
758+TEST_F(TestLauncherController, MultimonitorSwitchToSingleMonitor)
759+{
760+ uscreen.SetupFakeMultiMonitor();
761+ ASSERT_EQ(lc.launchers().size(), max_num_monitors);
762+
763+ uscreen.Reset();
764+ EXPECT_EQ(lc.launchers().size(), 1);
765+ EXPECT_EQ(lc.launcher().monitor(), 0);
766+}
767+
768+TEST_F(TestLauncherController, MultimonitorRemoveMiddleMonitor)
769+{
770+ uscreen.SetupFakeMultiMonitor();
771+ ASSERT_EQ(lc.launchers().size(), max_num_monitors);
772+
773+ std::vector<nux::Geometry> &monitors = uscreen.GetMonitors();
774+ monitors.erase(monitors.begin() + monitors.size()/2);
775+ uscreen.changed.emit(uscreen.GetPrimaryMonitor(), uscreen.GetMonitors());
776+ ASSERT_EQ(lc.launchers().size(), max_num_monitors - 1);
777+
778+ for (int i = 0; i < max_num_monitors - 1; ++i)
779+ EXPECT_EQ(lc.launchers()[i]->monitor(), i);
780+}
781+
782+TEST_F(TestLauncherController, SingleMonitorSwitchToMultimonitor)
783+{
784+ ASSERT_EQ(lc.launchers().size(), 1);
785+
786+ uscreen.SetupFakeMultiMonitor();
787+
788+ EXPECT_EQ(lc.launchers().size(), max_num_monitors);
789+}
790+
791+TEST_F(TestLauncherController, MultiMonitorEdgeBarrierSubscriptions)
792+{
793+ uscreen.SetupFakeMultiMonitor();
794+
795+ for (int i = 0; i < max_num_monitors; ++i)
796+ ASSERT_EQ(GetBarrierController().GetSubscriber(i), lc.launchers()[i].GetPointer());
797+}
798+
799+TEST_F(TestLauncherController, SingleMonitorEdgeBarrierSubscriptionsUpdates)
800+{
801+ lc.multiple_launchers = false;
802+ uscreen.SetupFakeMultiMonitor(0, false);
803+
804+ for (int i = 0; i < max_num_monitors; ++i)
805+ {
806+ uscreen.SetPrimary(i);
807+
808+ for (int j = 0; j < max_num_monitors; ++j)
809+ {
810+ if (j == i)
811+ {
812+ ASSERT_EQ(GetBarrierController().GetSubscriber(j), &lc.launcher());
813+ }
814+ else
815+ {
816+ ASSERT_EQ(GetBarrierController().GetSubscriber(j), nullptr);
817+ }
818+ }
819+ }
820+}
821+
822+}
823+>>>>>>> MERGE-SOURCE
824
825=== modified file 'unity-shared/UScreen.cpp'
826--- unity-shared/UScreen.cpp 2012-08-01 00:58:23 +0000
827+++ unity-shared/UScreen.cpp 2012-08-01 00:58:26 +0000
828@@ -37,9 +37,10 @@
829
830 namespace
831 {
832-static UScreen* default_screen_ = nullptr;
833 nux::logging::Logger logger("unity.screen");
834 }
835+
836+UScreen* UScreen::default_screen_ = nullptr;
837 >>>>>>> MERGE-SOURCE
838
839 UScreen::UScreen()
840@@ -51,13 +52,13 @@
841 "org.freedesktop.UPower",
842 G_BUS_TYPE_SYSTEM)
843 =======
844- : screen_(gdk_screen_get_default(), glib::AddRef())
845+ : primary_(0)
846+ , screen_(gdk_screen_get_default(), glib::AddRef())
847 , proxy_("org.freedesktop.UPower",
848 "/org/freedesktop/UPower",
849 "org.freedesktop.UPower",
850 G_BUS_TYPE_SYSTEM)
851 , refresh_id_(0)
852- , primary_(0)
853 >>>>>>> MERGE-SOURCE
854 {
855 size_changed_signal_.Connect(screen_, "size-changed", sigc::mem_fun(this, &UScreen::Changed));
856
857=== modified file 'unity-shared/UScreen.h'
858--- unity-shared/UScreen.h 2012-08-01 00:58:23 +0000
859+++ unity-shared/UScreen.h 2012-08-01 00:58:26 +0000
860@@ -64,19 +64,9 @@
861 void Changed(GdkScreen* screen);
862 void Refresh();
863
864-<<<<<<< TREE
865 protected:
866 static UScreen* default_screen_;
867 std::vector<nux::Geometry> monitors_;
868-=======
869-private:
870- std::vector<nux::Geometry> monitors_;
871- glib::Object<GdkScreen> screen_;
872- glib::DBusProxy proxy_;
873- glib::Signal<void, GdkScreen*> size_changed_signal_;
874- glib::Signal<void, GdkScreen*> monitors_changed_signal_;
875- guint refresh_id_;
876->>>>>>> MERGE-SOURCE
877 int primary_;
878 <<<<<<< TREE
879
880@@ -87,6 +77,13 @@
881 glib::Signal<void, GdkScreen*> monitors_changed_signal_;
882 glib::Source::UniquePtr refresh_idle_;
883 =======
884+
885+private:
886+ glib::Object<GdkScreen> screen_;
887+ glib::DBusProxy proxy_;
888+ glib::Signal<void, GdkScreen*> size_changed_signal_;
889+ glib::Signal<void, GdkScreen*> monitors_changed_signal_;
890+ guint refresh_id_;
891 >>>>>>> MERGE-SOURCE
892 };
893