… | |
… | |
1034 | |
1034 | |
1035 | void |
1035 | void |
1036 | rxvt_term::flush () |
1036 | rxvt_term::flush () |
1037 | { |
1037 | { |
1038 | flush_ev.stop (); |
1038 | flush_ev.stop (); |
1039 | |
1039 | |
1040 | #ifdef ENABLE_TRANSPARENCY |
1040 | #ifdef HAVE_BG_PIXMAP |
1041 | if (want_full_refresh) |
1041 | if (bgPixmap.check_clearChanged ()) |
1042 | { |
1042 | { |
1043 | want_full_refresh = 0; |
1043 | // scr_clear (true); This needs to be researched further! |
1044 | scr_clear (); |
|
|
1045 | scr_touch (false); |
1044 | scr_touch (false); |
1046 | } |
1045 | } |
1047 | #endif |
1046 | #endif |
1048 | |
1047 | |
1049 | if (want_refresh) |
1048 | if (want_refresh) |
… | |
… | |
1302 | void |
1301 | void |
1303 | rxvt_term::mouse_report (XButtonEvent &ev) |
1302 | rxvt_term::mouse_report (XButtonEvent &ev) |
1304 | { |
1303 | { |
1305 | int button_number, key_state = 0; |
1304 | int button_number, key_state = 0; |
1306 | int x, y; |
1305 | int x, y; |
|
|
1306 | int code = 32; |
1307 | |
1307 | |
1308 | x = ev.x; |
1308 | x = Pixel2Col (ev.x); |
1309 | y = ev.y; |
1309 | y = Pixel2Row (ev.y); |
1310 | pixel_position (&x, &y); |
1310 | if (ev.type == MotionNotify) { |
|
|
1311 | if (x == mouse_row && y == mouse_col) |
|
|
1312 | return; |
|
|
1313 | mouse_row = x; |
|
|
1314 | mouse_col = y; |
|
|
1315 | code += 32; |
|
|
1316 | } |
1311 | |
1317 | |
1312 | if (MEvent.button == AnyButton) |
1318 | if (MEvent.button == AnyButton) |
1313 | button_number = 3; |
1319 | button_number = 3; |
1314 | else |
1320 | else |
1315 | { |
1321 | { |
… | |
… | |
1361 | x + 1, |
1367 | x + 1, |
1362 | y + 1); |
1368 | y + 1); |
1363 | #endif |
1369 | #endif |
1364 | |
1370 | |
1365 | tt_printf ("\033[M%c%c%c", |
1371 | tt_printf ("\033[M%c%c%c", |
1366 | (32 + button_number + key_state), |
1372 | (code + button_number + key_state), |
1367 | (32 + x + 1), |
1373 | (32 + x + 1), |
1368 | (32 + y + 1)); |
1374 | (32 + y + 1)); |
1369 | } |
1375 | } |
1370 | |
1376 | |
1371 | /*{{{ process an X event */ |
1377 | /*{{{ process an X event */ |
… | |
… | |
1475 | && ev.xfocus.mode != NotifyGrab) |
1481 | && ev.xfocus.mode != NotifyGrab) |
1476 | focus_out (); |
1482 | focus_out (); |
1477 | break; |
1483 | break; |
1478 | |
1484 | |
1479 | case ConfigureNotify: |
1485 | case ConfigureNotify: |
1480 | /* fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n", |
1486 | /* fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n", |
1481 | ev.xconfigure.window, parent[0], ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y, |
1487 | ev.xconfigure.window, parent[0], ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y, |
1482 | szHint.width, szHint.height);*/ |
1488 | szHint.width, szHint.height); */ |
1483 | if (ev.xconfigure.window == parent[0]) |
1489 | if (ev.xconfigure.window == parent[0]) |
1484 | { |
1490 | { |
1485 | while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev)) |
1491 | while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev)) |
1486 | ; |
1492 | ; |
1487 | |
1493 | |
… | |
… | |
1490 | seen_resize = 1; |
1496 | seen_resize = 1; |
1491 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1497 | resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); |
1492 | } |
1498 | } |
1493 | else |
1499 | else |
1494 | { |
1500 | { |
1495 | #ifdef ENABLE_TRANSPARENCY |
1501 | #ifdef HAVE_BG_PIXMAP |
1496 | if (option (Opt_transparent)) |
1502 | if (bgPixmap.window_position_sensitive ()) |
1497 | update_background (); |
1503 | update_background (); |
1498 | #endif |
1504 | #endif |
1499 | } |
1505 | } |
1500 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1506 | HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1501 | } |
1507 | } |
… | |
… | |
1536 | text_blink_ev.stop (); |
1542 | text_blink_ev.stop (); |
1537 | #endif |
1543 | #endif |
1538 | HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1544 | HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END)); |
1539 | break; |
1545 | break; |
1540 | |
1546 | |
1541 | #ifdef ENABLE_TRANSPARENCY |
|
|
1542 | case ReparentNotify: |
|
|
1543 | rootwin_cb (ev); |
|
|
1544 | break; |
|
|
1545 | #endif /* ENABLE_TRANSPARENCY */ |
|
|
1546 | |
|
|
1547 | case GraphicsExpose: |
1547 | case GraphicsExpose: |
1548 | case Expose: |
1548 | case Expose: |
1549 | if (ev.xany.window == vt) |
1549 | if (ev.xany.window == vt) |
1550 | { |
1550 | { |
1551 | do |
1551 | do |
|
|
1552 | { |
1552 | scr_expose (ev.xexpose.x, ev.xexpose.y, |
1553 | scr_expose (ev.xexpose.x, ev.xexpose.y, |
1553 | ev.xexpose.width, ev.xexpose.height, False); |
1554 | ev.xexpose.width, ev.xexpose.height, False); |
|
|
1555 | } |
1554 | while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)); |
1556 | while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)); |
1555 | |
1557 | |
1556 | ev.xany.type = ev.xany.type == Expose ? GraphicsExpose : Expose; |
1558 | ev.xany.type = ev.xany.type == Expose ? GraphicsExpose : Expose; |
1557 | |
1559 | |
1558 | while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)) |
1560 | while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev)) |
|
|
1561 | { |
1559 | scr_expose (ev.xexpose.x, ev.xexpose.y, |
1562 | scr_expose (ev.xexpose.x, ev.xexpose.y, |
1560 | ev.xexpose.width, ev.xexpose.height, False); |
1563 | ev.xexpose.width, ev.xexpose.height, False); |
1561 | |
1564 | } |
1562 | want_refresh = 1; |
1565 | want_refresh = 1; |
1563 | } |
1566 | } |
1564 | else |
1567 | else |
1565 | { |
1568 | { |
1566 | XEvent unused_event; |
1569 | XEvent unused_event; |
… | |
… | |
1581 | case MotionNotify: |
1584 | case MotionNotify: |
1582 | #ifdef POINTER_BLANK |
1585 | #ifdef POINTER_BLANK |
1583 | if (hidden_pointer) |
1586 | if (hidden_pointer) |
1584 | pointer_unblank (); |
1587 | pointer_unblank (); |
1585 | #endif |
1588 | #endif |
|
|
1589 | if ((priv_modes & PrivMode_MouseBtnEvent && ev.xbutton.state & (Button1Mask|Button2Mask|Button3Mask)) |
|
|
1590 | || priv_modes & PrivMode_MouseAnyEvent) |
|
|
1591 | mouse_report (ev.xbutton); |
1586 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1592 | if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) |
1587 | break; |
1593 | break; |
1588 | |
1594 | |
1589 | if (ev.xany.window == vt) |
1595 | if (ev.xany.window == vt) |
1590 | { |
1596 | { |
… | |
… | |
1744 | } |
1750 | } |
1745 | #endif |
1751 | #endif |
1746 | #if ENABLE_FRILLS |
1752 | #if ENABLE_FRILLS |
1747 | if (option (Opt_urgentOnBell)) |
1753 | if (option (Opt_urgentOnBell)) |
1748 | { |
1754 | { |
1749 | XWMHints *h; |
|
|
1750 | |
|
|
1751 | h = XGetWMHints(dpy, parent[0]); |
1755 | if (XWMHints *h = XGetWMHints(dpy, parent[0])) |
1752 | if (h != NULL) |
|
|
1753 | { |
1756 | { |
1754 | h->flags &= ~XUrgencyHint; |
1757 | h->flags &= ~XUrgencyHint; |
1755 | XSetWMHints(dpy, parent[0], h); |
1758 | XSetWMHints (dpy, parent[0], h); |
1756 | } |
1759 | } |
1757 | } |
1760 | } |
1758 | #endif |
1761 | #endif |
1759 | } |
1762 | } |
1760 | } |
1763 | } |
… | |
… | |
2856 | { |
2859 | { |
2857 | // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt, |
2860 | // first parameter is normally 0 for vt100, 1 for vt220, 'R' for rxvt, |
2858 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2861 | // 'U' for rxvt-unicode != 7.[34] (where it was broken). |
2859 | // |
2862 | // |
2860 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
2863 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
2861 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
2864 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, 94 for urxvt <= 8.3, and 95 for later |
2862 | // that we do not support xterm mouse reporting (should be 95 when we do). |
2865 | // versions. |
2863 | // |
2866 | // |
2864 | tt_printf ("\033[>%d;94;0c", 'U'); |
2867 | tt_printf ("\033[>%d;95;0c", 'U'); |
2865 | } |
2868 | } |
2866 | break; |
2869 | break; |
2867 | case '?': |
2870 | case '?': |
2868 | if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') |
2871 | if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') |
2869 | process_terminal_mode (ch, priv, nargs, arg); |
2872 | process_terminal_mode (ch, priv, nargs, arg); |
… | |
… | |
3436 | } |
3439 | } |
3437 | |
3440 | |
3438 | break; |
3441 | break; |
3439 | #endif |
3442 | #endif |
3440 | |
3443 | |
3441 | #if XPM_BACKGROUND |
3444 | #if BG_IMAGE_FROM_FILE |
3442 | case Rxvt_Pixmap: |
3445 | case Rxvt_Pixmap: |
3443 | if (!strcmp (str, "?")) |
3446 | if (!strcmp (str, "?")) |
3444 | { |
3447 | { |
3445 | char str[256]; |
3448 | char str[256]; |
3446 | |
3449 | |
… | |
… | |
3634 | #ifndef NO_BACKSPACE_KEY |
3637 | #ifndef NO_BACKSPACE_KEY |
3635 | { 67, PrivMode_BackSpace }, |
3638 | { 67, PrivMode_BackSpace }, |
3636 | #endif |
3639 | #endif |
3637 | { 1000, PrivMode_MouseX11 }, |
3640 | { 1000, PrivMode_MouseX11 }, |
3638 | // 1001 Use Hilite Mouse Tracking. NYI, TODO |
3641 | // 1001 Use Hilite Mouse Tracking. NYI, TODO |
3639 | // 1002 Use Cell Motion Mouse Tracking. NYI, TODO |
3642 | { 1002, PrivMode_MouseBtnEvent }, |
3640 | // 1003 Use All Motion Mouse Tracking. NYI, TODO |
3643 | { 1003, PrivMode_MouseAnyEvent }, |
3641 | { 1010, PrivMode_TtyOutputInh }, // rxvt extension |
3644 | { 1010, PrivMode_TtyOutputInh }, // rxvt extension |
3642 | { 1011, PrivMode_Keypress }, // rxvt extension |
3645 | { 1011, PrivMode_Keypress }, // rxvt extension |
3643 | // 1035 enable modifiers for alt, numlock NYI |
3646 | // 1035 enable modifiers for alt, numlock NYI |
3644 | // 1036 send ESC for meta keys NYI |
3647 | // 1036 send ESC for meta keys NYI |
3645 | // 1037 send DEL for keypad delete NYI |
3648 | // 1037 send DEL for keypad delete NYI |
… | |
… | |
3719 | scr_autowrap (state); |
3722 | scr_autowrap (state); |
3720 | break; |
3723 | break; |
3721 | /* case 8: - auto repeat, can't do on a per window basis */ |
3724 | /* case 8: - auto repeat, can't do on a per window basis */ |
3722 | case 9: /* X10 mouse reporting */ |
3725 | case 9: /* X10 mouse reporting */ |
3723 | if (state) /* orthogonal */ |
3726 | if (state) /* orthogonal */ |
3724 | priv_modes &= ~PrivMode_MouseX11; |
3727 | priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); |
3725 | break; |
3728 | break; |
3726 | #ifdef scrollBar_esc |
3729 | #ifdef scrollBar_esc |
3727 | case scrollBar_esc: |
3730 | case scrollBar_esc: |
3728 | if (scrollbar_mapping (state)) |
3731 | if (scrollbar_mapping (state)) |
3729 | { |
3732 | { |
… | |
… | |
3742 | break; |
3745 | break; |
3743 | /* case 66: - application key pad */ |
3746 | /* case 66: - application key pad */ |
3744 | /* case 67: - backspace key */ |
3747 | /* case 67: - backspace key */ |
3745 | case 1000: /* X11 mouse reporting */ |
3748 | case 1000: /* X11 mouse reporting */ |
3746 | if (state) /* orthogonal */ |
3749 | if (state) /* orthogonal */ |
3747 | priv_modes &= ~PrivMode_MouseX10; |
3750 | priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent); |
3748 | break; |
3751 | break; |
3749 | #if 0 |
3752 | #if 0 |
3750 | case 1001: |
3753 | case 1001: |
3751 | break; /* X11 mouse highlighting */ |
3754 | break; /* X11 mouse highlighting */ |
3752 | #endif |
3755 | #endif |
|
|
3756 | case 1002: |
|
|
3757 | case 1003: |
|
|
3758 | if (state) { |
|
|
3759 | priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11); |
|
|
3760 | priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent; |
|
|
3761 | vt_emask_mouse = PointerMotionMask; |
|
|
3762 | } else |
|
|
3763 | vt_emask_mouse = NoEventMask; |
|
|
3764 | vt_select_input (); |
|
|
3765 | break; |
3753 | case 1010: /* scroll to bottom on TTY output inhibit */ |
3766 | case 1010: /* scroll to bottom on TTY output inhibit */ |
3754 | set_option (Opt_scrollTtyOutput, !state); |
3767 | set_option (Opt_scrollTtyOutput, !state); |
3755 | break; |
3768 | break; |
3756 | case 1011: /* scroll to bottom on key press */ |
3769 | case 1011: /* scroll to bottom on key press */ |
3757 | set_option (Opt_scrollTtyKeypress, state); |
3770 | set_option (Opt_scrollTtyKeypress, state); |
… | |
… | |
4009 | |
4022 | |
4010 | if (v_buflen == 0) |
4023 | if (v_buflen == 0) |
4011 | { |
4024 | { |
4012 | free (v_buffer); |
4025 | free (v_buffer); |
4013 | v_buffer = 0; |
4026 | v_buffer = 0; |
4014 | v_buflen = 0; |
|
|
4015 | |
4027 | |
4016 | pty_ev.set (EVENT_READ); |
4028 | pty_ev.set (EVENT_READ); |
4017 | return; |
4029 | return; |
4018 | } |
4030 | } |
4019 | |
4031 | |