565
strcpy (kbuf, key_backspace);
565
strcpy (kbuf, rs[Rs_backspace_key]);
568
568
#ifndef NO_DELETE_KEY
570
570
case XK_KP_Delete:
571
571
/* allow shift to override */
572
if ((priv_modes & PrivMode_aplKP) ? !shft : shft)
574
574
strcpy (kbuf, "\033On");
602
602
case XK_KP_Down: /* \033Or or standard */
603
603
case XK_KP_Right: /* \033Ov or standard */
604
604
case XK_KP_Left: /* \033Ot or standard */
605
if ((priv_modes & PrivMode_aplKP) ? !shft : shft)
607
607
strcpy (kbuf, "\033OZ");
608
608
kbuf[2] = "txvr"[keysym - XK_KP_Left];
714
714
case XK_KP_8: /* "\033Ox" : "8" */
715
715
case XK_KP_9: /* "\033Oy" : "9" */
716
716
/* allow shift to override */
717
if ((priv_modes & PrivMode_aplKP) ? !shft : shft)
719
719
strcpy (kbuf, "\033Oj");
720
720
kbuf[2] += (keysym - XK_KP_Multiply);
1305
1304
int button_number, key_state = 0;
1310
pixel_position (&x, &y);
1308
x = Pixel2Col (ev.x);
1309
y = Pixel2Row (ev.y);
1310
if (ev.type == MotionNotify) {
1311
if (x == mouse_row && y == mouse_col)
1312
1318
if (MEvent.button == AnyButton)
1313
1319
button_number = 3;
1479
1485
case ConfigureNotify:
1486
/* fprintf (stderr, "ConfigureNotify for %X, parent is %X, geom is %dx%d%+d%+d, old geom was %dx%d\n",
1487
ev.xconfigure.window, parent[0], ev.xconfigure.width, ev.xconfigure.height, ev.xconfigure.x, ev.xconfigure.y,
1488
szHint.width, szHint.height); */
1480
1489
if (ev.xconfigure.window == parent[0])
1482
1491
while (XCheckTypedWindowEvent (dpy, ev.xconfigure.window, ConfigureNotify, &ev))
1487
1496
seen_resize = 1;
1488
1497
resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1);
1489
#ifdef XPM_BACKGROUND
1490
if (!option (Opt_transparent) && bgPixmap.auto_resize)
1501
#ifdef HAVE_BG_PIXMAP
1502
if (bgPixmap.window_position_sensitive ())
1503
update_background ();
1498
1506
HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1500
#ifdef ENABLE_TRANSPARENCY
1501
if (option (Opt_transparent))
1502
check_our_parents ();
1541
1544
HOOK_INVOKE ((this, HOOK_UNMAP_NOTIFY, DT_XEVENT, &ev, DT_END));
1544
#ifdef ENABLE_TRANSPARENCY
1545
case ReparentNotify:
1548
#endif /* ENABLE_TRANSPARENCY */
1550
1547
case GraphicsExpose:
1552
1549
if (ev.xany.window == vt)
1555
scr_expose (ev.xexpose.x, ev.xexpose.y,
1556
ev.xexpose.width, ev.xexpose.height, False);
1553
scr_expose (ev.xexpose.x, ev.xexpose.y,
1554
ev.xexpose.width, ev.xexpose.height, False);
1557
1556
while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev));
1559
1558
ev.xany.type = ev.xany.type == Expose ? GraphicsExpose : Expose;
1561
1560
while (XCheckTypedWindowEvent (dpy, vt, ev.xany.type, &ev))
1562
scr_expose (ev.xexpose.x, ev.xexpose.y,
1563
ev.xexpose.width, ev.xexpose.height, False);
1562
scr_expose (ev.xexpose.x, ev.xexpose.y,
1563
ev.xexpose.width, ev.xexpose.height, False);
1565
1565
want_refresh = 1;
1591
1586
if (hidden_pointer)
1592
1587
pointer_unblank ();
1589
if ((priv_modes & PrivMode_MouseBtnEvent && ev.xbutton.state & (Button1Mask|Button2Mask|Button3Mask))
1590
|| priv_modes & PrivMode_MouseAnyEvent)
1591
mouse_report (ev.xbutton);
1594
1592
if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate)
1754
1752
#if ENABLE_FRILLS
1755
1753
if (option (Opt_urgentOnBell))
1759
h = XGetWMHints(dpy, parent[0]);
1755
if (XWMHints *h = XGetWMHints(dpy, parent[0]))
1762
1757
h->flags &= ~XUrgencyHint;
1763
XSetWMHints(dpy, parent[0], h);
1758
XSetWMHints (dpy, parent[0], h);
1836
1831
* if user used some Esetroot compatible prog to set the root bg,
1837
1832
* use the property to determine the pixmap. We use it later on.
1839
if (ev.xproperty.atom != xa[XA_XROOTPMAP_ID]
1840
&& ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID])
1844
case ReparentNotify:
1845
if (option (Opt_transparent))
1846
check_our_parents ();
1834
if (ev.xproperty.atom == xa[XA_XROOTPMAP_ID]
1835
|| ev.xproperty.atom == xa[XA_ESETROOT_PMAP_ID])
1837
bgPixmap.set_root_pixmap ();
1838
update_background ();
2869
2861
// 'U' for rxvt-unicode != 7.[34] (where it was broken).
2871
2863
// second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt
2872
// and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify
2873
// that we do not support xterm mouse reporting (should be 95 when we do).
2864
// and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, 94 for urxvt <= 8.3, and 95 for later
2875
tt_printf ("\033[>%d;94;0c", 'U');
2867
tt_printf ("\033[>%d;95;0c", 'U');
3433
3425
process_color_seq (op, Color_IT, str, resp);
3436
#if ENABLE_TRANSPARENCY && TINTING
3428
#if ENABLE_TRANSPARENCY
3437
3429
case URxvt_Color_tint:
3438
3430
process_color_seq (op, Color_tint, str, resp);
3440
check_our_parents ();
3443
want_full_refresh = want_refresh = 1;
3432
bool changed = false;
3433
if (ISSET_PIXCOLOR (Color_tint))
3434
changed = bgPixmap.set_tint (pix_colors_focused [Color_tint]);
3436
changed = bgPixmap.unset_tint ();
3438
update_background ();
3444
#if BG_IMAGE_FROM_FILE
3448
3445
case Rxvt_Pixmap:
3453
scale_pixmap (""); /* reset to default scaling */
3454
set_bgPixmap (str); /* change pixmap */
3461
while ((str = strchr (str, ';')) != NULL)
3465
changed += scale_pixmap (str);
3471
#ifdef XPM_BACKGROUND
3476
#if ENABLE_TRANSPARENCY && defined(HAVE_AFTERIMAGE)
3477
if (option (Opt_transparent))
3478
check_our_parents ();
3446
if (!strcmp (str, "?"))
3450
sprintf (str, "[%dx%d+%d+%d]", /* can't presume snprintf () ! */
3451
min (bgPixmap.h_scale, 32767), min (bgPixmap.v_scale, 32767),
3452
min (bgPixmap.h_align, 32767), min (bgPixmap.v_align, 32767));
3453
process_xterm_seq (XTerm_title, str, CHAR_ST);
3461
/* reset to default scaling :*/
3462
bgPixmap.unset_geometry ();
3463
if (bgPixmap.set_file (str)) /* change pixmap */
3465
str = strchr (str, ';');
3467
bgPixmap.set_defaultGeometry ();
3472
if (bgPixmap.set_geometry (str))
3474
str = strchr (str, ';');
3477
update_background ();
3483
3482
case Rxvt_restoreFG:
3484
3483
set_window_color (Color_fg, str);
3643
3640
{ 1000, PrivMode_MouseX11 },
3644
3641
// 1001 Use Hilite Mouse Tracking. NYI, TODO
3645
// 1002 Use Cell Motion Mouse Tracking. NYI, TODO
3646
// 1003 Use All Motion Mouse Tracking. NYI, TODO
3642
{ 1002, PrivMode_MouseBtnEvent },
3643
{ 1003, PrivMode_MouseAnyEvent },
3647
3644
{ 1010, PrivMode_TtyOutputInh }, // rxvt extension
3648
3645
{ 1011, PrivMode_Keypress }, // rxvt extension
3649
3646
// 1035 enable modifiers for alt, numlock NYI
3727
3724
/* case 8: - auto repeat, can't do on a per window basis */
3728
3725
case 9: /* X10 mouse reporting */
3729
3726
if (state) /* orthogonal */
3730
priv_modes &= ~PrivMode_MouseX11;
3727
priv_modes &= ~(PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent);
3732
3729
#ifdef scrollBar_esc
3733
3730
case scrollBar_esc:
3750
3747
/* case 67: - backspace key */
3751
3748
case 1000: /* X11 mouse reporting */
3752
3749
if (state) /* orthogonal */
3753
priv_modes &= ~PrivMode_MouseX10;
3750
priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent);
3757
3754
break; /* X11 mouse highlighting */
3759
priv_modes &= ~(PrivMode_MouseX10|PrivMode_MouseX11);
3760
priv_modes &= arg[i] == 1003 ? ~PrivMode_MouseBtnEvent : ~PrivMode_MouseAnyEvent;
3761
vt_emask_mouse = PointerMotionMask;
3763
vt_emask_mouse = NoEventMask;
3759
3766
case 1010: /* scroll to bottom on TTY output inhibit */
3760
3767
set_option (Opt_scrollTtyOutput, !state);