Merge lp:~mterry/notify-osd/deprecations into lp:notify-osd/lucid

Proposed by Michael Terry
Status: Merged
Merged at revision: 427
Proposed branch: lp:~mterry/notify-osd/deprecations
Merge into: lp:notify-osd/lucid
Diff against target: 699 lines (+149/-130)
9 files modified
configure.in (+10/-1)
src/bubble-window-accessible.c (+31/-33)
src/bubble.c (+24/-24)
src/defaults.c (+4/-2)
src/dialog.c (+0/-1)
tests/test-dnd.c (+1/-1)
tests/test-grow-bubble.c (+43/-37)
tests/test-scroll-text.c (+35/-30)
tests/test-tile.c (+1/-1)
To merge this branch: bzr merge lp:~mterry/notify-osd/deprecations
Reviewer Review Type Date Requested Status
David Barth (community) Approve
Review via email: mp+37645@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) wrote :

+1 thanks for the fix

Revision history for this message
David Barth (dbarth) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.in'
--- configure.in 2010-04-08 08:15:40 +0000
+++ configure.in 2010-10-05 17:57:15 +0000
@@ -59,7 +59,7 @@
5959
6060
61PKG_CHECK_MODULES(notify_osd, 61PKG_CHECK_MODULES(notify_osd,
62 gtk+-2.0 >= 2.14)62 gtk+-2.0 >= 2.22)
63AC_SUBST(NOTIFY_OSD_CFLAGS)63AC_SUBST(NOTIFY_OSD_CFLAGS)
64AC_SUBST(NOTIFY_OSD_LIBS)64AC_SUBST(NOTIFY_OSD_LIBS)
6565
@@ -128,6 +128,15 @@
128dnl CFLAGS128dnl CFLAGS
129CFLAGS="$CFLAGS -Wall"129CFLAGS="$CFLAGS -Wall"
130130
131AC_ARG_ENABLE([deprecations],
132 [AS_HELP_STRING([--enable-deprecations],
133 [allow deprecated API usage @<:@default=yes@:>@])],
134 [],
135 [enable_deprecations=yes])
136AS_IF([test "x$enable_deprecations" = xno],
137 [CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE"]
138)
139
131AC_OUTPUT([140AC_OUTPUT([
132Makefile141Makefile
133src/Makefile142src/Makefile
134143
=== modified file 'src/bubble-window-accessible.c'
--- src/bubble-window-accessible.c 2009-08-14 14:03:20 +0000
+++ src/bubble-window-accessible.c 2010-10-05 17:57:15 +0000
@@ -211,14 +211,12 @@
211{211{
212 GObject *object;212 GObject *object;
213 AtkObject *aobj;213 AtkObject *aobj;
214 GtkAccessible *gtk_accessible;
215 214
216 object = g_object_new (BUBBLE_WINDOW_TYPE_ACCESSIBLE, NULL);215 object = g_object_new (BUBBLE_WINDOW_TYPE_ACCESSIBLE, NULL);
217 216
218 aobj = ATK_OBJECT (object);217 aobj = ATK_OBJECT (object);
219 218
220 gtk_accessible = GTK_ACCESSIBLE (aobj);219 gtk_accessible_set_widget (GTK_ACCESSIBLE (aobj), widget);
221 gtk_accessible->widget = widget;
222 220
223 atk_object_initialize (aobj, widget);221 atk_object_initialize (aobj, widget);
224 222
@@ -228,18 +226,18 @@
228static const char* 226static const char*
229bubble_window_accessible_get_name (AtkObject* obj)227bubble_window_accessible_get_name (AtkObject* obj)
230{228{
231 GtkAccessible* accessible;229 GtkWidget* widget;
232 Bubble* bubble;230 Bubble* bubble;
233 const gchar* title;231 const gchar* title;
234 232
235 g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), "");233 g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), "");
236 234
237 accessible = GTK_ACCESSIBLE (obj);235 widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
238 236
239 if (accessible->widget == NULL)237 if (widget == NULL)
240 return "";238 return "";
241 239
242 bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble");240 bubble = g_object_get_data (G_OBJECT (widget), "bubble");
243241
244 g_return_val_if_fail (IS_BUBBLE (bubble), "");242 g_return_val_if_fail (IS_BUBBLE (bubble), "");
245 243
@@ -264,17 +262,17 @@
264static const char*262static const char*
265bubble_window_accessible_get_description (AtkObject* obj)263bubble_window_accessible_get_description (AtkObject* obj)
266{264{
267 GtkAccessible *accessible;265 GtkWidget *widget;
268 Bubble *bubble;266 Bubble *bubble;
269 267
270 g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), "");268 g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), "");
271 269
272 accessible = GTK_ACCESSIBLE (obj);270 widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
273 271
274 if (accessible->widget == NULL)272 if (widget == NULL)
275 return "";273 return "";
276 274
277 bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble");275 bubble = g_object_get_data (G_OBJECT (widget), "bubble");
278276
279 g_return_val_if_fail (IS_BUBBLE (bubble), "");277 g_return_val_if_fail (IS_BUBBLE (bubble), "");
280 278
@@ -286,18 +284,18 @@
286 GValue* value)284 GValue* value)
287{285{
288 gdouble current_value;286 gdouble current_value;
289 GtkAccessible* accessible;287 GtkWidget* widget;
290 Bubble* bubble;288 Bubble* bubble;
291 289
292 g_return_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj));290 g_return_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj));
293 291
294 accessible = GTK_ACCESSIBLE (obj);292 widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
295 293
296 if (accessible->widget == NULL)294 if (widget == NULL)
297 return;295 return;
298 296
299 bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble");297 bubble = g_object_get_data (G_OBJECT (widget), "bubble");
300 298
301 current_value = (gdouble) bubble_get_value(bubble);299 current_value = (gdouble) bubble_get_value(bubble);
302 300
303 memset (value, 0, sizeof (GValue));301 memset (value, 0, sizeof (GValue));
@@ -361,7 +359,7 @@
361 gint start_offset,359 gint start_offset,
362 gint end_offset)360 gint end_offset)
363{361{
364 GtkAccessible* accessible;362 GtkWidget* widget;
365 Bubble* bubble;363 Bubble* bubble;
366 const gchar* body_text;364 const gchar* body_text;
367 gsize char_length;365 gsize char_length;
@@ -369,11 +367,11 @@
369367
370 g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), g_strdup(""));368 g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), g_strdup(""));
371369
372 accessible = GTK_ACCESSIBLE (obj);370 widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
373371
374 g_return_val_if_fail (GTK_IS_WINDOW (accessible->widget), g_strdup(""));372 g_return_val_if_fail (GTK_IS_WINDOW (widget), g_strdup(""));
375 373
376 bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble");374 bubble = g_object_get_data (G_OBJECT(widget), "bubble");
377375
378 if (end_offset <= start_offset)376 if (end_offset <= start_offset)
379 return g_strdup("");377 return g_strdup("");
@@ -399,17 +397,17 @@
399static gint397static gint
400bubble_window_get_character_count (AtkText *obj)398bubble_window_get_character_count (AtkText *obj)
401{399{
402 GtkAccessible* accessible;400 GtkWidget* widget;
403 Bubble* bubble;401 Bubble* bubble;
404402
405 g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), 0);403 g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), 0);
406 404
407 accessible = GTK_ACCESSIBLE (obj);405 widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
408 406
409 if (accessible->widget == NULL)407 if (widget == NULL)
410 return 0;408 return 0;
411 409
412 bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble");410 bubble = g_object_get_data (G_OBJECT (widget), "bubble");
413411
414 return g_utf8_strlen(bubble_get_message_body (bubble), -1);412 return g_utf8_strlen(bubble_get_message_body (bubble), -1);
415}413}
@@ -418,18 +416,18 @@
418bubble_window_get_character_at_offset (AtkText *obj,416bubble_window_get_character_at_offset (AtkText *obj,
419 gint offset)417 gint offset)
420{418{
421 GtkAccessible* accessible;419 GtkWidget* widget;
422 Bubble* bubble;420 Bubble* bubble;
423 const gchar* body_text;421 const gchar* body_text;
424422
425 g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), 0);423 g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), 0);
426 424
427 accessible = GTK_ACCESSIBLE (obj);425 widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
428 426
429 if (accessible->widget == NULL)427 if (widget == NULL)
430 return 0;428 return 0;
431 429
432 bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble");430 bubble = g_object_get_data (G_OBJECT (widget), "bubble");
433431
434 body_text = bubble_get_message_body (bubble);432 body_text = bubble_get_message_body (bubble);
435433
436434
=== modified file 'src/bubble.c'
--- src/bubble.c 2010-04-14 10:04:26 +0000
+++ src/bubble.c 2010-10-05 17:57:15 +0000
@@ -1530,32 +1530,32 @@
1530 gint shadow_size)1530 gint shadow_size)
1531{1531{
1532 glong data[8];1532 glong data[8];
1533 gint width;1533 GtkAllocation a;
1534 gint height;1534 GdkWindow *gdkwindow;
15351535
1536 // sanity check1536 // sanity check
1537 if (!window)1537 if (!window)
1538 return;1538 return;
15391539
1540 width = window->allocation.width;1540 gtk_widget_get_allocation (window, &a);
1541 height = window->allocation.height;1541 gdkwindow = gtk_widget_get_window (window);
15421542
1543 // this is meant to tell the blur-plugin what and how to blur, somehow1543 // this is meant to tell the blur-plugin what and how to blur, somehow
1544 // the y-coords are interpreted as being CenterGravity, I wonder why1544 // the y-coords are interpreted as being CenterGravity, I wonder why
1545 data[0] = 2; // threshold1545 data[0] = 2; // threshold
1546 data[1] = 0; // filter1546 data[1] = 0; // filter
1547 data[2] = NorthWestGravity; // gravity of top-left1547 data[2] = NorthWestGravity; // gravity of top-left
1548 data[3] = shadow_size; // x-coord of top-left1548 data[3] = shadow_size; // x-coord of top-left
1549 data[4] = (-height / 2) + shadow_size; // y-coord of top-left1549 data[4] = (-a.height / 2) + shadow_size; // y-coord of top-left
1550 data[5] = NorthWestGravity; // gravity of bottom-right1550 data[5] = NorthWestGravity; // gravity of bottom-right
1551 data[6] = width - shadow_size; // bottom-right x-coord1551 data[6] = a.width - shadow_size; // bottom-right x-coord
1552 data[7] = (height / 2) - shadow_size; // bottom-right y-coord1552 data[7] = (a.height / 2) - shadow_size; // bottom-right y-coord
15531553
1554 if (set_blur)1554 if (set_blur)
1555 {1555 {
1556 XChangeProperty (GDK_WINDOW_XDISPLAY (window->window),1556 XChangeProperty (GDK_WINDOW_XDISPLAY (gdkwindow),
1557 GDK_WINDOW_XID (window->window),1557 GDK_WINDOW_XID (gdkwindow),
1558 XInternAtom (GDK_WINDOW_XDISPLAY (window->window),1558 XInternAtom (GDK_WINDOW_XDISPLAY (gdkwindow),
1559 "_COMPIZ_WM_WINDOW_BLUR",1559 "_COMPIZ_WM_WINDOW_BLUR",
1560 FALSE),1560 FALSE),
1561 XA_INTEGER,1561 XA_INTEGER,
@@ -1566,9 +1566,9 @@
1566 }1566 }
1567 else1567 else
1568 {1568 {
1569 XDeleteProperty (GDK_WINDOW_XDISPLAY (window->window),1569 XDeleteProperty (GDK_WINDOW_XDISPLAY (gdkwindow),
1570 GDK_WINDOW_XID (window->window),1570 GDK_WINDOW_XID (gdkwindow),
1571 XInternAtom (GDK_WINDOW_XDISPLAY (window->window),1571 XInternAtom (GDK_WINDOW_XDISPLAY (gdkwindow),
1572 "_COMPIZ_WM_WINDOW_BLUR",1572 "_COMPIZ_WM_WINDOW_BLUR",
1573 FALSE));1573 FALSE));
1574 }1574 }
@@ -1601,7 +1601,7 @@
16011601
1602 // set an empty input-mask to allow click-through 1602 // set an empty input-mask to allow click-through
1603 region = gdk_region_new ();1603 region = gdk_region_new ();
1604 gdk_window_input_shape_combine_region (window->window, region, 0, 0);1604 gdk_window_input_shape_combine_region (gtk_widget_get_window (window), region, 0, 0);
1605 gdk_region_destroy (region);1605 gdk_region_destroy (region);
1606}1606}
16071607
@@ -1635,7 +1635,7 @@
1635 GdkRegion* region = NULL;1635 GdkRegion* region = NULL;
16361636
1637 region = gdk_region_new ();1637 region = gdk_region_new ();
1638 gdk_window_shape_combine_region (priv->widget->window,1638 gdk_window_shape_combine_region (gtk_widget_get_window (priv->widget),
1639 region,1639 region,
1640 0,1640 0,
1641 0);1641 0);
@@ -1719,7 +1719,7 @@
1719 d = bubble->defaults;1719 d = bubble->defaults;
1720 priv = GET_PRIVATE (bubble);1720 priv = GET_PRIVATE (bubble);
17211721
1722 cr = gdk_cairo_create (window->window);1722 cr = gdk_cairo_create (gtk_widget_get_window (window));
17231723
1724 // clear bubble-background1724 // clear bubble-background
1725 cairo_scale (cr, 1.0f, 1.0f);1725 cairo_scale (cr, 1.0f, 1.0f);
@@ -1886,7 +1886,7 @@
1886 if (!GTK_IS_WINDOW (window))1886 if (!GTK_IS_WINDOW (window))
1887 return FALSE;1887 return FALSE;
18881888
1889 if (GTK_WIDGET_REALIZED (window))1889 if (gtk_widget_get_realized (window))
1890 {1890 {
1891 gint distance_x = 0;1891 gint distance_x = 0;
1892 gint distance_y = 0;1892 gint distance_y = 0;
@@ -2228,7 +2228,7 @@
2228 // make sure the window opens with a RGBA-visual2228 // make sure the window opens with a RGBA-visual
2229 screen_changed_handler (window, NULL, NULL);2229 screen_changed_handler (window, NULL, NULL);
2230 gtk_widget_realize (window);2230 gtk_widget_realize (window);
2231 gdk_window_set_back_pixmap (window->window, NULL, FALSE);2231 gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, FALSE);
22322232
2233 // hook up window-event handlers to window2233 // hook up window-event handlers to window
2234 g_signal_connect (G_OBJECT (window),2234 g_signal_connect (G_OBJECT (window),
@@ -3253,7 +3253,7 @@
3253 d = self->defaults;3253 d = self->defaults;
3254 priv = GET_PRIVATE (self);3254 priv = GET_PRIVATE (self);
32553255
3256 cr = gdk_cairo_create (priv->widget->window);3256 cr = gdk_cairo_create (gtk_widget_get_window (priv->widget));
3257 if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {3257 if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) {
3258 if (cr)3258 if (cr)
3259 cairo_destroy (cr);3259 cairo_destroy (cr);
32603260
=== modified file 'src/defaults.c'
--- src/defaults.c 2009-10-25 06:00:23 +0000
+++ src/defaults.c 2010-10-05 17:57:15 +0000
@@ -420,14 +420,16 @@
420 gulong items_left;420 gulong items_left;
421 glong* coords;421 glong* coords;
422 Atom workarea_atom;422 Atom workarea_atom;
423 Display* display;
423424
424 g_return_if_fail ((self != NULL) && IS_DEFAULTS (self));425 g_return_if_fail ((self != NULL) && IS_DEFAULTS (self));
425426
426 /* get real desktop-area without the panels */427 /* get real desktop-area without the panels */
427 workarea_atom = gdk_x11_get_xatom_by_name ("_NET_WORKAREA");428 workarea_atom = gdk_x11_get_xatom_by_name ("_NET_WORKAREA");
429 display = gdk_x11_display_get_xdisplay (gdk_display_get_default ());
428 430
429 gdk_error_trap_push ();431 gdk_error_trap_push ();
430 result = XGetWindowProperty (GDK_DISPLAY (),432 result = XGetWindowProperty (display,
431 GDK_ROOT_WINDOW (),433 GDK_ROOT_WINDOW (),
432 workarea_atom,434 workarea_atom,
433 0L,435 0L,
@@ -2365,7 +2367,7 @@
23652367
2366 gdk_error_trap_push ();2368 gdk_error_trap_push ();
23672369
2368 result = XGetClassHint (GDK_DISPLAY (),2370 result = XGetClassHint (gdk_x11_display_get_xdisplay (gdk_display_get_default ()),
2369 GDK_WINDOW_XWINDOW (win),2371 GDK_WINDOW_XWINDOW (win),
2370 &class_hints);2372 &class_hints);
23712373
23722374
=== modified file 'src/dialog.c'
--- src/dialog.c 2010-08-25 10:17:01 +0000
+++ src/dialog.c 2010-10-05 17:57:15 +0000
@@ -175,7 +175,6 @@
175 dialog_info->sender = g_strdup(sender);175 dialog_info->sender = g_strdup(sender);
176176
177 dialog = gtk_dialog_new ();177 dialog = gtk_dialog_new ();
178 gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
179178
180 hbox = g_object_new (GTK_TYPE_HBOX,179 hbox = g_object_new (GTK_TYPE_HBOX,
181 "spacing", gap,180 "spacing", gap,
182181
=== modified file 'tests/test-dnd.c'
--- tests/test-dnd.c 2009-07-24 11:23:14 +0000
+++ tests/test-dnd.c 2010-10-05 17:57:15 +0000
@@ -126,7 +126,7 @@
126126
127 // FIXME: test_dnd_fullscreen() fails under compiz because of it using127 // FIXME: test_dnd_fullscreen() fails under compiz because of it using
128 // viewports instead of workspaces128 // viewports instead of workspaces
129 wm_name = get_wm_name (GDK_DISPLAY ());129 wm_name = get_wm_name (gdk_x11_display_get_xdisplay (gdk_display_get_default ()));
130 if (wm_name && g_ascii_strcasecmp (WM_NAME_COMPIZ, wm_name))130 if (wm_name && g_ascii_strcasecmp (WM_NAME_COMPIZ, wm_name))
131 g_test_suite_add (ts, TC(test_dnd_fullscreen));131 g_test_suite_add (ts, TC(test_dnd_fullscreen));
132 else132 else
133133
=== modified file 'tests/test-grow-bubble.c'
--- tests/test-grow-bubble.c 2010-02-05 18:35:37 +0000
+++ tests/test-grow-bubble.c 2010-10-05 17:57:15 +0000
@@ -65,7 +65,7 @@
65 /* top-left, right of the corner */65 /* top-left, right of the corner */
66 cairo_move_to (cr, x + radius, y);66 cairo_move_to (cr, x + radius, y);
6767
68 /* top-right, left of the corner */68 /* top-right, left of the corner */
69 cairo_line_to (cr,69 cairo_line_to (cr,
70 x + width - radius,70 x + width - radius,
71 y);71 y);
@@ -78,12 +78,12 @@
78 -90.0f * G_PI / 180.0f,78 -90.0f * G_PI / 180.0f,
79 0.0f * G_PI / 180.0f);79 0.0f * G_PI / 180.0f);
8080
81 /* bottom-right, above the corner */81 /* bottom-right, above the corner */
82 cairo_line_to (cr,82 cairo_line_to (cr,
83 x + width,83 x + width,
84 y + height - radius);84 y + height - radius);
8585
86 /* bottom-right, left of the corner */86 /* bottom-right, left of the corner */
87 cairo_arc (cr,87 cairo_arc (cr,
88 x + width - radius,88 x + width - radius,
89 y + height - radius,89 y + height - radius,
@@ -96,7 +96,7 @@
96 x + radius,96 x + radius,
97 y + height);97 y + height);
9898
99 /* bottom-left, above the corner */99 /* bottom-left, above the corner */
100 cairo_arc (cr,100 cairo_arc (cr,
101 x + radius,101 x + radius,
102 y + height - radius,102 y + height - radius,
@@ -176,10 +176,15 @@
176 gint radius,176 gint radius,
177 gint shadow_size)177 gint shadow_size)
178{178{
179 GdkBitmap* mask = NULL;179 GdkBitmap* mask = NULL;
180 cairo_t* cr = NULL;180 cairo_t* cr = NULL;
181 gdouble width = (gdouble) window->allocation.width;181 GtkAllocation allocation;
182 gdouble height = (gdouble) window->allocation.height;182 gdouble width;
183 gdouble height;
184
185 gtk_widget_get_allocation (window, &allocation);
186 width = (gdouble) allocation.width;
187 height = (gdouble) allocation.height;
183188
184 if (g_composited)189 if (g_composited)
185 {190 {
@@ -353,11 +358,12 @@
353 GdkEventExpose* event,358 GdkEventExpose* event,
354 gpointer data)359 gpointer data)
355{360{
356 cairo_t* cr = NULL;361 cairo_t* cr = NULL;
357 guint width = window->allocation.width;362 GtkAllocation a;
358 guint height = window->allocation.height;363
359364 gtk_widget_get_allocation (window, &a);
360 cr = gdk_cairo_create (window->window);365
366 cr = gdk_cairo_create (gtk_widget_get_window (window));
361367
362 /* clear and render drop-shadow and bubble-background */368 /* clear and render drop-shadow and bubble-background */
363 cairo_scale (cr, 1.0f, 1.0f);369 cairo_scale (cr, 1.0f, 1.0f);
@@ -371,8 +377,8 @@
371 cr,377 cr,
372 0.0f,378 0.0f,
373 0.0f,379 0.0f,
374 width,380 a.width,
375 height,381 a.height,
376 g_distance,382 g_distance,
377 1.0f - g_distance);383 1.0f - g_distance);
378 gtk_window_set_opacity (GTK_WINDOW (window), 0.3f + g_distance * 0.7f);384 gtk_window_set_opacity (GTK_WINDOW (window), 0.3f + g_distance * 0.7f);
@@ -383,8 +389,8 @@
383 cr,389 cr,
384 0.0f,390 0.0f,
385 0.0f,391 0.0f,
386 width,392 a.width,
387 height,393 a.height,
388 g_distance,394 g_distance,
389 0.0f);395 0.0f);
390 gtk_window_set_opacity (GTK_WINDOW (window), 1.0f);396 gtk_window_set_opacity (GTK_WINDOW (window), 1.0f);
@@ -399,31 +405,31 @@
399set_bg_blur (GtkWidget* window,405set_bg_blur (GtkWidget* window,
400 gboolean blur)406 gboolean blur)
401{407{
402 gint width;408 GtkAllocation a;
403 gint height;409 GdkWindow *gdkwindow;
404 gint shadow = BUBBLE_SHADOW_SIZE;410 gint shadow = BUBBLE_SHADOW_SIZE;
405411
406 if (!window)412 if (!window)
407 return;413 return;
408414
409 width = window->allocation.width;415 gtk_widget_get_allocation (window, &a);
410 height = window->allocation.height;416 gdkwindow = gtk_widget_get_window (window);
411417
412 if (blur)418 if (blur)
413 {419 {
414 glong data[] = {420 glong data[] = {
415 2, /* threshold */421 2, /* threshold */
416 0, /* filter */422 0, /* filter */
417 NorthWestGravity, /* gravity of top-left */423 NorthWestGravity, /* gravity of top-left */
418 shadow, /* x-coord of top-left */424 shadow, /* x-coord of top-left */
419 -height/2 + shadow,/* y-coord of top-left */425 -a.height/2 + shadow,/* y-coord of top-left */
420 NorthWestGravity, /* gravity of bottom-right */426 NorthWestGravity, /* gravity of bottom-right */
421 width - shadow, /* bottom-right x-coord */427 a.width - shadow, /* bottom-right x-coord */
422 height/2 - shadow /* bottom-right y-coord */};428 a.height/2 - shadow /* bottom-right y-coord */};
423429
424 XChangeProperty (GDK_WINDOW_XDISPLAY (window->window),430 XChangeProperty (GDK_WINDOW_XDISPLAY (gdkwindow),
425 GDK_WINDOW_XID (window->window),431 GDK_WINDOW_XID (gdkwindow),
426 XInternAtom(GDK_WINDOW_XDISPLAY(window->window),432 XInternAtom(GDK_WINDOW_XDISPLAY(gdkwindow),
427 "_COMPIZ_WM_WINDOW_BLUR",433 "_COMPIZ_WM_WINDOW_BLUR",
428 FALSE),434 FALSE),
429 XA_INTEGER,435 XA_INTEGER,
@@ -434,9 +440,9 @@
434 }440 }
435 else441 else
436 {442 {
437 XDeleteProperty (GDK_WINDOW_XDISPLAY (window->window),443 XDeleteProperty (GDK_WINDOW_XDISPLAY (gdkwindow),
438 GDK_WINDOW_XID (window->window),444 GDK_WINDOW_XID (gdkwindow),
439 XInternAtom(GDK_WINDOW_XDISPLAY(window->window),445 XInternAtom(GDK_WINDOW_XDISPLAY(gdkwindow),
440 "_COMPIZ_WM_WINDOW_BLUR",446 "_COMPIZ_WM_WINDOW_BLUR",
441 FALSE));447 FALSE));
442 }448 }
@@ -529,7 +535,7 @@
529535
530 old_mouse_over = g_mouse_over;536 old_mouse_over = g_mouse_over;
531537
532 if (GTK_WIDGET_REALIZED (window))538 if (gtk_widget_get_realized (window))
533 {539 {
534 gint distance_x = 0;540 gint distance_x = 0;
535 gint distance_y = 0;541 gint distance_y = 0;
@@ -735,7 +741,7 @@
735 // make sure the window opens with a RGBA-visual741 // make sure the window opens with a RGBA-visual
736 screen_changed_handler (window, NULL, NULL);742 screen_changed_handler (window, NULL, NULL);
737 gtk_widget_realize (window);743 gtk_widget_realize (window);
738 gdk_window_set_back_pixmap (window->window, NULL, FALSE);744 gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, FALSE);
739745
740 // hook up window-event handlers to window746 // hook up window-event handlers to window
741 g_signal_connect (G_OBJECT (window),747 g_signal_connect (G_OBJECT (window),
742748
=== modified file 'tests/test-scroll-text.c'
--- tests/test-scroll-text.c 2010-02-05 18:35:37 +0000
+++ tests/test-scroll-text.c 2010-10-05 17:57:15 +0000
@@ -148,7 +148,7 @@
148 // top-left, right of the corner148 // top-left, right of the corner
149 cairo_move_to (cr, x + radius, y);149 cairo_move_to (cr, x + radius, y);
150150
151 // top-right, left of the corner151 // top-right, left of the corner
152 cairo_line_to (cr,152 cairo_line_to (cr,
153 x + width - radius,153 x + width - radius,
154 y);154 y);
@@ -161,12 +161,12 @@
161 -90.0f * G_PI / 180.0f,161 -90.0f * G_PI / 180.0f,
162 0.0f * G_PI / 180.0f);162 0.0f * G_PI / 180.0f);
163163
164 // bottom-right, above the corner164 // bottom-right, above the corner
165 cairo_line_to (cr,165 cairo_line_to (cr,
166 x + width,166 x + width,
167 y + height - radius);167 y + height - radius);
168168
169 // bottom-right, left of the corner169 // bottom-right, left of the corner
170 cairo_arc (cr,170 cairo_arc (cr,
171 x + width - radius,171 x + width - radius,
172 y + height - radius,172 y + height - radius,
@@ -179,7 +179,7 @@
179 x + radius,179 x + radius,
180 y + height);180 y + height);
181181
182 // bottom-left, above the corner182 // bottom-left, above the corner
183 cairo_arc (cr,183 cairo_arc (cr,
184 x + radius,184 x + radius,
185 y + height - radius,185 y + height - radius,
@@ -259,10 +259,15 @@
259 gint radius,259 gint radius,
260 gint shadow_size)260 gint shadow_size)
261{261{
262 GdkBitmap* mask = NULL;262 GdkBitmap* mask = NULL;
263 cairo_t* cr = NULL;263 cairo_t* cr = NULL;
264 gdouble width = (gdouble) window->allocation.width;264 GtkAllocation allocation;
265 gdouble height = (gdouble) window->allocation.height;265 gdouble width;
266 gdouble height;
267
268 gtk_widget_get_allocation (window, &allocation);
269 width = (gdouble) allocation.width;
270 height = (gdouble) allocation.height;
266271
267 if (g_composited)272 if (g_composited)
268 {273 {
@@ -440,7 +445,7 @@
440 cairo_pattern_t* pattern = NULL;445 cairo_pattern_t* pattern = NULL;
441 cairo_pattern_t* mask = NULL;446 cairo_pattern_t* mask = NULL;
442447
443 cr = gdk_cairo_create (window->window);448 cr = gdk_cairo_create (gtk_widget_get_window (window));
444449
445 // clear and render drop-shadow and bubble-background450 // clear and render drop-shadow and bubble-background
446 cairo_scale (cr, 1.0f, 1.0f);451 cairo_scale (cr, 1.0f, 1.0f);
@@ -521,31 +526,31 @@
521set_bg_blur (GtkWidget* window,526set_bg_blur (GtkWidget* window,
522 gboolean blur)527 gboolean blur)
523{528{
524 gint width;529 GtkAllocation a;
525 gint height;530 GdkWindow* gdkwindow;
526 gint shadow = BUBBLE_SHADOW_SIZE;531 gint shadow = BUBBLE_SHADOW_SIZE;
527532
528 if (!window)533 if (!window)
529 return;534 return;
530535
531 width = window->allocation.width;536 gtk_widget_get_allocation (window, &a);
532 height = window->allocation.height;537 gdkwindow = gtk_widget_get_window (window);
533538
534 if (blur)539 if (blur)
535 {540 {
536 glong data[] = {541 glong data[] = {
537 2, // threshold542 2, // threshold
538 0, // filter543 0, // filter
539 NorthWestGravity, // gravity of top-left544 NorthWestGravity, // gravity of top-left
540 shadow, // x-coord of top-left545 shadow, // x-coord of top-left
541 -height/2 + shadow, // y-coord of top-left546 -a.height/2 + shadow, // y-coord of top-left
542 NorthWestGravity, // gravity of bottom-right547 NorthWestGravity, // gravity of bottom-right
543 width - shadow, // bottom-right x-coord548 a.width - shadow, // bottom-right x-coord
544 height/2 - shadow}; // bottom-right y-coord549 a.height/2 - shadow}; // bottom-right y-coord
545550
546 XChangeProperty (GDK_WINDOW_XDISPLAY (window->window),551 XChangeProperty (GDK_WINDOW_XDISPLAY (gdkwindow),
547 GDK_WINDOW_XID (window->window),552 GDK_WINDOW_XID (gdkwindow),
548 XInternAtom(GDK_WINDOW_XDISPLAY(window->window),553 XInternAtom(GDK_WINDOW_XDISPLAY(gdkwindow),
549 "_COMPIZ_WM_WINDOW_BLUR",554 "_COMPIZ_WM_WINDOW_BLUR",
550 FALSE),555 FALSE),
551 XA_INTEGER,556 XA_INTEGER,
@@ -556,9 +561,9 @@
556 }561 }
557 else562 else
558 {563 {
559 XDeleteProperty (GDK_WINDOW_XDISPLAY (window->window),564 XDeleteProperty (GDK_WINDOW_XDISPLAY (gdkwindow),
560 GDK_WINDOW_XID (window->window),565 GDK_WINDOW_XID (gdkwindow),
561 XInternAtom(GDK_WINDOW_XDISPLAY(window->window),566 XInternAtom(GDK_WINDOW_XDISPLAY(gdkwindow),
562 "_COMPIZ_WM_WINDOW_BLUR",567 "_COMPIZ_WM_WINDOW_BLUR",
563 FALSE));568 FALSE));
564 }569 }
@@ -591,7 +596,7 @@
591596
592 old_mouse_over = g_mouse_over;597 old_mouse_over = g_mouse_over;
593598
594 if (GTK_WIDGET_REALIZED (window))599 if (gtk_widget_get_realized (window))
595 {600 {
596 gint distance_x = 0;601 gint distance_x = 0;
597 gint distance_y = 0;602 gint distance_y = 0;
@@ -939,7 +944,7 @@
939 // make sure the window opens with a RGBA-visual944 // make sure the window opens with a RGBA-visual
940 screen_changed_handler (window, NULL, NULL);945 screen_changed_handler (window, NULL, NULL);
941 gtk_widget_realize (window);946 gtk_widget_realize (window);
942 gdk_window_set_back_pixmap (window->window, NULL, FALSE);947 gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, FALSE);
943948
944 // hook up window-event handlers to window949 // hook up window-event handlers to window
945 g_signal_connect (G_OBJECT (window),950 g_signal_connect (G_OBJECT (window),
946951
=== modified file 'tests/test-tile.c'
--- tests/test-tile.c 2009-08-04 17:34:48 +0000
+++ tests/test-tile.c 2010-10-05 17:57:15 +0000
@@ -138,7 +138,7 @@
138 cairo_t* cr = NULL;138 cairo_t* cr = NULL;
139139
140 // create and setup result-surface and context140 // create and setup result-surface and context
141 cr = gdk_cairo_create (widget->window);141 cr = gdk_cairo_create (gtk_widget_get_window (widget));
142 if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)142 if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
143 {143 {
144 g_debug ("Could not create context for rendering to window!");144 g_debug ("Could not create context for rendering to window!");

Subscribers

People subscribed via source and target branches

to all changes: