Merge lp:~mhr3/unity/no-zero-timeouts into lp:unity

Proposed by Michal Hruby
Status: Merged
Merged at revision: 1739
Proposed branch: lp:~mhr3/unity/no-zero-timeouts
Merge into: lp:unity
Diff against target: 138 lines (+11/-11)
10 files modified
UnityCore/DBusIndicators.cpp (+1/-1)
plugins/unityshell/src/BGHash.cpp (+1/-1)
plugins/unityshell/src/HomeView.cpp (+1/-1)
plugins/unityshell/src/Launcher.cpp (+1/-1)
plugins/unityshell/src/LauncherHideMachine.cpp (+1/-1)
plugins/unityshell/src/LauncherHoverMachine.cpp (+1/-1)
plugins/unityshell/src/LensView.cpp (+1/-1)
plugins/unityshell/src/ResultViewGrid.cpp (+1/-1)
plugins/unityshell/src/SwitcherView.cpp (+1/-1)
plugins/unityshell/src/unityshell.cpp (+2/-2)
To merge this branch: bzr merge lp:~mhr3/unity/no-zero-timeouts
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Robert Carr (community) Approve
Review via email: mp+82186@code.launchpad.net

Description of the change

Using g_timeout_add (0, ...) is just evil, let's get rid of that...

To post a comment you must log in.
Revision history for this message
Robert Carr (robertcarr) wrote :

Seems sensical to me :)

review: Approve
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Agree.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UnityCore/DBusIndicators.cpp'
2--- UnityCore/DBusIndicators.cpp 2011-09-13 13:48:56 +0000
3+++ UnityCore/DBusIndicators.cpp 2011-11-14 16:43:39 +0000
4@@ -227,7 +227,7 @@
5 data->timestamp = timestamp;
6 data->button = button;
7
8- g_timeout_add(0, (GSourceFunc)send_show_entry, data);
9+ g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc)send_show_entry, data, NULL);
10 }
11
12 void DBusIndicators::Impl::OnEntrySecondaryActivate(std::string const& entry_id,
13
14=== modified file 'plugins/unityshell/src/BGHash.cpp'
15--- plugins/unityshell/src/BGHash.cpp 2011-10-21 15:56:58 +0000
16+++ plugins/unityshell/src/BGHash.cpp 2011-11-14 16:43:39 +0000
17@@ -72,7 +72,7 @@
18 glib::Object<GdkPixbuf> pixbuf(GetPixbufFromBG());
19 LoadPixbufToHash(pixbuf);
20
21- g_timeout_add (0, (GSourceFunc)ForceUpdate, (gpointer)this);
22+ g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc)ForceUpdate, (gpointer)this, NULL);
23
24 // avoids making a new object method when all we are doing is
25 // calling a method with no logic
26
27=== modified file 'plugins/unityshell/src/HomeView.cpp'
28--- plugins/unityshell/src/HomeView.cpp 2011-10-25 16:32:49 +0000
29+++ plugins/unityshell/src/HomeView.cpp 2011-11-14 16:43:39 +0000
30@@ -171,7 +171,7 @@
31 if (fix_renderering_id_)
32 return;
33
34- fix_renderering_id_ = g_timeout_add(0, (GSourceFunc)FixRenderering, this);
35+ fix_renderering_id_ = g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc)FixRenderering, this, NULL);
36 }
37
38 gboolean HomeView::FixRenderering(HomeView* self)
39
40=== modified file 'plugins/unityshell/src/Launcher.cpp'
41--- plugins/unityshell/src/Launcher.cpp 2011-11-08 19:41:00 +0000
42+++ plugins/unityshell/src/Launcher.cpp 2011-11-14 16:43:39 +0000
43@@ -2058,7 +2058,7 @@
44
45 // rely on the compiz event loop to come back to us in a nice throttling
46 if (AnimationInProgress())
47- _launcher_animation_timeout = g_timeout_add(0, &Launcher::AnimationTimeout, this);
48+ _launcher_animation_timeout = g_idle_add_full (G_PRIORITY_DEFAULT, &Launcher::AnimationTimeout, this, NULL);
49
50 nux::ROPConfig ROP;
51 ROP.Blend = false;
52
53=== modified file 'plugins/unityshell/src/LauncherHideMachine.cpp'
54--- plugins/unityshell/src/LauncherHideMachine.cpp 2011-09-06 18:30:26 +0000
55+++ plugins/unityshell/src/LauncherHideMachine.cpp 2011-11-14 16:43:39 +0000
56@@ -77,7 +77,7 @@
57
58 if (_hide_changed_emit_handle)
59 g_source_remove(_hide_changed_emit_handle);
60- _hide_changed_emit_handle = g_timeout_add(0, &EmitShouldHideChanged, this);
61+ _hide_changed_emit_handle = g_idle_add_full (G_PRIORITY_DEFAULT, &EmitShouldHideChanged, this, NULL);
62 }
63 }
64
65
66=== modified file 'plugins/unityshell/src/LauncherHoverMachine.cpp'
67--- plugins/unityshell/src/LauncherHoverMachine.cpp 2011-09-08 02:02:09 +0000
68+++ plugins/unityshell/src/LauncherHoverMachine.cpp 2011-11-14 16:43:39 +0000
69@@ -79,7 +79,7 @@
70
71 if (_hover_changed_emit_handle)
72 g_source_remove(_hover_changed_emit_handle);
73- _hover_changed_emit_handle = g_timeout_add(0, &EmitShouldHoverChanged, this);
74+ _hover_changed_emit_handle = g_idle_add_full (G_PRIORITY_DEFAULT, &EmitShouldHoverChanged, this, NULL);
75 }
76
77 gboolean
78
79=== modified file 'plugins/unityshell/src/LensView.cpp'
80--- plugins/unityshell/src/LensView.cpp 2011-10-25 16:32:49 +0000
81+++ plugins/unityshell/src/LensView.cpp 2011-11-14 16:43:39 +0000
82@@ -289,7 +289,7 @@
83 if (fix_renderering_id_)
84 return;
85
86- fix_renderering_id_ = g_timeout_add(0, (GSourceFunc)FixRenderering, this);
87+ fix_renderering_id_ = g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc)FixRenderering, this, NULL);
88 }
89
90 gboolean LensView::FixRenderering(LensView* self)
91
92=== modified file 'plugins/unityshell/src/ResultViewGrid.cpp'
93--- plugins/unityshell/src/ResultViewGrid.cpp 2011-10-11 18:18:13 +0000
94+++ plugins/unityshell/src/ResultViewGrid.cpp 2011-11-14 16:43:39 +0000
95@@ -125,7 +125,7 @@
96 {
97 if (lazy_load_handle_ == 0)
98 {
99- lazy_load_handle_ = g_timeout_add(0, (GSourceFunc)(&ResultViewGrid::OnLazyLoad), this);
100+ lazy_load_handle_ = g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc)(&ResultViewGrid::OnLazyLoad), this, NULL);
101 }
102 last_lazy_loaded_result_ = 0; // we always want to reset the lazy load index here
103 }
104
105=== modified file 'plugins/unityshell/src/SwitcherView.cpp'
106--- plugins/unityshell/src/SwitcherView.cpp 2011-10-25 17:00:12 +0000
107+++ plugins/unityshell/src/SwitcherView.cpp 2011-11-14 16:43:39 +0000
108@@ -779,7 +779,7 @@
109 int ms_since_change = TimeUtil::TimeDelta(&current, &save_time_);
110
111 if (ms_since_change < animation_length && redraw_handle_ == 0)
112- redraw_handle_ = g_timeout_add(0, &SwitcherView::OnDrawTimeout, this);
113+ redraw_handle_ = g_idle_add_full (G_PRIORITY_DEFAULT, &SwitcherView::OnDrawTimeout, this, NULL);
114
115 animation_draw_ = false;
116 }
117
118=== modified file 'plugins/unityshell/src/unityshell.cpp'
119--- plugins/unityshell/src/unityshell.cpp 2011-11-02 16:42:28 +0000
120+++ plugins/unityshell/src/unityshell.cpp 2011-11-14 16:43:39 +0000
121@@ -292,7 +292,7 @@
122 (UBusCallback)&UnityScreen::OnQuicklistEndKeyNav,
123 this);
124
125- g_timeout_add(0, &UnityScreen::initPluginActions, this);
126+ g_idle_add_full (G_PRIORITY_DEFAULT, &UnityScreen::initPluginActions, this, NULL);
127 super_keypressed_ = false;
128
129 GeisAdapter::Default()->Run();
130@@ -1977,7 +1977,7 @@
131 if (_in_paint)
132 {
133 if (!_redraw_handle)
134- _redraw_handle = g_timeout_add (0, &UnityScreen::OnRedrawTimeout, this);
135+ _redraw_handle = g_idle_add_full (G_PRIORITY_DEFAULT, &UnityScreen::OnRedrawTimeout, this, NULL);
136 }
137 else
138 {