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

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.418 by root, Fri Oct 10 00:11:44 2008 UTC vs.
Revision 1.421 by root, Wed Oct 15 17:16:47 2008 UTC

1127 { 1127 {
1128 // this should really be sched_yield(), but the linux guys thought 1128 // this should really be sched_yield(), but the linux guys thought
1129 // that giving a process calling sched_yield () less cpu time than 1129 // that giving a process calling sched_yield () less cpu time than
1130 // ones with high nice levels is a useful thing to do. It surely is is 1130 // ones with high nice levels is a useful thing to do. It surely is is
1131 // allowed by the sus... as is returning ENOSYS. 1131 // allowed by the sus... as is returning ENOSYS.
1132 // since the linux guys additionally thought that breaking the only
1133 // known workaroudn against their unusable sched_yield hack is cool,
1134 // we just nanosleep a bit and hope for the best.
1132 1135
1133 struct timespec ts = { 0, 0 }; 1136 struct timespec ts = { 0, 1000 };
1134 nanosleep (&ts, 0); 1137 nanosleep (&ts, 0);
1135 1138
1136 w.stop (); 1139 w.stop ();
1137 } 1140 }
1138 1141
1683 1686
1684 refresh_check (); 1687 refresh_check ();
1685} 1688}
1686 1689
1687void 1690void
1691rxvt_term::set_urgency (bool enable)
1692{
1693 if (enable == urgency_hint)
1694 return;
1695
1696 if (XWMHints *h = XGetWMHints (dpy, parent[0]))
1697 {
1698 h->flags = h->flags & ~XUrgencyHint | (enable ? XUrgencyHint : 0);
1699 XSetWMHints (dpy, parent[0], h);
1700 urgency_hint = enable;
1701 }
1702}
1703
1704void
1688rxvt_term::focus_in () 1705rxvt_term::focus_in ()
1689{ 1706{
1690 if (!focus) 1707 if (!focus)
1691 { 1708 {
1692 focus = 1; 1709 focus = 1;
1693 want_refresh = 1; 1710 want_refresh = 1;
1694
1695 HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END));
1696 1711
1697#if USE_XIM 1712#if USE_XIM
1698 if (Input_Context != NULL) 1713 if (Input_Context != NULL)
1699 { 1714 {
1700 IMSetPosition (); 1715 IMSetPosition ();
1712 scr_recolour (); 1727 scr_recolour ();
1713 } 1728 }
1714#endif 1729#endif
1715#if ENABLE_FRILLS 1730#if ENABLE_FRILLS
1716 if (option (Opt_urgentOnBell)) 1731 if (option (Opt_urgentOnBell))
1717 { 1732 set_urgency (0);
1718 if (XWMHints *h = XGetWMHints(dpy, parent[0]))
1719 {
1720 h->flags &= ~XUrgencyHint;
1721 XSetWMHints (dpy, parent[0], h);
1722 }
1723 }
1724#endif 1733#endif
1734
1735 HOOK_INVOKE ((this, HOOK_FOCUS_IN, DT_END));
1725 } 1736 }
1726} 1737}
1727 1738
1728void 1739void
1729rxvt_term::focus_out () 1740rxvt_term::focus_out ()
1731 if (focus) 1742 if (focus)
1732 { 1743 {
1733 focus = 0; 1744 focus = 0;
1734 want_refresh = 1; 1745 want_refresh = 1;
1735 1746
1736 HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END)); 1747#if ENABLE_FRILLS
1737 1748 if (option (Opt_urgentOnBell))
1749 set_urgency (0);
1750#endif
1738#if ENABLE_FRILLS || ISO_14755 1751#if ENABLE_FRILLS || ISO_14755
1739 if (iso14755buf) 1752 if (iso14755buf)
1740 { 1753 {
1741 iso14755buf = 0; 1754 iso14755buf = 0;
1742# if ISO_14755 1755# if ISO_14755
1759 { 1772 {
1760 pix_colors = pix_colors_unfocused; 1773 pix_colors = pix_colors_unfocused;
1761 scr_recolour (); 1774 scr_recolour ();
1762 } 1775 }
1763#endif 1776#endif
1777
1778 HOOK_INVOKE ((this, HOOK_FOCUS_OUT, DT_END));
1764 } 1779 }
1765} 1780}
1766 1781
1767void 1782void
1768rxvt_term::update_fade_color (unsigned int idx) 1783rxvt_term::update_fade_color (unsigned int idx)
3272 3287
3273 assert (str != NULL); 3288 assert (str != NULL);
3274 3289
3275 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) 3290 if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END)))
3276 return; 3291 return;
3277 fprintf (stderr, "op %d<%s>\n", op, str);//D
3278 3292
3279 switch (op) 3293 switch (op)
3280 { 3294 {
3281 case XTerm_name: 3295 case XTerm_name:
3282 set_title (str); 3296 set_title (str);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines