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

Collapse All | Expand All

(-)emerald-0.7.2/include/emerald.h (+2 lines)
Lines 24-29 Link Here
24
#include <gtk/gtkwindow.h>
24
#include <gtk/gtkwindow.h>
25
#include <gdk/gdkx.h>
25
#include <gdk/gdkx.h>
26
26
27
#define IS_VALID(o) (o && o->parent_instance.ref_count)
28
27
#ifdef USE_DBUS
29
#ifdef USE_DBUS
28
#define DBUS_API_SUBJECT_TO_CHANGE
30
#define DBUS_API_SUBJECT_TO_CHANGE
29
#include <dbus/dbus.h>
31
#include <dbus/dbus.h>
(-)emerald-0.7.2/src/main.c (-19 / +31 lines)
Lines 1181-1187 Link Here
1181
	else
1181
	else
1182
	    return;
1182
	    return;
1183
	if (button_region->bg_pixmap)
1183
	if (button_region->bg_pixmap)
1184
	    gdk_draw_drawable(d->buffer_pixmap ? d->buffer_pixmap : d->pixmap,
1184
	    gdk_draw_drawable(IS_VALID(d->buffer_pixmap) ? d->buffer_pixmap :
1185
			                                   d->pixmap,
1185
			      d->gc, button_region->bg_pixmap, src_x, src_y,
1186
			      d->gc, button_region->bg_pixmap, src_x, src_y,
1186
			      dest_x, dest_y, w, h);
1187
			      dest_x, dest_y, w, h);
1187
	d->min_drawn_buttons_region.x1 =
1188
	d->min_drawn_buttons_region.x1 =
Lines 1211-1218 Link Here
1211
    {
1212
    {
1212
	fade_info->cr =
1213
	fade_info->cr =
1213
	    gdk_cairo_create(GDK_DRAWABLE
1214
	    gdk_cairo_create(GDK_DRAWABLE
1214
			     (d->buffer_pixmap ? d->buffer_pixmap : d->
1215
			     (IS_VALID(d->buffer_pixmap) ? d->buffer_pixmap :
1215
			      pixmap));
1216
			                                   d->pixmap));
1216
	cairo_set_operator(fade_info->cr, CAIRO_OPERATOR_OVER);
1217
	cairo_set_operator(fade_info->cr, CAIRO_OPERATOR_OVER);
1217
    }
1218
    }
1218
1219
Lines 1324-1331 Link Here
1324
	    break;
1325
	    break;
1325
	}
1326
	}
1326
1327
1327
    if (d->buffer_pixmap && !d->button_fade_info.first_draw && d->min_drawn_buttons_region.x1 < 10000)	// if region is updated at least once
1328
    if (IS_VALID(d->buffer_pixmap) && !d->button_fade_info.first_draw &&
1329
	d->min_drawn_buttons_region.x1 < 10000)
1328
    {
1330
    {
1331
	// if region is updated at least once
1329
	gdk_draw_drawable(d->pixmap,
1332
	gdk_draw_drawable(d->pixmap,
1330
			  d->gc,
1333
			  d->gc,
1331
			  d->buffer_pixmap,
1334
			  d->buffer_pixmap,
Lines 1635-1642 Link Here
1635
    if (!d->draw_only_buttons_region)	// if not only drawing buttons
1638
    if (!d->draw_only_buttons_region)	// if not only drawing buttons
1636
    {
1639
    {
1637
	cr = gdk_cairo_create(GDK_DRAWABLE
1640
	cr = gdk_cairo_create(GDK_DRAWABLE
1638
			      (d->buffer_pixmap ? d->buffer_pixmap : d->
1641
			      (IS_VALID(d->buffer_pixmap) ? d->buffer_pixmap :
1639
			       pixmap));
1642
			                                    d->pixmap));
1640
	cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
1643
	cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
1641
	cairo_set_line_width(cr, 1.0);
1644
	cairo_set_line_width(cr, 1.0);
1642
	cairo_save(cr);
1645
	cairo_save(cr);
Lines 1751-1758 Link Here
1751
		else
1754
		else
1752
		{
1755
		{
1753
		    gdk_draw_drawable(button_region->bg_pixmap, d->gc,
1756
		    gdk_draw_drawable(button_region->bg_pixmap, d->gc,
1754
				      d->buffer_pixmap ? d->
1757
				      IS_VALID(d->buffer_pixmap) ?
1755
				      buffer_pixmap : d->pixmap, rx, ry, 0, 0,
1758
				      d->buffer_pixmap : d->pixmap,
1759
				      rx, ry, 0, 0,
1756
				      rw, rh);
1760
				      rw, rh);
1757
		}
1761
		}
1758
	    }
1762
	    }
Lines 1836-1843 Link Here
1836
    }
1840
    }
1837
    // Draw buttons
1841
    // Draw buttons
1838
1842
1839
    cr = gdk_cairo_create(GDK_DRAWABLE
1843
    cr = gdk_cairo_create(GDK_DRAWABLE (IS_VALID(d->buffer_pixmap) ?
1840
			  (d->buffer_pixmap ? d->buffer_pixmap : d->pixmap));
1844
					d->buffer_pixmap : d->pixmap));
1841
1845
1842
    cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
1846
    cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
1843
1847
Lines 1848-1854 Link Here
1848
1852
1849
    cairo_destroy(cr);
1853
    cairo_destroy(cr);
1850
1854
1851
    if (d->buffer_pixmap)
1855
    if (IS_VALID(d->buffer_pixmap))
1852
    {
1856
    {
1853
	/*if (d->draw_only_buttons_region && d->min_drawn_buttons_region.x1 < 10000)	// if region is updated at least once
1857
	/*if (d->draw_only_buttons_region && d->min_drawn_buttons_region.x1 < 10000)	// if region is updated at least once
1854
	  {
1858
	  {
Lines 1956-1962 Link Here
1956
    ushort a = SWITCHER_ALPHA;
1960
    ushort a = SWITCHER_ALPHA;
1957
    window_settings *ws = d->fs->ws;
1961
    window_settings *ws = d->fs->ws;
1958
1962
1959
    if (!d->buffer_pixmap)
1963
    if (!IS_VALID(d->buffer_pixmap))
1960
	return;
1964
	return;
1961
1965
1962
    style = gtk_widget_get_style(style_window);
1966
    style = gtk_widget_get_style(style_window);
Lines 1984-1990 Link Here
1984
    cairo_set_line_width(cr, 1.0);
1988
    cairo_set_line_width(cr, 1.0);
1985
1989
1986
    cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
1990
    cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
1987
    if (d->prop_xid || !d->buffer_pixmap)
1991
    if (d->prop_xid || !IS_VALID(d->buffer_pixmap))
1988
    {
1992
    {
1989
	draw_shadow_background(d, cr);
1993
	draw_shadow_background(d, cr);
1990
    }
1994
    }
Lines 2138-2144 Link Here
2138
    int top;
2142
    int top;
2139
    window_settings *ws = d->fs->ws;
2143
    window_settings *ws = d->fs->ws;
2140
2144
2141
    if (!d->pixmap || !d->buffer_pixmap)
2145
    if (!IS_VALID(d->pixmap) || !IS_VALID(d->buffer_pixmap))
2142
	return;
2146
	return;
2143
2147
2144
    style = gtk_widget_get_style(style_window);
2148
    style = gtk_widget_get_style(style_window);
Lines 3134-3146 Link Here
3134
    d->decorated = FALSE;
3138
    d->decorated = FALSE;
3135
    d->draw = draw_switcher_decoration;
3139
    d->draw = draw_switcher_decoration;
3136
3140
3137
    if (!d->pixmap && ws->switcher_pixmap)
3141
    if (!IS_VALID(d->pixmap) && IS_VALID(ws->switcher_pixmap))
3138
    {
3142
    {
3139
	g_object_ref (G_OBJECT (ws->switcher_pixmap));
3143
	g_object_ref (G_OBJECT (ws->switcher_pixmap));
3140
	d->pixmap = ws->switcher_pixmap;
3144
	d->pixmap = ws->switcher_pixmap;
3141
    }
3145
    }
3142
3146
3143
    if (!d->buffer_pixmap && ws->switcher_buffer_pixmap)
3147
    if (!IS_VALID(d->buffer_pixmap) && IS_VALID(ws->switcher_buffer_pixmap))
3144
    {
3148
    {
3145
	g_object_ref (G_OBJECT (ws->switcher_buffer_pixmap));
3149
	g_object_ref (G_OBJECT (ws->switcher_buffer_pixmap));
3146
	d->buffer_pixmap = ws->switcher_buffer_pixmap;
3150
	d->buffer_pixmap = ws->switcher_buffer_pixmap;
Lines 3217-3226 Link Here
3217
    if (width == d->width && height == d->height)
3221
    if (width == d->width && height == d->height)
3218
    {
3222
    {
3219
	if (!d->gc)
3223
	if (!d->gc)
3220
	    d->gc = gdk_gc_new(d->pixmap);
3224
	{
3225
	    if (d->pixmap->parent_instance.ref_count) 
3226
		d->gc = gdk_gc_new(d->pixmap);
3227
	    else 
3228
		d->pixmap = NULL;
3229
	}
3221
3230
3222
	queue_decor_draw(d);
3231
	if (d->pixmap)
3223
	return FALSE;
3232
	{
3233
	    queue_decor_draw(d);
3234
	    return FALSE;
3235
	}
3224
    }
3236
    }
3225
3237
3226
    pixmap = create_pixmap(width, height);
3238
    pixmap = create_pixmap(width, height);

Return to bug 210428