View | Details | Raw Unified | Return to bug 135448
Collapse All | Expand All

(-)gnome-panel/ChangeLog (+19 lines)
Lines 1-3 Link Here
1
2006-01-09  Vincent Untz  <vuntz@gnome.org>
2
3
	* panel-background.c: (panel_background_prepare): notify for change
4
	here instead of... (since we want to notify for change when the size
5
	of panel changes, eg)
6
	(panel_background_composite): here
7
	(panel_background_set_image_background_on_widget): rewrite with cairo
8
	goodness so that we correctly handle tiles
9
	Fix part of bug #164349.
10
	* panel-menu-bar.c: (panel_menu_bar_setup_tooltip): add a FIXME
11
12
2006-01-06  William Jon McCann  <mccann@jhu.edu>
13
14
	* panel-util.c (panel_lock_screen_action_get_command): 
15
	* panel-action-button.c (panel_action_lock_setup_menu):
16
	Remove the screensaver exit and restart commands.  I think
17
	that was for restarting xscreensaver to activate new prefs.
18
	Fixes bug #326059
19
1
==================== 2.13.4 ====================
20
==================== 2.13.4 ====================
2
21
3
2006-01-01  Vincent Untz  <vuntz@gnome.org>
22
2006-01-01  Vincent Untz  <vuntz@gnome.org>
(-)gnome-panel/panel-background.c (-18 / +36 lines)
Lines 28-33 Link Here
28
28
29
#include <string.h>
29
#include <string.h>
30
#include <gdk/gdkx.h>
30
#include <gdk/gdkx.h>
31
#include <cairo.h>
32
#include <cairo-xlib.h> //FIXME should be removed when gdk_cairo_set_source_pixmap() is available (GTK+ 2.10)
31
33
32
#include "panel-background-monitor.h"
34
#include "panel-background-monitor.h"
33
#include "panel-gdk-pixbuf-extensions.h"
35
#include "panel-gdk-pixbuf-extensions.h"
Lines 146-151 panel_background_prepare (PanelBackgroun Link Here
146
148
147
	background->prepared = TRUE;
149
	background->prepared = TRUE;
148
150
151
	background->notify_changed (background, background->user_data);
152
149
	return TRUE;
153
	return TRUE;
150
}
154
}
151
155
Lines 326-333 panel_background_composite (PanelBackgro Link Here
326
330
327
	panel_background_prepare (background);
331
	panel_background_prepare (background);
328
332
329
	background->notify_changed (background, background->user_data);
330
331
	return TRUE;
333
	return TRUE;
332
}
334
}
333
335
Lines 477-483 panel_background_transform (PanelBackgro Link Here
477
479
478
	free_transformed_resources (background);
480
	free_transformed_resources (background);
479
481
480
	if (background->type == PANEL_BACK_IMAGE) 
482
	if (background->type == PANEL_BACK_IMAGE)
481
		background->transformed_image =
483
		background->transformed_image =
482
			get_scaled_and_rotated_pixbuf (background);
484
			get_scaled_and_rotated_pixbuf (background);
483
485
Lines 1050-1082 static void Link Here
1050
panel_background_set_image_background_on_widget (PanelBackground *background,
1052
panel_background_set_image_background_on_widget (PanelBackground *background,
1051
						 GtkWidget       *widget)
1053
						 GtkWidget       *widget)
1052
{
1054
{
1053
	const GdkPixmap  *bg_pixmap;
1055
	const GdkPixmap *bg_pixmap;
1054
	GdkPixmap        *pixmap;
1056
	GdkPixmap       *pixmap;
1057
	int              width;
1058
	int              height;
1059
	cairo_t         *cr;
1060
	cairo_surface_t *surface;
1061
	cairo_pattern_t *pattern;
1062
	cairo_matrix_t   matrix;
1055
	GtkStyle         *style;
1063
	GtkStyle         *style;
1056
	GdkGC            *gc;
1057
1064
1058
	bg_pixmap = panel_background_get_pixmap (background);
1065
	bg_pixmap = panel_background_get_pixmap (background);
1059
	if (!bg_pixmap)
1066
	if (!bg_pixmap)
1060
		return;
1067
		return;
1061
1068
1062
	gc = gdk_gc_new (widget->window);
1069
	gdk_drawable_get_size (GDK_DRAWABLE (bg_pixmap), &width, &height);
1063
	g_return_if_fail (GDK_IS_GC (gc));
1070
1071
	//FIXME gdk_cairo_set_source_pixmap() should do the trick (GTK+ 2.10)
1072
	surface = cairo_xlib_surface_create (gdk_x11_drawable_get_xdisplay (widget->window),
1073
 					     gdk_x11_drawable_get_xid (GDK_DRAWABLE (bg_pixmap)),
1074
					     gdk_x11_visual_get_xvisual (gdk_drawable_get_visual (widget->window)),
1075
					     width, height);
1076
1077
	pattern = cairo_pattern_create_for_surface (surface);
1078
	cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
1079
	cairo_matrix_init_translate (&matrix,
1080
				     widget->allocation.x,
1081
				     widget->allocation.y);
1082
	cairo_pattern_set_matrix (pattern, &matrix);
1064
1083
1065
	pixmap = gdk_pixmap_new (widget->window,
1084
	pixmap = gdk_pixmap_new (widget->window,
1066
				 widget->allocation.width,
1085
				 widget->allocation.width,
1067
				 widget->allocation.height,
1086
				 widget->allocation.height,
1068
				 -1);
1087
				 -1);
1069
1088
1070
	gdk_draw_drawable (GDK_DRAWABLE (pixmap),
1089
	cr = gdk_cairo_create (GDK_DRAWABLE (pixmap));
1071
			   gc, 
1090
	cairo_set_source (cr, pattern);
1072
			   GDK_DRAWABLE (bg_pixmap),
1091
	cairo_rectangle (cr, 0, 0,
1073
			   widget->allocation.x,
1092
			 widget->allocation.width, widget->allocation.height);
1074
			   widget->allocation.y,
1093
	cairo_fill (cr);
1075
			   0, 0,
1094
1076
			   widget->allocation.width,
1095
	cairo_pattern_destroy (pattern);
1077
			   widget->allocation.height);
1096
	cairo_surface_destroy (surface);
1078
1097
	cairo_destroy (cr);
1079
	g_object_unref (gc);
1080
1098
1081
	style = gtk_style_copy (widget->style);
1099
	style = gtk_style_copy (widget->style);
1082
	if (style->bg_pixmap[GTK_STATE_NORMAL])
1100
	if (style->bg_pixmap[GTK_STATE_NORMAL])
(-)libpanel-applet/ChangeLog (+7 lines)
Lines 1-3 Link Here
1
2006-01-09  Vincent Untz  <vuntz@gnome.org>
2
3
	* panel-applet.c: (panel_applet_get_pixmap): rewrite with cairo
4
	goodness so that we correctly handle tiles. Also, grab the display to
5
	avoid crashes with xid that are being removed.
6
	Fix part of bug #164349.
7
1
==================== 2.13.4 ====================
8
==================== 2.13.4 ====================
2
9
3
2005-12-30  Vincent Untz  <vuntz@gnome.org>
10
2005-12-30  Vincent Untz  <vuntz@gnome.org>
(-)libpanel-applet/panel-applet.c (-22 / +49 lines)
Lines 29-34 Link Here
29
#include <unistd.h>
29
#include <unistd.h>
30
#include <stdlib.h>
30
#include <stdlib.h>
31
#include <string.h>
31
#include <string.h>
32
#include <cairo.h>
33
#include <cairo-xlib.h> //FIXME should be removed when gdk_cairo_set_source_pixmap() is available (GTK+ 2.10)
32
#include <gdk/gdk.h>
34
#include <gdk/gdk.h>
33
#include <gdk/gdkx.h>
35
#include <gdk/gdkx.h>
34
#include <gdk/gdkkeysyms.h>
36
#include <gdk/gdkkeysyms.h>
Lines 942-990 panel_applet_get_pixmap (PanelApplet Link Here
942
			 int              x,
944
			 int              x,
943
			 int              y)
945
			 int              y)
944
{
946
{
945
	GdkPixmap  *pixmap;
947
	gboolean         display_grabbed;
946
	GdkDisplay *display;
948
	GdkPixmap       *pixmap;
947
	GdkPixmap  *retval;
949
	GdkDisplay      *display;
948
	GdkGC      *gc;
950
	GdkPixmap       *retval;
949
	int         width;
951
	int              width;
950
	int         height;
952
	int              height;
953
	cairo_t         *cr;
954
	cairo_surface_t *surface;
955
	cairo_pattern_t *pattern;
956
	cairo_matrix_t   matrix;
951
957
952
	g_return_val_if_fail (PANEL_IS_APPLET (applet), NULL);
958
	g_return_val_if_fail (PANEL_IS_APPLET (applet), NULL);
953
959
954
	if (!GTK_WIDGET_REALIZED (applet))
960
	if (!GTK_WIDGET_REALIZED (applet))
955
		return NULL;
961
		return NULL;
956
962
957
	gc = gdk_gc_new (GDK_DRAWABLE (GTK_WIDGET (applet)->window));
958
959
	g_return_val_if_fail (GDK_IS_GC (gc), NULL);
960
961
	display = gdk_display_get_default ();
963
	display = gdk_display_get_default ();
962
	
964
	display_grabbed = FALSE;
965
963
	pixmap = gdk_pixmap_lookup_for_display (display, xid);
966
	pixmap = gdk_pixmap_lookup_for_display (display, xid);
964
	if (pixmap)
967
	if (pixmap)
965
		g_object_ref (pixmap);
968
		g_object_ref (pixmap);
966
	else
969
	else {
970
		display_grabbed = TRUE;
971
		gdk_x11_display_grab (display);
967
		pixmap = gdk_pixmap_foreign_new_for_display (display, xid);
972
		pixmap = gdk_pixmap_foreign_new_for_display (display, xid);
973
	}
968
974
969
	/* This can happen if the user changes the background very fast.
975
	/* This can happen if the user changes the background very fast.
970
	 * We'll get the next update, so it's not a big deal. */
976
	 * We'll get the next update, so it's not a big deal. */
971
	if (pixmap == NULL)
977
	if (pixmap == NULL) {
978
		if (display_grabbed)
979
			gdk_x11_display_ungrab (display);
972
		return NULL;
980
		return NULL;
981
	}
982
983
	gdk_drawable_get_size (GDK_DRAWABLE (pixmap), &width, &height);
984
985
	//FIXME gdk_cairo_set_source_pixmap() should do the trick (GTK+ 2.10)
986
	surface = cairo_xlib_surface_create (GDK_DISPLAY_XDISPLAY (display),
987
 					     //xid,
988
					     gdk_x11_drawable_get_xid (GDK_DRAWABLE (pixmap)),
989
					     gdk_x11_visual_get_xvisual (gdk_drawable_get_visual (GTK_WIDGET (applet)->window)),
990
					     width, height);
991
992
	pattern = cairo_pattern_create_for_surface (surface);
993
	cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
994
	cairo_matrix_init_translate (&matrix, x, y);
995
	cairo_pattern_set_matrix (pattern, &matrix);
973
996
974
	gdk_drawable_get_size (GDK_DRAWABLE (GTK_WIDGET (applet)->window),
997
	gdk_drawable_get_size (GDK_DRAWABLE (GTK_WIDGET (applet)->window),
975
			       &width, &height);
998
			       &width, &height);
999
	retval = gdk_pixmap_new (GTK_WIDGET (applet)->window,
1000
				 width, height, -1);
976
1001
977
	retval = gdk_pixmap_new (GTK_WIDGET (applet)->window, width, height, -1);
1002
	cr = gdk_cairo_create (GDK_DRAWABLE (retval));
1003
	cairo_set_source (cr, pattern);
1004
	cairo_rectangle (cr, 0, 0, width, height);
1005
	cairo_fill (cr);
1006
1007
	cairo_pattern_destroy (pattern);
1008
	cairo_surface_destroy (surface);
1009
	cairo_destroy (cr);
978
1010
979
	gdk_draw_drawable (GDK_DRAWABLE (retval),
980
			   gc, 
981
			   GDK_DRAWABLE (pixmap),
982
			   x, y,
983
			   0, 0,
984
			   width, height);
985
986
	g_object_unref (gc);
987
	g_object_unref (pixmap);
1011
	g_object_unref (pixmap);
1012
1013
	if (display_grabbed)
1014
		gdk_x11_display_ungrab (display);
988
1015
989
	return retval;
1016
	return retval;
990
}
1017
}

Return to bug 135448