BLOCK_INPUT;
+ curs_x = FRAME_CURSOR_X (f);
+ curs_y = FRAME_CURSOR_Y (f);
+
if (f == FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_frame)
{
/* Don't do highlighting for mouse motion during the update. */
BLOCK_INPUT;
do_line_dance ();
- x_display_cursor (f, 1);
+ x_display_cursor (f, 1, curs_x, curs_y);
if (f == FRAME_X_DISPLAY_INFO (f)->mouse_face_mouse_frame)
FRAME_X_DISPLAY_INFO (f)->mouse_face_defer = 0;
if (updating_frame == 0)
{
BLOCK_INPUT;
- x_display_cursor (selected_frame, 1);
+ x_display_cursor (selected_frame, 1, curs_x, curs_y);
XFlush (FRAME_X_DISPLAY (selected_frame));
UNBLOCK_INPUT;
}
f->phys_cursor_x = -1;
if (updating_frame == 0)
- {
- f->cursor_x += len;
- x_display_cursor (f, 1);
- f->cursor_x -= len;
- }
+ x_display_cursor (f, 1, FRAME_CURSOR_X (f) + len, FRAME_CURSOR_Y (f));
else
curs_x += len;
ht = f->height;
intborder = f->output_data.x->internal_border_width;
- x_display_cursor (updating_frame, 0);
+ x_update_cursor (updating_frame, 0);
for (i = 0; i < ht; ++i)
if (line_dance[i] != -1 && (distance = line_dance[i]-i) > 0)
/* Turn the cursor on if we turned it off. */
if (cursor_cleared)
- x_display_cursor (f, 1);
+ x_update_cursor (f, 1);
}
\f
static void
FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
int i;
int cursor_off = 0;
- int old_curs_x = curs_x;
- int old_curs_y = curs_y;
-
- /* Set these variables temporarily
- so that if we have to turn the cursor off and on again
- we will put it back at the same place. */
- curs_x = f->phys_cursor_x;
- curs_y = f->phys_cursor_y;
for (i = FRAME_X_DISPLAY_INFO (f)->mouse_face_beg_row;
i <= FRAME_X_DISPLAY_INFO (f)->mouse_face_end_row; i++)
&& curs_x >= column - 1
&& curs_x <= endcolumn)
{
- x_display_cursor (f, 0);
+ x_update_cursor (f, 0);
cursor_off = 1;
}
/* If we turned the cursor off, turn it back on. */
if (cursor_off)
- x_display_cursor (f, 1);
-
- curs_x = old_curs_x;
- curs_y = old_curs_y;
+ x_update_cursor (f, 1);
/* Change the mouse cursor according to the value of HL. */
if (hl > 0)
XNextEvent (dpyinfo->display, &event);
#endif
#ifdef HAVE_X_I18N
- /* The necessity of the following line took me
- a full work-day to decipher from the docs!! */
- if (FRAME_XIC (f) && XFilterEvent (&event, None))
- break;
+ {
+ struct frame *f1 = x_any_window_to_frame (dpyinfo,
+ &event.xclient.window);
+ /* The necessity of the following line took me
+ a full work-day to decipher from the docs!! */
+ if (f1 != 0 && FRAME_XIC (f1) && XFilterEvent (&event, None))
+ break;
+ }
#endif
event_found = 1;
|| f->phys_cursor_x < 0)
return;
- x_display_cursor (f, 0);
+ x_update_cursor (f, 0);
f->phys_cursor_x = -1;
}
}
/* Display the cursor on frame F, or clear it, according to ON.
- Use the position specified by curs_x and curs_y
- if we are doing an update of frame F now.
- Otherwise use the position in the FRAME_CURSOR_X and FRAME_CURSOR_Y fields
- of F. */
+ Also set the frame's cursor position to X and Y. */
-x_display_cursor (f, on)
+x_display_cursor (f, on, x, y)
struct frame *f;
int on;
+ int x, y;
{
BLOCK_INPUT;
- /* If we're not updating, then don't change the physical cursor
- position. Just change (if appropriate) the style of display. */
- if (f != updating_frame)
- {
- curs_x = FRAME_CURSOR_X (f);
- curs_y = FRAME_CURSOR_Y (f);
- }
-
if (FRAME_DESIRED_CURSOR (f) == filled_box_cursor)
- x_display_box_cursor (f, on, curs_x, curs_y);
+ x_display_box_cursor (f, on, x, y);
else if (FRAME_DESIRED_CURSOR (f) == bar_cursor)
- x_display_bar_cursor (f, on, curs_x, curs_y);
+ x_display_bar_cursor (f, on, x, y);
else
/* Those are the only two we have implemented! */
abort ();