Commit 2d385b9b authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

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().
parent 1654cab6
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
......
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
......
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
......
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
......
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
......
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
......
......@@ -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;
}
......@@ -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);
......
......@@ -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;
......
......@@ -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)
{
}
......
......@@ -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");
}
......
......@@ -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,
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment