… | |
… | |
1217 | if (ev.type == KeyPress && hidden_pointer == 0) |
1217 | if (ev.type == KeyPress && hidden_pointer == 0) |
1218 | pointer_blank (); |
1218 | pointer_blank (); |
1219 | } |
1219 | } |
1220 | #endif |
1220 | #endif |
1221 | |
1221 | |
1222 | Window unused_root, unused_child; |
1222 | Window unused_root, unused_child; |
1223 | int unused_root_x, unused_root_y; |
1223 | int unused_root_x, unused_root_y; |
1224 | unsigned int unused_mask; |
1224 | unsigned int unused_mask; |
1225 | |
1225 | |
1226 | switch (ev.type) |
1226 | switch (ev.type) |
1227 | { |
1227 | { |
1228 | case KeyPress: |
1228 | case KeyPress: |
1229 | #if ISO_14755 |
1229 | #if ISO_14755 |
… | |
… | |
1334 | 0L, 1000000L, |
1334 | 0L, 1000000L, |
1335 | False, AnyPropertyType, |
1335 | False, AnyPropertyType, |
1336 | &ActualType, &ActualFormat, |
1336 | &ActualType, &ActualFormat, |
1337 | &Size, &RemainingBytes, |
1337 | &Size, &RemainingBytes, |
1338 | &data); |
1338 | &data); |
1339 | XChangeProperty (display->display, display->root, |
1339 | set_string_property (XA_CUT_BUFFER0, data); |
1340 | XA_CUT_BUFFER0, XA_STRING, |
|
|
1341 | 8, PropModeReplace, |
|
|
1342 | data, strlen (data)); |
|
|
1343 | XFree (data); |
1340 | XFree (data); |
1344 | selection_paste (display->root, XA_CUT_BUFFER0, True); |
1341 | selection_paste (display->root, XA_CUT_BUFFER0, True); |
1345 | XSetInputFocus (display->display, display->root, RevertToNone, CurrentTime); |
1342 | XSetInputFocus (display->display, display->root, RevertToNone, CurrentTime); |
1346 | } |
1343 | } |
1347 | #endif /* OFFIX_DND */ |
1344 | #endif /* OFFIX_DND */ |
… | |
… | |
1453 | resize_all_windows (width, height, 1); |
1450 | resize_all_windows (width, height, 1); |
1454 | } |
1451 | } |
1455 | |
1452 | |
1456 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1453 | #ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ |
1457 | if (options & Opt_transparent) |
1454 | if (options & Opt_transparent) |
1458 | { |
|
|
1459 | check_our_parents (); |
1455 | check_our_parents (); |
1460 | if (am_transparent) |
|
|
1461 | want_refresh = want_full_refresh = 1; |
|
|
1462 | } |
|
|
1463 | #endif |
1456 | #endif |
1464 | } |
1457 | } |
1465 | break; |
1458 | break; |
1466 | |
1459 | |
1467 | case PropertyNotify: |
1460 | case PropertyNotify: |
… | |
… | |
2416 | sy = 0; |
2409 | sy = 0; |
2417 | } |
2410 | } |
2418 | |
2411 | |
2419 | MIN_IT (nw, (unsigned int) (wrootattr.width - sx)); |
2412 | MIN_IT (nw, (unsigned int) (wrootattr.width - sx)); |
2420 | MIN_IT (nh, (unsigned int) (wrootattr.height - sy)); |
2413 | MIN_IT (nh, (unsigned int) (wrootattr.height - sy)); |
|
|
2414 | |
|
|
2415 | XSync (display->display, False); |
2421 | allowedxerror = -1; |
2416 | allowedxerror = -1; |
2422 | image = XGetImage (display->display, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
2417 | image = XGetImage (display->display, rootpixmap, sx, sy, nw, nh, AllPlanes, ZPixmap); |
2423 | |
2418 | |
2424 | /* XXX: handle BadMatch - usually because we're outside the pixmap */ |
2419 | /* XXX: handle BadMatch - usually because we're outside the pixmap */ |
2425 | /* XXX: may need a delay here? */ |
2420 | /* XXX: may need a delay here? */ |
… | |
… | |
2471 | |
2466 | |
2472 | am_transparent = am_pixmap_trans = 1; |
2467 | am_transparent = am_pixmap_trans = 1; |
2473 | } |
2468 | } |
2474 | } |
2469 | } |
2475 | |
2470 | |
2476 | if (!am_pixmap_trans) |
2471 | if (am_pixmap_trans) |
|
|
2472 | XSetWindowBackgroundPixmap (display->display, TermWin.vt, ParentRelative); |
|
|
2473 | else |
2477 | { |
2474 | { |
2478 | unsigned int n; |
2475 | unsigned int n; |
2479 | /* |
2476 | /* |
2480 | * InheritPixmap transparency |
2477 | * InheritPixmap transparency |
2481 | */ |
2478 | */ |
… | |
… | |
2544 | if (scrollBar.win) |
2541 | if (scrollBar.win) |
2545 | { |
2542 | { |
2546 | XSetWindowBackgroundPixmap (display->display, scrollBar.win, ParentRelative); |
2543 | XSetWindowBackgroundPixmap (display->display, scrollBar.win, ParentRelative); |
2547 | scrollBar.setIdle (); |
2544 | scrollBar.setIdle (); |
2548 | scrollbar_show (0); |
2545 | scrollbar_show (0); |
|
|
2546 | } |
|
|
2547 | |
|
|
2548 | if (am_transparent) |
|
|
2549 | { |
|
|
2550 | want_refresh = want_full_refresh = 1; |
|
|
2551 | if (am_pixmap_trans) |
|
|
2552 | flush (); |
2549 | } |
2553 | } |
2550 | |
2554 | |
2551 | return pchanged; |
2555 | return pchanged; |
2552 | } |
2556 | } |
2553 | #endif |
2557 | #endif |
… | |
… | |
3513 | * ends_how is terminator used. returned input must be free()'d |
3517 | * ends_how is terminator used. returned input must be free()'d |
3514 | */ |
3518 | */ |
3515 | unsigned char * |
3519 | unsigned char * |
3516 | rxvt_term::get_to_st (unicode_t &ends_how) |
3520 | rxvt_term::get_to_st (unicode_t &ends_how) |
3517 | { |
3521 | { |
3518 | unicode_t seen_esc = 0, ch; |
3522 | unicode_t ch; |
|
|
3523 | bool seen_esc = false; |
3519 | unsigned int n = 0; |
3524 | unsigned int n = 0; |
3520 | unsigned char *s; |
|
|
3521 | unsigned char string[STRING_MAX]; |
3525 | wchar_t string[STRING_MAX]; |
3522 | |
3526 | |
3523 | while ((ch = cmd_getc ()) != NOCHAR) |
3527 | while ((ch = cmd_getc ()) != NOCHAR) |
3524 | { |
3528 | { |
3525 | if (seen_esc) |
3529 | if (seen_esc) |
3526 | { |
3530 | { |
… | |
… | |
3529 | else |
3533 | else |
3530 | return NULL; |
3534 | return NULL; |
3531 | } |
3535 | } |
3532 | else if (ch == C0_ESC) |
3536 | else if (ch == C0_ESC) |
3533 | { |
3537 | { |
3534 | seen_esc = 1; |
3538 | seen_esc = true; |
3535 | continue; |
3539 | continue; |
3536 | } |
3540 | } |
3537 | else if (ch == C0_BEL || ch == CHAR_ST) |
3541 | else if (ch == C0_BEL || ch == CHAR_ST) |
3538 | break; |
3542 | break; |
3539 | else if (ch < 0x20) |
3543 | else if (ch < 0x20) |
3540 | return NULL; /* other control character - exit */ |
3544 | return NULL; /* other control character - exit */ |
3541 | |
3545 | |
3542 | seen_esc = 0; |
3546 | seen_esc = false; |
3543 | |
3547 | |
3544 | if (n >= sizeof (string) - 1) |
3548 | if (n >= sizeof (string) - 1) |
3545 | // stop at some sane length |
3549 | // stop at some sane length |
3546 | return NULL; |
3550 | return NULL; |
3547 | |
3551 | |
… | |
… | |
3551 | string[n++] = ch; |
3555 | string[n++] = ch; |
3552 | } |
3556 | } |
3553 | |
3557 | |
3554 | string[n++] = '\0'; |
3558 | string[n++] = '\0'; |
3555 | |
3559 | |
3556 | if ((s = (unsigned char *)rxvt_malloc (n)) == NULL) |
|
|
3557 | return NULL; |
|
|
3558 | |
|
|
3559 | ends_how = (ch == 0x5c ? C0_ESC : ch); |
3560 | ends_how = (ch == 0x5c ? C0_ESC : ch); |
3560 | strncpy (s, string, n); |
3561 | |
3561 | return s; |
3562 | return (unsigned char *)rxvt_wcstombs (string); |
3562 | } |
3563 | } |
3563 | |
3564 | |
3564 | /*----------------------------------------------------------------------*/ |
3565 | /*----------------------------------------------------------------------*/ |
3565 | /* |
3566 | /* |
3566 | * process DEVICE CONTROL STRING `ESC P ... (ST|BEL)' or `0x90 ... (ST|BEL)' |
3567 | * process DEVICE CONTROL STRING `ESC P ... (ST|BEL)' or `0x90 ... (ST|BEL)' |
… | |
… | |
3667 | set_title (str); |
3668 | set_title (str); |
3668 | break; |
3669 | break; |
3669 | case XTerm_property: |
3670 | case XTerm_property: |
3670 | if (str[0] == '?') |
3671 | if (str[0] == '?') |
3671 | { |
3672 | { |
3672 | Atom prop = XInternAtom (display->display, str + 1, True); |
3673 | Atom prop = display->atom (str + 1); |
3673 | Atom actual_type; |
3674 | Atom actual_type; |
3674 | int actual_format; |
3675 | int actual_format; |
3675 | unsigned long nitems; |
3676 | unsigned long nitems; |
3676 | unsigned long bytes_after; |
3677 | unsigned long bytes_after; |
3677 | unsigned char *value = 0; |
3678 | unsigned char *value = 0; |
… | |
… | |
3695 | char *eq = strchr (str, '='); // constness lost, but verified to be ok |
3696 | char *eq = strchr (str, '='); // constness lost, but verified to be ok |
3696 | |
3697 | |
3697 | if (eq) |
3698 | if (eq) |
3698 | { |
3699 | { |
3699 | *eq = 0; |
3700 | *eq = 0; |
3700 | XChangeProperty (display->display, TermWin.parent[0], |
3701 | set_utf8_property (display->atom (str), eq + 1); |
3701 | display->atom (str), XA_STRING, 8, |
|
|
3702 | PropModeReplace, (unsigned char *)eq + 1, |
|
|
3703 | strlen (eq + 1)); |
|
|
3704 | } |
3702 | } |
3705 | else |
3703 | else |
3706 | XDeleteProperty (display->display, TermWin.parent[0], |
3704 | XDeleteProperty (display->display, TermWin.parent[0], |
3707 | display->atom (str)); |
3705 | display->atom (str)); |
3708 | } |
3706 | } |