Commit cfc51b9e authored by Alberts Muktupāvels's avatar Alberts Muktupāvels
Browse files

desktop-background: remove

Next commit will readd background drawing in desktop module.
parent c7828377
......@@ -158,11 +158,6 @@ PKG_CHECK_MODULES([DESKTOP], [
gtk+-3.0 >= $GTK_REQUIRED
])
PKG_CHECK_MODULES([DESKTOP_BACKGROUND], [
gtk+-3.0 >= $GTK_REQUIRED
gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED
])
PKG_CHECK_MODULES([END_SESSION_DIALOG], [
gio-unix-2.0 >= $GLIB_REQUIRED
gtk+-3.0 >= $GTK_REQUIRED
......@@ -359,7 +354,6 @@ AC_CONFIG_FILES([
gnome-flashback/libcommon/Makefile
gnome-flashback/libclipboard/Makefile
gnome-flashback/libdesktop/Makefile
gnome-flashback/libdesktop-background/Makefile
gnome-flashback/libend-session-dialog/Makefile
gnome-flashback/libidle-monitor/Makefile
gnome-flashback/libinput-settings/Makefile
......
......@@ -7,7 +7,6 @@ gsettings_SCHEMAS = \
org.gnome.gnome-flashback.gschema.xml \
org.gnome.gnome-flashback.desktop.gschema.xml \
org.gnome.gnome-flashback.desktop.background.gschema.xml \
org.gnome.gnome-flashback.desktop-background.gschema.xml \
org.gnome.gnome-flashback.input-sources.gschema.xml \
$(NULL)
......
<schemalist gettext-domain="gnome-flashback">
<schema id="org.gnome.gnome-flashback.desktop-background" path="/org/gnome/gnome-flashback/desktop-background/">
<key name="fade" type="b">
<default>true</default>
<summary>Fade the background on change</summary>
<description>If set to true, then fade effect will be used to change the desktop background.</description>
</key>
</schema>
</schemalist>
......@@ -33,12 +33,6 @@
<summary>Desktop</summary>
</key>
<key name="desktop-background" type="b">
<default>true</default>
<summary>Desktop background</summary>
<description>If set to true, then GNOME Flashback application will be used to draw the desktop background.</description>
</key>
<key name="end-session-dialog" type="b">
<default>true</default>
<summary>End session dialog</summary>
......@@ -117,7 +111,6 @@
</key>
<child schema="org.gnome.gnome-flashback.desktop" name="desktop" />
<child schema="org.gnome.gnome-flashback.desktop-background" name="desktop-background" />
<child schema="org.gnome.gnome-flashback.input-sources" name="input-sources" />
</schema>
</schemalist>
......@@ -8,7 +8,6 @@ SUBDIRS = \
libcommon \
libclipboard \
libdesktop \
libdesktop-background \
libend-session-dialog \
libidle-monitor \
libinput-settings \
......@@ -68,7 +67,6 @@ gnome_flashback_LDADD = \
$(top_builddir)/gnome-flashback/libbluetooth-applet/libbluetooth-applet.la \
$(top_builddir)/gnome-flashback/libclipboard/libclipboard.la \
$(top_builddir)/gnome-flashback/libdesktop/libdesktop.la \
$(top_builddir)/gnome-flashback/libdesktop-background/libdesktop-background.la \
$(top_builddir)/gnome-flashback/libend-session-dialog/libend-session-dialog.la \
$(top_builddir)/gnome-flashback/libidle-monitor/libidle-monitor.la \
$(top_builddir)/gnome-flashback/libinput-settings/libinput-settings.la \
......
......@@ -29,7 +29,6 @@
#include "libbluetooth-applet/gf-bluetooth-applet.h"
#include "libclipboard/gf-clipboard.h"
#include "libdesktop/gf-desktop.h"
#include "libdesktop-background/gf-desktop-background.h"
#include "libend-session-dialog/gf-end-session-dialog.h"
#include "libidle-monitor/flashback-idle-monitor.h"
#include "libinput-settings/gf-input-settings.h"
......@@ -65,7 +64,6 @@ struct _GfApplication
GfBluetoothApplet *bluetooth;
GfClipboard *clipboard;
GfDesktop *desktop;
GfDesktopBackground *background;
GfEndSessionDialog *dialog;
GfInputSettings *input_settings;
GfInputSources *input_sources;
......@@ -165,7 +163,6 @@ settings_changed (GSettings *settings,
SETTING_CHANGED (audio_device_selection, "audio-device-selection", gf_audio_device_selection_new)
SETTING_CHANGED (bluetooth, "bluetooth-applet", gf_bluetooth_applet_new)
SETTING_CHANGED (desktop, "desktop", gf_desktop_new)
SETTING_CHANGED (background, "desktop-background", gf_desktop_background_new)
SETTING_CHANGED (clipboard, "clipboard", gf_clipboard_new)
SETTING_CHANGED (dialog, "end-session-dialog", gf_end_session_dialog_new)
SETTING_CHANGED (input_settings, "input-settings", gf_input_settings_new)
......@@ -213,7 +210,6 @@ gf_application_dispose (GObject *object)
g_clear_object (&application->audio_device_selection);
g_clear_object (&application->bluetooth);
g_clear_object (&application->desktop);
g_clear_object (&application->background);
g_clear_object (&application->clipboard);
g_clear_object (&application->dialog);
g_clear_object (&application->input_settings);
......
NULL =
noinst_LTLIBRARIES = \
libdesktop-background.la \
$(NULL)
libdesktop_background_la_CPPFLAGS = \
-DG_LOG_DOMAIN=\"desktop-background\" \
-DG_LOG_USE_STRUCTURED=1 \
$(NULL)
libdesktop_background_la_CFLAGS = \
$(DESKTOP_BACKGROUND_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CFLAGS) \
-I$(top_builddir)/gnome-flashback/libdesktop-background \
-DGNOME_DESKTOP_USE_UNSTABLE_API \
$(NULL)
libdesktop_background_la_SOURCES = \
gf-desktop-background.c \
gf-desktop-background.h \
$(NULL)
libdesktop_background_la_LDFLAGS = \
$(WARN_LDFLAGS) \
$(AM_LDFLAGS) \
$(NULL)
libdesktop_background_la_LIBADD = \
$(DESKTOP_BACKGROUND_LIBS) \
$(NULL)
-include $(top_srcdir)/git.mk
/*
* Copyright (C) 2014 - 2016 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gtk/gtk.h>
#include <libgnome-desktop/gnome-bg.h>
#include "gf-desktop-background.h"
struct _GfDesktopBackground
{
GObject parent;
gulong monitors_changed_id;
gulong size_changed_id;
gulong change_event_id;
guint redraw_idle_id;
GnomeBG *bg;
GnomeBGCrossfade *fade;
GSettings *settings;
};
G_DEFINE_TYPE (GfDesktopBackground, gf_desktop_background, G_TYPE_OBJECT)
static void
fade_finished_cb (GfDesktopBackground *background)
{
g_clear_object (&background->fade);
}
static void
draw_background (GfDesktopBackground *background,
gboolean fade)
{
GdkScreen *screen;
GdkWindow *root;
gint width;
gint height;
cairo_surface_t *surface;
screen = gdk_screen_get_default ();
root = gdk_screen_get_root_window (screen);
width = gdk_window_get_width (root);
height = gdk_window_get_height (root);
surface = gnome_bg_create_surface (background->bg, root, width, height, TRUE);
if (fade)
{
if (background->fade != NULL)
g_object_unref (background->fade);
background->fade = gnome_bg_set_surface_as_root_with_crossfade (screen,
surface);
g_signal_connect_swapped (background->fade, "finished",
G_CALLBACK (fade_finished_cb), background);
}
else
{
gnome_bg_set_surface_as_root (screen, surface);
}
cairo_surface_destroy (surface);
}
static gboolean
change_event_cb (GSettings *settings,
gpointer keys,
gint n_keys,
GfDesktopBackground *background)
{
gnome_bg_load_from_preferences (background->bg, background->settings);
return TRUE;
}
static void
changed_cb (GnomeBG *bg,
GfDesktopBackground *background)
{
GSettings *settings;
gboolean fade;
settings = g_settings_new ("org.gnome.gnome-flashback.desktop-background");
fade = g_settings_get_boolean (settings, "fade");
draw_background (background, fade);
g_object_unref (settings);
}
static void
transitioned_cb (GnomeBG *bg,
GfDesktopBackground *background)
{
draw_background (background, FALSE);
}
static gboolean
redraw_cb (gpointer user_data)
{
GfDesktopBackground *background;
background = GF_DESKTOP_BACKGROUND (user_data);
draw_background (background, FALSE);
background->redraw_idle_id = 0;
return G_SOURCE_REMOVE;
}
static void
queue_redraw (GfDesktopBackground *background)
{
if (background->redraw_idle_id != 0)
return;
background->redraw_idle_id = g_idle_add (redraw_cb, background);
}
static void
monitors_changed_cb (GdkScreen *screen,
GfDesktopBackground *background)
{
queue_redraw (background);
}
static void
size_changed_cb (GdkScreen *screen,
GfDesktopBackground *background)
{
queue_redraw (background);
}
static void
gf_desktop_background_dispose (GObject *object)
{
GfDesktopBackground *background;
GdkScreen *screen;
background = GF_DESKTOP_BACKGROUND (object);
screen = gdk_screen_get_default ();
if (background->monitors_changed_id != 0)
{
g_signal_handler_disconnect (screen, background->monitors_changed_id);
background->monitors_changed_id = 0;
}
if (background->size_changed_id != 0)
{
g_signal_handler_disconnect (screen, background->size_changed_id);
background->size_changed_id = 0;
}
if (background->change_event_id != 0)
{
g_signal_handler_disconnect (background->settings, background->change_event_id);
background->change_event_id = 0;
}
if (background->redraw_idle_id != 0)
{
g_source_remove (background->redraw_idle_id);
background->redraw_idle_id = 0;
}
g_clear_object (&background->bg);
g_clear_object (&background->fade);
g_clear_object (&background->settings);
G_OBJECT_CLASS (gf_desktop_background_parent_class)->dispose (object);
}
static void
gf_desktop_background_class_init (GfDesktopBackgroundClass *background_class)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (background_class);
object_class->dispose = gf_desktop_background_dispose;
}
static void
gf_desktop_background_init (GfDesktopBackground *background)
{
GdkScreen *screen;
screen = gdk_screen_get_default ();
background->monitors_changed_id =
g_signal_connect (screen, "monitors-changed",
G_CALLBACK (monitors_changed_cb), background);
background->size_changed_id =
g_signal_connect (screen, "size-changed",
G_CALLBACK (size_changed_cb), background);
background->bg = gnome_bg_new ();
g_signal_connect (background->bg, "changed",
G_CALLBACK (changed_cb), background);
g_signal_connect (background->bg, "transitioned",
G_CALLBACK (transitioned_cb), background);
background->settings = g_settings_new ("org.gnome.desktop.background");
background->change_event_id =
g_signal_connect (background->settings, "change-event",
G_CALLBACK (change_event_cb), background);
gnome_bg_load_from_preferences (background->bg, background->settings);
}
GfDesktopBackground *
gf_desktop_background_new (void)
{
return g_object_new (GF_TYPE_DESKTOP_BACKGROUND, NULL);
}
/*
* Copyright (C) 2014 - 2015 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GF_DESKTOP_BACKGROUND_H
#define GF_DESKTOP_BACKGROUND_H
#include <glib-object.h>
G_BEGIN_DECLS
#define GF_TYPE_DESKTOP_BACKGROUND gf_desktop_background_get_type ()
G_DECLARE_FINAL_TYPE (GfDesktopBackground, gf_desktop_background,
GF, DESKTOP_BACKGROUND, GObject)
GfDesktopBackground *gf_desktop_background_new (void);
G_END_DECLS
#endif
......@@ -9,7 +9,6 @@ data/directories/X-GNOME-Flashback-Settings-System.directory.desktop.in
data/schemas/org.gnome.gnome-flashback.gschema.xml
data/schemas/org.gnome.gnome-flashback.desktop.gschema.xml
data/schemas/org.gnome.gnome-flashback.desktop.background.gschema.xml
data/schemas/org.gnome.gnome-flashback.desktop-background.gschema.xml
data/schemas/org.gnome.gnome-flashback.input-sources.gschema.xml
data/ui/gf-confirm-display-change-dialog.ui
data/xsessions/gnome-flashback-compiz.desktop.in.in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment