summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-desktop-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmate-desktop/mate-desktop-utils.c')
-rw-r--r--libmate-desktop/mate-desktop-utils.c21
1 files changed, 13 insertions, 8 deletions
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