Merge lp:~mterry/notify-osd/deprecations into lp:notify-osd/lucid
- deprecations
- Merge into lucid
Proposed by
Michael Terry
on 2010-10-05
| 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 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| David Barth (community) | 2010-10-05 | Approve on 2010-10-05 | |
|
Review via email:
|
|||
Commit Message
Description of the Change
For bug 655232.
To post a comment you must log in.
| David Barth (dbarth) wrote : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
| 1 | === modified file 'configure.in' |
| 2 | --- configure.in 2010-04-08 08:15:40 +0000 |
| 3 | +++ configure.in 2010-10-05 17:57:15 +0000 |
| 4 | @@ -59,7 +59,7 @@ |
| 5 | |
| 6 | |
| 7 | PKG_CHECK_MODULES(notify_osd, |
| 8 | - gtk+-2.0 >= 2.14) |
| 9 | + gtk+-2.0 >= 2.22) |
| 10 | AC_SUBST(NOTIFY_OSD_CFLAGS) |
| 11 | AC_SUBST(NOTIFY_OSD_LIBS) |
| 12 | |
| 13 | @@ -128,6 +128,15 @@ |
| 14 | dnl CFLAGS |
| 15 | CFLAGS="$CFLAGS -Wall" |
| 16 | |
| 17 | +AC_ARG_ENABLE([deprecations], |
| 18 | + [AS_HELP_STRING([--enable-deprecations], |
| 19 | + [allow deprecated API usage @<:@default=yes@:>@])], |
| 20 | + [], |
| 21 | + [enable_deprecations=yes]) |
| 22 | +AS_IF([test "x$enable_deprecations" = xno], |
| 23 | + [CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE"] |
| 24 | +) |
| 25 | + |
| 26 | AC_OUTPUT([ |
| 27 | Makefile |
| 28 | src/Makefile |
| 29 | |
| 30 | === modified file 'src/bubble-window-accessible.c' |
| 31 | --- src/bubble-window-accessible.c 2009-08-14 14:03:20 +0000 |
| 32 | +++ src/bubble-window-accessible.c 2010-10-05 17:57:15 +0000 |
| 33 | @@ -211,14 +211,12 @@ |
| 34 | { |
| 35 | GObject *object; |
| 36 | AtkObject *aobj; |
| 37 | - GtkAccessible *gtk_accessible; |
| 38 | |
| 39 | object = g_object_new (BUBBLE_WINDOW_TYPE_ACCESSIBLE, NULL); |
| 40 | |
| 41 | aobj = ATK_OBJECT (object); |
| 42 | |
| 43 | - gtk_accessible = GTK_ACCESSIBLE (aobj); |
| 44 | - gtk_accessible->widget = widget; |
| 45 | + gtk_accessible_set_widget (GTK_ACCESSIBLE (aobj), widget); |
| 46 | |
| 47 | atk_object_initialize (aobj, widget); |
| 48 | |
| 49 | @@ -228,18 +226,18 @@ |
| 50 | static const char* |
| 51 | bubble_window_accessible_get_name (AtkObject* obj) |
| 52 | { |
| 53 | - GtkAccessible* accessible; |
| 54 | + GtkWidget* widget; |
| 55 | Bubble* bubble; |
| 56 | const gchar* title; |
| 57 | |
| 58 | g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), ""); |
| 59 | |
| 60 | - accessible = GTK_ACCESSIBLE (obj); |
| 61 | + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); |
| 62 | |
| 63 | - if (accessible->widget == NULL) |
| 64 | - return ""; |
| 65 | + if (widget == NULL) |
| 66 | + return ""; |
| 67 | |
| 68 | - bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble"); |
| 69 | + bubble = g_object_get_data (G_OBJECT (widget), "bubble"); |
| 70 | |
| 71 | g_return_val_if_fail (IS_BUBBLE (bubble), ""); |
| 72 | |
| 73 | @@ -264,17 +262,17 @@ |
| 74 | static const char* |
| 75 | bubble_window_accessible_get_description (AtkObject* obj) |
| 76 | { |
| 77 | - GtkAccessible *accessible; |
| 78 | + GtkWidget *widget; |
| 79 | Bubble *bubble; |
| 80 | |
| 81 | g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), ""); |
| 82 | |
| 83 | - accessible = GTK_ACCESSIBLE (obj); |
| 84 | + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); |
| 85 | |
| 86 | - if (accessible->widget == NULL) |
| 87 | - return ""; |
| 88 | + if (widget == NULL) |
| 89 | + return ""; |
| 90 | |
| 91 | - bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble"); |
| 92 | + bubble = g_object_get_data (G_OBJECT (widget), "bubble"); |
| 93 | |
| 94 | g_return_val_if_fail (IS_BUBBLE (bubble), ""); |
| 95 | |
| 96 | @@ -286,18 +284,18 @@ |
| 97 | GValue* value) |
| 98 | { |
| 99 | gdouble current_value; |
| 100 | - GtkAccessible* accessible; |
| 101 | + GtkWidget* widget; |
| 102 | Bubble* bubble; |
| 103 | |
| 104 | g_return_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj)); |
| 105 | |
| 106 | - accessible = GTK_ACCESSIBLE (obj); |
| 107 | + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); |
| 108 | |
| 109 | - if (accessible->widget == NULL) |
| 110 | - return; |
| 111 | + if (widget == NULL) |
| 112 | + return; |
| 113 | |
| 114 | - bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble"); |
| 115 | - |
| 116 | + bubble = g_object_get_data (G_OBJECT (widget), "bubble"); |
| 117 | + |
| 118 | current_value = (gdouble) bubble_get_value(bubble); |
| 119 | |
| 120 | memset (value, 0, sizeof (GValue)); |
| 121 | @@ -361,7 +359,7 @@ |
| 122 | gint start_offset, |
| 123 | gint end_offset) |
| 124 | { |
| 125 | - GtkAccessible* accessible; |
| 126 | + GtkWidget* widget; |
| 127 | Bubble* bubble; |
| 128 | const gchar* body_text; |
| 129 | gsize char_length; |
| 130 | @@ -369,11 +367,11 @@ |
| 131 | |
| 132 | g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), g_strdup("")); |
| 133 | |
| 134 | - accessible = GTK_ACCESSIBLE (obj); |
| 135 | + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); |
| 136 | |
| 137 | - g_return_val_if_fail (GTK_IS_WINDOW (accessible->widget), g_strdup("")); |
| 138 | + g_return_val_if_fail (GTK_IS_WINDOW (widget), g_strdup("")); |
| 139 | |
| 140 | - bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble"); |
| 141 | + bubble = g_object_get_data (G_OBJECT(widget), "bubble"); |
| 142 | |
| 143 | if (end_offset <= start_offset) |
| 144 | return g_strdup(""); |
| 145 | @@ -399,17 +397,17 @@ |
| 146 | static gint |
| 147 | bubble_window_get_character_count (AtkText *obj) |
| 148 | { |
| 149 | - GtkAccessible* accessible; |
| 150 | + GtkWidget* widget; |
| 151 | Bubble* bubble; |
| 152 | |
| 153 | g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), 0); |
| 154 | |
| 155 | - accessible = GTK_ACCESSIBLE (obj); |
| 156 | + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); |
| 157 | |
| 158 | - if (accessible->widget == NULL) |
| 159 | - return 0; |
| 160 | + if (widget == NULL) |
| 161 | + return 0; |
| 162 | |
| 163 | - bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble"); |
| 164 | + bubble = g_object_get_data (G_OBJECT (widget), "bubble"); |
| 165 | |
| 166 | return g_utf8_strlen(bubble_get_message_body (bubble), -1); |
| 167 | } |
| 168 | @@ -418,18 +416,18 @@ |
| 169 | bubble_window_get_character_at_offset (AtkText *obj, |
| 170 | gint offset) |
| 171 | { |
| 172 | - GtkAccessible* accessible; |
| 173 | + GtkWidget* widget; |
| 174 | Bubble* bubble; |
| 175 | const gchar* body_text; |
| 176 | |
| 177 | g_return_val_if_fail (BUBBLE_WINDOW_IS_ACCESSIBLE (obj), 0); |
| 178 | |
| 179 | - accessible = GTK_ACCESSIBLE (obj); |
| 180 | + widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); |
| 181 | |
| 182 | - if (accessible->widget == NULL) |
| 183 | - return 0; |
| 184 | + if (widget == NULL) |
| 185 | + return 0; |
| 186 | |
| 187 | - bubble = g_object_get_data (G_OBJECT(accessible->widget), "bubble"); |
| 188 | + bubble = g_object_get_data (G_OBJECT (widget), "bubble"); |
| 189 | |
| 190 | body_text = bubble_get_message_body (bubble); |
| 191 | |
| 192 | |
| 193 | === modified file 'src/bubble.c' |
| 194 | --- src/bubble.c 2010-04-14 10:04:26 +0000 |
| 195 | +++ src/bubble.c 2010-10-05 17:57:15 +0000 |
| 196 | @@ -1530,32 +1530,32 @@ |
| 197 | gint shadow_size) |
| 198 | { |
| 199 | glong data[8]; |
| 200 | - gint width; |
| 201 | - gint height; |
| 202 | + GtkAllocation a; |
| 203 | + GdkWindow *gdkwindow; |
| 204 | |
| 205 | // sanity check |
| 206 | if (!window) |
| 207 | return; |
| 208 | |
| 209 | - width = window->allocation.width; |
| 210 | - height = window->allocation.height; |
| 211 | + gtk_widget_get_allocation (window, &a); |
| 212 | + gdkwindow = gtk_widget_get_window (window); |
| 213 | |
| 214 | // this is meant to tell the blur-plugin what and how to blur, somehow |
| 215 | // the y-coords are interpreted as being CenterGravity, I wonder why |
| 216 | - data[0] = 2; // threshold |
| 217 | - data[1] = 0; // filter |
| 218 | - data[2] = NorthWestGravity; // gravity of top-left |
| 219 | - data[3] = shadow_size; // x-coord of top-left |
| 220 | - data[4] = (-height / 2) + shadow_size; // y-coord of top-left |
| 221 | - data[5] = NorthWestGravity; // gravity of bottom-right |
| 222 | - data[6] = width - shadow_size; // bottom-right x-coord |
| 223 | - data[7] = (height / 2) - shadow_size; // bottom-right y-coord |
| 224 | + data[0] = 2; // threshold |
| 225 | + data[1] = 0; // filter |
| 226 | + data[2] = NorthWestGravity; // gravity of top-left |
| 227 | + data[3] = shadow_size; // x-coord of top-left |
| 228 | + data[4] = (-a.height / 2) + shadow_size; // y-coord of top-left |
| 229 | + data[5] = NorthWestGravity; // gravity of bottom-right |
| 230 | + data[6] = a.width - shadow_size; // bottom-right x-coord |
| 231 | + data[7] = (a.height / 2) - shadow_size; // bottom-right y-coord |
| 232 | |
| 233 | if (set_blur) |
| 234 | { |
| 235 | - XChangeProperty (GDK_WINDOW_XDISPLAY (window->window), |
| 236 | - GDK_WINDOW_XID (window->window), |
| 237 | - XInternAtom (GDK_WINDOW_XDISPLAY (window->window), |
| 238 | + XChangeProperty (GDK_WINDOW_XDISPLAY (gdkwindow), |
| 239 | + GDK_WINDOW_XID (gdkwindow), |
| 240 | + XInternAtom (GDK_WINDOW_XDISPLAY (gdkwindow), |
| 241 | "_COMPIZ_WM_WINDOW_BLUR", |
| 242 | FALSE), |
| 243 | XA_INTEGER, |
| 244 | @@ -1566,9 +1566,9 @@ |
| 245 | } |
| 246 | else |
| 247 | { |
| 248 | - XDeleteProperty (GDK_WINDOW_XDISPLAY (window->window), |
| 249 | - GDK_WINDOW_XID (window->window), |
| 250 | - XInternAtom (GDK_WINDOW_XDISPLAY (window->window), |
| 251 | + XDeleteProperty (GDK_WINDOW_XDISPLAY (gdkwindow), |
| 252 | + GDK_WINDOW_XID (gdkwindow), |
| 253 | + XInternAtom (GDK_WINDOW_XDISPLAY (gdkwindow), |
| 254 | "_COMPIZ_WM_WINDOW_BLUR", |
| 255 | FALSE)); |
| 256 | } |
| 257 | @@ -1601,7 +1601,7 @@ |
| 258 | |
| 259 | // set an empty input-mask to allow click-through |
| 260 | region = gdk_region_new (); |
| 261 | - gdk_window_input_shape_combine_region (window->window, region, 0, 0); |
| 262 | + gdk_window_input_shape_combine_region (gtk_widget_get_window (window), region, 0, 0); |
| 263 | gdk_region_destroy (region); |
| 264 | } |
| 265 | |
| 266 | @@ -1635,7 +1635,7 @@ |
| 267 | GdkRegion* region = NULL; |
| 268 | |
| 269 | region = gdk_region_new (); |
| 270 | - gdk_window_shape_combine_region (priv->widget->window, |
| 271 | + gdk_window_shape_combine_region (gtk_widget_get_window (priv->widget), |
| 272 | region, |
| 273 | 0, |
| 274 | 0); |
| 275 | @@ -1719,7 +1719,7 @@ |
| 276 | d = bubble->defaults; |
| 277 | priv = GET_PRIVATE (bubble); |
| 278 | |
| 279 | - cr = gdk_cairo_create (window->window); |
| 280 | + cr = gdk_cairo_create (gtk_widget_get_window (window)); |
| 281 | |
| 282 | // clear bubble-background |
| 283 | cairo_scale (cr, 1.0f, 1.0f); |
| 284 | @@ -1886,7 +1886,7 @@ |
| 285 | if (!GTK_IS_WINDOW (window)) |
| 286 | return FALSE; |
| 287 | |
| 288 | - if (GTK_WIDGET_REALIZED (window)) |
| 289 | + if (gtk_widget_get_realized (window)) |
| 290 | { |
| 291 | gint distance_x = 0; |
| 292 | gint distance_y = 0; |
| 293 | @@ -2228,7 +2228,7 @@ |
| 294 | // make sure the window opens with a RGBA-visual |
| 295 | screen_changed_handler (window, NULL, NULL); |
| 296 | gtk_widget_realize (window); |
| 297 | - gdk_window_set_back_pixmap (window->window, NULL, FALSE); |
| 298 | + gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, FALSE); |
| 299 | |
| 300 | // hook up window-event handlers to window |
| 301 | g_signal_connect (G_OBJECT (window), |
| 302 | @@ -3253,7 +3253,7 @@ |
| 303 | d = self->defaults; |
| 304 | priv = GET_PRIVATE (self); |
| 305 | |
| 306 | - cr = gdk_cairo_create (priv->widget->window); |
| 307 | + cr = gdk_cairo_create (gtk_widget_get_window (priv->widget)); |
| 308 | if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) { |
| 309 | if (cr) |
| 310 | cairo_destroy (cr); |
| 311 | |
| 312 | === modified file 'src/defaults.c' |
| 313 | --- src/defaults.c 2009-10-25 06:00:23 +0000 |
| 314 | +++ src/defaults.c 2010-10-05 17:57:15 +0000 |
| 315 | @@ -420,14 +420,16 @@ |
| 316 | gulong items_left; |
| 317 | glong* coords; |
| 318 | Atom workarea_atom; |
| 319 | + Display* display; |
| 320 | |
| 321 | g_return_if_fail ((self != NULL) && IS_DEFAULTS (self)); |
| 322 | |
| 323 | /* get real desktop-area without the panels */ |
| 324 | workarea_atom = gdk_x11_get_xatom_by_name ("_NET_WORKAREA"); |
| 325 | + display = gdk_x11_display_get_xdisplay (gdk_display_get_default ()); |
| 326 | |
| 327 | gdk_error_trap_push (); |
| 328 | - result = XGetWindowProperty (GDK_DISPLAY (), |
| 329 | + result = XGetWindowProperty (display, |
| 330 | GDK_ROOT_WINDOW (), |
| 331 | workarea_atom, |
| 332 | 0L, |
| 333 | @@ -2365,7 +2367,7 @@ |
| 334 | |
| 335 | gdk_error_trap_push (); |
| 336 | |
| 337 | - result = XGetClassHint (GDK_DISPLAY (), |
| 338 | + result = XGetClassHint (gdk_x11_display_get_xdisplay (gdk_display_get_default ()), |
| 339 | GDK_WINDOW_XWINDOW (win), |
| 340 | &class_hints); |
| 341 | |
| 342 | |
| 343 | === modified file 'src/dialog.c' |
| 344 | --- src/dialog.c 2010-08-25 10:17:01 +0000 |
| 345 | +++ src/dialog.c 2010-10-05 17:57:15 +0000 |
| 346 | @@ -175,7 +175,6 @@ |
| 347 | dialog_info->sender = g_strdup(sender); |
| 348 | |
| 349 | dialog = gtk_dialog_new (); |
| 350 | - gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); |
| 351 | |
| 352 | hbox = g_object_new (GTK_TYPE_HBOX, |
| 353 | "spacing", gap, |
| 354 | |
| 355 | === modified file 'tests/test-dnd.c' |
| 356 | --- tests/test-dnd.c 2009-07-24 11:23:14 +0000 |
| 357 | +++ tests/test-dnd.c 2010-10-05 17:57:15 +0000 |
| 358 | @@ -126,7 +126,7 @@ |
| 359 | |
| 360 | // FIXME: test_dnd_fullscreen() fails under compiz because of it using |
| 361 | // viewports instead of workspaces |
| 362 | - wm_name = get_wm_name (GDK_DISPLAY ()); |
| 363 | + wm_name = get_wm_name (gdk_x11_display_get_xdisplay (gdk_display_get_default ())); |
| 364 | if (wm_name && g_ascii_strcasecmp (WM_NAME_COMPIZ, wm_name)) |
| 365 | g_test_suite_add (ts, TC(test_dnd_fullscreen)); |
| 366 | else |
| 367 | |
| 368 | === modified file 'tests/test-grow-bubble.c' |
| 369 | --- tests/test-grow-bubble.c 2010-02-05 18:35:37 +0000 |
| 370 | +++ tests/test-grow-bubble.c 2010-10-05 17:57:15 +0000 |
| 371 | @@ -65,7 +65,7 @@ |
| 372 | /* top-left, right of the corner */ |
| 373 | cairo_move_to (cr, x + radius, y); |
| 374 | |
| 375 | - /* top-right, left of the corner */ |
| 376 | + /* top-right, left of the corner */ |
| 377 | cairo_line_to (cr, |
| 378 | x + width - radius, |
| 379 | y); |
| 380 | @@ -78,12 +78,12 @@ |
| 381 | -90.0f * G_PI / 180.0f, |
| 382 | 0.0f * G_PI / 180.0f); |
| 383 | |
| 384 | - /* bottom-right, above the corner */ |
| 385 | + /* bottom-right, above the corner */ |
| 386 | cairo_line_to (cr, |
| 387 | x + width, |
| 388 | y + height - radius); |
| 389 | |
| 390 | - /* bottom-right, left of the corner */ |
| 391 | + /* bottom-right, left of the corner */ |
| 392 | cairo_arc (cr, |
| 393 | x + width - radius, |
| 394 | y + height - radius, |
| 395 | @@ -96,7 +96,7 @@ |
| 396 | x + radius, |
| 397 | y + height); |
| 398 | |
| 399 | - /* bottom-left, above the corner */ |
| 400 | + /* bottom-left, above the corner */ |
| 401 | cairo_arc (cr, |
| 402 | x + radius, |
| 403 | y + height - radius, |
| 404 | @@ -176,10 +176,15 @@ |
| 405 | gint radius, |
| 406 | gint shadow_size) |
| 407 | { |
| 408 | - GdkBitmap* mask = NULL; |
| 409 | - cairo_t* cr = NULL; |
| 410 | - gdouble width = (gdouble) window->allocation.width; |
| 411 | - gdouble height = (gdouble) window->allocation.height; |
| 412 | + GdkBitmap* mask = NULL; |
| 413 | + cairo_t* cr = NULL; |
| 414 | + GtkAllocation allocation; |
| 415 | + gdouble width; |
| 416 | + gdouble height; |
| 417 | + |
| 418 | + gtk_widget_get_allocation (window, &allocation); |
| 419 | + width = (gdouble) allocation.width; |
| 420 | + height = (gdouble) allocation.height; |
| 421 | |
| 422 | if (g_composited) |
| 423 | { |
| 424 | @@ -353,11 +358,12 @@ |
| 425 | GdkEventExpose* event, |
| 426 | gpointer data) |
| 427 | { |
| 428 | - cairo_t* cr = NULL; |
| 429 | - guint width = window->allocation.width; |
| 430 | - guint height = window->allocation.height; |
| 431 | - |
| 432 | - cr = gdk_cairo_create (window->window); |
| 433 | + cairo_t* cr = NULL; |
| 434 | + GtkAllocation a; |
| 435 | + |
| 436 | + gtk_widget_get_allocation (window, &a); |
| 437 | + |
| 438 | + cr = gdk_cairo_create (gtk_widget_get_window (window)); |
| 439 | |
| 440 | /* clear and render drop-shadow and bubble-background */ |
| 441 | cairo_scale (cr, 1.0f, 1.0f); |
| 442 | @@ -371,8 +377,8 @@ |
| 443 | cr, |
| 444 | 0.0f, |
| 445 | 0.0f, |
| 446 | - width, |
| 447 | - height, |
| 448 | + a.width, |
| 449 | + a.height, |
| 450 | g_distance, |
| 451 | 1.0f - g_distance); |
| 452 | gtk_window_set_opacity (GTK_WINDOW (window), 0.3f + g_distance * 0.7f); |
| 453 | @@ -383,8 +389,8 @@ |
| 454 | cr, |
| 455 | 0.0f, |
| 456 | 0.0f, |
| 457 | - width, |
| 458 | - height, |
| 459 | + a.width, |
| 460 | + a.height, |
| 461 | g_distance, |
| 462 | 0.0f); |
| 463 | gtk_window_set_opacity (GTK_WINDOW (window), 1.0f); |
| 464 | @@ -399,31 +405,31 @@ |
| 465 | set_bg_blur (GtkWidget* window, |
| 466 | gboolean blur) |
| 467 | { |
| 468 | - gint width; |
| 469 | - gint height; |
| 470 | + GtkAllocation a; |
| 471 | + GdkWindow *gdkwindow; |
| 472 | gint shadow = BUBBLE_SHADOW_SIZE; |
| 473 | |
| 474 | if (!window) |
| 475 | return; |
| 476 | |
| 477 | - width = window->allocation.width; |
| 478 | - height = window->allocation.height; |
| 479 | + gtk_widget_get_allocation (window, &a); |
| 480 | + gdkwindow = gtk_widget_get_window (window); |
| 481 | |
| 482 | if (blur) |
| 483 | { |
| 484 | glong data[] = { |
| 485 | - 2, /* threshold */ |
| 486 | - 0, /* filter */ |
| 487 | - NorthWestGravity, /* gravity of top-left */ |
| 488 | - shadow, /* x-coord of top-left */ |
| 489 | - -height/2 + shadow,/* y-coord of top-left */ |
| 490 | - NorthWestGravity, /* gravity of bottom-right */ |
| 491 | - width - shadow, /* bottom-right x-coord */ |
| 492 | - height/2 - shadow /* bottom-right y-coord */}; |
| 493 | + 2, /* threshold */ |
| 494 | + 0, /* filter */ |
| 495 | + NorthWestGravity, /* gravity of top-left */ |
| 496 | + shadow, /* x-coord of top-left */ |
| 497 | + -a.height/2 + shadow,/* y-coord of top-left */ |
| 498 | + NorthWestGravity, /* gravity of bottom-right */ |
| 499 | + a.width - shadow, /* bottom-right x-coord */ |
| 500 | + a.height/2 - shadow /* bottom-right y-coord */}; |
| 501 | |
| 502 | - XChangeProperty (GDK_WINDOW_XDISPLAY (window->window), |
| 503 | - GDK_WINDOW_XID (window->window), |
| 504 | - XInternAtom(GDK_WINDOW_XDISPLAY(window->window), |
| 505 | + XChangeProperty (GDK_WINDOW_XDISPLAY (gdkwindow), |
| 506 | + GDK_WINDOW_XID (gdkwindow), |
| 507 | + XInternAtom(GDK_WINDOW_XDISPLAY(gdkwindow), |
| 508 | "_COMPIZ_WM_WINDOW_BLUR", |
| 509 | FALSE), |
| 510 | XA_INTEGER, |
| 511 | @@ -434,9 +440,9 @@ |
| 512 | } |
| 513 | else |
| 514 | { |
| 515 | - XDeleteProperty (GDK_WINDOW_XDISPLAY (window->window), |
| 516 | - GDK_WINDOW_XID (window->window), |
| 517 | - XInternAtom(GDK_WINDOW_XDISPLAY(window->window), |
| 518 | + XDeleteProperty (GDK_WINDOW_XDISPLAY (gdkwindow), |
| 519 | + GDK_WINDOW_XID (gdkwindow), |
| 520 | + XInternAtom(GDK_WINDOW_XDISPLAY(gdkwindow), |
| 521 | "_COMPIZ_WM_WINDOW_BLUR", |
| 522 | FALSE)); |
| 523 | } |
| 524 | @@ -529,7 +535,7 @@ |
| 525 | |
| 526 | old_mouse_over = g_mouse_over; |
| 527 | |
| 528 | - if (GTK_WIDGET_REALIZED (window)) |
| 529 | + if (gtk_widget_get_realized (window)) |
| 530 | { |
| 531 | gint distance_x = 0; |
| 532 | gint distance_y = 0; |
| 533 | @@ -735,7 +741,7 @@ |
| 534 | // make sure the window opens with a RGBA-visual |
| 535 | screen_changed_handler (window, NULL, NULL); |
| 536 | gtk_widget_realize (window); |
| 537 | - gdk_window_set_back_pixmap (window->window, NULL, FALSE); |
| 538 | + gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, FALSE); |
| 539 | |
| 540 | // hook up window-event handlers to window |
| 541 | g_signal_connect (G_OBJECT (window), |
| 542 | |
| 543 | === modified file 'tests/test-scroll-text.c' |
| 544 | --- tests/test-scroll-text.c 2010-02-05 18:35:37 +0000 |
| 545 | +++ tests/test-scroll-text.c 2010-10-05 17:57:15 +0000 |
| 546 | @@ -148,7 +148,7 @@ |
| 547 | // top-left, right of the corner |
| 548 | cairo_move_to (cr, x + radius, y); |
| 549 | |
| 550 | - // top-right, left of the corner |
| 551 | + // top-right, left of the corner |
| 552 | cairo_line_to (cr, |
| 553 | x + width - radius, |
| 554 | y); |
| 555 | @@ -161,12 +161,12 @@ |
| 556 | -90.0f * G_PI / 180.0f, |
| 557 | 0.0f * G_PI / 180.0f); |
| 558 | |
| 559 | - // bottom-right, above the corner |
| 560 | + // bottom-right, above the corner |
| 561 | cairo_line_to (cr, |
| 562 | x + width, |
| 563 | y + height - radius); |
| 564 | |
| 565 | - // bottom-right, left of the corner |
| 566 | + // bottom-right, left of the corner |
| 567 | cairo_arc (cr, |
| 568 | x + width - radius, |
| 569 | y + height - radius, |
| 570 | @@ -179,7 +179,7 @@ |
| 571 | x + radius, |
| 572 | y + height); |
| 573 | |
| 574 | - // bottom-left, above the corner |
| 575 | + // bottom-left, above the corner |
| 576 | cairo_arc (cr, |
| 577 | x + radius, |
| 578 | y + height - radius, |
| 579 | @@ -259,10 +259,15 @@ |
| 580 | gint radius, |
| 581 | gint shadow_size) |
| 582 | { |
| 583 | - GdkBitmap* mask = NULL; |
| 584 | - cairo_t* cr = NULL; |
| 585 | - gdouble width = (gdouble) window->allocation.width; |
| 586 | - gdouble height = (gdouble) window->allocation.height; |
| 587 | + GdkBitmap* mask = NULL; |
| 588 | + cairo_t* cr = NULL; |
| 589 | + GtkAllocation allocation; |
| 590 | + gdouble width; |
| 591 | + gdouble height; |
| 592 | + |
| 593 | + gtk_widget_get_allocation (window, &allocation); |
| 594 | + width = (gdouble) allocation.width; |
| 595 | + height = (gdouble) allocation.height; |
| 596 | |
| 597 | if (g_composited) |
| 598 | { |
| 599 | @@ -440,7 +445,7 @@ |
| 600 | cairo_pattern_t* pattern = NULL; |
| 601 | cairo_pattern_t* mask = NULL; |
| 602 | |
| 603 | - cr = gdk_cairo_create (window->window); |
| 604 | + cr = gdk_cairo_create (gtk_widget_get_window (window)); |
| 605 | |
| 606 | // clear and render drop-shadow and bubble-background |
| 607 | cairo_scale (cr, 1.0f, 1.0f); |
| 608 | @@ -521,31 +526,31 @@ |
| 609 | set_bg_blur (GtkWidget* window, |
| 610 | gboolean blur) |
| 611 | { |
| 612 | - gint width; |
| 613 | - gint height; |
| 614 | - gint shadow = BUBBLE_SHADOW_SIZE; |
| 615 | + GtkAllocation a; |
| 616 | + GdkWindow* gdkwindow; |
| 617 | + gint shadow = BUBBLE_SHADOW_SIZE; |
| 618 | |
| 619 | if (!window) |
| 620 | return; |
| 621 | |
| 622 | - width = window->allocation.width; |
| 623 | - height = window->allocation.height; |
| 624 | + gtk_widget_get_allocation (window, &a); |
| 625 | + gdkwindow = gtk_widget_get_window (window); |
| 626 | |
| 627 | if (blur) |
| 628 | { |
| 629 | glong data[] = { |
| 630 | - 2, // threshold |
| 631 | - 0, // filter |
| 632 | - NorthWestGravity, // gravity of top-left |
| 633 | - shadow, // x-coord of top-left |
| 634 | - -height/2 + shadow, // y-coord of top-left |
| 635 | - NorthWestGravity, // gravity of bottom-right |
| 636 | - width - shadow, // bottom-right x-coord |
| 637 | - height/2 - shadow}; // bottom-right y-coord |
| 638 | + 2, // threshold |
| 639 | + 0, // filter |
| 640 | + NorthWestGravity, // gravity of top-left |
| 641 | + shadow, // x-coord of top-left |
| 642 | + -a.height/2 + shadow, // y-coord of top-left |
| 643 | + NorthWestGravity, // gravity of bottom-right |
| 644 | + a.width - shadow, // bottom-right x-coord |
| 645 | + a.height/2 - shadow}; // bottom-right y-coord |
| 646 | |
| 647 | - XChangeProperty (GDK_WINDOW_XDISPLAY (window->window), |
| 648 | - GDK_WINDOW_XID (window->window), |
| 649 | - XInternAtom(GDK_WINDOW_XDISPLAY(window->window), |
| 650 | + XChangeProperty (GDK_WINDOW_XDISPLAY (gdkwindow), |
| 651 | + GDK_WINDOW_XID (gdkwindow), |
| 652 | + XInternAtom(GDK_WINDOW_XDISPLAY(gdkwindow), |
| 653 | "_COMPIZ_WM_WINDOW_BLUR", |
| 654 | FALSE), |
| 655 | XA_INTEGER, |
| 656 | @@ -556,9 +561,9 @@ |
| 657 | } |
| 658 | else |
| 659 | { |
| 660 | - XDeleteProperty (GDK_WINDOW_XDISPLAY (window->window), |
| 661 | - GDK_WINDOW_XID (window->window), |
| 662 | - XInternAtom(GDK_WINDOW_XDISPLAY(window->window), |
| 663 | + XDeleteProperty (GDK_WINDOW_XDISPLAY (gdkwindow), |
| 664 | + GDK_WINDOW_XID (gdkwindow), |
| 665 | + XInternAtom(GDK_WINDOW_XDISPLAY(gdkwindow), |
| 666 | "_COMPIZ_WM_WINDOW_BLUR", |
| 667 | FALSE)); |
| 668 | } |
| 669 | @@ -591,7 +596,7 @@ |
| 670 | |
| 671 | old_mouse_over = g_mouse_over; |
| 672 | |
| 673 | - if (GTK_WIDGET_REALIZED (window)) |
| 674 | + if (gtk_widget_get_realized (window)) |
| 675 | { |
| 676 | gint distance_x = 0; |
| 677 | gint distance_y = 0; |
| 678 | @@ -939,7 +944,7 @@ |
| 679 | // make sure the window opens with a RGBA-visual |
| 680 | screen_changed_handler (window, NULL, NULL); |
| 681 | gtk_widget_realize (window); |
| 682 | - gdk_window_set_back_pixmap (window->window, NULL, FALSE); |
| 683 | + gdk_window_set_back_pixmap (gtk_widget_get_window (window), NULL, FALSE); |
| 684 | |
| 685 | // hook up window-event handlers to window |
| 686 | g_signal_connect (G_OBJECT (window), |
| 687 | |
| 688 | === modified file 'tests/test-tile.c' |
| 689 | --- tests/test-tile.c 2009-08-04 17:34:48 +0000 |
| 690 | +++ tests/test-tile.c 2010-10-05 17:57:15 +0000 |
| 691 | @@ -138,7 +138,7 @@ |
| 692 | cairo_t* cr = NULL; |
| 693 | |
| 694 | // create and setup result-surface and context |
| 695 | - cr = gdk_cairo_create (widget->window); |
| 696 | + cr = gdk_cairo_create (gtk_widget_get_window (widget)); |
| 697 | if (cairo_status (cr) != CAIRO_STATUS_SUCCESS) |
| 698 | { |
| 699 | g_debug ("Could not create context for rendering to window!"); |


+1 thanks for the fix