… | |
… | |
1458 | break; |
1458 | break; |
1459 | } |
1459 | } |
1460 | break; |
1460 | break; |
1461 | |
1461 | |
1462 | case FocusIn: |
1462 | case FocusIn: |
|
|
1463 | if (ev.xfocus.detail != NotifyInferior && ev.xfocus.detail != NotifyPointer) |
1463 | focus_in (); |
1464 | focus_in (); |
1464 | break; |
1465 | break; |
1465 | |
1466 | |
1466 | case FocusOut: |
1467 | case FocusOut: |
|
|
1468 | if (ev.xfocus.detail != NotifyInferior && ev.xfocus.detail != NotifyPointer) |
1467 | focus_out (); |
1469 | focus_out (); |
1468 | break; |
1470 | break; |
1469 | |
1471 | |
1470 | case ConfigureNotify: |
1472 | case ConfigureNotify: |
1471 | if (ev.xconfigure.window == parent[0]) |
1473 | if (ev.xconfigure.window == parent[0]) |
1472 | { |
1474 | { |
… | |
… | |
1479 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1481 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1480 | } |
1482 | } |
1481 | |
1483 | |
1482 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1484 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1483 | |
1485 | |
1484 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1486 | #ifdef TRANSPARENT |
1485 | if (OPTION (Opt_transparent)) |
1487 | if (OPTION (Opt_transparent)) |
1486 | check_our_parents (); |
1488 | check_our_parents (); |
1487 | #endif |
1489 | #endif |
1488 | } |
1490 | } |
1489 | break; |
1491 | break; |
… | |
… | |
1775 | } |
1777 | } |
1776 | #endif |
1778 | #endif |
1777 | } |
1779 | } |
1778 | } |
1780 | } |
1779 | |
1781 | |
1780 | #if TRANSPARENT |
1782 | void |
|
|
1783 | rxvt_term::update_fade_color (unsigned int idx) |
|
|
1784 | { |
|
|
1785 | #if OFF_FOCUS_FADING |
|
|
1786 | if (rs[Rs_fade]) |
|
|
1787 | { |
|
|
1788 | rgba c; |
|
|
1789 | pix_colors [Color_fade].get (c); |
|
|
1790 | pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c); |
|
|
1791 | } |
|
|
1792 | #endif |
|
|
1793 | } |
|
|
1794 | |
|
|
1795 | #if TRANSPARENT || ENABLE_PERL |
1781 | void |
1796 | void |
1782 | rxvt_term::rootwin_cb (XEvent &ev) |
1797 | rxvt_term::rootwin_cb (XEvent &ev) |
1783 | { |
1798 | { |
1784 | make_current (); |
1799 | make_current (); |
1785 | |
1800 | |
|
|
1801 | if (SHOULD_INVOKE (HOOK_ROOT_EVENT) |
|
|
1802 | && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END))) |
|
|
1803 | return; |
|
|
1804 | |
|
|
1805 | # if TRANSPARENT |
1786 | switch (ev.type) |
1806 | switch (ev.type) |
1787 | { |
1807 | { |
1788 | case PropertyNotify: |
1808 | case PropertyNotify: |
1789 | /* |
1809 | /* |
1790 | * if user used some Esetroot compatible prog to set the root bg, |
1810 | * if user used some Esetroot compatible prog to set the root bg, |
… | |
… | |
1798 | case ReparentNotify: |
1818 | case ReparentNotify: |
1799 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1819 | if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) |
1800 | want_refresh = want_full_refresh = 1; |
1820 | want_refresh = want_full_refresh = 1; |
1801 | break; |
1821 | break; |
1802 | } |
1822 | } |
|
|
1823 | # endif |
1803 | } |
1824 | } |
1804 | #endif |
1825 | #endif |
1805 | |
1826 | |
1806 | void |
1827 | void |
1807 | rxvt_term::button_press (XButtonEvent &ev) |
1828 | rxvt_term::button_press (XButtonEvent &ev) |
… | |
… | |
2135 | selection_make (ev.time); |
2156 | selection_make (ev.time); |
2136 | break; |
2157 | break; |
2137 | |
2158 | |
2138 | case Button2: |
2159 | case Button2: |
2139 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2160 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2140 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Primary : Sel_Primary); |
2161 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); |
2141 | break; |
2162 | break; |
2142 | |
2163 | |
2143 | #ifdef MOUSE_WHEEL |
2164 | #ifdef MOUSE_WHEEL |
2144 | case Button4: |
2165 | case Button4: |
2145 | case Button5: |
2166 | case Button5: |
… | |
… | |
3655 | seen_esc = true; |
3676 | seen_esc = true; |
3656 | continue; |
3677 | continue; |
3657 | } |
3678 | } |
3658 | else if (ch == C0_BEL || ch == CHAR_ST) |
3679 | else if (ch == C0_BEL || ch == CHAR_ST) |
3659 | break; |
3680 | break; |
|
|
3681 | else if (ch == C0_SYN) |
|
|
3682 | ch = cmd_get8 (); |
3660 | else if (ch < 0x20) |
3683 | else if (ch < 0x20) |
3661 | return NULL; /* other control character - exit */ |
3684 | return NULL; /* other control character - exit */ |
3662 | |
3685 | |
3663 | seen_esc = false; |
3686 | seen_esc = false; |
3664 | |
3687 | |
3665 | if (n >= STRING_MAX - 1) |
3688 | if (n >= STRING_MAX - 1) |
3666 | // stop at some sane length |
3689 | // stop at some sane length |
3667 | return NULL; |
3690 | return NULL; |
3668 | |
3691 | |
3669 | if (ch == C0_SYN) |
|
|
3670 | string[n++] = cmd_get8 (); |
|
|
3671 | else |
|
|
3672 | string[n++] = ch; |
3692 | string[n++] = ch; |
3673 | } |
3693 | } |
3674 | |
3694 | |
3675 | string[n++] = '\0'; |
3695 | string[n++] = '\0'; |
3676 | |
3696 | |
3677 | ends_how = (ch == 0x5c ? C0_ESC : ch); |
3697 | ends_how = (ch == 0x5c ? C0_ESC : ch); |
… | |
… | |
3758 | dLocal (Display *, dpy); |
3778 | dLocal (Display *, dpy); |
3759 | |
3779 | |
3760 | assert (str != NULL); |
3780 | assert (str != NULL); |
3761 | |
3781 | |
3762 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) |
3782 | if (HOOK_INVOKE ((this, HOOK_OSC_SEQ, DT_INT, op, DT_STR, str, DT_END))) |
3763 | ; // no responses yet |
3783 | return; |
3764 | |
3784 | |
3765 | switch (op) |
3785 | switch (op) |
3766 | { |
3786 | { |
3767 | case XTerm_name: |
3787 | case XTerm_name: |
3768 | set_title (str); |
3788 | set_title (str); |