diff options
| author | Jan Djärv | 2009-07-03 11:07:02 +0000 |
|---|---|---|
| committer | Jan Djärv | 2009-07-03 11:07:02 +0000 |
| commit | e044e4fcd50c4db40c9efb40dd395bace59f287b (patch) | |
| tree | b5bae9d80138aba8501ad0d4cbb56cce5492dd09 /src/xterm.c | |
| parent | 2e9b968b289df9e1237d21253c8057789fb33808 (diff) | |
| download | emacs-e044e4fcd50c4db40c9efb40dd395bace59f287b.tar.gz emacs-e044e4fcd50c4db40c9efb40dd395bace59f287b.zip | |
* xterm.h (struct x_display_info): Add invisible_cursor.
(struct x_output): Add current_cursor.
* xterm.c (XTtoggle_invisible_pointer): New function.
(x_define_frame_cursor): Don't define cursor if invisible or the
same as before. Set current_cursor.
(x_create_terminal): Set toggle_invisible_pointer_hook.
* xfns.c (make_invisible_cursor): New function.
(x_set_mouse_color): Call make_invisible_cursor.
Set current_cursor.
(x_window): Set current_cursor.
* termhooks.h (struct terminal): Add toggle_invisible_pointer_hook.
* keyboard.c (command_loop_1): Call frame_make_pointer_invisible after
inserting a character.
(read_avail_input): Call frame_make_pointer_visible.
* frame.c (Vmake_pointer_invisible): New variable.
(frame_make_pointer_invisible, frame_make_pointer_visible): New
functions.
(syms_of_frame): DEFVAR make-pointer-invisible, initialize to Qt.
* frame.h: Declare frame_make_pointer_invisible and
frame_make_pointer_visible.
(struct frame): Add pointer_invisible.
* cus-start.el (all): Added make-pointer-invisible.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c index 77dc48f9a64..c034faaec2e 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -3128,6 +3128,25 @@ XTflash (f) | |||
| 3128 | #endif /* defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) */ | 3128 | #endif /* defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) */ |
| 3129 | 3129 | ||
| 3130 | 3130 | ||
| 3131 | static void | ||
| 3132 | XTtoggle_invisible_pointer (f, invisible) | ||
| 3133 | FRAME_PTR f; | ||
| 3134 | int invisible; | ||
| 3135 | { | ||
| 3136 | BLOCK_INPUT; | ||
| 3137 | if (invisible) | ||
| 3138 | { | ||
| 3139 | if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor != 0) | ||
| 3140 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | ||
| 3141 | FRAME_X_DISPLAY_INFO (f)->invisible_cursor); | ||
| 3142 | } | ||
| 3143 | else | ||
| 3144 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | ||
| 3145 | f->output_data.x->current_cursor); | ||
| 3146 | UNBLOCK_INPUT; | ||
| 3147 | } | ||
| 3148 | |||
| 3149 | |||
| 3131 | /* Make audible bell. */ | 3150 | /* Make audible bell. */ |
| 3132 | 3151 | ||
| 3133 | void | 3152 | void |
| @@ -4568,7 +4587,7 @@ x_create_toolkit_scroll_bar (f, bar) | |||
| 4568 | /* Set the cursor to an arrow. I didn't find a resource to do that. | 4587 | /* Set the cursor to an arrow. I didn't find a resource to do that. |
| 4569 | And I'm wondering why it hasn't an arrow cursor by default. */ | 4588 | And I'm wondering why it hasn't an arrow cursor by default. */ |
| 4570 | XDefineCursor (XtDisplay (widget), XtWindow (widget), | 4589 | XDefineCursor (XtDisplay (widget), XtWindow (widget), |
| 4571 | f->output_data.x->nontext_cursor); | 4590 | f->output_data.x->nontext_cursor); |
| 4572 | 4591 | ||
| 4573 | #else /* !USE_MOTIF i.e. use Xaw */ | 4592 | #else /* !USE_MOTIF i.e. use Xaw */ |
| 4574 | 4593 | ||
| @@ -7344,7 +7363,10 @@ x_define_frame_cursor (f, cursor) | |||
| 7344 | struct frame *f; | 7363 | struct frame *f; |
| 7345 | Cursor cursor; | 7364 | Cursor cursor; |
| 7346 | { | 7365 | { |
| 7347 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); | 7366 | if (!f->pointer_invisible |
| 7367 | && f->output_data.x->current_cursor != cursor) | ||
| 7368 | XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor); | ||
| 7369 | f->output_data.x->current_cursor = cursor; | ||
| 7348 | } | 7370 | } |
| 7349 | 7371 | ||
| 7350 | 7372 | ||
| @@ -10657,6 +10679,7 @@ x_create_terminal (struct x_display_info *dpyinfo) | |||
| 10657 | terminal->ins_del_lines_hook = x_ins_del_lines; | 10679 | terminal->ins_del_lines_hook = x_ins_del_lines; |
| 10658 | terminal->delete_glyphs_hook = x_delete_glyphs; | 10680 | terminal->delete_glyphs_hook = x_delete_glyphs; |
| 10659 | terminal->ring_bell_hook = XTring_bell; | 10681 | terminal->ring_bell_hook = XTring_bell; |
| 10682 | terminal->toggle_invisible_pointer_hook = XTtoggle_invisible_pointer; | ||
| 10660 | terminal->reset_terminal_modes_hook = XTreset_terminal_modes; | 10683 | terminal->reset_terminal_modes_hook = XTreset_terminal_modes; |
| 10661 | terminal->set_terminal_modes_hook = XTset_terminal_modes; | 10684 | terminal->set_terminal_modes_hook = XTset_terminal_modes; |
| 10662 | terminal->update_begin_hook = x_update_begin; | 10685 | terminal->update_begin_hook = x_update_begin; |