summaryrefslogtreecommitdiff
path: root/libmate-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'libmate-desktop')
-rw-r--r--libmate-desktop/mate-aboutdialog.c9
-rw-r--r--libmate-desktop/mate-aboutdialog.h1
-rw-r--r--libmate-desktop/mate-bg-crossfade.h9
-rw-r--r--libmate-desktop/mate-bg.h9
-rw-r--r--libmate-desktop/mate-colorbutton.h1
-rw-r--r--libmate-desktop/mate-colorsel.c78
-rw-r--r--libmate-desktop/mate-colorsel.h1
-rw-r--r--libmate-desktop/mate-colorseldialog.h1
-rw-r--r--libmate-desktop/mate-desktop-item.h8
-rw-r--r--libmate-desktop/mate-desktop-thumbnail.c99
-rw-r--r--libmate-desktop/mate-desktop-thumbnail.h8
-rw-r--r--libmate-desktop/mate-desktop-utils.c21
-rw-r--r--libmate-desktop/mate-desktop-utils.h15
-rw-r--r--libmate-desktop/mate-rr.c6
-rw-r--r--libmate-desktop/private.h10
15 files changed, 57 insertions, 219 deletions
diff --git a/libmate-desktop/mate-aboutdialog.c b/libmate-desktop/mate-aboutdialog.c
index 08833ef..0b39dce 100644
--- a/libmate-desktop/mate-aboutdialog.c
+++ b/libmate-desktop/mate-aboutdialog.c
@@ -33,9 +33,6 @@
#include <string.h>
#include <gdk/gdkkeysyms.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
-#include <gdk/gdkkeysyms-compat.h>
-#endif
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
@@ -1765,9 +1762,9 @@ text_view_key_press_event (GtkWidget *text_view,
switch (event->keyval)
{
- case GDK_Return:
- case GDK_ISO_Enter:
- case GDK_KP_Enter:
+ case GDK_KEY_Return:
+ case GDK_KEY_ISO_Enter:
+ case GDK_KEY_KP_Enter:
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
gtk_text_buffer_get_iter_at_mark (buffer, &iter,
gtk_text_buffer_get_insert (buffer));
diff --git a/libmate-desktop/mate-aboutdialog.h b/libmate-desktop/mate-aboutdialog.h
index d2e788d..2fbd950 100644
--- a/libmate-desktop/mate-aboutdialog.h
+++ b/libmate-desktop/mate-aboutdialog.h
@@ -29,6 +29,7 @@
#ifndef __MATE_ABOUT_DIALOG_H__
#define __MATE_ABOUT_DIALOG_H__
+#include <glib.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/libmate-desktop/mate-bg-crossfade.h b/libmate-desktop/mate-bg-crossfade.h
index 28c1e28..f4674fd 100644
--- a/libmate-desktop/mate-bg-crossfade.h
+++ b/libmate-desktop/mate-bg-crossfade.h
@@ -29,12 +29,11 @@
#error MateBGCrossfade is unstable API. You must define MATE_DESKTOP_USE_UNSTABLE_API before including mate-bg-crossfade.h
#endif
+#include <glib.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+G_BEGIN_DECLS
#define MATE_TYPE_BG_CROSSFADE (mate_bg_crossfade_get_type ())
#define MATE_BG_CROSSFADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_TYPE_BG_CROSSFADE, MateBGCrossfade))
@@ -82,8 +81,6 @@ void mate_bg_crossfade_start (MateBGCrossfade *fade,
gboolean mate_bg_crossfade_is_started (MateBGCrossfade *fade);
void mate_bg_crossfade_stop (MateBGCrossfade *fade);
-#ifdef __cplusplus
-}
-#endif
+G_END_DECLS
#endif
diff --git a/libmate-desktop/mate-bg.h b/libmate-desktop/mate-bg.h
index f69454d..65152cd 100644
--- a/libmate-desktop/mate-bg.h
+++ b/libmate-desktop/mate-bg.h
@@ -31,14 +31,13 @@
#error MateBG is unstable API. You must define MATE_DESKTOP_USE_UNSTABLE_API before including mate-bg.h
#endif
+#include <glib.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include "mate-desktop-thumbnail.h"
#include "mate-bg-crossfade.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+G_BEGIN_DECLS
#define MATE_TYPE_BG (mate_bg_get_type ())
#define MATE_BG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MATE_TYPE_BG, MateBG))
@@ -175,8 +174,6 @@ MateBGCrossfade *mate_bg_set_pixmap_as_root_with_crossfade (GdkScreen *sc
GdkPixmap *mate_bg_get_pixmap_from_root (GdkScreen *screen);
#endif /* GTK_CHECK_VERSION(3, 0, 0) */
-#ifdef __cplusplus
-}
-#endif
+G_END_DECLS
#endif
diff --git a/libmate-desktop/mate-colorbutton.h b/libmate-desktop/mate-colorbutton.h
index cfc5e34..2eeebc1 100644
--- a/libmate-desktop/mate-colorbutton.h
+++ b/libmate-desktop/mate-colorbutton.h
@@ -32,6 +32,7 @@
#ifndef __MATE_COLOR_BUTTON_H__
#define __MATE_COLOR_BUTTON_H__
+#include <glib.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/libmate-desktop/mate-colorsel.c b/libmate-desktop/mate-colorsel.c
index 8f01a61..1790cbf 100644
--- a/libmate-desktop/mate-colorsel.c
+++ b/libmate-desktop/mate-colorsel.c
@@ -32,11 +32,6 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
-#include <gdk/gdkkeysyms-compat.h>
-#else
-#include <gdkconfig.h>
-#endif
#include <glib/gi18n-lib.h>
#include "mate-colorsel.h"
@@ -138,11 +133,7 @@ struct _ColorSelectionPrivate
};
-#if GTK_CHECK_VERSION (3, 0, 0)
static void mate_color_selection_dispose (GObject *object);
-#else
-static void mate_color_selection_destroy (GtkObject *object);
-#endif
static void mate_color_selection_finalize (GObject *object);
static void update_color (MateColorSelection *colorsel);
static void mate_color_selection_set_property (GObject *object,
@@ -294,9 +285,6 @@ static void
mate_color_selection_class_init (MateColorSelectionClass *klass)
{
GObjectClass *gobject_class;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- GtkObjectClass *object_class;
-#endif
GtkWidgetClass *widget_class;
gobject_class = G_OBJECT_CLASS (klass);
@@ -304,12 +292,7 @@ mate_color_selection_class_init (MateColorSelectionClass *klass)
gobject_class->set_property = mate_color_selection_set_property;
gobject_class->get_property = mate_color_selection_get_property;
-#if GTK_CHECK_VERSION (3, 0, 0)
gobject_class->dispose = mate_color_selection_dispose;
-#else
- object_class = GTK_OBJECT_CLASS (klass);
- object_class->destroy = mate_color_selection_destroy;
-#endif
widget_class = GTK_WIDGET_CLASS (klass);
widget_class->realize = mate_color_selection_realize;
@@ -348,11 +331,7 @@ mate_color_selection_class_init (MateColorSelectionClass *klass)
color_selection_signals[COLOR_CHANGED] =
g_signal_new ("color-changed",
-#if GTK_CHECK_VERSION (3, 0, 0)
G_OBJECT_CLASS_TYPE (gobject_class),
-#else
- G_OBJECT_CLASS_TYPE (object_class),
-#endif
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (MateColorSelectionClass, color_changed),
NULL, NULL,
@@ -616,7 +595,6 @@ mate_color_selection_get_property (GObject *object,
}
}
-#if GTK_CHECK_VERSION (3, 0, 0)
static void
mate_color_selection_dispose (GObject *object)
{
@@ -631,24 +609,6 @@ mate_color_selection_dispose (GObject *object)
G_OBJECT_CLASS (mate_color_selection_parent_class)->dispose (object);
}
-#else
-/* GtkObject methods */
-
-static void
-mate_color_selection_destroy (GtkObject *object)
-{
- MateColorSelection *cselection = MATE_COLOR_SELECTION (object);
- ColorSelectionPrivate *priv = cselection->private_data;
-
- if (priv->dropper_grab_widget)
- {
- gtk_widget_destroy (priv->dropper_grab_widget);
- priv->dropper_grab_widget = NULL;
- }
-
- GTK_OBJECT_CLASS (mate_color_selection_parent_class)->destroy (object);
-}
-#endif
/* GtkWidget methods */
@@ -1664,11 +1624,11 @@ palette_activate (GtkWidget *widget,
gpointer data)
{
/* should have a drawing area subclass with an activate signal */
- if ((event->keyval == GDK_space) ||
- (event->keyval == GDK_Return) ||
- (event->keyval == GDK_ISO_Enter) ||
- (event->keyval == GDK_KP_Enter) ||
- (event->keyval == GDK_KP_Space))
+ if ((event->keyval == GDK_KEY_space) ||
+ (event->keyval == GDK_KEY_Return) ||
+ (event->keyval == GDK_KEY_ISO_Enter) ||
+ (event->keyval == GDK_KEY_KP_Enter) ||
+ (event->keyval == GDK_KEY_KP_Space))
{
if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "color_set")) != 0)
{
@@ -1974,15 +1934,15 @@ key_press (GtkWidget *invisible,
switch (event->keyval)
{
- case GDK_space:
- case GDK_Return:
- case GDK_ISO_Enter:
- case GDK_KP_Enter:
- case GDK_KP_Space:
+ case GDK_KEY_space:
+ case GDK_KEY_Return:
+ case GDK_KEY_ISO_Enter:
+ case GDK_KEY_KP_Enter:
+ case GDK_KEY_KP_Space:
grab_color_at_mouse (screen, x, y, data);
/* fall through */
- case GDK_Escape:
+ case GDK_KEY_Escape:
shutdown_eyedropper (data);
g_signal_handlers_disconnect_by_func (invisible,
@@ -1995,23 +1955,23 @@ key_press (GtkWidget *invisible,
return TRUE;
#if defined GDK_WINDOWING_X11 || defined GDK_WINDOWING_WIN32
- case GDK_Up:
- case GDK_KP_Up:
+ case GDK_KEY_Up:
+ case GDK_KEY_KP_Up:
dy = state == GDK_MOD1_MASK ? -BIG_STEP : -1;
break;
- case GDK_Down:
- case GDK_KP_Down:
+ case GDK_KEY_Down:
+ case GDK_KEY_KP_Down:
dy = state == GDK_MOD1_MASK ? BIG_STEP : 1;
break;
- case GDK_Left:
- case GDK_KP_Left:
+ case GDK_KEY_Left:
+ case GDK_KEY_KP_Left:
dx = state == GDK_MOD1_MASK ? -BIG_STEP : -1;
break;
- case GDK_Right:
- case GDK_KP_Right:
+ case GDK_KEY_Right:
+ case GDK_KEY_KP_Right:
dx = state == GDK_MOD1_MASK ? BIG_STEP : 1;
break;
#endif
diff --git a/libmate-desktop/mate-colorsel.h b/libmate-desktop/mate-colorsel.h
index cd5b995..b841ba9 100644
--- a/libmate-desktop/mate-colorsel.h
+++ b/libmate-desktop/mate-colorsel.h
@@ -28,6 +28,7 @@
#ifndef __MATE_COLOR_SELECTION_H__
#define __MATE_COLOR_SELECTION_H__
+#include <glib.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/libmate-desktop/mate-colorseldialog.h b/libmate-desktop/mate-colorseldialog.h
index 0848c90..5270352 100644
--- a/libmate-desktop/mate-colorseldialog.h
+++ b/libmate-desktop/mate-colorseldialog.h
@@ -27,6 +27,7 @@
#ifndef __MATE_COLOR_SELECTION_DIALOG_H__
#define __MATE_COLOR_SELECTION_DIALOG_H__
+#include <glib.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/libmate-desktop/mate-desktop-item.h b/libmate-desktop/mate-desktop-item.h
index 2f9ff9b..76f1660 100644
--- a/libmate-desktop/mate-desktop-item.h
+++ b/libmate-desktop/mate-desktop-item.h
@@ -34,9 +34,7 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+G_BEGIN_DECLS
typedef enum {
MATE_DESKTOP_ITEM_TYPE_NULL = 0 /* This means its NULL, that is, not
@@ -305,8 +303,6 @@ void mate_desktop_item_set_launch_time (MateDesktopItem
void mate_desktop_item_clear_section (MateDesktopItem *item,
const char *section);
-#ifdef __cplusplus
-}
-#endif
+G_END_DECLS
#endif /* MATE_DITEM_H */
diff --git a/libmate-desktop/mate-desktop-thumbnail.c b/libmate-desktop/mate-desktop-thumbnail.c
index 734334b..d974b37 100644
--- a/libmate-desktop/mate-desktop-thumbnail.c
+++ b/libmate-desktop/mate-desktop-thumbnail.c
@@ -50,11 +50,7 @@
struct _MateDesktopThumbnailFactoryPrivate {
MateDesktopThumbnailSize size;
-#if GLIB_CHECK_VERSION(2, 31, 0)
GMutex lock;
-#else
- GMutex* lock;
-#endif
GList *thumbnailers;
GHashTable *mime_types_map;
@@ -499,15 +495,7 @@ mate_desktop_thumbnail_factory_finalize (GObject *object)
priv->monitors = NULL;
}
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_clear (&priv->lock);
-#else
- if (priv->lock)
- {
- g_mutex_free (priv->lock);
- priv->lock = NULL;
- }
-#endif
if (priv->disabled_types)
{
@@ -592,11 +580,7 @@ update_or_create_thumbnailer (MateDesktopThumbnailFactory *factory,
Thumbnailer *thumb;
gboolean found = FALSE;
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_lock (&priv->lock);
-#else
- g_mutex_lock (priv->lock);
-#endif
for (l = priv->thumbnailers; l && !found; l = g_list_next (l))
{
@@ -624,11 +608,7 @@ update_or_create_thumbnailer (MateDesktopThumbnailFactory *factory,
mate_desktop_thumbnail_factory_add_thumbnailer (factory, thumb);
}
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_unlock (&priv->lock);
-#else
- g_mutex_unlock (priv->lock);
-#endif
}
static void
@@ -639,11 +619,7 @@ remove_thumbnailer (MateDesktopThumbnailFactory *factory,
GList *l;
Thumbnailer *thumb;
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_lock (&priv->lock);
-#else
- g_mutex_lock (priv->lock);
-#endif
for (l = priv->thumbnailers; l; l = g_list_next (l))
{
@@ -661,11 +637,7 @@ remove_thumbnailer (MateDesktopThumbnailFactory *factory,
}
}
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_unlock (&priv->lock);
-#else
- g_mutex_unlock (priv->lock);
-#endif
}
static void
@@ -767,11 +739,7 @@ external_thumbnailers_disabled_all_changed_cb (GSettings *set
{
MateDesktopThumbnailFactoryPrivate *priv = factory->priv;
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_lock (&priv->lock);
-#else
- g_mutex_lock (priv->lock);
-#endif
priv->disabled = g_settings_get_boolean (priv->settings, "disable-all");
if (priv->disabled)
@@ -785,11 +753,7 @@ external_thumbnailers_disabled_all_changed_cb (GSettings *set
mate_desktop_thumbnail_factory_load_thumbnailers (factory);
}
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_unlock (&priv->lock);
-#else
- g_mutex_unlock (priv->lock);
-#endif
}
static void
@@ -799,22 +763,14 @@ external_thumbnailers_disabled_changed_cb (GSettings *setting
{
MateDesktopThumbnailFactoryPrivate *priv = factory->priv;
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_lock (&priv->lock);
-#else
- g_mutex_lock (priv->lock);
-#endif
if (priv->disabled)
return;
g_strfreev (priv->disabled_types);
priv->disabled_types = g_settings_get_strv (priv->settings, "disable");
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_unlock (&priv->lock);
-#else
- g_mutex_unlock (priv->lock);
-#endif
}
static void
@@ -833,11 +789,7 @@ mate_desktop_thumbnail_factory_init (MateDesktopThumbnailFactory *factory)
(GDestroyNotify)g_free,
(GDestroyNotify)thumbnailer_unref);
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_init (&priv->lock);
-#else
- priv->lock = g_mutex_new ();
-#endif
priv->settings = g_settings_new ("org.mate.thumbnailers");
priv->disabled = g_settings_get_boolean (priv->settings, "disable-all");
@@ -929,13 +881,8 @@ mate_desktop_thumbnail_factory_lookup (MateDesktopThumbnailFactory *factory,
file = g_strconcat (g_checksum_get_string (checksum), ".png", NULL);
-#if GLIB_CHECK_VERSION (2, 34, 0)
path = g_build_filename (g_get_user_cache_dir (),
"thumbnails",
-#else
- path = g_build_filename (g_get_home_dir (),
- ".thumbnails",
-#endif
(priv->size == MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL)?"normal":"large",
file,
NULL);
@@ -995,13 +942,8 @@ mate_desktop_thumbnail_factory_has_valid_failed_thumbnail (MateDesktopThumbnailF
file = g_strconcat (g_checksum_get_string (checksum), ".png", NULL);
-#if GLIB_CHECK_VERSION (2, 34, 0)
path = g_build_filename (g_get_user_cache_dir (),
"thumbnails/fail",
-#else
- path = g_build_filename (g_get_home_dir (),
- ".thumbnails/fail",
-#endif
appname,
file,
NULL);
@@ -1103,11 +1045,7 @@ mate_desktop_thumbnail_factory_can_thumbnail (MateDesktopThumbnailFactory *facto
if (!mime_type)
return FALSE;
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_lock (&factory->priv->lock);
-#else
- g_mutex_lock (factory->priv->lock);
-#endif
if (!mate_desktop_thumbnail_factory_is_disabled (factory, mime_type))
{
Thumbnailer *thumb;
@@ -1115,11 +1053,7 @@ mate_desktop_thumbnail_factory_can_thumbnail (MateDesktopThumbnailFactory *facto
thumb = g_hash_table_lookup (factory->priv->mime_types_map, mime_type);
have_script = thumbnailer_try_exec (thumb);
}
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_unlock (&factory->priv->lock);
-#else
- g_mutex_unlock (factory->priv->lock);
-#endif
if (have_script || mimetype_supported_by_gdk_pixbuf (mime_type))
{
@@ -1242,11 +1176,7 @@ mate_desktop_thumbnail_factory_generate_thumbnail (MateDesktopThumbnailFactory *
pixbuf = NULL;
script = NULL;
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_lock (&factory->priv->lock);
-#else
- g_mutex_lock (factory->priv->lock);
-#endif
if (!mate_desktop_thumbnail_factory_is_disabled (factory, mime_type))
{
Thumbnailer *thumb;
@@ -1255,11 +1185,7 @@ mate_desktop_thumbnail_factory_generate_thumbnail (MateDesktopThumbnailFactory *
if (thumb)
script = g_strdup (thumb->command);
}
-#if GLIB_CHECK_VERSION(2, 31, 0)
g_mutex_unlock (&factory->priv->lock);
-#else
- g_mutex_unlock (factory->priv->lock);
-#endif
if (script)
{
@@ -1359,13 +1285,8 @@ make_thumbnail_dirs (MateDesktopThumbnailFactory *factory)
res = FALSE;
-#if GLIB_CHECK_VERSION (2, 34, 0)
thumbnail_dir = g_build_filename (g_get_user_cache_dir (),
"thumbnails",
-#else
- thumbnail_dir = g_build_filename (g_get_home_dir (),
- ".thumbnails",
-#endif
NULL);
if (!g_file_test (thumbnail_dir, G_FILE_TEST_IS_DIR))
{
@@ -1398,13 +1319,8 @@ make_thumbnail_fail_dirs (MateDesktopThumbnailFactory *factory)
res = FALSE;
-#if GLIB_CHECK_VERSION (2, 34, 0)
thumbnail_dir = g_build_filename (g_get_user_cache_dir (),
"thumbnails",
-#else
- thumbnail_dir = g_build_filename (g_get_home_dir (),
- ".thumbnails",
-#endif
NULL);
if (!g_file_test (thumbnail_dir, G_FILE_TEST_IS_DIR))
{
@@ -1478,13 +1394,8 @@ mate_desktop_thumbnail_factory_save_thumbnail (MateDesktopThumbnailFactory *fact
file = g_strconcat (g_checksum_get_string (checksum), ".png", NULL);
-#if GLIB_CHECK_VERSION (2, 34, 0)
path = g_build_filename (g_get_user_cache_dir (),
"thumbnails",
-#else
- path = g_build_filename (g_get_home_dir (),
- ".thumbnails",
-#endif
(priv->size == MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL)?"normal":"large",
file,
NULL);
@@ -1591,13 +1502,8 @@ mate_desktop_thumbnail_factory_create_failed_thumbnail (MateDesktopThumbnailFact
file = g_strconcat (g_checksum_get_string (checksum), ".png", NULL);
-#if GLIB_CHECK_VERSION (2, 34, 0)
path = g_build_filename (g_get_user_cache_dir (),
"thumbnails/fail",
-#else
- path = g_build_filename (g_get_home_dir (),
- ".thumbnails/fail",
-#endif
appname,
file,
NULL);
@@ -1687,13 +1593,8 @@ mate_desktop_thumbnail_path_for_uri (const char *uri,
file = g_strconcat (md5, ".png", NULL);
g_free (md5);
-#if GLIB_CHECK_VERSION (2, 34, 0)
path = g_build_filename (g_get_user_cache_dir (),
"thumbnails",
-#else
- path = g_build_filename (g_get_home_dir (),
- ".thumbnails",
-#endif
(size == MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL)?"normal":"large",
file,
NULL);
diff --git a/libmate-desktop/mate-desktop-thumbnail.h b/libmate-desktop/mate-desktop-thumbnail.h
index 775348b..1decb4a 100644
--- a/libmate-desktop/mate-desktop-thumbnail.h
+++ b/libmate-desktop/mate-desktop-thumbnail.h
@@ -35,9 +35,7 @@
#include <time.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+G_BEGIN_DECLS
typedef enum {
MATE_DESKTOP_THUMBNAIL_SIZE_NORMAL,
@@ -107,8 +105,6 @@ GdkPixbuf *mate_desktop_thumbnail_scale_down_pixbuf (GdkPixbuf *pixbuf,
int dest_width,
int dest_height);
-#ifdef __cplusplus
-}
-#endif
+G_END_DECLS
#endif /* MATE_DESKTOP_THUMBNAIL_H */
diff --git a/libmate-desktop/mate-desktop-utils.c b/libmate-desktop/mate-desktop-utils.c
index 985278f..431c57f 100644
--- a/libmate-desktop/mate-desktop-utils.c
+++ b/libmate-desktop/mate-desktop-utils.c
@@ -10,12 +10,12 @@
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
-
+
The Mate Library 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
Library General Public License for more details.
-
+
You should have received a copy of the GNU Library General Public
License along with the Mate Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
@@ -28,6 +28,8 @@
#include <glib.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
#define MATE_DESKTOP_USE_UNSTABLE_API
#include <mate-desktop-utils.h>
@@ -83,7 +85,7 @@ mate_desktop_prepend_terminal_to_vector (int *argc, char ***argv)
settings = g_settings_new ("org.mate.applications-terminal");
terminal = g_settings_get_string (settings, "exec");
-
+
if (terminal) {
gchar *command_line;
gchar *exec_flag;
@@ -163,15 +165,14 @@ mate_desktop_prepend_terminal_to_vector (int *argc, char ***argv)
#endif
}
-#if GTK_CHECK_VERSION (3, 0, 0)
/**
* mate_gdk_spawn_command_line_on_screen:
* @screen: a GdkScreen
* @command: a command line
* @error: return location for errors
*
- * This is a replacement for gdk_spawn_command_line_on_screen, removed
- * in GTK3.
+ * This is a replacement for gdk_spawn_command_line_on_screen, deprecated
+ * in GDK 2.24 and removed in GDK 3.0.
*
* gdk_spawn_command_line_on_screen is like g_spawn_command_line_async(),
* except the child process is spawned in such an environment that on
@@ -195,8 +196,13 @@ mate_gdk_spawn_command_line_on_screen (GdkScreen *screen, const gchar *command,
appinfo = g_app_info_create_from_commandline (command, NULL, G_APP_INFO_CREATE_NONE, error);
if (appinfo) {
+#if GTK_CHECK_VERSION (3, 0, 0)
+ context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
+#else
+ /* Deprecated in GDK 3.0 */
context = gdk_app_launch_context_new ();
gdk_app_launch_context_set_screen (context, screen);
+#endif
res = g_app_info_launch (appinfo, NULL, G_APP_LAUNCH_CONTEXT (context), error);
g_object_unref (context);
g_object_unref (appinfo);
@@ -204,12 +210,11 @@ mate_gdk_spawn_command_line_on_screen (GdkScreen *screen, const gchar *command,
return res;
}
-#endif
void
_mate_desktop_init_i18n (void) {
static gboolean initialized = FALSE;
-
+
if (!initialized) {
bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
diff --git a/libmate-desktop/mate-desktop-utils.h b/libmate-desktop/mate-desktop-utils.h
index dd6921b..824b11a 100644
--- a/libmate-desktop/mate-desktop-utils.h
+++ b/libmate-desktop/mate-desktop-utils.h
@@ -32,25 +32,16 @@
#endif
#include <glib.h>
-#include <glib-object.h>
-
#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+G_BEGIN_DECLS
/* prepend the terminal command to a vector */
void mate_desktop_prepend_terminal_to_vector (int *argc, char ***argv);
-#if GTK_CHECK_VERSION (3, 0, 0)
/* replace gdk_spawn_command_line_on_screen, not available in GTK3 */
gboolean mate_gdk_spawn_command_line_on_screen (GdkScreen *screen, const gchar *command, GError **error);
-#endif
-#ifdef __cplusplus
-}
-#endif
+G_END_DECLS
-#endif /* MATE_DITEM_H */
+#endif /* MATE_DESKTOP_UTILS_H */
diff --git a/libmate-desktop/mate-rr.c b/libmate-desktop/mate-rr.c
index 197d75b..ae27277 100644
--- a/libmate-desktop/mate-rr.c
+++ b/libmate-desktop/mate-rr.c
@@ -673,11 +673,7 @@ mate_rr_screen_new (GdkScreen *gdk_screen,
screen->gdk_screen = gdk_screen;
screen->gdk_root = gdk_screen_get_root_window (gdk_screen);
- #if GTK_CHECK_VERSION(3, 0, 0)
- screen->xroot = gdk_x11_window_get_xid (screen->gdk_root);
- #else
- screen->xroot = gdk_x11_drawable_get_xid (screen->gdk_root);
- #endif
+ screen->xroot = GDK_WINDOW_XID (screen->gdk_root);
screen->xdisplay = dpy;
screen->xscreen = gdk_x11_screen_get_xscreen (screen->gdk_screen);
screen->connector_type_atom = XInternAtom (dpy, "ConnectorType", FALSE);
diff --git a/libmate-desktop/private.h b/libmate-desktop/private.h
index 616fe28..baa4ba7 100644
--- a/libmate-desktop/private.h
+++ b/libmate-desktop/private.h
@@ -25,14 +25,12 @@
#ifndef __MATE_DESKTOP_PRIVATE_H__
#define __MATE_DESKTOP_PRIVATE_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <glib.h>
+
+G_BEGIN_DECLS
void _mate_desktop_init_i18n (void);
-#ifdef __cplusplus
-}
-#endif
+G_END_DECLS
#endif