… | |
… | |
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; |
… | |
… | |
2154 | selection_make (ev.time); |
2160 | selection_make (ev.time); |
2155 | break; |
2161 | break; |
2156 | |
2162 | |
2157 | case Button2: |
2163 | case Button2: |
2158 | 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? |
2159 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Primary : Sel_Primary); |
2165 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); |
2160 | break; |
2166 | break; |
2161 | |
2167 | |
2162 | #ifdef MOUSE_WHEEL |
2168 | #ifdef MOUSE_WHEEL |
2163 | case Button4: |
2169 | case Button4: |
2164 | case Button5: |
2170 | case Button5: |
… | |
… | |
3674 | seen_esc = true; |
3680 | seen_esc = true; |
3675 | continue; |
3681 | continue; |
3676 | } |
3682 | } |
3677 | else if (ch == C0_BEL || ch == CHAR_ST) |
3683 | else if (ch == C0_BEL || ch == CHAR_ST) |
3678 | break; |
3684 | break; |
|
|
3685 | else if (ch == C0_SYN) |
|
|
3686 | ch = cmd_get8 (); |
3679 | else if (ch < 0x20) |
3687 | else if (ch < 0x20) |
3680 | return NULL; /* other control character - exit */ |
3688 | return NULL; /* other control character - exit */ |
3681 | |
3689 | |
3682 | seen_esc = false; |
3690 | seen_esc = false; |
3683 | |
3691 | |
3684 | if (n >= STRING_MAX - 1) |
3692 | if (n >= STRING_MAX - 1) |
3685 | // stop at some sane length |
3693 | // stop at some sane length |
3686 | return NULL; |
3694 | return NULL; |
3687 | |
3695 | |
3688 | if (ch == C0_SYN) |
|
|
3689 | string[n++] = cmd_get8 (); |
|
|
3690 | else |
|
|
3691 | string[n++] = ch; |
3696 | string[n++] = ch; |
3692 | } |
3697 | } |
3693 | |
3698 | |
3694 | string[n++] = '\0'; |
3699 | string[n++] = '\0'; |
3695 | |
3700 | |
3696 | ends_how = (ch == 0x5c ? C0_ESC : ch); |
3701 | ends_how = (ch == 0x5c ? C0_ESC : ch); |