[gnome-flashback] libdesktop-background: don't use custom signal
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] libdesktop-background: don't use custom signal
- Date: Sat, 27 Sep 2014 00:05:09 +0000 (UTC)
commit 11e4909f8f06cf9742f4230decdddc1698fc5d02
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Sep 27 02:16:19 2014 +0300
libdesktop-background: don't use custom signal
.../libdesktop-background/desktop-background.c | 23 +++++++-------
.../libdesktop-background/desktop-window.c | 31 --------------------
2 files changed, 12 insertions(+), 42 deletions(-)
---
diff --git a/gnome-flashback/libdesktop-background/desktop-background.c
b/gnome-flashback/libdesktop-background/desktop-background.c
index 9583f2b..6bdd94d 100644
--- a/gnome-flashback/libdesktop-background/desktop-background.c
+++ b/gnome-flashback/libdesktop-background/desktop-background.c
@@ -386,6 +386,16 @@ desktop_background_change_event (GSettings *settings,
}
static void
+size_allocate (GtkWidget *widget,
+ GtkAllocation *allocation,
+ gpointer user_data)
+{
+ DesktopBackground *background = DESKTOP_BACKGROUND (user_data);
+
+ queue_background_change (user_data);
+}
+
+static void
desktop_background_finalize (GObject *object)
{
DesktopBackground *background;
@@ -413,15 +423,6 @@ desktop_background_finalize (GObject *object)
}
static void
-desktop_background_update (DesktopWindow *window,
- gpointer user_data)
-{
- DesktopBackground *background = DESKTOP_BACKGROUND (user_data);
-
- queue_background_change (user_data);
-}
-
-static void
desktop_background_init (DesktopBackground *background)
{
DesktopBackgroundPrivate *priv;
@@ -443,8 +444,8 @@ desktop_background_init (DesktopBackground *background)
G_CALLBACK (desktop_background_change_event), background);
priv->background = desktop_window_new ();
- g_signal_connect (priv->background, "update",
- G_CALLBACK (desktop_background_update), background);
+ g_signal_connect (priv->background, "size-allocate",
+ G_CALLBACK (size_allocate), background);
queue_background_change (background);
diff --git a/gnome-flashback/libdesktop-background/desktop-window.c
b/gnome-flashback/libdesktop-background/desktop-window.c
index 41a01a5..b9fe495 100644
--- a/gnome-flashback/libdesktop-background/desktop-window.c
+++ b/gnome-flashback/libdesktop-background/desktop-window.c
@@ -26,13 +26,6 @@ struct _DesktopWindowPrivate {
G_DEFINE_TYPE_WITH_PRIVATE (DesktopWindow, desktop_window, GTK_TYPE_WINDOW);
-enum {
- UPDATE_SIGNAL,
- LAST_SIGNAL
-};
-
-static guint signals [LAST_SIGNAL] = { 0 };
-
static void
desktop_window_screen_changed (GdkScreen *screen,
gpointer user_data)
@@ -49,8 +42,6 @@ desktop_window_screen_changed (GdkScreen *screen,
"width-request", width,
"height-request", height,
NULL);
-
- g_signal_emit (window, signals [UPDATE_SIGNAL], 0);
}
static void
@@ -129,16 +120,6 @@ desktop_window_init (DesktopWindow *window)
}
static void
-desktop_window_style_updated (GtkWidget *widget)
-{
- DesktopWindow *window = DESKTOP_WINDOW (widget);
-
- GTK_WIDGET_CLASS (desktop_window_parent_class)->style_updated (widget);
-
- g_signal_emit (window, signals [UPDATE_SIGNAL], 0);
-}
-
-static void
desktop_window_class_init (DesktopWindowClass *class)
{
GObjectClass *object_class;
@@ -152,18 +133,6 @@ desktop_window_class_init (DesktopWindowClass *class)
widget_class->realize = desktop_window_relaize;
widget_class->unrealize = desktop_window_unrelaize;
widget_class->map = desktop_window_map;
- widget_class->style_updated = desktop_window_style_updated;
-
- signals [UPDATE_SIGNAL] =
- g_signal_new ("update",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- 0,
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
}
GtkWidget *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]