Merge lp:~cimi/notify-osd/no-deprecated-functions into lp:~canonical-dx-team/notify-osd/precise

Proposed by Andrea Cimitan
Status: Needs review
Proposed branch: lp:~cimi/notify-osd/no-deprecated-functions
Merge into: lp:~canonical-dx-team/notify-osd/precise
Diff against target: 136 lines (+36/-16)
5 files modified
egg/egg-timeout-pool.c (+7/-8)
src/bubble.c (+8/-1)
src/defaults.c (+5/-5)
tests/test-grow-bubble.c (+8/-1)
tests/test-scroll-text.c (+8/-1)
To merge this branch: bzr merge lp:~cimi/notify-osd/no-deprecated-functions
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
jenkins (community) continuous-integration Approve
Mirco Müller (community) Needs Fixing
Review via email: mp+100412@code.launchpad.net

Description of the change

Use the proper not-deprecated functions.

Please make sure egg_timeout_pool_get_ticks is returning the difference with the required scale, since I didn't pay much attention in the right conversion.

To post a comment you must log in.
Revision history for this message
Mirco Müller (macslow) wrote :

Your branch is breaking the timing calculations. Very obvious e.g. in the much too short throbbing animation of the volume over- and undershoot animations.

review: Needs Fixing
Revision history for this message
Andrea Cimitan (cimi) wrote :

Exactly as I said in the description: egg_timeout_pool_get_ticks needs the right scale, could you please help me on that? I will multiply the value returned by the function.

Revision history for this message
Mirco Müller (macslow) wrote :

Dash corners first :) So either this evening or tomorrow.

Revision history for this message
Andrea Cimitan (cimi) wrote :

Indeed, while the color branch has to come in 12.04, this could be added to trunk for 12.10 branch

Revision history for this message
jenkins (martin-mrazik+qa) wrote :

PASSED: Continuous integration, rev:457
http://s-jenkins:8080/job/notify-osd-ci/1/

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

457. By Andrea Cimitan

Don't use deprecated functions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'egg/egg-timeout-pool.c'
2--- egg/egg-timeout-pool.c 2009-02-06 11:12:41 +0000
3+++ egg/egg-timeout-pool.c 2012-04-02 13:47:22 +0000
4@@ -63,7 +63,7 @@
5
6 guint next_id;
7
8- GTimeVal start_time;
9+ guint64 start_time;
10 GList *timeouts, *dispatched_timeouts;
11 gint ready;
12
13@@ -127,12 +127,11 @@
14 static guint
15 egg_timeout_pool_get_ticks (EggTimeoutPool *pool)
16 {
17- GTimeVal time_now;
18-
19- g_source_get_current_time ((GSource *) pool, &time_now);
20-
21- return (time_now.tv_sec - pool->start_time.tv_sec) * 1000
22- + (time_now.tv_usec - pool->start_time.tv_usec) / 1000;
23+ gint64 time_now;
24+
25+ time_now = g_source_get_time ((GSource *) pool);
26+
27+ return time_now - pool->start_time;
28 }
29
30 static gboolean
31@@ -448,7 +447,7 @@
32
33 pool = (EggTimeoutPool *) source;
34
35- g_get_current_time (&pool->start_time);
36+ pool->start_time = g_get_monotonic_time ();
37 pool->next_id = 1;
38 pool->id = g_source_attach (source, NULL);
39
40
41=== modified file 'src/bubble.c'
42--- src/bubble.c 2012-03-09 21:20:47 +0000
43+++ src/bubble.c 2012-04-02 13:47:22 +0000
44@@ -1864,10 +1864,17 @@
45
46 if (gtk_widget_get_realized (window))
47 {
48+ GdkDeviceManager *device_manager;
49+ GdkDevice *device;
50+ GdkWindow *widget_window;
51 gint distance_x = 0;
52 gint distance_y = 0;
53
54- gtk_widget_get_pointer (window, &pointer_rel_x, &pointer_rel_y);
55+ widget_window = gtk_widget_get_window (window);
56+ device_manager = gdk_display_get_device_manager (gdk_window_get_display (widget_window));
57+ device = gdk_device_manager_get_client_pointer (device_manager);
58+
59+ gdk_window_get_device_position (widget_window, device, &pointer_rel_x, &pointer_rel_y, NULL);
60 gtk_window_get_position (GTK_WINDOW (window), &win_x, &win_y);
61 pointer_abs_x = win_x + pointer_rel_x;
62 pointer_abs_y = win_y + pointer_rel_y;
63
64=== modified file 'src/defaults.c'
65--- src/defaults.c 2012-03-23 11:04:46 +0000
66+++ src/defaults.c 2012-04-02 13:47:22 +0000
67@@ -2212,6 +2212,8 @@
68 GdkScreen* screen = NULL;
69 GdkWindow* active_window = NULL;
70 GdkWindow* panel_window = NULL;
71+ GdkDeviceManager* device_manager = NULL;
72+ GdkDevice* device = NULL;
73 gint mx;
74 gint my;
75 gint monitor = 0;
76@@ -2222,11 +2224,9 @@
77
78 g_return_if_fail (self != NULL && IS_DEFAULTS (self));
79
80- gdk_display_get_pointer (gdk_display_get_default (),
81- &screen,
82- &mx,
83- &my,
84- NULL);
85+ device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
86+ device = gdk_device_manager_get_client_pointer (device_manager);
87+ gdk_device_get_position (device, &screen, &mx, &my);
88
89 panel_window = get_panel_window ();
90
91
92=== modified file 'tests/test-grow-bubble.c'
93--- tests/test-grow-bubble.c 2011-07-08 08:34:52 +0000
94+++ tests/test-grow-bubble.c 2012-04-02 13:47:22 +0000
95@@ -482,10 +482,17 @@
96
97 if (gtk_widget_get_realized (window))
98 {
99+ GdkDeviceManager *device_manager;
100+ GdkDevice *device;
101+ GdkWindow *widget_window;
102 gint distance_x = 0;
103 gint distance_y = 0;
104
105- gtk_widget_get_pointer (window, &pointer_rel_x, &pointer_rel_y);
106+ widget_window = gtk_widget_get_window (window);
107+ device_manager = gdk_display_get_device_manager (gdk_window_get_display (widget_window));
108+ device = gdk_device_manager_get_client_pointer (device_manager);
109+
110+ gdk_window_get_device_position (widget_window, device, &pointer_rel_x, &pointer_rel_y, NULL);
111 gtk_window_get_position (GTK_WINDOW (window), &win_x, &win_y);
112 pointer_abs_x = win_x + pointer_rel_x;
113 pointer_abs_y = win_y + pointer_rel_y;
114
115=== modified file 'tests/test-scroll-text.c'
116--- tests/test-scroll-text.c 2011-07-08 08:34:52 +0000
117+++ tests/test-scroll-text.c 2012-04-02 13:47:22 +0000
118@@ -542,10 +542,17 @@
119
120 if (gtk_widget_get_realized (window))
121 {
122+ GdkDeviceManager *device_manager;
123+ GdkDevice *device;
124+ GdkWindow *widget_window;
125 gint distance_x = 0;
126 gint distance_y = 0;
127
128- gtk_widget_get_pointer (window, &pointer_rel_x, &pointer_rel_y);
129+ widget_window = gtk_widget_get_window (window);
130+ device_manager = gdk_display_get_device_manager (gdk_window_get_display (widget_window));
131+ device = gdk_device_manager_get_client_pointer (device_manager);
132+
133+ gdk_window_get_device_position (widget_window, device, &pointer_rel_x, &pointer_rel_y, NULL);
134 gtk_window_get_position (GTK_WINDOW (window), &win_x, &win_y);
135 pointer_abs_x = win_x + pointer_rel_x;
136 pointer_abs_y = win_y + pointer_rel_y;

Subscribers

People subscribed via source and target branches