/[emacs]/emacs/src/xsmfns.c
ViewVC logotype

Diff of /emacs/src/xsmfns.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by jhd, Mon Mar 3 19:55:10 2003 UTC revision 1.9 by jhd, Thu Aug 21 19:54:47 2003 UTC
# Line 24  Boston, MA 02111-1307, USA.  */ Line 24  Boston, MA 02111-1307, USA.  */
24  #ifdef HAVE_X_SM  #ifdef HAVE_X_SM
25    
26  #include <X11/SM/SMlib.h>  #include <X11/SM/SMlib.h>
27    #include <X11/Xlib.h>
28    #include <X11/Xutil.h>
29    
30  #ifdef HAVE_STRING_H  #ifdef HAVE_STRING_H
31  #include <string.h>  #include <string.h>
32  #else  #else
# Line 47  Boston, MA 02111-1307, USA.  */ Line 50  Boston, MA 02111-1307, USA.  */
50  #include "lisp.h"  #include "lisp.h"
51  #include "termhooks.h"  #include "termhooks.h"
52  #include "termopts.h"  #include "termopts.h"
53    #include "xterm.h"
54    
55  #ifndef MAXPATHLEN  #ifndef MAXPATHLEN
56  #define MAXPATHLEN 1024  #define MAXPATHLEN 1024
# Line 403  ice_conn_watch_CB (iceConn, clientData, Line 407  ice_conn_watch_CB (iceConn, clientData,
407  #endif /* ! defined (SIGIO) */  #endif /* ! defined (SIGIO) */
408  }  }
409    
410    /* Create the client leader window.  */
411    static void
412    create_client_leader_window (dpyinfo, client_id)
413         struct x_display_info *dpyinfo;
414         char *client_id;
415    {
416      Window w;
417      XClassHint class_hints;
418      Atom sm_id;
419    
420      w = XCreateSimpleWindow (dpyinfo->display,
421                               dpyinfo->root_window,
422                               -1, -1, 1, 1,
423                               CopyFromParent, CopyFromParent, CopyFromParent);
424    
425      class_hints.res_name = (char *) SDATA (Vx_resource_name);
426      class_hints.res_class = (char *) SDATA (Vx_resource_class);
427      XSetClassHint (dpyinfo->display, w, &class_hints);
428      XStoreName (dpyinfo->display, w, class_hints.res_name);
429    
430      sm_id = XInternAtom (dpyinfo->display, "SM_CLIENT_ID", False);
431      XChangeProperty (dpyinfo->display, w, sm_id, XA_STRING, 8, PropModeReplace,
432                       client_id, strlen (client_id));
433    
434      dpyinfo->client_leader_window = w;
435    }
436    
437  /* Try to open a connection to the session manager. */  /* Try to open a connection to the session manager. */
438  void  void
439  x_session_initialize ()  x_session_initialize (dpyinfo)
440         struct x_display_info *dpyinfo;
441  {  {
442  #define SM_ERRORSTRING_LEN 512  #define SM_ERRORSTRING_LEN 512
443    char errorstring[SM_ERRORSTRING_LEN];    char errorstring[SM_ERRORSTRING_LEN];
# Line 466  x_session_initialize () Line 498  x_session_initialize ()
498                                  errorstring);                                  errorstring);
499    
500    if (smc_conn != 0)    if (smc_conn != 0)
501      Vx_session_id = make_string (client_id, strlen (client_id));      {
502          Vx_session_id = make_string (client_id, strlen (client_id));
503    
504    #ifdef USE_GTK
505          /* GTK creats a leader window by itself, but we need to tell
506             it about our client_id.  */
507          gdk_set_sm_client_id (client_id);
508    #else
509          create_client_leader_window (dpyinfo, client_id);
510    #endif
511        }
512  }  }
513    
514    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26