summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-09-30 19:38:12 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-09-30 19:38:12 +0000
commit2d385b9bb671d5b27917ebbc29926ff7d70442c1 (patch)
tree6c42a9e19a38101e90bb2752a0231e71a4d4c254
parent1654cab645fb7a4f10ae2aa8e2844fb456d6a55d (diff)
downloadgtk+-2d385b9bb671d5b27917ebbc29926ff7d70442c1.tar.gz
Set the client ID on all displays. (#85713)
Mon Sep 30 15:31:57 2002 Owen Taylor <otaylor@redhat.com> * gdk/gdkdisplay.c gdk/x11/gdkdisplay-x11.c gdk/gdkinternals.h: Set the client ID on all displays. (#85713) * gdk/gdkdisplay.h gkd/gdkinternals.h gdk/{linux-fb,win32,x11}/gdkmain-{fb,win32,x11}.c Privatize gdk_display_set_sm_client_id().
-rw-r--r--ChangeLog10
-rw-r--r--ChangeLog.pre-2-1010
-rw-r--r--ChangeLog.pre-2-210
-rw-r--r--ChangeLog.pre-2-410
-rw-r--r--ChangeLog.pre-2-610
-rw-r--r--ChangeLog.pre-2-810
-rw-r--r--gdk/gdkdisplay.c25
-rw-r--r--gdk/gdkdisplay.h2
-rw-r--r--gdk/gdkinternals.h5
-rw-r--r--gdk/linux-fb/gdkmain-fb.c26
-rw-r--r--gdk/win32/gdkmain-win32.c4
-rw-r--r--gdk/x11/gdkdisplay-x11.c5
-rw-r--r--gdk/x11/gdkmain-x11.c19
13 files changed, 100 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index 6187ea54b4..eeb1765648 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Mon Sep 30 15:31:57 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdisplay.c gdk/x11/gdkdisplay-x11.c
+ gdk/gdkinternals.h: Set the client ID on all
+ displays. (#85713)
+
+ * gdk/gdkdisplay.h gkd/gdkinternals.h
+ gdk/{linux-fb,win32,x11}/gdkmain-{fb,win32,x11}.c
+ Privatize gdk_display_set_sm_client_id().
+
Mon Sep 30 14:46:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbindings.c (gtk_binding_set_new): Initialize
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 6187ea54b4..eeb1765648 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,13 @@
+Mon Sep 30 15:31:57 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdisplay.c gdk/x11/gdkdisplay-x11.c
+ gdk/gdkinternals.h: Set the client ID on all
+ displays. (#85713)
+
+ * gdk/gdkdisplay.h gkd/gdkinternals.h
+ gdk/{linux-fb,win32,x11}/gdkmain-{fb,win32,x11}.c
+ Privatize gdk_display_set_sm_client_id().
+
Mon Sep 30 14:46:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbindings.c (gtk_binding_set_new): Initialize
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 6187ea54b4..eeb1765648 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,13 @@
+Mon Sep 30 15:31:57 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdisplay.c gdk/x11/gdkdisplay-x11.c
+ gdk/gdkinternals.h: Set the client ID on all
+ displays. (#85713)
+
+ * gdk/gdkdisplay.h gkd/gdkinternals.h
+ gdk/{linux-fb,win32,x11}/gdkmain-{fb,win32,x11}.c
+ Privatize gdk_display_set_sm_client_id().
+
Mon Sep 30 14:46:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbindings.c (gtk_binding_set_new): Initialize
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 6187ea54b4..eeb1765648 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,13 @@
+Mon Sep 30 15:31:57 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdisplay.c gdk/x11/gdkdisplay-x11.c
+ gdk/gdkinternals.h: Set the client ID on all
+ displays. (#85713)
+
+ * gdk/gdkdisplay.h gkd/gdkinternals.h
+ gdk/{linux-fb,win32,x11}/gdkmain-{fb,win32,x11}.c
+ Privatize gdk_display_set_sm_client_id().
+
Mon Sep 30 14:46:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbindings.c (gtk_binding_set_new): Initialize
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 6187ea54b4..eeb1765648 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,13 @@
+Mon Sep 30 15:31:57 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdisplay.c gdk/x11/gdkdisplay-x11.c
+ gdk/gdkinternals.h: Set the client ID on all
+ displays. (#85713)
+
+ * gdk/gdkdisplay.h gkd/gdkinternals.h
+ gdk/{linux-fb,win32,x11}/gdkmain-{fb,win32,x11}.c
+ Privatize gdk_display_set_sm_client_id().
+
Mon Sep 30 14:46:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbindings.c (gtk_binding_set_new): Initialize
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 6187ea54b4..eeb1765648 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,13 @@
+Mon Sep 30 15:31:57 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/gdkdisplay.c gdk/x11/gdkdisplay-x11.c
+ gdk/gdkinternals.h: Set the client ID on all
+ displays. (#85713)
+
+ * gdk/gdkdisplay.h gkd/gdkinternals.h
+ gdk/{linux-fb,win32,x11}/gdkmain-{fb,win32,x11}.c
+ Privatize gdk_display_set_sm_client_id().
+
Mon Sep 30 14:46:49 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkbindings.c (gtk_binding_set_new): Initialize
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index b783eb2ecc..453188268e 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -41,6 +41,7 @@ static void gdk_display_finalize (GObject *object);
static guint signals[LAST_SIGNAL] = { 0 };
static GObjectClass *parent_class;
+static char *gdk_sm_client_id;
GType
gdk_display_get_type (void)
@@ -353,6 +354,28 @@ gdk_display_get_core_pointer (GdkDisplay *display)
void
gdk_set_sm_client_id (const gchar* sm_client_id)
{
- gdk_display_set_sm_client_id (gdk_display_get_default (), sm_client_id);
+ GSList *displays, *tmp_list;
+
+ g_free (gdk_sm_client_id);
+ gdk_sm_client_id = g_strdup (sm_client_id);
+
+ displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
+ for (tmp_list = displays; tmp_list; tmp_list = tmp_list->next)
+ _gdk_windowing_display_set_sm_client_id (tmp_list->data, sm_client_id);
+
+ g_slist_free (displays);
}
+/**
+ * _gdk_get_sm_client_id:
+ *
+ * Gets the client ID set with gdk_set_sm_client_id(), if any.
+ *
+ * Return value: Session ID, or %NULL if gdk_set_sm_client_id()
+ * has never been called.
+ **/
+const char *
+_gdk_get_sm_client_id (void)
+{
+ return gdk_sm_client_id;
+}
diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h
index 49e02cebd0..f555517ece 100644
--- a/gdk/gdkdisplay.h
+++ b/gdk/gdkdisplay.h
@@ -109,8 +109,6 @@ void gdk_display_add_client_message_filter (GdkDisplay *display,
void gdk_display_set_double_click_time (GdkDisplay *display,
guint msec);
-void gdk_display_set_sm_client_id (GdkDisplay *display,
- const gchar *sm_client_id);
GdkDisplay *gdk_display_get_default (void);
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index a8703d3326..d322e10348 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -235,6 +235,8 @@ void _gdk_window_clear_update_area (GdkWindow *window);
void _gdk_screen_close (GdkScreen *screen);
+const char *_gdk_get_sm_client_id (void);
+
/*****************************************
* Interfaces provided by windowing code *
*****************************************/
@@ -306,6 +308,9 @@ void _gdk_windowing_window_destroy (GdkWindow *window,
gboolean recursing,
gboolean foreign_destroy);
+void _gdk_windowing_display_set_sm_client_id (GdkDisplay *display,
+ const gchar *sm_client_id);
+
/* Implementation types */
GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
diff --git a/gdk/linux-fb/gdkmain-fb.c b/gdk/linux-fb/gdkmain-fb.c
index 63ad7dce7d..dd252470bc 100644
--- a/gdk/linux-fb/gdkmain-fb.c
+++ b/gdk/linux-fb/gdkmain-fb.c
@@ -1227,31 +1227,9 @@ gdk_screen_get_height_mm (GdkScreen *screen)
return 0.5 + gdk_screen_height () * (25.4 / 72.);
}
-/*
- *--------------------------------------------------------------
- * gdk_display_set_sm_client_id
- *
- * Set the SM_CLIENT_ID property on the WM_CLIENT_LEADER window
- * so that the window manager can save our state using the
- * X11R6 ICCCM session management protocol. A NULL value should
- * be set following disconnection from the session manager to
- * remove the SM_CLIENT_ID property.
- *
- * Arguments:
- *
- * "sm_client_id" specifies the client id assigned to us by the
- * session manager or NULL to remove the property.
- *
- * Results:
- *
- * Side effects:
- *
- *--------------------------------------------------------------
- */
-
void
-gdk_display_set_sm_client_id (GdkDisplay* display,
- const gchar* sm_client_id)
+_gdk_windowing_display_set_sm_client_id (GdkDisplay* display,
+ const gchar* sm_client_id)
{
}
diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c
index ac0f39bb75..f0feada707 100644
--- a/gdk/win32/gdkmain-win32.c
+++ b/gdk/win32/gdkmain-win32.c
@@ -181,8 +181,8 @@ gdk_screen_get_height_mm (GdkScreen *screen)
}
void
-gdk_display_set_sm_client_id (GdkDisplay *display,
- const gchar *sm_client_id)
+_gdk_windowing_display_set_sm_client_id (GdkDisplay *display,
+ const gchar *sm_client_id)
{
g_warning("gdk_set_sm_client_id %s", sm_client_id ? sm_client_id : "NULL");
}
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 50e7339477..4558e3449a 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -108,6 +108,7 @@ gdk_display_open (const gchar *display_name)
GdkDisplayX11 *display_x11;
gint argc;
gchar **argv;
+ const char *sm_client_id;
XClassHint *class_hint;
XKeyboardState keyboard_state;
@@ -160,6 +161,10 @@ gdk_display_open (const gchar *display_name)
class_hint);
XFree (class_hint);
+ sm_client_id = _gdk_get_sm_client_id ();
+ if (sm_client_id)
+ _gdk_windowing_display_set_sm_client_id (display, sm_client_id);
+
pid = getpid ();
XChangeProperty (display_x11->xdisplay,
display_x11->leader_window,
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 2a7e49d25d..c34eafaadd 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -449,24 +449,9 @@ _gdk_xgrab_check_destroy (GdkWindow *window)
display_x11->keyboard_xgrab_window = NULL;
}
-/**
- * gdk_display_set_sm_client_id:
- * @display: a #GdkDisplay
- * @sm_client_id: the client id assigned by the session manager when the
- * connection was opened, or %NULL to remove the property.
- *
- * Sets the <literal>SM_CLIENT_ID</literal> property on the application's leader window
- * so that the window manager can save the application's state using the X11R6 ICCCM
- * session management protocol.
- *
- * See the X Session Management Library documentation for more information on
- * session management and the Inter-Client Communication Conventions Manual
- * (ICCCM) for information on the <literal>WM_CLIENT_LEADER</literal> property.
- * (Both documents are part of the X Window System distribution.)
- **/
void
-gdk_display_set_sm_client_id (GdkDisplay *display,
- const gchar *sm_client_id)
+_gdk_windowing_display_set_sm_client_id (GdkDisplay *display,
+ const gchar *sm_client_id)
{
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);