summaryrefslogtreecommitdiff
path: root/src/xterm.c
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2009-07-03 11:07:02 +0000
committerJan Djärv <jan.h.d@swipnet.se>2009-07-03 11:07:02 +0000
commite044e4fcd50c4db40c9efb40dd395bace59f287b (patch)
treeb5bae9d80138aba8501ad0d4cbb56cce5492dd09 /src/xterm.c
parent2e9b968b289df9e1237d21253c8057789fb33808 (diff)
downloademacs-e044e4fcd50c4db40c9efb40dd395bace59f287b.tar.gz
* 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.c27
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)
#endif /* defined (HAVE_TIMEVAL) && defined (HAVE_SELECT) */
+static void
+XTtoggle_invisible_pointer (f, invisible)
+ FRAME_PTR f;
+ int invisible;
+{
+ BLOCK_INPUT;
+ if (invisible)
+ {
+ if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor != 0)
+ XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ FRAME_X_DISPLAY_INFO (f)->invisible_cursor);
+ }
+ else
+ XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ f->output_data.x->current_cursor);
+ UNBLOCK_INPUT;
+}
+
+
/* Make audible bell. */
void
@@ -4568,7 +4587,7 @@ x_create_toolkit_scroll_bar (f, bar)
/* Set the cursor to an arrow. I didn't find a resource to do that.
And I'm wondering why it hasn't an arrow cursor by default. */
XDefineCursor (XtDisplay (widget), XtWindow (widget),
- f->output_data.x->nontext_cursor);
+ f->output_data.x->nontext_cursor);
#else /* !USE_MOTIF i.e. use Xaw */
@@ -7344,7 +7363,10 @@ x_define_frame_cursor (f, cursor)
struct frame *f;
Cursor cursor;
{
- XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor);
+ if (!f->pointer_invisible
+ && f->output_data.x->current_cursor != cursor)
+ XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor);
+ f->output_data.x->current_cursor = cursor;
}
@@ -10657,6 +10679,7 @@ x_create_terminal (struct x_display_info *dpyinfo)
terminal->ins_del_lines_hook = x_ins_del_lines;
terminal->delete_glyphs_hook = x_delete_glyphs;
terminal->ring_bell_hook = XTring_bell;
+ terminal->toggle_invisible_pointer_hook = XTtoggle_invisible_pointer;
terminal->reset_terminal_modes_hook = XTreset_terminal_modes;
terminal->set_terminal_modes_hook = XTset_terminal_modes;
terminal->update_begin_hook = x_update_begin;