Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 344293 | Differences between
and this patch

Collapse All | Expand All

(-)a/gtk/window-decorator/gtk-window-decorator.c (-54 / +27 lines)
Lines 380-386 typedef struct _decor { Link Here
380
    guint	      button_states[BUTTON_NUM];
380
    guint	      button_states[BUTTON_NUM];
381
    GdkPixmap	      *pixmap;
381
    GdkPixmap	      *pixmap;
382
    GdkPixmap	      *buffer_pixmap;
382
    GdkPixmap	      *buffer_pixmap;
383
    GdkGC	      *gc;
383
    cairo_t           *cr;
384
    decor_layout_t    border_layout;
384
    decor_layout_t    border_layout;
385
    decor_context_t   *context;
385
    decor_context_t   *context;
386
    decor_shadow_t    *shadow;
386
    decor_shadow_t    *shadow;
Lines 918-923 button_state_paint (cairo_t *cr, Link Here
918
}
918
}
919
919
920
static void
920
static void
921
copy_to_front_buffer (decor_t *d)
922
{
923
    if (!d->buffer_pixmap)
924
	return;
925
926
    cairo_set_operator (d->cr, CAIRO_OPERATOR_SOURCE);
927
    gdk_cairo_set_source_pixmap (d->cr, d->buffer_pixmap, 0, 0);
928
    cairo_paint (d->cr);
929
}
930
931
static void
921
draw_window_decoration (decor_t *d)
932
draw_window_decoration (decor_t *d)
922
{
933
{
923
    cairo_t       *cr;
934
    cairo_t       *cr;
Lines 1298-1313 draw_window_decoration (decor_t *d) Link Here
1298
1309
1299
    cairo_destroy (cr);
1310
    cairo_destroy (cr);
1300
1311
1301
    if (d->buffer_pixmap)
1312
    copy_to_front_buffer (d);
1302
	gdk_draw_drawable  (d->pixmap,
1303
			    d->gc,
1304
			    d->buffer_pixmap,
1305
			    0,
1306
			    0,
1307
			    0,
1308
			    0,
1309
			    d->width,
1310
			    d->height);
1311
1313
1312
    if (d->prop_xid)
1314
    if (d->prop_xid)
1313
    {
1315
    {
Lines 2103-2118 meta_draw_window_decoration (decor_t *d) Link Here
2103
	XRenderFreePicture (xdisplay, src);
2105
	XRenderFreePicture (xdisplay, src);
2104
    }
2106
    }
2105
2107
2106
    if (d->buffer_pixmap)
2108
    copy_to_front_buffer (d);
2107
	gdk_draw_drawable  (d->pixmap,
2108
			    d->gc,
2109
			    d->buffer_pixmap,
2110
			    0,
2111
			    0,
2112
			    0,
2113
			    0,
2114
			    d->width,
2115
			    d->height);
2116
2109
2117
    if (d->prop_xid)
2110
    if (d->prop_xid)
2118
    {
2111
    {
Lines 2361-2378 draw_switcher_background (decor_t *d) Link Here
2361
				      alpha);
2354
				      alpha);
2362
2355
2363
    cairo_stroke (cr);
2356
    cairo_stroke (cr);
2364
2365
    cairo_destroy (cr);
2357
    cairo_destroy (cr);
2366
2358
2367
    gdk_draw_drawable (d->pixmap,
2359
    copy_to_front_buffer (d);
2368
		       d->gc,
2369
		       d->buffer_pixmap,
2370
		       0,
2371
		       0,
2372
		       0,
2373
		       0,
2374
		       d->width,
2375
		       d->height);
2376
2360
2377
    pixel = ((((a * style->bg[GTK_STATE_NORMAL].blue ) >> 24) & 0x0000ff) |
2361
    pixel = ((((a * style->bg[GTK_STATE_NORMAL].blue ) >> 24) & 0x0000ff) |
2378
	     (((a * style->bg[GTK_STATE_NORMAL].green) >> 16) & 0x00ff00) |
2362
	     (((a * style->bg[GTK_STATE_NORMAL].green) >> 16) & 0x00ff00) |
Lines 2439-2453 draw_switcher_foreground (decor_t *d) Link Here
2439
2423
2440
    cairo_destroy (cr);
2424
    cairo_destroy (cr);
2441
2425
2442
    gdk_draw_drawable  (d->pixmap,
2426
    copy_to_front_buffer (d);
2443
			d->gc,
2444
			d->buffer_pixmap,
2445
			0,
2446
			0,
2447
			0,
2448
			0,
2449
			d->width,
2450
			d->height);
2451
}
2427
}
2452
2428
2453
static void
2429
static void
Lines 3512-3526 update_window_decoration_size (WnckWindow *win) Link Here
3512
    if (d->buffer_pixmap)
3488
    if (d->buffer_pixmap)
3513
	g_object_unref (G_OBJECT (d->buffer_pixmap));
3489
	g_object_unref (G_OBJECT (d->buffer_pixmap));
3514
3490
3515
    if (d->gc)
3516
	g_object_unref (G_OBJECT (d->gc));
3517
3518
    if (d->picture)
3491
    if (d->picture)
3519
	XRenderFreePicture (xdisplay, d->picture);
3492
	XRenderFreePicture (xdisplay, d->picture);
3520
3493
3494
    if (d->cr)
3495
	cairo_destroy (d->cr);
3496
3521
    d->pixmap	     = pixmap;
3497
    d->pixmap	     = pixmap;
3522
    d->buffer_pixmap = buffer_pixmap;
3498
    d->buffer_pixmap = buffer_pixmap;
3523
    d->gc	     = gdk_gc_new (pixmap);
3499
    d->cr            = gdk_cairo_create (pixmap);
3524
3500
3525
    d->picture = picture;
3501
    d->picture = picture;
3526
3502
Lines 3642-3647 update_switcher_window (WnckWindow *win, Link Here
3642
    {
3618
    {
3643
	g_object_ref (G_OBJECT (switcher_pixmap));
3619
	g_object_ref (G_OBJECT (switcher_pixmap));
3644
	d->pixmap = switcher_pixmap;
3620
	d->pixmap = switcher_pixmap;
3621
	d->cr = gdk_cairo_create (switcher_pixmap);
3645
    }
3622
    }
3646
3623
3647
    if (!d->buffer_pixmap && switcher_buffer_pixmap)
3624
    if (!d->buffer_pixmap && switcher_buffer_pixmap)
Lines 3729-3737 update_switcher_window (WnckWindow *win, Link Here
3729
3706
3730
    if (width == d->width && height == d->height)
3707
    if (width == d->width && height == d->height)
3731
    {
3708
    {
3732
	if (!d->gc)
3733
	    d->gc = gdk_gc_new (d->pixmap);
3734
3735
	if (!d->picture)
3709
	if (!d->picture)
3736
	    d->picture =
3710
	    d->picture =
3737
		XRenderCreatePicture (xdisplay,
3711
		XRenderCreatePicture (xdisplay,
Lines 3765-3772 update_switcher_window (WnckWindow *win, Link Here
3765
    if (d->buffer_pixmap)
3739
    if (d->buffer_pixmap)
3766
	g_object_unref (G_OBJECT (d->buffer_pixmap));
3740
	g_object_unref (G_OBJECT (d->buffer_pixmap));
3767
3741
3768
    if (d->gc)
3742
    if (d->cr)
3769
	g_object_unref (G_OBJECT (d->gc));
3743
	cairo_destroy (d->cr);
3770
3744
3771
    if (d->picture)
3745
    if (d->picture)
3772
	XRenderFreePicture (xdisplay, d->picture);
3746
	XRenderFreePicture (xdisplay, d->picture);
Lines 3782-3788 update_switcher_window (WnckWindow *win, Link Here
3782
3756
3783
    d->pixmap	     = pixmap;
3757
    d->pixmap	     = pixmap;
3784
    d->buffer_pixmap = buffer_pixmap;
3758
    d->buffer_pixmap = buffer_pixmap;
3785
    d->gc	     = gdk_gc_new (pixmap);
3759
    d->cr            = gdk_cairo_create (pixmap);
3786
3760
3787
    d->picture = XRenderCreatePicture (xdisplay, GDK_PIXMAP_XID (buffer_pixmap),
3761
    d->picture = XRenderCreatePicture (xdisplay, GDK_PIXMAP_XID (buffer_pixmap),
3788
				       xformat, 0, NULL);
3762
				       xformat, 0, NULL);
Lines 3817-3826 remove_frame_window (WnckWindow *win) Link Here
3817
	d->buffer_pixmap = NULL;
3791
	d->buffer_pixmap = NULL;
3818
    }
3792
    }
3819
3793
3820
    if (d->gc)
3794
    if (d->cr)
3821
    {
3795
    {
3822
	g_object_unref (G_OBJECT (d->gc));
3796
	cairo_destroy (d->cr);
3823
	d->gc = NULL;
3797
	d->cr = NULL;
3824
    }
3798
    }
3825
3799
3826
    if (d->picture)
3800
    if (d->picture)
3827
-

Return to bug 344293