summaryrefslogtreecommitdiff
path: root/cut-n-paste
diff options
context:
space:
mode:
Diffstat (limited to 'cut-n-paste')
-rw-r--r--cut-n-paste/smclient/eggsmclient-private.h1
-rw-r--r--cut-n-paste/smclient/eggsmclient-xsmp.c5
-rw-r--r--cut-n-paste/toolbar-editor/egg-editable-toolbar.c50
3 files changed, 54 insertions, 2 deletions
diff --git a/cut-n-paste/smclient/eggsmclient-private.h b/cut-n-paste/smclient/eggsmclient-private.h
index fc3a0a2d..4f8572fe 100644
--- a/cut-n-paste/smclient/eggsmclient-private.h
+++ b/cut-n-paste/smclient/eggsmclient-private.h
@@ -20,7 +20,6 @@
#ifndef __EGG_SM_CLIENT_PRIVATE_H__
#define __EGG_SM_CLIENT_PRIVATE_H__
-#include <gdkconfig.h>
#include "eggsmclient.h"
G_BEGIN_DECLS
diff --git a/cut-n-paste/smclient/eggsmclient-xsmp.c b/cut-n-paste/smclient/eggsmclient-xsmp.c
index 90f201d9..4eed5c20 100644
--- a/cut-n-paste/smclient/eggsmclient-xsmp.c
+++ b/cut-n-paste/smclient/eggsmclient-xsmp.c
@@ -36,6 +36,7 @@
#include <X11/SM/SMlib.h>
#include <gdk/gdk.h>
+#include <gtk/gtk.h>
#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))
@@ -367,7 +368,11 @@ sm_client_xsmp_startup (EggSMClient *client,
free (ret_client_id);
gdk_threads_enter ();
+#if GTK_CHECK_VERSION (2, 24, 0)
+ gdk_x11_set_sm_client_id (xsmp->client_id);
+#else
gdk_set_sm_client_id (xsmp->client_id);
+#endif
gdk_threads_leave ();
g_debug ("Got client ID \"%s\"", xsmp->client_id);
diff --git a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
index 9193120a..bd66f6c6 100644
--- a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
+++ b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
@@ -372,6 +372,20 @@ popup_context_menu_cb (GtkWidget *toolbar,
}
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+static gboolean
+edit_mode_button_press_event_cb (GtkWidget *widget,
+ GdkEventButton *event,
+ EggEditableToolbar *etoolbar)
+{
+ if (event->button == 1)
+ {
+ return TRUE;
+ }
+ return FALSE;
+}
+#endif
+
static gboolean
button_press_event_cb (GtkWidget *widget,
GdkEventButton *event,
@@ -418,6 +432,24 @@ configure_item_sensitivity (GtkToolItem *item, EggEditableToolbar *etoolbar)
}
+#if GTK_CHECK_VERSION (3, 0, 0)
+static void toolbar_disable_window_drag (GtkToolItem *item,
+ EggEditableToolbar *etoolbar)
+{
+ if (etoolbar->priv->edit_mode > 0)
+ {
+ g_signal_connect (item, "button-press-event",
+ G_CALLBACK (edit_mode_button_press_event_cb), NULL);
+ }
+ else
+ {
+ g_signal_handlers_disconnect_by_func (item,
+ G_CALLBACK (edit_mode_button_press_event_cb),
+ NULL);
+ }
+}
+#endif
+
static void
configure_item_cursor (GtkToolItem *item,
EggEditableToolbar *etoolbar)
@@ -567,8 +599,18 @@ action_sensitive_cb (GtkAction *action,
GParamSpec *pspec,
GtkToolItem *item)
{
- EggEditableToolbar *etoolbar = EGG_EDITABLE_TOOLBAR
+ EggEditableToolbar *etoolbar;
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkWidget *ancestor = gtk_widget_get_ancestor (GTK_WIDGET (item), EGG_TYPE_EDITABLE_TOOLBAR);
+ if (!ancestor)
+ return;
+
+ etoolbar = EGG_EDITABLE_TOOLBAR (ancestor);
+#else
+ etoolbar = EGG_EDITABLE_TOOLBAR
(gtk_widget_get_ancestor (GTK_WIDGET (item), EGG_TYPE_EDITABLE_TOOLBAR));
+#endif
if (etoolbar->priv->edit_mode > 0)
{
@@ -1184,6 +1226,9 @@ item_added_cb (EggToolbarsModel *model,
connect_widget_signals (GTK_WIDGET (item), etoolbar);
configure_item_tooltip (item);
configure_item_cursor (item, etoolbar);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ toolbar_disable_window_drag (item, etoolbar);
+#endif
configure_item_sensitivity (item, etoolbar);
dock = get_dock_nth (etoolbar, tpos);
@@ -1504,6 +1549,9 @@ set_edit_mode (EggEditableToolbar *etoolbar,
item = gtk_toolbar_get_nth_item (GTK_TOOLBAR (toolbar), l);
configure_item_cursor (item, etoolbar);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ toolbar_disable_window_drag (item, etoolbar);
+#endif
configure_item_sensitivity (item, etoolbar);
}
}