… | |
… | |
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] |
1335 | && (Atom)ev.xclient.data.l[0] == xa[XA_WMDELETEWINDOW]) |
1336 | && ev.xclient.data.l[0] == xa[XA_WM_DELETE_WINDOW]) |
1336 | destroy (); |
1337 | destroy (); |
|
|
1338 | #if ENABLE_XEMBED |
|
|
1339 | else if (ev.xclient.format == 32 |
|
|
1340 | && ev.xclient.message_type == xa[XA_XEMBED]) |
|
|
1341 | { |
|
|
1342 | if (ev.xclient.data.l[1] == XEMBED_FOCUS_IN) |
|
|
1343 | focus_in (); |
|
|
1344 | else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT) |
|
|
1345 | focus_out (); |
|
|
1346 | } |
|
|
1347 | #endif |
1337 | #ifdef OFFIX_DND |
1348 | #ifdef OFFIX_DND |
1338 | /* OffiX Dnd (drag 'n' drop) protocol */ |
1349 | /* OffiX Dnd (drag 'n' drop) protocol */ |
1339 | else if (ev.xclient.message_type == xa[XA_DNDPROTOCOL] |
1350 | else if (ev.xclient.message_type == xa[XA_DNDPROTOCOL] |
1340 | && (ev.xclient.data.l[0] == DndFile |
1351 | && (ev.xclient.data.l[0] == DndFile |
1341 | || ev.xclient.data.l[0] == DndDir |
1352 | || ev.xclient.data.l[0] == DndDir |
1342 | || ev.xclient.data.l[0] == DndLink)) |
1353 | || ev.xclient.data.l[0] == DndLink)) |
1343 | { |
1354 | { |
1344 | /* Get Dnd data */ |
1355 | /* Get Dnd data */ |
1345 | Atom ActualType; |
1356 | Atom ActualType; |
1346 | int ActualFormat; |
1357 | int ActualFormat; |
1347 | unsigned char *data; |
1358 | unsigned char *data; |
… | |
… | |
1390 | break; |
1401 | break; |
1391 | } |
1402 | } |
1392 | break; |
1403 | break; |
1393 | |
1404 | |
1394 | case FocusIn: |
1405 | case FocusIn: |
1395 | if (!TermWin.focus) |
1406 | 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; |
1407 | break; |
1420 | |
1408 | |
1421 | case FocusOut: |
1409 | case FocusOut: |
1422 | if (TermWin.focus) |
1410 | 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; |
1411 | break; |
1451 | |
1412 | |
1452 | case ConfigureNotify: |
1413 | case ConfigureNotify: |
1453 | if (ev.xconfigure.window == TermWin.parent[0]) |
1414 | if (ev.xconfigure.window == TermWin.parent[0]) |
1454 | { |
1415 | { |
… | |
… | |
1668 | scr_refresh (refresh_type); |
1629 | scr_refresh (refresh_type); |
1669 | refresh_limit = 0; |
1630 | refresh_limit = 0; |
1670 | scrollbar_show (1); |
1631 | scrollbar_show (1); |
1671 | } |
1632 | } |
1672 | break; |
1633 | break; |
|
|
1634 | } |
|
|
1635 | } |
|
|
1636 | |
|
|
1637 | void |
|
|
1638 | rxvt_term::focus_in () |
|
|
1639 | { |
|
|
1640 | if (!TermWin.focus) |
|
|
1641 | { |
|
|
1642 | TermWin.focus = 1; |
|
|
1643 | want_refresh = 1; |
|
|
1644 | #ifdef USE_XIM |
|
|
1645 | if (Input_Context != NULL) |
|
|
1646 | { |
|
|
1647 | IMSetStatusPosition (); |
|
|
1648 | XSetICFocus (Input_Context); |
|
|
1649 | } |
|
|
1650 | #endif |
|
|
1651 | #ifdef CURSOR_BLINK |
|
|
1652 | if (options & Opt_cursorBlink) |
|
|
1653 | cursor_blink_ev.start (NOW + BLINK_INTERVAL); |
|
|
1654 | #endif |
|
|
1655 | #ifdef OFF_FOCUS_FADING |
|
|
1656 | if (rs[Rs_fade]) |
|
|
1657 | { |
|
|
1658 | pix_colors = pix_colors_focused; |
|
|
1659 | scr_recolour (); |
|
|
1660 | } |
|
|
1661 | #endif |
|
|
1662 | } |
|
|
1663 | } |
|
|
1664 | |
|
|
1665 | void |
|
|
1666 | rxvt_term::focus_out () |
|
|
1667 | { |
|
|
1668 | if (TermWin.focus) |
|
|
1669 | { |
|
|
1670 | TermWin.focus = 0; |
|
|
1671 | want_refresh = 1; |
|
|
1672 | |
|
|
1673 | #if ENABLE_FRILLS || ISO_14755 |
|
|
1674 | iso14755buf = 0; |
|
|
1675 | #endif |
|
|
1676 | #if ENABLE_OVERLAY |
|
|
1677 | scr_overlay_off (); |
|
|
1678 | #endif |
|
|
1679 | #ifdef USE_XIM |
|
|
1680 | if (Input_Context != NULL) |
|
|
1681 | XUnsetICFocus (Input_Context); |
|
|
1682 | #endif |
|
|
1683 | #ifdef CURSOR_BLINK |
|
|
1684 | if (options & Opt_cursorBlink) |
|
|
1685 | cursor_blink_ev.stop (); |
|
|
1686 | hidden_cursor = 0; |
|
|
1687 | #endif |
|
|
1688 | #ifdef OFF_FOCUS_FADING |
|
|
1689 | if (rs[Rs_fade]) |
|
|
1690 | { |
|
|
1691 | pix_colors = pix_colors_unfocused; |
|
|
1692 | scr_recolour (); |
|
|
1693 | } |
|
|
1694 | #endif |
1673 | } |
1695 | } |
1674 | } |
1696 | } |
1675 | |
1697 | |
1676 | #if TRANSPARENT |
1698 | #if TRANSPARENT |
1677 | void |
1699 | void |