comparison src/xsmfns.c @ 112434:9de5a68b57e1

Promote SSDATA macro from gtkutil.c and xsmfns.c to lisp.h.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 22 Jan 2011 18:56:06 -0800
parents 42e22c4f06b7
children
comparison
equal deleted inserted replaced
112433:7b649f6eac4f 112434:9de5a68b57e1
36 #include "sysselect.h" 36 #include "sysselect.h"
37 #include "frame.h" 37 #include "frame.h"
38 #include "termhooks.h" 38 #include "termhooks.h"
39 #include "termopts.h" 39 #include "termopts.h"
40 #include "xterm.h" 40 #include "xterm.h"
41
42 /* Avoid "differ in sign" warnings */
43 #define SSDATA(x) ((char *) SDATA (x))
44 41
45 /* This is the event used when SAVE_SESSION_EVENT occurs. */ 42 /* This is the event used when SAVE_SESSION_EVENT occurs. */
46 43
47 static struct input_event emacs_event; 44 static struct input_event emacs_event;
48 45
230 227
231 props[props_idx]->vals[2].length = strlen (NOSPLASH_OPT); 228 props[props_idx]->vals[2].length = strlen (NOSPLASH_OPT);
232 props[props_idx]->vals[2].value = NOSPLASH_OPT; 229 props[props_idx]->vals[2].value = NOSPLASH_OPT;
233 230
234 cwd = get_current_dir_name (); 231 cwd = get_current_dir_name ();
235 if (cwd) 232 if (cwd)
236 { 233 {
237 chdir_opt = xmalloc (strlen (CHDIR_OPT) + strlen (cwd) + 1); 234 chdir_opt = xmalloc (strlen (CHDIR_OPT) + strlen (cwd) + 1);
238 strcpy (chdir_opt, CHDIR_OPT); 235 strcpy (chdir_opt, CHDIR_OPT);
239 strcat (chdir_opt, cwd); 236 strcat (chdir_opt, cwd);
240 237
392 w = XCreateSimpleWindow (dpyinfo->display, 389 w = XCreateSimpleWindow (dpyinfo->display,
393 dpyinfo->root_window, 390 dpyinfo->root_window,
394 -1, -1, 1, 1, 391 -1, -1, 1, 1,
395 CopyFromParent, CopyFromParent, CopyFromParent); 392 CopyFromParent, CopyFromParent, CopyFromParent);
396 393
397 class_hints.res_name = (char *) SDATA (Vx_resource_name); 394 class_hints.res_name = SSDATA (Vx_resource_name);
398 class_hints.res_class = (char *) SDATA (Vx_resource_class); 395 class_hints.res_class = SSDATA (Vx_resource_class);
399 XSetClassHint (dpyinfo->display, w, &class_hints); 396 XSetClassHint (dpyinfo->display, w, &class_hints);
400 XStoreName (dpyinfo->display, w, class_hints.res_name); 397 XStoreName (dpyinfo->display, w, class_hints.res_name);
401 398
402 XChangeProperty (dpyinfo->display, w, dpyinfo->Xatom_SM_CLIENT_ID, 399 XChangeProperty (dpyinfo->display, w, dpyinfo->Xatom_SM_CLIENT_ID,
403 XA_STRING, 8, PropModeReplace, 400 XA_STRING, 8, PropModeReplace,
535 532
536 /* This will not be reached, but we want kill-emacs-hook to be run. */ 533 /* This will not be reached, but we want kill-emacs-hook to be run. */
537 SmcCloseConnection (smc_conn, 0, 0); 534 SmcCloseConnection (smc_conn, 0, 0);
538 ice_connection_closed (); 535 ice_connection_closed ();
539 } 536 }
540 537
541 return Qnil; 538 return Qnil;
542 } 539 }
543 540
544 541
545 542
546 /*********************************************************************** 543 /***********************************************************************
547 Initialization 544 Initialization
548 ***********************************************************************/ 545 ***********************************************************************/
582 579
583 defsubr (&Shandle_save_session); 580 defsubr (&Shandle_save_session);
584 } 581 }
585 582
586 #endif /* HAVE_X_SM */ 583 #endif /* HAVE_X_SM */
587