emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xsmfns.c [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/xsmfns.c [lexbind]
Date: Tue, 14 Oct 2003 19:23:34 -0400

Index: emacs/src/xsmfns.c
diff -c emacs/src/xsmfns.c:1.3.2.1 emacs/src/xsmfns.c:1.3.2.2
*** emacs/src/xsmfns.c:1.3.2.1  Fri Apr  4 01:21:09 2003
--- emacs/src/xsmfns.c  Tue Oct 14 19:22:52 2003
***************
*** 24,29 ****
--- 24,32 ----
  #ifdef HAVE_X_SM
  
  #include <X11/SM/SMlib.h>
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+ 
  #ifdef HAVE_STRING_H
  #include <string.h>
  #else
***************
*** 47,52 ****
--- 50,56 ----
  #include "lisp.h"
  #include "termhooks.h"
  #include "termopts.h"
+ #include "xterm.h"
  
  #ifndef MAXPATHLEN
  #define MAXPATHLEN 1024
***************
*** 403,411 ****
  #endif /* ! defined (SIGIO) */
  }
  
  /* Try to open a connection to the session manager. */
  void
! x_session_initialize ()
  {
  #define SM_ERRORSTRING_LEN 512
    char errorstring[SM_ERRORSTRING_LEN];
--- 407,443 ----
  #endif /* ! defined (SIGIO) */
  }
  
+ /* Create the client leader window.  */
+ static void
+ create_client_leader_window (dpyinfo, client_id)
+      struct x_display_info *dpyinfo;
+      char *client_id;
+ {
+   Window w;
+   XClassHint class_hints;
+   Atom sm_id;
+ 
+   w = XCreateSimpleWindow (dpyinfo->display,
+                            dpyinfo->root_window,
+                            -1, -1, 1, 1,
+                            CopyFromParent, CopyFromParent, CopyFromParent);
+ 
+   class_hints.res_name = (char *) SDATA (Vx_resource_name);
+   class_hints.res_class = (char *) SDATA (Vx_resource_class);
+   XSetClassHint (dpyinfo->display, w, &class_hints);
+   XStoreName (dpyinfo->display, w, class_hints.res_name);
+ 
+   sm_id = XInternAtom (dpyinfo->display, "SM_CLIENT_ID", False);
+   XChangeProperty (dpyinfo->display, w, sm_id, XA_STRING, 8, PropModeReplace,
+                    client_id, strlen (client_id));
+ 
+   dpyinfo->client_leader_window = w;
+ }
+ 
  /* Try to open a connection to the session manager. */
  void
! x_session_initialize (dpyinfo)
!      struct x_display_info *dpyinfo;
  {
  #define SM_ERRORSTRING_LEN 512
    char errorstring[SM_ERRORSTRING_LEN];
***************
*** 466,472 ****
                                  errorstring);
  
    if (smc_conn != 0)
!     Vx_session_id = make_string (client_id, strlen (client_id));
  }
  
  
--- 498,514 ----
                                  errorstring);
  
    if (smc_conn != 0)
!     {
!       Vx_session_id = make_string (client_id, strlen (client_id));
! 
! #ifdef USE_GTK
!       /* GTK creats a leader window by itself, but we need to tell
!          it about our client_id.  */
!       gdk_set_sm_client_id (client_id);
! #else
!       create_client_leader_window (dpyinfo, client_id);
! #endif
!     }
  }
  
  
***************
*** 544,546 ****
--- 586,591 ----
  }
  
  #endif /* HAVE_X_SM */
+ 
+ /* arch-tag: 56a2c58c-adfa-430a-b772-130abd29fd2e
+    (do not change this comment) */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]