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.218 by root, Thu Feb 2 18:04:46 2006 UTC vs.
Revision 1.223 by root, Sat Feb 18 14:14:43 2006 UTC

198void rxvt_term::emergency_cleanup () 198void rxvt_term::emergency_cleanup ()
199{ 199{
200 if (cmd_pid) 200 if (cmd_pid)
201 kill (-cmd_pid, SIGHUP); 201 kill (-cmd_pid, SIGHUP);
202 202
203 pty_ev.stop ();
203 delete pty; pty = 0; 204 delete pty; pty = 0;
204} 205}
205 206
206rxvt_term::~rxvt_term () 207rxvt_term::~rxvt_term ()
207{ 208{
704 705
705 if (!OPTION (Opt_scrollBar_right)) 706 if (!OPTION (Opt_scrollBar_right))
706 window_vt_x += sb_w; 707 window_vt_x += sb_w;
707 } 708 }
708 709
709 szHint.width_inc = fwidth; 710 szHint.width_inc = fwidth;
710 szHint.height_inc = fheight; 711 szHint.height_inc = fheight;
711 szHint.min_width = szHint.base_width + szHint.width_inc; 712 szHint.min_width = szHint.base_width + szHint.width_inc;
712 szHint.min_height = szHint.base_height + szHint.height_inc; 713 szHint.min_height = szHint.base_height + szHint.height_inc;
713 714
714 if (newwidth && newwidth - szHint.base_width < max_width) 715 if (newwidth && newwidth - szHint.base_width < max_width)
715 { 716 {
716 szHint.width = newwidth; 717 szHint.width = newwidth;
1033 int fix_screen; 1034 int fix_screen;
1034 int old_width = szHint.width; 1035 int old_width = szHint.width;
1035 int old_height = szHint.height; 1036 int old_height = szHint.height;
1036 1037
1037 window_calc (newwidth, newheight); 1038 window_calc (newwidth, newheight);
1039
1040 if (!HOOK_INVOKE ((this, HOOK_RESIZE_ALL_WINDOWS, DT_INT, newwidth, DT_INT, newheight, DT_END)))
1038 XSetWMNormalHints (dpy, parent[0], &szHint); 1041 XSetWMNormalHints (dpy, parent[0], &szHint);
1039 1042
1040 if (!ignoreparent) 1043 if (!ignoreparent)
1041 { 1044 {
1042#ifdef SMART_RESIZE 1045#ifdef SMART_RESIZE
1043 /* 1046 /*
1117 if (pixmap) 1120 if (pixmap)
1118 scr_touch (false); 1121 scr_touch (false);
1119#endif 1122#endif
1120 1123
1121#ifdef USE_XIM 1124#ifdef USE_XIM
1122 IMSetStatusPosition (); 1125 IMSetPosition ();
1123#endif 1126#endif
1124} 1127}
1125 1128
1126/* 1129/*
1127 * Set the width/height of the vt window in characters. Units are pixels. 1130 * Set the width/height of the vt window in characters. Units are pixels.
1524 preedit_attr, 1527 preedit_attr,
1525 status_attr ? XNStatusAttributes : NULL, 1528 status_attr ? XNStatusAttributes : NULL,
1526 status_attr, NULL); 1529 status_attr, NULL);
1527 1530
1528 if (preedit_attr) XFree (preedit_attr); 1531 if (preedit_attr) XFree (preedit_attr);
1529 if (status_attr) XFree (status_attr); 1532 if (status_attr) XFree (status_attr);
1530 if (fs) XFreeFontSet (dpy, fs); 1533 if (fs) XFreeFontSet (dpy, fs);
1531 1534
1532 if (Input_Context == NULL) 1535 if (Input_Context == NULL)
1533 { 1536 {
1534 rxvt_warn ("failed to create input context, continuing without XIM.\n"); 1537 rxvt_warn ("failed to create input context, continuing without XIM.\n");
1535 im_destroy (); 1538 im_destroy ();
1540 // unfortunately, only the focus window is used by XIM, hard to fix 1543 // unfortunately, only the focus window is used by XIM, hard to fix
1541 if (!XGetICValues (Input_Context, XNFilterEvents, &vt_emask_xim, NULL)) 1544 if (!XGetICValues (Input_Context, XNFilterEvents, &vt_emask_xim, NULL))
1542 vt_select_input (); 1545 vt_select_input ();
1543#endif 1546#endif
1544 1547
1545 if (input_style & XIMPreeditArea)
1546 IMSetStatusPosition (); 1548 IMSetPosition ();
1547 1549
1548 return true; 1550 return true;
1549} 1551}
1550 1552
1551void 1553void
1609 SET_LOCALE (locale); 1611 SET_LOCALE (locale);
1610#endif 1612#endif
1611} 1613}
1612 1614
1613void 1615void
1614rxvt_term::IMSetStatusPosition () 1616rxvt_term::IMSetPosition ()
1615{ 1617{
1616 XRectangle preedit_rect, status_rect, *needed_rect; 1618 XRectangle preedit_rect, status_rect, *needed_rect;
1617 XVaNestedList preedit_attr, status_attr; 1619 XVaNestedList preedit_attr, status_attr;
1618 1620
1619 if (!Input_Context 1621 if (!Input_Context
1620 || !focus 1622 || !focus
1621 || !(input_style & XIMPreeditArea) 1623 || !(input_style & (XIMPreeditArea | XIMPreeditPosition))
1622 || !IMisRunning ()) 1624 || !IMisRunning ())
1623 return; 1625 return;
1624 1626
1627 if (input_style & XIMPreeditPosition)
1628 {
1629 im_set_size (preedit_rect);
1630 preedit_attr = XVaCreateNestedList (0, XNArea, &preedit_rect, NULL);
1631
1632 XSetICValues (Input_Context,
1633 XNPreeditAttributes, preedit_attr, NULL);
1634 }
1635 else
1636 {
1625 /* Getting the necessary width of preedit area */ 1637 /* Getting the necessary width of preedit area */
1626 status_attr = XVaCreateNestedList (0, XNAreaNeeded, &needed_rect, NULL); 1638 status_attr = XVaCreateNestedList (0, XNAreaNeeded, &needed_rect, NULL);
1627 XGetICValues (Input_Context, XNStatusAttributes, status_attr, NULL); 1639 XGetICValues (Input_Context, XNStatusAttributes, status_attr, NULL);
1628 XFree (status_attr); 1640 XFree (status_attr);
1629 1641
1630 im_set_preedit_area (preedit_rect, status_rect, *needed_rect); 1642 im_set_preedit_area (preedit_rect, status_rect, *needed_rect);
1631 XFree (needed_rect); 1643 XFree (needed_rect);
1632 1644
1633 preedit_attr = XVaCreateNestedList (0, XNArea, &preedit_rect, NULL); 1645 preedit_attr = XVaCreateNestedList (0, XNArea, &preedit_rect, NULL);
1634 status_attr = XVaCreateNestedList (0, XNArea, &status_rect, NULL); 1646 status_attr = XVaCreateNestedList (0, XNArea, &status_rect, NULL);
1635 1647
1636 XSetICValues (Input_Context, 1648 XSetICValues (Input_Context,
1637 XNPreeditAttributes, preedit_attr, 1649 XNPreeditAttributes, preedit_attr,
1638 XNStatusAttributes, status_attr, NULL); 1650 XNStatusAttributes, status_attr,
1651 NULL);
1639 1652
1653 XFree (status_attr);
1654 }
1655
1640 XFree (preedit_attr); 1656 XFree (preedit_attr);
1641 XFree (status_attr);
1642} 1657}
1643#endif /* USE_XIM */ 1658#endif /* USE_XIM */
1644 1659
1645/*----------------------- end-of-file (C source) -----------------------*/ 1660/*----------------------- end-of-file (C source) -----------------------*/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines