Commit 9b378208 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(x_set_mouse_pixel_position): New function.

parent 152e6c70
...@@ -5258,16 +5258,13 @@ x_set_resize_hint (f) ...@@ -5258,16 +5258,13 @@ x_set_resize_hint (f)
/* Mouse warping, focus shifting, raising and lowering. */ /* Mouse warping, focus shifting, raising and lowering. */
void
x_set_mouse_position (f, x, y) x_set_mouse_position (f, x, y)
struct frame *f; struct frame *f;
int x, y; int x, y;
{ {
int pix_x, pix_y; int pix_x, pix_y;
#if 0 /* Let the user ask for this if he wants it. */
x_raise_frame (f);
#endif
pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->display.x->font) / 2; pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->display.x->font) / 2;
pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->display.x->line_height / 2; pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->display.x->line_height / 2;
...@@ -5283,6 +5280,19 @@ x_set_mouse_position (f, x, y) ...@@ -5283,6 +5280,19 @@ x_set_mouse_position (f, x, y)
UNBLOCK_INPUT; UNBLOCK_INPUT;
} }
/* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F. */
void
x_set_mouse_pixel_position (f, pix_x, pix_y)
struct frame *f;
int pix_x, pix_y;
{
BLOCK_INPUT;
XWarpMousePointer (FRAME_X_WINDOW (f), pix_x, pix_y);
UNBLOCK_INPUT;
}
#ifdef HAVE_X11 #ifdef HAVE_X11
x_focus_on_frame (f) x_focus_on_frame (f)
struct frame *f; struct frame *f;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment