ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.30 by pcg, Thu Feb 12 01:53:25 2004 UTC vs.
Revision 1.32 by pcg, Fri Feb 13 12:16:21 2004 UTC

121#endif 121#endif
122 122
123 // TODO: free pixcolours, colours should become part of rxvt_display 123 // TODO: free pixcolours, colours should become part of rxvt_display
124 124
125 delete PixColors; 125 delete PixColors;
126 delete TermWin.fontset;
126 127
127 displays.put (display); 128 displays.put (display);
128} 129}
129 130
130void 131void
133 if (display) 134 if (display)
134 { 135 {
135 if (TermWin.parent[0]) 136 if (TermWin.parent[0])
136 XDestroyWindow (display->display, TermWin.parent[0]); 137 XDestroyWindow (display->display, TermWin.parent[0]);
137 138
139 rootwin_ev.stop (display);
138 termwin_ev.stop (display); 140 termwin_ev.stop (display);
139 vt_ev.stop (display); 141 vt_ev.stop (display);
140 142
141#ifdef USE_XIM 143#ifdef USE_XIM
142 im_destroy (); 144 im_destroy ();
172 174
173 delete this; 175 delete this;
174} 176}
175 177
176/*----------------------------------------------------------------------*/ 178/*----------------------------------------------------------------------*/
177/* rxvt_init() */ 179/* rxvt_init () */
178/* LIBPROTO */ 180/* LIBPROTO */
179rxvt_t 181rxvt_t
180rxvt_init (int argc, const char *const *argv) 182rxvt_init (int argc, const char *const *argv)
181{ 183{
182 SET_R (new rxvt_term); 184 SET_R (new rxvt_term);
188 } 190 }
189 191
190 return GET_R; 192 return GET_R;
191} 193}
192 194
193static int (*old_xerror_handler)(Display *dpy, XErrorEvent *event); 195static int (*old_xerror_handler) (Display *dpy, XErrorEvent *event);
194 196
195void 197void
196rxvt_init_signals () 198rxvt_init_signals ()
197{ 199{
198 /* install exit handler for cleanup */ 200 /* install exit handler for cleanup */
199#if 0 201#if 0
200#ifdef HAVE_ATEXIT 202#ifdef HAVE_ATEXIT
201 atexit(rxvt_clean_exit); 203 atexit (rxvt_clean_exit);
202#else 204#else
203#endif 205#endif
204#endif 206#endif
205 207
206 struct sigaction sa; 208 struct sigaction sa;
257 Gr_reset (); /* reset graphics */ 259 Gr_reset (); /* reset graphics */
258#endif 260#endif
259 261
260#if 0 262#if 0
261#ifdef DEBUG_X 263#ifdef DEBUG_X
262 XSynchronize(display->display, True); 264 XSynchronize (display->display, True);
263#endif 265#endif
264#endif 266#endif
265 267
266#ifdef HAVE_SCROLLBARS 268#ifdef HAVE_SCROLLBARS
267 if (Options & Opt_scrollBar) 269 if (Options & Opt_scrollBar)
268 resize_scrollbar (); /* create and map scrollbar */ 270 resize_scrollbar (); /* create and map scrollbar */
269#endif 271#endif
270#if (MENUBAR_MAX) 272#if (MENUBAR_MAX)
271 if (menubar_visible(r)) 273 if (menubar_visible (r))
272 XMapWindow (display->display, menuBar.win); 274 XMapWindow (display->display, menuBar.win);
273#endif 275#endif
274#ifdef TRANSPARENT 276#ifdef TRANSPARENT
275 if (Options & Opt_transparent) 277 if (Options & Opt_transparent)
276 { 278 {
301 * Catch a SIGCHLD signal and exit if the direct child has died 303 * Catch a SIGCHLD signal and exit if the direct child has died
302 */ 304 */
303/* ARGSUSED */ 305/* ARGSUSED */
304/* EXTPROTO */ 306/* EXTPROTO */
305RETSIGTYPE 307RETSIGTYPE
306rxvt_Child_signal(int sig __attribute__ ((unused))) 308rxvt_Child_signal (int sig __attribute__ ((unused)))
307{ 309{
308 int pid, save_errno = errno; 310 int pid, save_errno = errno;
309 while ((pid = waitpid (-1, NULL, WNOHANG)) == -1 && errno == EINTR) 311 while ((pid = waitpid (-1, NULL, WNOHANG)) == -1 && errno == EINTR)
310 ; 312 ;
311 errno = save_errno; 313 errno = save_errno;
319/* 321/*
320 * Catch a fatal signal and tidy up before quitting 322 * Catch a fatal signal and tidy up before quitting
321 */ 323 */
322/* EXTPROTO */ 324/* EXTPROTO */
323RETSIGTYPE 325RETSIGTYPE
324rxvt_Exit_signal(int sig) 326rxvt_Exit_signal (int sig)
325{ 327{
326 signal (sig, SIG_DFL); 328 signal (sig, SIG_DFL);
327#ifdef DEBUG_CMD 329#ifdef DEBUG_CMD
328 rxvt_print_error ("signal %d", sig); 330 rxvt_print_error ("signal %d", sig);
329#endif 331#endif
330 rxvt_clean_exit(); 332 rxvt_clean_exit ();
331 kill (getpid (), sig); 333 kill (getpid (), sig);
332} 334}
333 335
334/* INTPROTO */ 336/* INTPROTO */
335int 337int
363/* ------------------------------------------------------------------------- * 365/* ------------------------------------------------------------------------- *
364 * MEMORY ALLOCATION WRAPPERS * 366 * MEMORY ALLOCATION WRAPPERS *
365 * ------------------------------------------------------------------------- */ 367 * ------------------------------------------------------------------------- */
366/* EXTPROTO */ 368/* EXTPROTO */
367void * 369void *
368rxvt_malloc(size_t size) 370rxvt_malloc (size_t size)
369{ 371{
370 void *p; 372 void *p;
371 373
372 p = malloc(size); 374 p = malloc (size);
373 if (p) 375 if (p)
374 return p; 376 return p;
375 377
376 fprintf(stderr, APL_NAME ": memory allocation failure. Aborting"); 378 fprintf (stderr, APL_NAME ": memory allocation failure. Aborting");
377 rxvt_clean_exit(); 379 rxvt_clean_exit ();
378 exit(EXIT_FAILURE); 380 exit (EXIT_FAILURE);
379 /* NOTREACHED */ 381 /* NOTREACHED */
380} 382}
381 383
382/* EXTPROTO */ 384/* EXTPROTO */
383void * 385void *
384rxvt_calloc(size_t number, size_t size) 386rxvt_calloc (size_t number, size_t size)
385{ 387{
386 void *p; 388 void *p;
387 389
388 p = calloc(number, size); 390 p = calloc (number, size);
389 if (p) 391 if (p)
390 return p; 392 return p;
391 393
392 fprintf(stderr, APL_NAME ": memory allocation failure. Aborting"); 394 fprintf (stderr, APL_NAME ": memory allocation failure. Aborting");
393 rxvt_clean_exit(); 395 rxvt_clean_exit ();
394 exit(EXIT_FAILURE); 396 exit (EXIT_FAILURE);
395 /* NOTREACHED */ 397 /* NOTREACHED */
396} 398}
397 399
398/* EXTPROTO */ 400/* EXTPROTO */
399void * 401void *
400rxvt_realloc(void *ptr, size_t size) 402rxvt_realloc (void *ptr, size_t size)
401{ 403{
402 void *p; 404 void *p;
403 405
404 if (ptr) 406 if (ptr)
405 p = realloc(ptr, size); 407 p = realloc (ptr, size);
406 else 408 else
407 p = malloc(size); 409 p = malloc (size);
408 if (p) 410 if (p)
409 return p; 411 return p;
410 412
411 fprintf(stderr, APL_NAME ": memory allocation failure. Aborting"); 413 fprintf (stderr, APL_NAME ": memory allocation failure. Aborting");
412 rxvt_clean_exit(); 414 rxvt_clean_exit ();
413 exit(EXIT_FAILURE); 415 exit (EXIT_FAILURE);
414 /* NOTREACHED */ 416 /* NOTREACHED */
415} 417}
416 418
417/* ------------------------------------------------------------------------- * 419/* ------------------------------------------------------------------------- *
418 * PRIVILEGED OPERATIONS * 420 * PRIVILEGED OPERATIONS *
421void 423void
422rxvt_term::privileges (int mode) 424rxvt_term::privileges (int mode)
423{ 425{
424#if ! defined(__CYGWIN32__) 426#if ! defined(__CYGWIN32__)
425# if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) 427# if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID)
426 /* setreuid() is the poor man's setuid(), seteuid() */ 428 /* setreuid () is the poor man's setuid (), seteuid () */
427# define seteuid(a) setreuid(-1, (a)) 429# define seteuid(a) setreuid(-1, (a))
428# define setegid(a) setregid(-1, (a)) 430# define setegid(a) setregid(-1, (a))
429# define HAVE_SETEUID 431# define HAVE_SETEUID
430# endif 432# endif
431# ifdef HAVE_SETEUID 433# ifdef HAVE_SETEUID
434 case IGNORE: 436 case IGNORE:
435 /* 437 /*
436 * change effective uid/gid - not real uid/gid - so we can switch 438 * change effective uid/gid - not real uid/gid - so we can switch
437 * back to root later, as required 439 * back to root later, as required
438 */ 440 */
439 seteuid(getuid()); 441 seteuid (getuid ());
440 setegid(getgid()); 442 setegid (getgid ());
441 break; 443 break;
442 case SAVE: 444 case SAVE:
443 euid = geteuid(); 445 euid = geteuid ();
444 egid = getegid(); 446 egid = getegid ();
445 break; 447 break;
446 case RESTORE: 448 case RESTORE:
447 seteuid(euid); 449 seteuid (euid);
448 setegid(egid); 450 setegid (egid);
449 break; 451 break;
450 } 452 }
451# else 453# else
452 switch (mode) 454 switch (mode)
453 { 455 {
454 case IGNORE: 456 case IGNORE:
455 setuid(getuid()); 457 setuid (getuid ());
456 setgid(getgid()); 458 setgid (getgid ());
457 /* FALLTHROUGH */ 459 /* FALLTHROUGH */
458 case SAVE: 460 case SAVE:
459 /* FALLTHROUGH */ 461 /* FALLTHROUGH */
460 case RESTORE: 462 case RESTORE:
461 break; 463 break;
466 468
467#ifdef UTMP_SUPPORT 469#ifdef UTMP_SUPPORT
468void 470void
469rxvt_term::privileged_utmp (char action) 471rxvt_term::privileged_utmp (char action)
470{ 472{
471 D_MAIN((stderr, "rxvt_privileged_utmp(%c); waiting for: %c (pid: %d)", 473 D_MAIN ((stderr, "rxvt_privileged_utmp (%c); waiting for: %c (pid: %d)",
472 action, next_utmp_action, getpid())); 474 action, next_utmp_action, getpid ()));
473 if (next_utmp_action != action || (action != SAVE && action != RESTORE) 475 if (next_utmp_action != action || (action != SAVE && action != RESTORE)
474 || (Options & Opt_utmpInhibit) 476 || (Options & Opt_utmpInhibit)
475 || ttydev == NULL || *ttydev == '\0') 477 || ttydev == NULL || *ttydev == '\0')
476 return; 478 return;
477 479
492 494
493#ifndef NO_SETOWNER_TTYDEV 495#ifndef NO_SETOWNER_TTYDEV
494void 496void
495rxvt_term::privileged_ttydev (char action) 497rxvt_term::privileged_ttydev (char action)
496{ 498{
497 D_MAIN((stderr, 499 D_MAIN ((stderr,
498 "privileged_ttydev (%c); waiting for: %c (pid: %d)", 500 "privileged_ttydev (%c); waiting for: %c (pid: %d)",
499 action, next_tty_action, getpid())); 501 action, next_tty_action, getpid ()));
500 if (next_tty_action != action || (action != SAVE && action != RESTORE) 502 if (next_tty_action != action || (action != SAVE && action != RESTORE)
501 || ttydev == NULL || *ttydev == '\0') 503 || ttydev == NULL || *ttydev == '\0')
502 return; 504 return;
503 505
504 privileges (RESTORE); 506 privileges (RESTORE);
505 507
506 if (action == SAVE) 508 if (action == SAVE)
507 { 509 {
508 next_tty_action = RESTORE; 510 next_tty_action = RESTORE;
509# ifndef RESET_TTY_TO_COMMON_DEFAULTS 511# ifndef RESET_TTY_TO_COMMON_DEFAULTS
510 /* store original tty status for restoration rxvt_clean_exit() -- rgg 04/12/95 */ 512 /* store original tty status for restoration rxvt_clean_exit () -- rgg 04/12/95 */
511 if (lstat(ttydev, &ttyfd_stat) < 0) /* you lose out */ 513 if (lstat (ttydev, &ttyfd_stat) < 0) /* you lose out */
512 next_tty_action = IGNORE; 514 next_tty_action = IGNORE;
513 else 515 else
514# endif 516# endif
515 517
516 { 518 {
517 chown(ttydev, getuid(), ttygid); /* fail silently */ 519 chown (ttydev, getuid (), ttygid); /* fail silently */
518 chmod(ttydev, ttymode); 520 chmod (ttydev, ttymode);
519# ifdef HAVE_REVOKE 521# ifdef HAVE_REVOKE
520 revoke(ttydev); 522 revoke (ttydev);
521# endif 523# endif
522 524
523 } 525 }
524 } 526 }
525 else 527 else
526 { /* action == RESTORE */ 528 { /* action == RESTORE */
527 next_tty_action = IGNORE; 529 next_tty_action = IGNORE;
528# ifndef RESET_TTY_TO_COMMON_DEFAULTS 530# ifndef RESET_TTY_TO_COMMON_DEFAULTS
529 chmod(ttydev, ttyfd_stat.st_mode); 531 chmod (ttydev, ttyfd_stat.st_mode);
530 chown(ttydev, ttyfd_stat.st_uid, ttyfd_stat.st_gid); 532 chown (ttydev, ttyfd_stat.st_uid, ttyfd_stat.st_gid);
531# else 533# else
532 chmod(ttydev, 534 chmod (ttydev,
533 (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)); 535 (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH));
534 chown(ttydev, 0, 0); 536 chown (ttydev, 0, 0);
535# endif 537# endif
536 538
537 } 539 }
538 540
539 privileges (IGNORE); 541 privileges (IGNORE);
540 542
541# ifndef RESET_TTY_TO_COMMON_DEFAULTS 543# ifndef RESET_TTY_TO_COMMON_DEFAULTS
542 D_MAIN((stderr, "%s \"%s\": mode %03o, uid %d, gid %d", 544 D_MAIN ((stderr, "%s \"%s\": mode %03o, uid %d, gid %d",
543 action == RESTORE ? "Restoring" : (action == 545 action == RESTORE ? "Restoring" : (action ==
544 SAVE ? "Saving" : 546 SAVE ? "Saving" :
545 "UNKNOWN ERROR for"), ttydev, 547 "UNKNOWN ERROR for"), ttydev,
546 ttyfd_stat.st_mode, ttyfd_stat.st_uid, 548 ttyfd_stat.st_mode, ttyfd_stat.st_uid,
547 ttyfd_stat.st_gid)); 549 ttyfd_stat.st_gid));
560 short recalc_x, recalc_y; 562 short recalc_x, recalc_y;
561 int x, y, sb_w, mb_h, flags; 563 int x, y, sb_w, mb_h, flags;
562 unsigned int w, h; 564 unsigned int w, h;
563 unsigned int max_width, max_height; 565 unsigned int max_width, max_height;
564 566
565 D_SIZE((stderr, "< Cols/Rows: %3d x %3d ; Width/Height: %4d x %4d", 567 D_SIZE ((stderr, "< Cols/Rows: %3d x %3d ; Width/Height: %4d x %4d",
566 TermWin.ncol, TermWin.nrow, szHint.width, 568 TermWin.ncol, TermWin.nrow, szHint.width,
567 szHint.height)); 569 szHint.height));
568 szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity; 570 szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity;
569 szHint.win_gravity = NorthWestGravity; 571 szHint.win_gravity = NorthWestGravity;
570 /* szHint.min_aspect.x = szHint.min_aspect.y = 1; */ 572 /* szHint.min_aspect.x = szHint.min_aspect.y = 1; */
573 flags = 0; 575 flags = 0;
574 if (!parsed_geometry) 576 if (!parsed_geometry)
575 { 577 {
576 parsed_geometry = 1; 578 parsed_geometry = 1;
577 if (rs[Rs_geometry]) 579 if (rs[Rs_geometry])
578 flags = XParseGeometry(rs[Rs_geometry], &x, &y, &w, &h); 580 flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h);
579 if (flags & WidthValue) 581 if (flags & WidthValue)
580 { 582 {
581 TermWin.ncol = BOUND_POSITIVE_INT16(w); 583 TermWin.ncol = BOUND_POSITIVE_INT16 (w);
582 szHint.flags |= USSize; 584 szHint.flags |= USSize;
583 } 585 }
584 if (flags & HeightValue) 586 if (flags & HeightValue)
585 { 587 {
586 TermWin.nrow = BOUND_POSITIVE_INT16(h); 588 TermWin.nrow = BOUND_POSITIVE_INT16 (h);
587 szHint.flags |= USSize; 589 szHint.flags |= USSize;
588 } 590 }
589 if (flags & XValue) 591 if (flags & XValue)
590 { 592 {
591 szHint.x = x; 593 szHint.x = x;
620 622
621 sb_w = mb_h = 0; 623 sb_w = mb_h = 0;
622 window_vt_x = window_vt_y = 0; 624 window_vt_x = window_vt_y = 0;
623 if (scrollbar_visible ()) 625 if (scrollbar_visible ())
624 { 626 {
625 sb_w = scrollbar_TotalWidth(); 627 sb_w = scrollbar_TotalWidth ();
626 szHint.base_width += sb_w; 628 szHint.base_width += sb_w;
627 if (!(Options & Opt_scrollBar_right)) 629 if (! (Options & Opt_scrollBar_right))
628 window_vt_x = sb_w; 630 window_vt_x = sb_w;
629 } 631 }
630 if (menubar_visible ()) 632 if (menubar_visible ())
631 { 633 {
632 mb_h = menuBar_TotalHeight(); 634 mb_h = menuBar_TotalHeight ();
633 szHint.base_height += mb_h; 635 szHint.base_height += mb_h;
634 window_vt_y = mb_h; 636 window_vt_y = mb_h;
635 } 637 }
636 szHint.width_inc = TermWin.fwidth; 638 szHint.width_inc = TermWin.fwidth;
637 szHint.height_inc = TermWin.fheight; 639 szHint.height_inc = TermWin.fheight;
643 szHint.width = width; 645 szHint.width = width;
644 TermWin.width = width - szHint.base_width; 646 TermWin.width = width - szHint.base_width;
645 } 647 }
646 else 648 else
647 { 649 {
648 MIN_IT(TermWin.width, max_width); 650 MIN_IT (TermWin.width, max_width);
649 szHint.width = szHint.base_width + TermWin.width; 651 szHint.width = szHint.base_width + TermWin.width;
650 } 652 }
651 if (height && height - szHint.base_height < max_height) 653 if (height && height - szHint.base_height < max_height)
652 { 654 {
653 szHint.height = height; 655 szHint.height = height;
654 TermWin.height = height - szHint.base_height; 656 TermWin.height = height - szHint.base_height;
655 } 657 }
656 else 658 else
657 { 659 {
658 MIN_IT(TermWin.height, max_height); 660 MIN_IT (TermWin.height, max_height);
659 szHint.height = szHint.base_height + TermWin.height; 661 szHint.height = szHint.base_height + TermWin.height;
660 } 662 }
661 if (scrollbar_visible () && (Options & Opt_scrollBar_right)) 663 if (scrollbar_visible () && (Options & Opt_scrollBar_right))
662 window_sb_x = szHint.width - sb_w; 664 window_sb_x = szHint.width - sb_w;
663 665
668 szHint.y += (DisplayHeight (display->display, DefaultScreen (display->display)) 670 szHint.y += (DisplayHeight (display->display, DefaultScreen (display->display))
669 - szHint.height - 2 * TermWin.ext_bwidth); 671 - szHint.height - 2 * TermWin.ext_bwidth);
670 672
671 TermWin.ncol = TermWin.width / TermWin.fwidth; 673 TermWin.ncol = TermWin.width / TermWin.fwidth;
672 TermWin.nrow = TermWin.height / TermWin.fheight; 674 TermWin.nrow = TermWin.height / TermWin.fheight;
673 D_SIZE((stderr, "> Cols/Rows: %3d x %3d ; Width/Height: %4d x %4d", 675 D_SIZE ((stderr, "> Cols/Rows: %3d x %3d ; Width/Height: %4d x %4d",
674 TermWin.ncol, TermWin.nrow, szHint.width, 676 TermWin.ncol, TermWin.nrow, szHint.width,
675 szHint.height)); 677 szHint.height));
676 return; 678 return;
677} 679}
678 680
694 ws.ws_xpixel = ws.ws_ypixel = 0; 696 ws.ws_xpixel = ws.ws_ypixel = 0;
695#ifndef DEBUG_SIZE 697#ifndef DEBUG_SIZE
696 (void)ioctl (cmd_fd, TIOCSWINSZ, &ws); 698 (void)ioctl (cmd_fd, TIOCSWINSZ, &ws);
697#else 699#else
698 if (ioctl (cmd_fd, TIOCSWINSZ, &ws) < 0) 700 if (ioctl (cmd_fd, TIOCSWINSZ, &ws) < 0)
699 D_SIZE((stderr, "Failed to send TIOCSWINSZ to fd %d", fd)); 701 D_SIZE ((stderr, "Failed to send TIOCSWINSZ to fd %d", fd));
700# ifdef SIGWINCH 702# ifdef SIGWINCH
701 else if (cmd_pid) /* force through to the command */ 703 else if (cmd_pid) /* force through to the command */
702 kill (cmd_pid, SIGWINCH); 704 kill (cmd_pid, SIGWINCH);
703# endif 705# endif
704#endif 706#endif
705} 707}
706 708
707/*----------------------------------------------------------------------*/ 709/*----------------------------------------------------------------------*/
708/* rxvt_change_font() - Switch to a new font */ 710/* rxvt_change_font () - Switch to a new font */
709/* 711/*
710 * init = 1 - initialize 712 * init = 1 - initialize
711 * 713 *
712 * fontname == FONT_UP - switch to bigger font 714 * fontname == FONT_UP - switch to bigger font
713 * fontname == FONT_DN - switch to smaller font 715 * fontname == FONT_DN - switch to smaller font
725/* xterm sequences - title, iconName, color (exptl) */ 727/* xterm sequences - title, iconName, color (exptl) */
726void 728void
727rxvt_term::set_title (const char *str) 729rxvt_term::set_title (const char *str)
728{ 730{
729#ifndef SMART_WINDOW_TITLE 731#ifndef SMART_WINDOW_TITLE
730 XStoreName(display->display, TermWin.parent[0], str); 732 XStoreName (display->display, TermWin.parent[0], str);
731#else 733#else
732 char *name; 734 char *name;
733 735
734 if (XFetchName(display->display, TermWin.parent[0], &name) == 0) 736 if (XFetchName (display->display, TermWin.parent[0], &name) == 0)
735 name = NULL; 737 name = NULL;
736 if (name == NULL || STRCMP(name, str)) 738 if (name == NULL || STRCMP (name, str))
737 XStoreName(display->display, TermWin.parent[0], str); 739 XStoreName (display->display, TermWin.parent[0], str);
738 if (name) 740 if (name)
739 XFree(name); 741 XFree (name);
740#endif 742#endif
741} 743}
742 744
743void 745void
744rxvt_term::set_iconName (const char *str) 746rxvt_term::set_iconName (const char *str)
745{ 747{
746#ifndef SMART_WINDOW_TITLE 748#ifndef SMART_WINDOW_TITLE
747 XSetIconName(display->display, TermWin.parent[0], str); 749 XSetIconName (display->display, TermWin.parent[0], str);
748#else 750#else
749 char *name; 751 char *name;
750 752
751 if (XGetIconName(display->display, TermWin.parent[0], &name)) 753 if (XGetIconName (display->display, TermWin.parent[0], &name))
752 name = NULL; 754 name = NULL;
753 if (name == NULL || STRCMP(name, str)) 755 if (name == NULL || STRCMP (name, str))
754 XSetIconName(display->display, TermWin.parent[0], str); 756 XSetIconName (display->display, TermWin.parent[0], str);
755 if (name) 757 if (name)
756 XFree(name); 758 XFree (name);
757#endif 759#endif
758} 760}
759 761
760#ifdef XTERM_COLOR_CHANGE 762#ifdef XTERM_COLOR_CHANGE
761void 763void
766 768
767 if (color == NULL || *color == '\0') 769 if (color == NULL || *color == '\0')
768 return; 770 return;
769 771
770 /* handle color aliases */ 772 /* handle color aliases */
771 if (isdigit(*color)) 773 if (isdigit (*color))
772 { 774 {
773 i = atoi(color); 775 i = atoi (color);
774 if (i >= 8 && i <= 15) 776 if (i >= 8 && i <= 15)
775 { /* bright colors */ 777 { /* bright colors */
776 i -= 8; 778 i -= 8;
777# ifndef NO_BRIGHTCOLOR 779# ifndef NO_BRIGHTCOLOR
778 PixColors[idx] = PixColors[minBrightCOLOR + i]; 780 PixColors[idx] = PixColors[minBrightCOLOR + i];
779 SET_PIXCOLOR(idx); 781 SET_PIXCOLOR (idx);
780 goto Done; 782 goto Done;
781# endif 783# endif
782 784
783 } 785 }
784 if (i >= 0 && i <= 7) 786 if (i >= 0 && i <= 7)
785 { /* normal colors */ 787 { /* normal colors */
786 PixColors[idx] = PixColors[minCOLOR + i]; 788 PixColors[idx] = PixColors[minCOLOR + i];
787 SET_PIXCOLOR(idx); 789 SET_PIXCOLOR (idx);
788 goto Done; 790 goto Done;
789 } 791 }
790 } 792 }
791 if (!rXParseAllocColor (& xcol, color)) 793 if (!rXParseAllocColor (& xcol, color))
792 return; 794 return;
801 if (PixColors[idx] == PixColors[i]) 803 if (PixColors[idx] == PixColors[i])
802 break; 804 break;
803 if (i > Color_White) 805 if (i > Color_White)
804 { 806 {
805 /* fprintf (stderr, "XFreeColors: PixColors [%d] = %lu\n", idx, PixColors [idx]); */ 807 /* fprintf (stderr, "XFreeColors: PixColors [%d] = %lu\n", idx, PixColors [idx]); */
806 XFreeColors(display->display, XCMAP, (PixColors + idx), 1, 808 XFreeColors (display->display, XCMAP, (PixColors + idx), 1,
807 DisplayPlanes(display->display, display->screen)); 809 DisplayPlanes (display->display, display->screen));
808 } 810 }
809# endif 811# endif
810 812
811 PixColors[idx] = xcol; 813 PixColors[idx] = xcol;
812 SET_PIXCOLOR(idx); 814 SET_PIXCOLOR (idx);
813 815
814 /* XSetWindowAttributes attr; */ 816 /* XSetWindowAttributes attr; */
815 /* Cursor cursor; */ 817 /* Cursor cursor; */
816Done: 818Done:
817 if (idx == Color_bg && !(Options & Opt_transparent)) 819 if (idx == Color_bg && ! (Options & Opt_transparent))
818 XSetWindowBackground(display->display, TermWin.vt, 820 XSetWindowBackground (display->display, TermWin.vt,
819 PixColors[Color_bg]); 821 PixColors[Color_bg]);
820 822
821 /* handle Color_BD, scrollbar background, etc. */ 823 /* handle Color_BD, scrollbar background, etc. */
822 824
823 set_colorfgbg (); 825 set_colorfgbg ();
837 rxvt_color xcol[2]; 839 rxvt_color xcol[2];
838 840
839 xcol[0] = PixColors[Color_pointer]; 841 xcol[0] = PixColors[Color_pointer];
840 xcol[1] = PixColors[Color_bg]; 842 xcol[1] = PixColors[Color_bg];
841 XQueryColors (display->display, XCMAP, xcol, 2); 843 XQueryColors (display->display, XCMAP, xcol, 2);
842 XRecolorCursor (display->display, TermWin_cursor, &(xcol[0]), &(xcol[1])); 844 XRecolorCursor (display->display, TermWin_cursor, & (xcol[0]), & (xcol[1]));
843#endif 845#endif
844} 846}
845 847
846/*----------------------------------------------------------------------*/ 848/*----------------------------------------------------------------------*/
847/* 849/*
850void 852void
851rxvt_term::set_colorfgbg () 853rxvt_term::set_colorfgbg ()
852{ 854{
853 unsigned int i; 855 unsigned int i;
854 const char *xpmb = "\0"; 856 const char *xpmb = "\0";
855 char fstr[sizeof("default") + 1], bstr[sizeof("default") + 1]; 857 char fstr[sizeof ("default") + 1], bstr[sizeof ("default") + 1];
856 858
857 env_colorfgbg = 859 env_colorfgbg =
858 (char *)rxvt_malloc(sizeof("COLORFGBG=default;default;bg") + 1); 860 (char *)rxvt_malloc (sizeof ("COLORFGBG=default;default;bg") + 1);
859 STRCPY(fstr, "default"); 861 STRCPY (fstr, "default");
860 STRCPY(bstr, "default"); 862 STRCPY (bstr, "default");
861 for (i = Color_Black; i <= Color_White; i++) 863 for (i = Color_Black; i <= Color_White; i++)
862 if (PixColors[Color_fg] == PixColors[i]) 864 if (PixColors[Color_fg] == PixColors[i])
863 { 865 {
864 sprintf(fstr, "%d", (i - Color_Black)); 866 sprintf (fstr, "%d", (i - Color_Black));
865 break; 867 break;
866 } 868 }
867 for (i = Color_Black; i <= Color_White; i++) 869 for (i = Color_Black; i <= Color_White; i++)
868 if (PixColors[Color_bg] == PixColors[i]) 870 if (PixColors[Color_bg] == PixColors[i])
869 { 871 {
870 sprintf(bstr, "%d", (i - Color_Black)); 872 sprintf (bstr, "%d", (i - Color_Black));
871#ifdef XPM_BACKGROUND 873#ifdef XPM_BACKGROUND
872 xpmb = "default;"; 874 xpmb = "default;";
873#endif 875#endif
874 break; 876 break;
875 } 877 }
876 sprintf(env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr); 878 sprintf (env_colorfgbg, "COLORFGBG=%s;%s%s", fstr, xpmb, bstr);
877 putenv(env_colorfgbg); 879 putenv (env_colorfgbg);
878 880
879#ifndef NO_BRIGHTCOLOR 881#ifndef NO_BRIGHTCOLOR
880 colorfgbg = DEFAULT_RSTYLE; 882 colorfgbg = DEFAULT_RSTYLE;
881 for (i = minCOLOR; i <= maxCOLOR; i++) 883 for (i = minCOLOR; i <= maxCOLOR; i++)
882 { 884 {
883 if (PixColors[Color_fg] == PixColors[i]) 885 if (PixColors[Color_fg] == PixColors[i])
884 colorfgbg = SET_FGCOLOR(colorfgbg, i); 886 colorfgbg = SET_FGCOLOR (colorfgbg, i);
885 if (PixColors[Color_bg] == PixColors[i]) 887 if (PixColors[Color_bg] == PixColors[i])
886 colorfgbg = SET_BGCOLOR(colorfgbg, i); 888 colorfgbg = SET_BGCOLOR (colorfgbg, i);
887 } 889 }
888#endif 890#endif
889} 891}
890 892
891/*----------------------------------------------------------------------*/ 893/*----------------------------------------------------------------------*/
897int 899int
898rxvt_term::rXParseAllocColor (rxvt_color *screen_in_out, const char *colour) 900rxvt_term::rXParseAllocColor (rxvt_color *screen_in_out, const char *colour)
899{ 901{
900 if (!screen_in_out->set (display, colour)) 902 if (!screen_in_out->set (display, colour))
901 { 903 {
902 rxvt_print_error("can't allocate colour: %s", colour); 904 rxvt_print_error ("can't allocate colour: %s", colour);
903 return false; 905 return false;
904 } 906 }
905 907
906 return true; 908 return true;
907} 909}
1013 TermWin.ncol = prev_ncol; // save b/c scr_blank_screen_mem uses this 1015 TermWin.ncol = prev_ncol; // save b/c scr_blank_screen_mem uses this
1014 curr_screen = scr_change_screen (PRIMARY); 1016 curr_screen = scr_change_screen (PRIMARY);
1015 TermWin.ncol = ncol; 1017 TermWin.ncol = ncol;
1016 } 1018 }
1017 1019
1018 scr_reset(); 1020 scr_reset ();
1019 1021
1020 if (curr_screen >= 0) /* this is not the first time through */ 1022 if (curr_screen >= 0) /* this is not the first time through */
1021 { 1023 {
1022 scr_change_screen (curr_screen); 1024 scr_change_screen (curr_screen);
1023 selection_check (old_ncol != TermWin.ncol ? 4 : 0); 1025 selection_check (old_ncol != TermWin.ncol ? 4 : 0);
1041{ 1043{
1042 XWindowAttributes wattr; 1044 XWindowAttributes wattr;
1043 1045
1044 if (width == 0 || height == 0) 1046 if (width == 0 || height == 0)
1045 { 1047 {
1046 XGetWindowAttributes(display->display, display->root, &wattr); 1048 XGetWindowAttributes (display->display, display->root, &wattr);
1047 if (width == 0) 1049 if (width == 0)
1048 width = wattr.width - szHint.base_width; 1050 width = wattr.width - szHint.base_width;
1049 if (height == 0) 1051 if (height == 0)
1050 height = wattr.height - szHint.base_height; 1052 height = wattr.height - szHint.base_height;
1051 } 1053 }
1065void 1067void
1066rxvt_term::im_set_size (XRectangle *size) 1068rxvt_term::im_set_size (XRectangle *size)
1067{ 1069{
1068 size->x = TermWin.int_bwidth; 1070 size->x = TermWin.int_bwidth;
1069 size->y = TermWin.int_bwidth; 1071 size->y = TermWin.int_bwidth;
1070 size->width = Width2Pixel(TermWin.ncol); 1072 size->width = Width2Pixel (TermWin.ncol);
1071 size->height = Height2Pixel(TermWin.nrow); 1073 size->height = Height2Pixel (TermWin.nrow);
1072} 1074}
1073 1075
1074void 1076void
1075rxvt_term::im_set_color (unsigned long *fg, unsigned long *bg) 1077rxvt_term::im_set_color (unsigned long *fg, unsigned long *bg)
1076{ 1078{
1086 Atom atom; 1088 Atom atom;
1087 Window win; 1089 Window win;
1088 char server[IMBUFSIZ]; 1090 char server[IMBUFSIZ];
1089 1091
1090 /* get current locale modifier */ 1092 /* get current locale modifier */
1091 if ((p = XSetLocaleModifiers(NULL)) != NULL) 1093 if ((p = XSetLocaleModifiers (NULL)) != NULL)
1092 { 1094 {
1093 STRCPY(server, "@server="); 1095 STRCPY (server, "@server=");
1094 STRNCAT(server, &(p[4]), IMBUFSIZ - 9); /* skip "@im=" */ 1096 STRNCAT (server, & (p[4]), IMBUFSIZ - 9); /* skip "@im=" */
1095 if ((p = STRCHR(server + 1, '@')) != NULL) /* first one only */ 1097 if ((p = STRCHR (server + 1, '@')) != NULL) /* first one only */
1096 *p = '\0'; 1098 *p = '\0';
1097 1099
1098 atom = XInternAtom(display->display, server, False); 1100 atom = XInternAtom (display->display, server, False);
1099 win = XGetSelectionOwner(display->display, atom); 1101 win = XGetSelectionOwner (display->display, atom);
1100 if (win != None) 1102 if (win != None)
1101 return True; 1103 return True;
1102 } 1104 }
1103 return False; 1105 return False;
1104} 1106}
1108{ 1110{
1109 XPoint spot; 1111 XPoint spot;
1110 XVaNestedList preedit_attr; 1112 XVaNestedList preedit_attr;
1111 1113
1112 if (Input_Context == NULL 1114 if (Input_Context == NULL
1113 || !TermWin.focus || !(input_style & XIMPreeditPosition) 1115 || !TermWin.focus || ! (input_style & XIMPreeditPosition)
1114 || !(event_type == KeyPress 1116 || ! (event_type == KeyPress
1115 || event_type == Expose 1117 || event_type == Expose
1116 || event_type == NoExpose 1118 || event_type == NoExpose
1117 || event_type == SelectionNotify 1119 || event_type == SelectionNotify
1118 || event_type == ButtonRelease || event_type == FocusIn) 1120 || event_type == ButtonRelease || event_type == FocusIn)
1119 || !IMisRunning ()) 1121 || !IMisRunning ())
1120 return; 1122 return;
1121 1123
1122 im_set_position (&spot); 1124 im_set_position (&spot);
1123 1125
1124 preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL); 1126 preedit_attr = XVaCreateNestedList (0, XNSpotLocation, &spot, NULL);
1125 XSetICValues(Input_Context, XNPreeditAttributes, preedit_attr, NULL); 1127 XSetICValues (Input_Context, XNPreeditAttributes, preedit_attr, NULL);
1126 XFree(preedit_attr); 1128 XFree (preedit_attr);
1127} 1129}
1128 1130
1129void 1131void
1130rxvt_term::im_set_preedit_area (XRectangle * preedit_rect, XRectangle * status_rect, 1132rxvt_term::im_set_preedit_area (XRectangle * preedit_rect, XRectangle * status_rect,
1131 XRectangle * needed_rect) 1133 XRectangle * needed_rect)
1132{ 1134{
1133 int mbh, vtx = 0; 1135 int mbh, vtx = 0;
1134 1136
1135 if (scrollbar_visible () && !(Options & Opt_scrollBar_right)) 1137 if (scrollbar_visible () && ! (Options & Opt_scrollBar_right))
1136 vtx = scrollbar_TotalWidth(); 1138 vtx = scrollbar_TotalWidth ();
1137 1139
1138 mbh = menubar_visible () ? menuBar_TotalHeight() : 0; 1140 mbh = menubar_visible () ? menuBar_TotalHeight () : 0;
1139 mbh -= TermWin.lineSpace; 1141 mbh -= TermWin.lineSpace;
1140 1142
1141 preedit_rect->x = needed_rect->width + vtx; 1143 preedit_rect->x = needed_rect->width + vtx;
1142 preedit_rect->y = Height2Pixel(TermWin.nrow - 1) + mbh; 1144 preedit_rect->y = Height2Pixel (TermWin.nrow - 1) + mbh;
1143 1145
1144 preedit_rect->width = Width2Pixel(TermWin.ncol + 1) - needed_rect->width + vtx; 1146 preedit_rect->width = Width2Pixel (TermWin.ncol + 1) - needed_rect->width + vtx;
1145 preedit_rect->height = Height2Pixel(1); 1147 preedit_rect->height = Height2Pixel (1);
1146 1148
1147 status_rect->x = vtx; 1149 status_rect->x = vtx;
1148 status_rect->y = Height2Pixel(TermWin.nrow - 1) + mbh; 1150 status_rect->y = Height2Pixel (TermWin.nrow - 1) + mbh;
1149 1151
1150 status_rect->width = needed_rect->width ? needed_rect->width : Width2Pixel(TermWin.ncol + 1); 1152 status_rect->width = needed_rect->width ? needed_rect->width : Width2Pixel (TermWin.ncol + 1);
1151 status_rect->height = Height2Pixel(1); 1153 status_rect->height = Height2Pixel (1);
1152} 1154}
1153 1155
1154void 1156void
1155rxvt_term::im_destroy () 1157rxvt_term::im_destroy ()
1156{ 1158{
1182 const char *p; 1184 const char *p;
1183 char **s; 1185 char **s;
1184 XIMStyles *xim_styles; 1186 XIMStyles *xim_styles;
1185 XVaNestedList preedit_attr, status_attr; 1187 XVaNestedList preedit_attr, status_attr;
1186 1188
1187 if (!((p = XSetLocaleModifiers (modifiers)) && *p)) 1189 if (! ((p = XSetLocaleModifiers (modifiers)) && *p))
1188 return false; 1190 return false;
1189 1191
1190 D_MAIN((stderr, "rxvt_IM_get_IC()")); 1192 D_MAIN ((stderr, "rxvt_IM_get_IC ()"));
1191 input_method = display->get_xim (locale, modifiers); 1193 input_method = display->get_xim (locale, modifiers);
1192 if (input_method == NULL) 1194 if (input_method == NULL)
1193 return false; 1195 return false;
1194 1196
1195 xim = input_method->xim; 1197 xim = input_method->xim;
1201 display->put_xim (input_method); 1203 display->put_xim (input_method);
1202 return false; 1204 return false;
1203 } 1205 }
1204 1206
1205 p = rs[Rs_preeditType] ? rs[Rs_preeditType] : "OverTheSpot,OffTheSpot,Root"; 1207 p = rs[Rs_preeditType] ? rs[Rs_preeditType] : "OverTheSpot,OffTheSpot,Root";
1206 s = rxvt_splitcommastring(p); 1208 s = rxvt_splitcommastring (p);
1207 for (i = found = 0; !found && s[i]; i++) 1209 for (i = found = 0; !found && s[i]; i++)
1208 { 1210 {
1209 if (!STRCMP(s[i], "OverTheSpot")) 1211 if (!STRCMP (s[i], "OverTheSpot"))
1210 input_style = (XIMPreeditPosition | XIMStatusNothing); 1212 input_style = (XIMPreeditPosition | XIMStatusNothing);
1211 else if (!STRCMP(s[i], "OffTheSpot")) 1213 else if (!STRCMP (s[i], "OffTheSpot"))
1212 input_style = (XIMPreeditArea | XIMStatusArea); 1214 input_style = (XIMPreeditArea | XIMStatusArea);
1213 else if (!STRCMP(s[i], "Root")) 1215 else if (!STRCMP (s[i], "Root"))
1214 input_style = (XIMPreeditNothing | XIMStatusNothing); 1216 input_style = (XIMPreeditNothing | XIMStatusNothing);
1215 1217
1216 for (j = 0; j < xim_styles->count_styles; j++) 1218 for (j = 0; j < xim_styles->count_styles; j++)
1217 if (input_style == xim_styles->supported_styles[j]) 1219 if (input_style == xim_styles->supported_styles[j])
1218 { 1220 {
1239 { 1241 {
1240 im_set_size (&rect); 1242 im_set_size (&rect);
1241 im_set_position (&spot); 1243 im_set_position (&spot);
1242 im_set_color (&fg, &bg); 1244 im_set_color (&fg, &bg);
1243 1245
1244 preedit_attr = XVaCreateNestedList(0, XNArea, &rect, 1246 preedit_attr = XVaCreateNestedList (0, XNArea, &rect,
1245 XNSpotLocation, &spot, 1247 XNSpotLocation, &spot,
1246 XNForeground, fg, XNBackground, bg, 1248 XNForeground, fg, XNBackground, bg,
1247 //XNFontSet, TermWin.fontset, 1249 //XNFontSet, TermWin.fontset,
1248 NULL); 1250 NULL);
1249 } 1251 }
1257 */ 1259 */
1258 needed_rect.width = 0; 1260 needed_rect.width = 0;
1259 1261
1260 im_set_preedit_area (&rect, &status_rect, &needed_rect); 1262 im_set_preedit_area (&rect, &status_rect, &needed_rect);
1261 1263
1262 preedit_attr = XVaCreateNestedList(0, XNArea, &rect, 1264 preedit_attr = XVaCreateNestedList (0, XNArea, &rect,
1263 XNForeground, fg, XNBackground, bg, 1265 XNForeground, fg, XNBackground, bg,
1264 //XNFontSet, TermWin.fontset, 1266 //XNFontSet, TermWin.fontset,
1265 NULL); 1267 NULL);
1266 status_attr = XVaCreateNestedList(0, XNArea, &status_rect, 1268 status_attr = XVaCreateNestedList (0, XNArea, &status_rect,
1267 XNForeground, fg, XNBackground, bg, 1269 XNForeground, fg, XNBackground, bg,
1268 //XNFontSet, TermWin.fontset, 1270 //XNFontSet, TermWin.fontset,
1269 NULL); 1271 NULL);
1270 } 1272 }
1271 1273
1272 Input_Context = XCreateIC(xim, XNInputStyle, input_style, 1274 Input_Context = XCreateIC (xim, XNInputStyle, input_style,
1273 XNClientWindow, TermWin.parent[0], 1275 XNClientWindow, TermWin.parent[0],
1274 XNFocusWindow, TermWin.parent[0], 1276 XNFocusWindow, TermWin.parent[0],
1275 preedit_attr ? XNPreeditAttributes : NULL, 1277 preedit_attr ? XNPreeditAttributes : NULL,
1276 preedit_attr, 1278 preedit_attr,
1277 status_attr ? XNStatusAttributes : NULL, 1279 status_attr ? XNStatusAttributes : NULL,
1278 status_attr, NULL); 1280 status_attr, NULL);
1279 if (preedit_attr) XFree(preedit_attr); 1281 if (preedit_attr) XFree (preedit_attr);
1280 if (status_attr) XFree(status_attr); 1282 if (status_attr) XFree (status_attr);
1281 1283
1282 if (Input_Context == NULL) 1284 if (Input_Context == NULL)
1283 { 1285 {
1284 rxvt_print_error("failed to create input context"); 1286 rxvt_print_error ("failed to create input context");
1285 display->put_xim (input_method); 1287 display->put_xim (input_method);
1286 return false; 1288 return false;
1287 } 1289 }
1288 1290
1289 if (input_style & XIMPreeditArea) 1291 if (input_style & XIMPreeditArea)
1290 IMSetStatusPosition (); 1292 IMSetStatusPosition ();
1291 1293
1292 D_MAIN((stderr, "rxvt_IM_get_IC() - successful connection")); 1294 D_MAIN ((stderr, "rxvt_IM_get_IC () - successful connection"));
1293 return true; 1295 return true;
1294} 1296}
1295 1297
1296void 1298void
1297rxvt_term::im_cb () 1299rxvt_term::im_cb ()
1301 char **s; 1303 char **s;
1302 char buf[IMBUFSIZ]; 1304 char buf[IMBUFSIZ];
1303 1305
1304 im_destroy (); 1306 im_destroy ();
1305 1307
1306 D_MAIN((stderr, "rxvt_IMInstantiateCallback()")); 1308 D_MAIN ((stderr, "rxvt_IMInstantiateCallback ()"));
1307 if (Input_Context) 1309 if (Input_Context)
1308 return; 1310 return;
1309 1311
1310#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) 1312#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
1311 if (rs[Rs_imLocale]) 1313 if (rs[Rs_imLocale])
1330 break; 1332 break;
1331 } 1333 }
1332 } 1334 }
1333 } 1335 }
1334 for (i = 0; s[i]; i++) 1336 for (i = 0; s[i]; i++)
1335 free(s[i]); 1337 free (s[i]);
1336 free(s); 1338 free (s);
1337 1339
1338 if (found) 1340 if (found)
1339 goto done; 1341 goto done;
1340 } 1342 }
1341 1343
1359{ 1361{
1360 XRectangle preedit_rect, status_rect, *needed_rect; 1362 XRectangle preedit_rect, status_rect, *needed_rect;
1361 XVaNestedList preedit_attr, status_attr; 1363 XVaNestedList preedit_attr, status_attr;
1362 1364
1363 if (Input_Context == NULL 1365 if (Input_Context == NULL
1364 || !TermWin.focus || !(input_style & XIMPreeditArea) 1366 || !TermWin.focus || ! (input_style & XIMPreeditArea)
1365 || !IMisRunning ()) 1367 || !IMisRunning ())
1366 return; 1368 return;
1367 1369
1368 /* Getting the necessary width of preedit area */ 1370 /* Getting the necessary width of preedit area */
1369 status_attr = XVaCreateNestedList(0, XNAreaNeeded, &needed_rect, NULL); 1371 status_attr = XVaCreateNestedList (0, XNAreaNeeded, &needed_rect, NULL);
1370 XGetICValues(Input_Context, XNStatusAttributes, status_attr, NULL); 1372 XGetICValues (Input_Context, XNStatusAttributes, status_attr, NULL);
1371 XFree(status_attr); 1373 XFree (status_attr);
1372 1374
1373 im_set_preedit_area (&preedit_rect, &status_rect, needed_rect); 1375 im_set_preedit_area (&preedit_rect, &status_rect, needed_rect);
1374 1376
1375 preedit_attr = XVaCreateNestedList(0, XNArea, &preedit_rect, NULL); 1377 preedit_attr = XVaCreateNestedList (0, XNArea, &preedit_rect, NULL);
1376 status_attr = XVaCreateNestedList(0, XNArea, &status_rect, NULL); 1378 status_attr = XVaCreateNestedList (0, XNArea, &status_rect, NULL);
1377 1379
1378 XSetICValues(Input_Context, 1380 XSetICValues (Input_Context,
1379 XNPreeditAttributes, preedit_attr, 1381 XNPreeditAttributes, preedit_attr,
1380 XNStatusAttributes, status_attr, NULL); 1382 XNStatusAttributes, status_attr, NULL);
1381 1383
1382 XFree(preedit_attr); 1384 XFree (preedit_attr);
1383 XFree(status_attr); 1385 XFree (status_attr);
1384} 1386}
1385#endif /* USE_XIM */ 1387#endif /* USE_XIM */
1386 1388
1387/*----------------------------------------------------------------------*/ 1389/*----------------------------------------------------------------------*/
1388rxvt_t rxvt_current_term; 1390rxvt_t rxvt_current_term;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines