… | |
… | |
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 |
… | |
… | |
3854 | tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp); |
3883 | tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp); |
3855 | else |
3884 | else |
3856 | { |
3885 | { |
3857 | set_locale (str); |
3886 | set_locale (str); |
3858 | pty.set_utf8_mode (enc_utf8); |
3887 | pty.set_utf8_mode (enc_utf8); |
3859 | # ifdef USE_XIM |
|
|
3860 | im_cb (); |
3888 | init_xlocale (); |
3861 | # endif |
|
|
3862 | } |
3889 | } |
3863 | break; |
3890 | break; |
3864 | #endif |
3891 | #endif |
3865 | |
3892 | |
3866 | #ifdef MENUBAR |
3893 | #ifdef MENUBAR |