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