diff options
| author | Richard M. Stallman | 1993-03-15 06:04:31 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-03-15 06:04:31 +0000 |
| commit | d56a553a20129ebd865a9d2c76c8480cfbcccca1 (patch) | |
| tree | c9e1f4bcbb8dc8a64bae34158e5fd76cf4366242 /src | |
| parent | bdbe6f28567c2bd4aa86bd171111821e597f11ea (diff) | |
| download | emacs-d56a553a20129ebd865a9d2c76c8480cfbcccca1.tar.gz emacs-d56a553a20129ebd865a9d2c76c8480cfbcccca1.zip | |
(Xatom_wm_change_state): Define here.
(XTread_socket): Handle NEW_SELECTIONS alternative:
queue events for SelectionRequest and SelectionClear;
call functions for SelectionNotify and PropertyNotify.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 64 |
1 files changed, 58 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c index a7e1b983d3d..53a57e688e2 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -25,6 +25,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 25 | 25 | ||
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | #define NEW_SELECTIONS | ||
| 29 | |||
| 28 | #include "config.h" | 30 | #include "config.h" |
| 29 | 31 | ||
| 30 | #ifdef HAVE_X_WINDOWS | 32 | #ifdef HAVE_X_WINDOWS |
| @@ -2441,6 +2443,9 @@ Atom Xatom_wm_delete_window; | |||
| 2441 | Atom Xatom_wm_configure_denied; /* When our config request is denied */ | 2443 | Atom Xatom_wm_configure_denied; /* When our config request is denied */ |
| 2442 | Atom Xatom_wm_window_moved; /* When the WM moves us. */ | 2444 | Atom Xatom_wm_window_moved; /* When the WM moves us. */ |
| 2443 | 2445 | ||
| 2446 | /* Window manager communication. */ | ||
| 2447 | Atom Xatom_wm_change_state; | ||
| 2448 | |||
| 2444 | /* Record the last 100 characters stored | 2449 | /* Record the last 100 characters stored |
| 2445 | to help debug the loss-of-chars-during-GC problem. */ | 2450 | to help debug the loss-of-chars-during-GC problem. */ |
| 2446 | int temp_index; | 2451 | int temp_index; |
| @@ -2562,18 +2567,65 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 2562 | } | 2567 | } |
| 2563 | break; | 2568 | break; |
| 2564 | 2569 | ||
| 2570 | #ifdef NEW_SELECTIONS | ||
| 2571 | case SelectionNotify: | ||
| 2572 | x_handle_selection_notify (&event); | ||
| 2573 | break; | ||
| 2574 | #endif | ||
| 2575 | |||
| 2565 | case SelectionClear: /* Someone has grabbed ownership. */ | 2576 | case SelectionClear: /* Someone has grabbed ownership. */ |
| 2577 | #ifdef NEW_SELECTIONS | ||
| 2578 | { | ||
| 2579 | XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event; | ||
| 2580 | |||
| 2581 | if (numchars == 0) | ||
| 2582 | abort (); | ||
| 2583 | |||
| 2584 | bufp->kind = selection_clear_event; | ||
| 2585 | SELECTION_EVENT_DISPLAY (bufp) = eventp->display; | ||
| 2586 | SELECTION_EVENT_SELECTION (bufp) = eventp->selection; | ||
| 2587 | SELECTION_EVENT_TIME (bufp) = eventp->time; | ||
| 2588 | bufp++; | ||
| 2589 | |||
| 2590 | count += 1; | ||
| 2591 | numchars -= 1; | ||
| 2592 | } | ||
| 2593 | #else | ||
| 2566 | x_disown_selection (event.xselectionclear.window, | 2594 | x_disown_selection (event.xselectionclear.window, |
| 2567 | event.xselectionclear.selection, | 2595 | event.xselectionclear.selection, |
| 2568 | event.xselectionclear.time); | 2596 | event.xselectionclear.time); |
| 2597 | #endif | ||
| 2569 | break; | 2598 | break; |
| 2570 | 2599 | ||
| 2571 | case SelectionRequest: /* Someone wants our selection. */ | 2600 | case SelectionRequest: /* Someone wants our selection. */ |
| 2601 | #ifdef NEW_SELECTIONS | ||
| 2602 | { | ||
| 2603 | XSelectionRequestEvent *eventp = (XSelectionRequestEvent *) &event; | ||
| 2604 | |||
| 2605 | if (numchars == 0) | ||
| 2606 | abort (); | ||
| 2607 | |||
| 2608 | bufp->kind = selection_request_event; | ||
| 2609 | SELECTION_EVENT_DISPLAY (bufp) = eventp->display; | ||
| 2610 | SELECTION_EVENT_REQUESTOR (bufp) = eventp->requestor; | ||
| 2611 | SELECTION_EVENT_SELECTION (bufp) = eventp->selection; | ||
| 2612 | SELECTION_EVENT_TARGET (bufp) = eventp->target; | ||
| 2613 | SELECTION_EVENT_PROPERTY (bufp) = eventp->property; | ||
| 2614 | SELECTION_EVENT_TIME (bufp) = eventp->time; | ||
| 2615 | bufp++; | ||
| 2616 | |||
| 2617 | count += 1; | ||
| 2618 | numchars -= 1; | ||
| 2619 | } | ||
| 2620 | #else | ||
| 2572 | x_answer_selection_request (event); | 2621 | x_answer_selection_request (event); |
| 2622 | #endif | ||
| 2573 | break; | 2623 | break; |
| 2574 | 2624 | ||
| 2575 | case PropertyNotify: | 2625 | case PropertyNotify: |
| 2576 | 2626 | #ifdef NEW_SELECTIONS | |
| 2627 | x_handle_property_notify (&event); | ||
| 2628 | #else | ||
| 2577 | /* If we're being told about a root window property, then it's | 2629 | /* If we're being told about a root window property, then it's |
| 2578 | a cut buffer change. */ | 2630 | a cut buffer change. */ |
| 2579 | if (event.xproperty.window == ROOT_WINDOW) | 2631 | if (event.xproperty.window == ROOT_WINDOW) |
| @@ -2587,6 +2639,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 2587 | about re-selecting. */ | 2639 | about re-selecting. */ |
| 2588 | x_send_incremental (event); | 2640 | x_send_incremental (event); |
| 2589 | } | 2641 | } |
| 2642 | #endif | ||
| 2590 | break; | 2643 | break; |
| 2591 | 2644 | ||
| 2592 | case Expose: | 2645 | case Expose: |
| @@ -4155,9 +4208,6 @@ x_make_frame_invisible (f) | |||
| 4155 | UNBLOCK_INPUT; | 4208 | UNBLOCK_INPUT; |
| 4156 | } | 4209 | } |
| 4157 | 4210 | ||
| 4158 | /* Window manager communication. Created in Fx_open_connection. */ | ||
| 4159 | extern Atom Xatom_wm_change_state; | ||
| 4160 | |||
| 4161 | /* Change window state from mapped to iconified. */ | 4211 | /* Change window state from mapped to iconified. */ |
| 4162 | 4212 | ||
| 4163 | x_iconify_frame (f) | 4213 | x_iconify_frame (f) |
| @@ -4495,12 +4545,14 @@ x_term_init (display_name) | |||
| 4495 | x_find_modifier_meanings (); | 4545 | x_find_modifier_meanings (); |
| 4496 | 4546 | ||
| 4497 | /* Get the scroll bar cursor. */ | 4547 | /* Get the scroll bar cursor. */ |
| 4498 | x_vertical_scroll_bar_cursor = | 4548 | x_vertical_scroll_bar_cursor |
| 4499 | XCreateFontCursor (x_current_display, XC_sb_v_double_arrow); | 4549 | = XCreateFontCursor (x_current_display, XC_sb_v_double_arrow); |
| 4500 | 4550 | ||
| 4551 | #if 0 | ||
| 4501 | /* Watch for PropertyNotify events on the root window; we use them | 4552 | /* Watch for PropertyNotify events on the root window; we use them |
| 4502 | to figure out when to invalidate our cache of the cut buffers. */ | 4553 | to figure out when to invalidate our cache of the cut buffers. */ |
| 4503 | x_watch_cut_buffer_cache (); | 4554 | x_watch_cut_buffer_cache (); |
| 4555 | #endif | ||
| 4504 | 4556 | ||
| 4505 | dup2 (ConnectionNumber (x_current_display), 0); | 4557 | dup2 (ConnectionNumber (x_current_display), 0); |
| 4506 | 4558 | ||