[gnome-applets] stickynotes: Fix the build with gtk3



commit 9cb63db161552427a959e3df4a6cbec30b09cb62
Author: Christian Persch <chpe gnome org>
Date:   Thu Oct 28 14:37:29 2010 +0200

    stickynotes: Fix the build with gtk3

 stickynotes/Makefile.am                    |    2 +-
 stickynotes/stickynotes.c                  |    7 +---
 stickynotes/stickynotes_applet.c           |    4 +-
 stickynotes/stickynotes_applet_callbacks.c |   55 +++-------------------------
 stickynotes/stickynotes_applet_callbacks.h |    5 ---
 5 files changed, 10 insertions(+), 63 deletions(-)
---
diff --git a/stickynotes/Makefile.am b/stickynotes/Makefile.am
index c279952..212d210 100644
--- a/stickynotes/Makefile.am
+++ b/stickynotes/Makefile.am
@@ -39,7 +39,7 @@ stickynotes_applet_LDADD =	\
 
 builder_DATA = $(builder_files)
 
-uidir = $(datadir)/gnome-2.0/ui
+uidir = $(pkgdatadir)/ui
 ui_DATA = $(ui_files)
 
 schemasdir = @GCONF_SCHEMA_FILE_DIR@
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c
index d390fd3..a18e8b3 100644
--- a/stickynotes/stickynotes.c
+++ b/stickynotes/stickynotes.c
@@ -56,7 +56,7 @@ set_icon_geometry  (GdkWindow *window,
       XChangeProperty (dpy,
                        GDK_WINDOW_XID (window),
                        gdk_x11_get_xatom_by_name_for_display (
-			       gdk_drawable_get_display (window),
+			       gdk_window_get_display (window),
 			       "_NET_WM_ICON_GEOMETRY"),
 		       XA_CARDINAL, 32, PropModeReplace,
                        (guchar *)&data, 4);
@@ -501,11 +501,6 @@ stickynote_set_color (StickyNote  *note,
 		gdk_color_parse ("black", &colors[4]);
 		gdk_color_parse ("white", &colors[5]);
 
-		/* Allocate these colors */
-		gdk_colormap_alloc_colors (gtk_widget_get_colormap (
-					note->w_window),
-				colors, 6, FALSE, TRUE, success);
-
 		/* Apply colors to style */
 		rc_style->base[GTK_STATE_NORMAL] = colors[0];
 		rc_style->bg[GTK_STATE_PRELIGHT] = colors[1];
diff --git a/stickynotes/stickynotes_applet.c b/stickynotes/stickynotes_applet.c
index 9e5eb11..06d6a7f 100644
--- a/stickynotes/stickynotes_applet.c
+++ b/stickynotes/stickynotes_applet.c
@@ -418,11 +418,11 @@ StickyNotesApplet * stickynotes_applet_new(PanelApplet *panel_applet)
 			G_CALLBACK(applet_size_allocate_cb), applet);
 	g_signal_connect(G_OBJECT(applet->w_applet), "change-orient",
 			G_CALLBACK(applet_change_orient_cb), applet);
-	g_signal_connect(G_OBJECT(applet->w_applet), "change_background",
-			G_CALLBACK(applet_change_bg_cb), applet);
 	g_signal_connect(G_OBJECT(applet->w_applet), "destroy",
 			G_CALLBACK(applet_destroy_cb), applet);
 
+        panel_applet_set_background_widget (panel_applet, applet->w_applet);
+
 	atk_obj = gtk_widget_get_accessible (applet->w_applet);
 	atk_object_set_name (atk_obj, _("Sticky Notes"));
 
diff --git a/stickynotes/stickynotes_applet_callbacks.c b/stickynotes/stickynotes_applet_callbacks.c
index a25ff24..f88e832 100644
--- a/stickynotes/stickynotes_applet_callbacks.c
+++ b/stickynotes/stickynotes_applet_callbacks.c
@@ -110,10 +110,10 @@ applet_key_cb (GtkWidget         *widget,
 {
 	switch (event->keyval)
 	{
-		case GDK_KP_Space:
-		case GDK_space:
-		case GDK_KP_Enter:
-		case GDK_Return:
+		case GDK_KEY_KP_Space:
+		case GDK_KEY_space:
+		case GDK_KEY_KP_Enter:
+		case GDK_KEY_Return:
 			stickynote_show_notes (TRUE);
 			return TRUE;
 	}
@@ -179,13 +179,13 @@ void install_check_click_on_desktop (void)
 		Window *data;
 
 		/* We only use this extra property if the actual user-time property's missing */
-		int  status = XGetWindowProperty( GDK_DISPLAY(), desktop_window, user_time,
+		int  status = XGetWindowProperty( GDK_DISPLAY_XDISPLAY(gdk_window_get_display(window)), desktop_window, user_time,
 					0, 4, False, AnyPropertyType, &actual_type, &actual_format,
 					&nitems, &bytes, (unsigned char **)&data );
 		if (actual_type == None)
 		{
 			/* No user-time property, so look for the user-time-window */
-			status = XGetWindowProperty( GDK_DISPLAY(), desktop_window, user_time_window,
+                        status = XGetWindowProperty( GDK_DISPLAY_XDISPLAY(gdk_window_get_display(window)), desktop_window, user_time_window,
 					0, 4, False, AnyPropertyType, &actual_type, &actual_format,
 					&nitems, &bytes, (unsigned char **)&data );
 			if (actual_type != None)
@@ -227,49 +227,6 @@ void applet_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation, Stick
 	return;
 }
 
-/* Applet Callback : Change the applet background. */
-void
-applet_change_bg_cb (PanelApplet *panel_applet,
-		     PanelAppletBackgroundType type,
-		     GdkColor *color,
-		     GdkPixmap *pixmap,
-		     StickyNotesApplet *applet)
-{
-	/* Taken from TrashApplet */
-	GtkRcStyle *rc_style;
-	GtkStyle *style;
-
-	if (!applet) g_print ("arrg, no applet!\n");
-
-	/* reset style */
-	gtk_widget_set_style (GTK_WIDGET (applet->w_applet), NULL);
-	rc_style = gtk_rc_style_new ();
-	gtk_widget_modify_style (GTK_WIDGET (applet->w_applet), rc_style);
-	g_object_unref (rc_style);
-
-	switch (type)
-	{
-		case PANEL_NO_BACKGROUND:
-			break;
-		case PANEL_COLOR_BACKGROUND:
-			gtk_widget_modify_bg (GTK_WIDGET (applet->w_applet),
-					GTK_STATE_NORMAL, color);
-			break;
-		case PANEL_PIXMAP_BACKGROUND:
-			style = gtk_style_copy (
-					gtk_widget_get_style (GTK_WIDGET (applet->w_applet)));
-			if (style->bg_pixmap[GTK_STATE_NORMAL])
-				g_object_unref (
-					style->bg_pixmap[GTK_STATE_NORMAL]);
-			style->bg_pixmap[GTK_STATE_NORMAL] = g_object_ref (
-					pixmap);
-			gtk_widget_set_style (
-					GTK_WIDGET (applet->w_applet), style);
-			g_object_unref (style);
-			break;
-	}
-}
-
 /* Applet Callback : Deletes the applet. */
 void applet_destroy_cb (PanelApplet *panel_applet, StickyNotesApplet *applet)
 {
diff --git a/stickynotes/stickynotes_applet_callbacks.h b/stickynotes/stickynotes_applet_callbacks.h
index 75b826f..95b66a4 100644
--- a/stickynotes/stickynotes_applet_callbacks.h
+++ b/stickynotes/stickynotes_applet_callbacks.h
@@ -30,11 +30,6 @@ gboolean applet_focus_cb(GtkWidget *widget, GdkEventFocus *event, StickyNotesApp
 void install_check_click_on_desktop (void);
 void applet_change_orient_cb(PanelApplet *panel_applet, PanelAppletOrient orient, StickyNotesApplet *applet);
 void applet_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation, StickyNotesApplet *applet);
-void applet_change_bg_cb (PanelApplet *panel_applet,
-				 PanelAppletBackgroundType type,
-				 GdkColor *color,
-                     		 GdkPixmap *pixmap,
-                     		 StickyNotesApplet *applet);
 void applet_destroy_cb (PanelApplet *panel_applet, StickyNotesApplet *applet);
 /* Callbacks for sticky notes applet menu */
 void menu_create_cb(GtkAction *action, StickyNotesApplet *applet);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]