summaryrefslogtreecommitdiff
path: root/cut-n-paste-code/libegg
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2016-11-22 15:02:51 -0500
committerlukefromdc <[email protected]>2016-11-22 15:02:51 -0500
commit276eb145ce96d5f75f8d3901daf6310f60ddbb81 (patch)
tree544f41e76c9a91973867065696fc2e414ca60170 /cut-n-paste-code/libegg
parent969e4d021fe49654fe6e5ee7e88c920fec126505 (diff)
downloadcaja-276eb145ce96d5f75f8d3901daf6310f60ddbb81.tar.bz2
caja-276eb145ce96d5f75f8d3901daf6310f60ddbb81.tar.xz
move to GTK+3 (>= 3.14), drop libunique, GTK+2 code, and --with-gtk build option
*Remove GTK_VERSION_CHECK (3, 0, 0) and libunique selectors *Remove GTK2 and libunique specific code. *Leaves selector for specific GTK3 versions. *Remove #DEFINES for vbox/hbox previously required for GTK2 compatability *Keep vbox in caja-spatial-window.c, it is necessary for the desktop to work *spatial-window vbox issue at https://github.com/mate-desktop/caja/issues/591
Diffstat (limited to 'cut-n-paste-code/libegg')
-rw-r--r--cut-n-paste-code/libegg/eggsmclient-private.h4
-rw-r--r--cut-n-paste-code/libegg/eggsmclient-xsmp.c21
-rw-r--r--cut-n-paste-code/libegg/eggsmclient.c5
3 files changed, 1 insertions, 29 deletions
diff --git a/cut-n-paste-code/libegg/eggsmclient-private.h b/cut-n-paste-code/libegg/eggsmclient-private.h
index 7bc38235..3eec5324 100644
--- a/cut-n-paste-code/libegg/eggsmclient-private.h
+++ b/cut-n-paste-code/libegg/eggsmclient-private.h
@@ -22,10 +22,6 @@
#include <gtk/gtk.h>
-#if !GTK_CHECK_VERSION(3, 0, 0)
-#include <gdkconfig.h>
-#endif
-
#include "eggsmclient.h"
G_BEGIN_DECLS
diff --git a/cut-n-paste-code/libegg/eggsmclient-xsmp.c b/cut-n-paste-code/libegg/eggsmclient-xsmp.c
index 263d78ac..808fffc0 100644
--- a/cut-n-paste-code/libegg/eggsmclient-xsmp.c
+++ b/cut-n-paste-code/libegg/eggsmclient-xsmp.c
@@ -37,9 +37,7 @@
#include <gtk/gtk.h>
#include <gdk/gdk.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
#include <gdk/gdkx.h>
-#endif
#define EGG_TYPE_SM_CLIENT_XSMP (egg_sm_client_xsmp_get_type ())
#define EGG_SM_CLIENT_XSMP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT_XSMP, EggSMClientXSMP))
@@ -371,13 +369,7 @@ sm_client_xsmp_startup (EggSMClient *client,
xsmp->client_id = g_strdup (ret_client_id);
free (ret_client_id);
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_x11_set_sm_client_id (xsmp->client_id);
-#else
- gdk_threads_enter ();
- gdk_set_sm_client_id (xsmp->client_id);
- gdk_threads_leave ();
-#endif
g_debug ("Got client ID \"%s\"", xsmp->client_id);
}
@@ -545,10 +537,6 @@ idle_do_pending_events (gpointer data)
EggSMClientXSMP *xsmp = data;
EggSMClient *client = data;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_enter ();
-#endif
-
xsmp->idle = 0;
if (xsmp->waiting_to_emit_quit)
@@ -572,9 +560,6 @@ idle_do_pending_events (gpointer data)
}
out:
-#if !GTK_CHECK_VERSION (3, 0, 0)
- gdk_threads_leave ();
-#endif
return FALSE;
}
@@ -1295,13 +1280,7 @@ static gboolean
process_ice_messages (IceConn ice_conn)
{
IceProcessMessagesStatus status;
-#if GTK_CHECK_VERSION (3, 0, 0)
- status = IceProcessMessages (ice_conn, NULL, NULL);
-#else
- gdk_threads_enter ();
status = IceProcessMessages (ice_conn, NULL, NULL);
- gdk_threads_leave ();
-#endif
switch (status)
{
diff --git a/cut-n-paste-code/libegg/eggsmclient.c b/cut-n-paste-code/libegg/eggsmclient.c
index 153d98e8..7dc0f8a8 100644
--- a/cut-n-paste-code/libegg/eggsmclient.c
+++ b/cut-n-paste-code/libegg/eggsmclient.c
@@ -53,7 +53,6 @@ G_DEFINE_TYPE (EggSMClient, egg_sm_client, G_TYPE_OBJECT)
static EggSMClient *global_client;
static EggSMClientMode global_client_mode = EGG_SM_CLIENT_MODE_NORMAL;
-#if ENABLE_LIBUNIQUE == (0)
static gboolean
running_in_mate (void)
{
@@ -61,7 +60,6 @@ running_in_mate (void)
|| (g_strcmp0 (g_getenv ("XDG_SESSION_DESKTOP"), "MATE") == 0)
|| (g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "MATE") == 0);
}
-#endif
static void
egg_sm_client_init (EggSMClient *client)
@@ -366,11 +364,10 @@ egg_sm_client_get (void)
/*as egg_sm_client_set_mode must be called prior to start of main loop
/*to stop caja restart but this is diffcult in GtkApplication
*/
-#if ENABLE_LIBUNIQUE == (0)
+
if (geteuid () == 0 || !running_in_mate ()){
global_client = g_object_new (EGG_TYPE_SM_CLIENT, NULL);
}
-#endif
}
return global_client;