Esempio n. 1
0
static void
eel_background_unrealize (EelBackground *self)
{
    free_background_surface (self);

    self->details->bg_entire_width = 0;
    self->details->bg_entire_height = 0;
    self->details->default_color.red = 0xffff;
    self->details->default_color.green = 0xffff;
    self->details->default_color.blue = 0xffff;
}
static void
athena_desktop_background_unrealize (AthenaDesktopBackground *self)
{
	free_background_surface (self);

	self->details->background_entire_width = 0;
	self->details->background_entire_height = 0;
	self->details->default_color.red = 0xffff;
	self->details->default_color.green = 0xffff;
	self->details->default_color.blue = 0xffff;
}
Esempio n. 3
0
static gboolean
eel_background_ensure_realized (EelBackground *self)
{
    GtkStyle *style;
    int width, height;
    GdkWindow *window;

    /* Set the default color */
    style = gtk_widget_get_style (self->details->widget);
    if (self->details->use_base) {
       self->details->default_color = style->base[GTK_STATE_NORMAL];
    } else {
        self->details->default_color = style->bg[GTK_STATE_NORMAL];
    }

    /* If the window size is the same as last time, don't update */
    drawable_get_adjusted_size (self, &width, &height);
    if (width == self->details->bg_entire_width &&
        height == self->details->bg_entire_height)
    {
        return FALSE;
    }

    free_background_surface (self);

    /* Calls mate_bg_set_color, which sets "ignore-pending-change" to false,
       and queues emission of changed signal if it's still false */
    set_image_properties (self);

    window = gtk_widget_get_window (self->details->widget);
    self->details->bg_surface = mate_bg_create_surface (self->details->bg,
        						window, width, height,
        						self->details->is_desktop);
    self->details->unset_root_surface = self->details->is_desktop;

    /* We got the surface and everything, so we don't care about a change
       that is pending (unless things actually change after this time) */
    g_object_set_data (G_OBJECT (self->details->bg),
                       "ignore-pending-change",
                       GINT_TO_POINTER (TRUE));

    self->details->bg_entire_width = width;
    self->details->bg_entire_height = height;

    return TRUE;
}
Esempio n. 4
0
static void
eel_background_finalize (GObject *object)
{
    EelBackground *self = EEL_BACKGROUND (object);

    g_free (self->details->color);

    if (self->details->bg != NULL) {
        g_object_unref (G_OBJECT (self->details->bg));
        self->details->bg = NULL;
    }

    free_background_surface (self);

    free_fade (self);

    G_OBJECT_CLASS (eel_background_parent_class)->finalize (object);
}
static void
athena_desktop_background_finalize (GObject *object)
{
	AthenaDesktopBackground *self;

	self = ATHENA_DESKTOP_BACKGROUND (object);

	g_signal_handlers_disconnect_by_func (gnome_background_preferences,
					      background_settings_change_event_cb,
					      self);

	free_background_surface (self);
	free_fade (self);

	g_clear_object (&self->details->bg);

	G_OBJECT_CLASS (athena_desktop_background_parent_class)->finalize (object);
}
Esempio n. 6
0
static gboolean
eel_background_ensure_realized (EelBackground *self)
{
    GtkStyle *style;
    int width, height;
    GdkWindow *window;

    /* Set the default color */
    style = gtk_widget_get_style (self->details->widget);
    if (self->details->use_base) {
       self->details->default_color = style->base[GTK_STATE_NORMAL];
    } else {
        self->details->default_color = style->bg[GTK_STATE_NORMAL];
    }

    /* If the window size is the same as last time, don't update */
    drawable_get_adjusted_size (self, &width, &height);
    if (width == self->details->bg_entire_width &&
        height == self->details->bg_entire_height)
    {
        return FALSE;
    }

    free_background_surface (self);

    set_image_properties (self);

    window = gtk_widget_get_window (self->details->widget);
    self->details->bg_surface = mate_bg_create_surface (self->details->bg,
        						window, width, height,
        						self->details->is_desktop);
    self->details->unset_root_surface = self->details->is_desktop;

    self->details->bg_entire_width = width;
    self->details->bg_entire_height = height;

    return TRUE;
}
static gboolean
athena_desktop_background_ensure_realized (AthenaDesktopBackground *self)
{
	int entire_width;
	int entire_height;
	GdkScreen *screen;
	GdkWindow *window;

	screen = gtk_widget_get_screen (self->details->widget);
	entire_height = gdk_screen_get_height (screen);
	entire_width = gdk_screen_get_width (screen);

	/* If the window size is the same as last time, don't update */
	if (entire_width == self->details->background_entire_width &&
	    entire_height == self->details->background_entire_height) {
		return FALSE;
	}

	free_background_surface (self);

	window = gtk_widget_get_window (self->details->widget);
	self->details->background_surface = gnome_bg_create_surface (self->details->bg,
                                                                     window,
                                                                     entire_width, entire_height,
                                                                     TRUE);

	/* We got the surface and everything, so we don't care about a change
	   that is pending (unless things actually change after this time) */
	g_object_set_data (G_OBJECT (self),
			   "ignore-pending-change", GINT_TO_POINTER (TRUE));

	self->details->background_entire_width = entire_width;
	self->details->background_entire_height = entire_height;

	return TRUE;
}