… | |
… | |
1330 | button_release (ev.xbutton); |
1330 | button_release (ev.xbutton); |
1331 | break; |
1331 | break; |
1332 | |
1332 | |
1333 | case ClientMessage: |
1333 | case ClientMessage: |
1334 | if (ev.xclient.format == 32 |
1334 | if (ev.xclient.format == 32 |
|
|
1335 | && ev.xclient.message_type == xa[XA_WM_PROTOCOLS]) |
|
|
1336 | { |
1335 | && (Atom)ev.xclient.data.l[0] == xa[XA_WMDELETEWINDOW]) |
1337 | if (ev.xclient.data.l[0] == xa[XA_WM_DELETE_WINDOW]) |
1336 | destroy (); |
1338 | destroy (); |
|
|
1339 | #if ENABLE_EWMH |
|
|
1340 | else if (ev.xclient.data.l[0] == xa[XA_NET_WM_PING]) |
|
|
1341 | XSendEvent (disp, ev.xclient.window = display->root, |
|
|
1342 | False, SubstructureRedirectMask | SubstructureNotifyMask, |
|
|
1343 | &ev); |
|
|
1344 | #endif |
|
|
1345 | } |
|
|
1346 | #if ENABLE_XEMBED |
|
|
1347 | else if (ev.xclient.format == 32 && ev.xclient.message_type == xa[XA_XEMBED]) |
|
|
1348 | { |
|
|
1349 | if (ev.xclient.data.l[1] == XEMBED_FOCUS_IN) |
|
|
1350 | focus_in (); |
|
|
1351 | else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) |
|
|
1352 | focus_out (); |
|
|
1353 | } |
|
|
1354 | #endif |
1337 | #ifdef OFFIX_DND |
1355 | #ifdef OFFIX_DND |
1338 | /* OffiX Dnd (drag 'n' drop) protocol */ |
1356 | /* OffiX Dnd (drag 'n' drop) protocol */ |
1339 | else if (ev.xclient.message_type == xa[XA_DNDPROTOCOL] |
1357 | else if (ev.xclient.message_type == xa[XA_DNDPROTOCOL] |
1340 | && (ev.xclient.data.l[0] == DndFile |
1358 | && (ev.xclient.data.l[0] == DndFile |
1341 | || ev.xclient.data.l[0] == DndDir |
1359 | || ev.xclient.data.l[0] == DndDir |
1342 | || ev.xclient.data.l[0] == DndLink)) |
1360 | || ev.xclient.data.l[0] == DndLink)) |
1343 | { |
1361 | { |
1344 | /* Get Dnd data */ |
1362 | /* Get Dnd data */ |
1345 | Atom ActualType; |
1363 | Atom ActualType; |
1346 | int ActualFormat; |
1364 | int ActualFormat; |
1347 | unsigned char *data; |
1365 | unsigned char *data; |
… | |
… | |
1390 | break; |
1408 | break; |
1391 | } |
1409 | } |
1392 | break; |
1410 | break; |
1393 | |
1411 | |
1394 | case FocusIn: |
1412 | case FocusIn: |
1395 | if (!TermWin.focus) |
1413 | focus_in (); |
1396 | { |
|
|
1397 | TermWin.focus = 1; |
|
|
1398 | want_refresh = 1; |
|
|
1399 | #ifdef USE_XIM |
|
|
1400 | if (Input_Context != NULL) |
|
|
1401 | { |
|
|
1402 | IMSetStatusPosition (); |
|
|
1403 | XSetICFocus (Input_Context); |
|
|
1404 | } |
|
|
1405 | #endif |
|
|
1406 | #ifdef CURSOR_BLINK |
|
|
1407 | if (options & Opt_cursorBlink) |
|
|
1408 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
|
|
1409 | #endif |
|
|
1410 | #ifdef OFF_FOCUS_FADING |
|
|
1411 | if (rs[Rs_fade]) |
|
|
1412 | { |
|
|
1413 | pix_colors = pix_colors_focused; |
|
|
1414 | scr_recolour (); |
|
|
1415 | } |
|
|
1416 | #endif |
|
|
1417 | |
|
|
1418 | } |
|
|
1419 | break; |
1414 | break; |
1420 | |
1415 | |
1421 | case FocusOut: |
1416 | case FocusOut: |
1422 | if (TermWin.focus) |
1417 | focus_out (); |
1423 | { |
|
|
1424 | TermWin.focus = 0; |
|
|
1425 | want_refresh = 1; |
|
|
1426 | |
|
|
1427 | #if ENABLE_FRILLS || ISO_14755 |
|
|
1428 | iso14755buf = 0; |
|
|
1429 | #endif |
|
|
1430 | #if ENABLE_OVERLAY |
|
|
1431 | scr_overlay_off (); |
|
|
1432 | #endif |
|
|
1433 | #ifdef USE_XIM |
|
|
1434 | if (Input_Context != NULL) |
|
|
1435 | XUnsetICFocus (Input_Context); |
|
|
1436 | #endif |
|
|
1437 | #ifdef CURSOR_BLINK |
|
|
1438 | if (options & Opt_cursorBlink) |
|
|
1439 | cursor_blink_ev.stop (); |
|
|
1440 | hidden_cursor = 0; |
|
|
1441 | #endif |
|
|
1442 | #ifdef OFF_FOCUS_FADING |
|
|
1443 | if (rs[Rs_fade]) |
|
|
1444 | { |
|
|
1445 | pix_colors = pix_colors_unfocused; |
|
|
1446 | scr_recolour (); |
|
|
1447 | } |
|
|
1448 | #endif |
|
|
1449 | } |
|
|
1450 | break; |
1418 | break; |
1451 | |
1419 | |
1452 | case ConfigureNotify: |
1420 | case ConfigureNotify: |
1453 | if (ev.xconfigure.window == TermWin.parent[0]) |
1421 | if (ev.xconfigure.window == TermWin.parent[0]) |
1454 | { |
1422 | { |
… | |
… | |
1668 | scr_refresh (refresh_type); |
1636 | scr_refresh (refresh_type); |
1669 | refresh_limit = 0; |
1637 | refresh_limit = 0; |
1670 | scrollbar_show (1); |
1638 | scrollbar_show (1); |
1671 | } |
1639 | } |
1672 | break; |
1640 | break; |
|
|
1641 | } |
|
|
1642 | } |
|
|
1643 | |
|
|
1644 | void |
|
|
1645 | rxvt_term::focus_in () |
|
|
1646 | { |
|
|
1647 | if (!TermWin.focus) |
|
|
1648 | { |
|
|
1649 | TermWin.focus = 1; |
|
|
1650 | want_refresh = 1; |
|
|
1651 | #ifdef USE_XIM |
|
|
1652 | if (Input_Context != NULL) |
|
|
1653 | { |
|
|
1654 | IMSetStatusPosition (); |
|
|
1655 | XSetICFocus (Input_Context); |
|
|
1656 | } |
|
|
1657 | #endif |
|
|
1658 | #ifdef CURSOR_BLINK |
|
|
1659 | if (options & Opt_cursorBlink) |
|
|
1660 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
|
|
1661 | #endif |
|
|
1662 | #ifdef OFF_FOCUS_FADING |
|
|
1663 | if (rs[Rs_fade]) |
|
|
1664 | { |
|
|
1665 | pix_colors = pix_colors_focused; |
|
|
1666 | scr_recolour (); |
|
|
1667 | } |
|
|
1668 | #endif |
|
|
1669 | } |
|
|
1670 | } |
|
|
1671 | |
|
|
1672 | void |
|
|
1673 | rxvt_term::focus_out () |
|
|
1674 | { |
|
|
1675 | if (TermWin.focus) |
|
|
1676 | { |
|
|
1677 | TermWin.focus = 0; |
|
|
1678 | want_refresh = 1; |
|
|
1679 | |
|
|
1680 | #if ENABLE_FRILLS || ISO_14755 |
|
|
1681 | iso14755buf = 0; |
|
|
1682 | #endif |
|
|
1683 | #if ENABLE_OVERLAY |
|
|
1684 | scr_overlay_off (); |
|
|
1685 | #endif |
|
|
1686 | #ifdef USE_XIM |
|
|
1687 | if (Input_Context != NULL) |
|
|
1688 | XUnsetICFocus (Input_Context); |
|
|
1689 | #endif |
|
|
1690 | #ifdef CURSOR_BLINK |
|
|
1691 | if (options & Opt_cursorBlink) |
|
|
1692 | cursor_blink_ev.stop (); |
|
|
1693 | hidden_cursor = 0; |
|
|
1694 | #endif |
|
|
1695 | #ifdef OFF_FOCUS_FADING |
|
|
1696 | if (rs[Rs_fade]) |
|
|
1697 | { |
|
|
1698 | pix_colors = pix_colors_unfocused; |
|
|
1699 | scr_recolour (); |
|
|
1700 | } |
|
|
1701 | #endif |
1673 | } |
1702 | } |
1674 | } |
1703 | } |
1675 | |
1704 | |
1676 | #if TRANSPARENT |
1705 | #if TRANSPARENT |
1677 | void |
1706 | void |
… | |
… | |
3637 | set_window_color (color, str); |
3666 | set_window_color (color, str); |
3638 | } |
3667 | } |
3639 | |
3668 | |
3640 | /* |
3669 | /* |
3641 | * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL) |
3670 | * XTerm escape sequences: ESC ] Ps;Pt (ST|BEL) |
3642 | * 0 = change iconName/title |
|
|
3643 | * 1 = change iconName |
|
|
3644 | * 2 = change title |
|
|
3645 | * 4 = change color |
|
|
3646 | * 10 = change fg color |
|
|
3647 | * 11 = change bg color |
|
|
3648 | * 12 = change text color |
|
|
3649 | * 13 = change mouse foreground color |
|
|
3650 | * 17 = change highlight character colour |
|
|
3651 | * 18 = change bold character color |
|
|
3652 | * 19 = change underlined character color |
|
|
3653 | * 46 = change logfile (not implemented) |
|
|
3654 | * 50 = change font |
|
|
3655 | * |
|
|
3656 | * rxvt extensions: |
|
|
3657 | * 20 = bg pixmap |
|
|
3658 | * 39 = change default fg color |
|
|
3659 | * 49 = change default bg color |
|
|
3660 | * 55 = dump scrollback buffer and all of screen |
|
|
3661 | * 701 = change locale |
|
|
3662 | * 702 = find font |
|
|
3663 | * 703 = menu |
|
|
3664 | */ |
3671 | */ |
3665 | void |
3672 | void |
3666 | rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp) |
3673 | rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp) |
3667 | { |
3674 | { |
3668 | int changed = 0; |
3675 | int changed = 0; |
… | |
… | |
3767 | break; |
3774 | break; |
3768 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3775 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3769 | case XTerm_Color_BD: |
3776 | case XTerm_Color_BD: |
3770 | process_color_seq (XTerm_Color_BD, Color_BD, str, resp); |
3777 | process_color_seq (XTerm_Color_BD, Color_BD, str, resp); |
3771 | break; |
3778 | break; |
3772 | case XTerm_Color_IT: |
|
|
3773 | process_color_seq (XTerm_Color_IT, Color_IT, str, resp); |
|
|
3774 | break; |
|
|
3775 | case XTerm_Color_UL: |
3779 | case XTerm_Color_UL: |
3776 | process_color_seq (XTerm_Color_UL, Color_UL, str, resp); |
3780 | process_color_seq (XTerm_Color_UL, Color_UL, str, resp); |
3777 | break; |
3781 | break; |
3778 | case XTerm_Color_RV: |
3782 | case XTerm_Color_RV: |
3779 | process_color_seq (XTerm_Color_RV, Color_RV, str, resp); |
3783 | process_color_seq (XTerm_Color_RV, Color_RV, str, resp); |
3780 | break; |
3784 | break; |
|
|
3785 | case URxvt_Color_IT: |
|
|
3786 | process_color_seq (URxvt_Color_IT, Color_IT, str, resp); |
|
|
3787 | break; |
3781 | #endif |
3788 | #endif |
3782 | #if TRANSPARENT && TINTING |
3789 | #if TRANSPARENT && TINTING |
3783 | case XTerm_Color_tint: |
3790 | case URxvt_Color_tint: |
3784 | process_color_seq (XTerm_Color_tint, Color_tint, str, resp); |
3791 | process_color_seq (URxvt_Color_tint, Color_tint, str, resp); |
3785 | check_our_parents (); |
3792 | check_our_parents (); |
3786 | if (am_transparent) |
3793 | if (am_transparent) |
3787 | want_full_refresh = want_refresh = 1; |
3794 | want_full_refresh = want_refresh = 1; |
3788 | break; |
3795 | break; |
3789 | #endif |
3796 | #endif |
… | |
… | |
3823 | |
3830 | |
3824 | case XTerm_logfile: |
3831 | case XTerm_logfile: |
3825 | // TODO, when secure mode? |
3832 | // TODO, when secure mode? |
3826 | break; |
3833 | break; |
3827 | |
3834 | |
|
|
3835 | #ifdef MENUBAR |
|
|
3836 | case URxvt_Menu: |
|
|
3837 | if (options & Opt_insecure) |
|
|
3838 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
|
|
3839 | break; |
|
|
3840 | #endif |
|
|
3841 | #if 0 |
|
|
3842 | case XTerm_dumpscreen: /* no error notices */ |
|
|
3843 | { |
|
|
3844 | int fd; |
|
|
3845 | if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) |
|
|
3846 | { |
|
|
3847 | scr_dump (fd); |
|
|
3848 | close (fd); |
|
|
3849 | } |
|
|
3850 | } |
|
|
3851 | break; |
|
|
3852 | #endif |
3828 | case XTerm_font: |
3853 | case XTerm_font: |
3829 | op = URxvt_font; |
3854 | op = URxvt_font; |
3830 | case URxvt_font: |
3855 | case URxvt_font: |
3831 | #if ENABLE_STYLES |
3856 | #if ENABLE_STYLES |
3832 | case URxvt_boldFont: |
3857 | case URxvt_boldFont: |
… | |
… | |
3847 | set_fonts (); |
3872 | set_fonts (); |
3848 | } |
3873 | } |
3849 | break; |
3874 | break; |
3850 | |
3875 | |
3851 | #if ENABLE_FRILLS |
3876 | #if ENABLE_FRILLS |
3852 | case XTerm_locale: |
3877 | case URxvt_locale: |
3853 | if (query) |
3878 | if (query) |
3854 | tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp); |
3879 | tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp); |
3855 | else |
3880 | else |
3856 | { |
3881 | { |
3857 | set_locale (str); |
3882 | set_locale (str); |
3858 | pty.set_utf8_mode (enc_utf8); |
3883 | pty.set_utf8_mode (enc_utf8); |
3859 | # ifdef USE_XIM |
|
|
3860 | im_cb (); |
3884 | init_xlocale (); |
3861 | # endif |
|
|
3862 | } |
3885 | } |
3863 | break; |
3886 | break; |
3864 | #endif |
|
|
3865 | |
3887 | |
3866 | #ifdef MENUBAR |
3888 | case URxvt_view_up: |
3867 | case XTerm_Menu: |
3889 | case URxvt_view_down: |
3868 | if (options & Opt_insecure) |
3890 | int lines = atoi (str); |
3869 | menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked |
3891 | |
3870 | break; |
3892 | if (lines) |
3871 | #endif |
3893 | scr_page (op == URxvt_view_up ? UP : DN, lines); |
3872 | #if 0 |
|
|
3873 | case XTerm_dumpscreen: /* no error notices */ |
|
|
3874 | { |
3894 | else |
3875 | int fd; |
|
|
3876 | if ((fd = open (str, O_RDWR | O_CREAT | O_EXCL, 0600)) >= 0) |
|
|
3877 | { |
3895 | { |
3878 | scr_dump (fd); |
3896 | scr_erase_savelines (); |
3879 | close (fd); |
|
|
3880 | } |
3897 | } |
3881 | } |
3898 | |
3882 | break; |
3899 | break; |
3883 | #endif |
3900 | #endif |
3884 | } |
3901 | } |
3885 | } |
3902 | } |
3886 | /*----------------------------------------------------------------------*/ |
3903 | /*----------------------------------------------------------------------*/ |