diff options
| author | Richard M. Stallman | 1994-04-22 21:46:12 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-22 21:46:12 +0000 |
| commit | 9b378208db34b4af0ec0dc0eee5dbb66e1fbf5ae (patch) | |
| tree | 3496bc29460d65524360cace21ee2dd241a8f736 | |
| parent | 152e6c70336858449fc6fc36aea767ac38feb1d2 (diff) | |
| download | emacs-9b378208db34b4af0ec0dc0eee5dbb66e1fbf5ae.tar.gz emacs-9b378208db34b4af0ec0dc0eee5dbb66e1fbf5ae.zip | |
(x_set_mouse_pixel_position): New function.
| -rw-r--r-- | src/xterm.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/xterm.c b/src/xterm.c index 7177d826a8f..1fdeab0b1cc 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -5258,16 +5258,13 @@ x_set_resize_hint (f) | |||
| 5258 | 5258 | ||
| 5259 | /* Mouse warping, focus shifting, raising and lowering. */ | 5259 | /* Mouse warping, focus shifting, raising and lowering. */ |
| 5260 | 5260 | ||
| 5261 | void | ||
| 5261 | x_set_mouse_position (f, x, y) | 5262 | x_set_mouse_position (f, x, y) |
| 5262 | struct frame *f; | 5263 | struct frame *f; |
| 5263 | int x, y; | 5264 | int x, y; |
| 5264 | { | 5265 | { |
| 5265 | int pix_x, pix_y; | 5266 | int pix_x, pix_y; |
| 5266 | 5267 | ||
| 5267 | #if 0 /* Let the user ask for this if he wants it. */ | ||
| 5268 | x_raise_frame (f); | ||
| 5269 | #endif | ||
| 5270 | |||
| 5271 | pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->display.x->font) / 2; | 5268 | pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->display.x->font) / 2; |
| 5272 | pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->display.x->line_height / 2; | 5269 | pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->display.x->line_height / 2; |
| 5273 | 5270 | ||
| @@ -5283,6 +5280,19 @@ x_set_mouse_position (f, x, y) | |||
| 5283 | UNBLOCK_INPUT; | 5280 | UNBLOCK_INPUT; |
| 5284 | } | 5281 | } |
| 5285 | 5282 | ||
| 5283 | /* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F. */ | ||
| 5284 | |||
| 5285 | void | ||
| 5286 | x_set_mouse_pixel_position (f, pix_x, pix_y) | ||
| 5287 | struct frame *f; | ||
| 5288 | int pix_x, pix_y; | ||
| 5289 | { | ||
| 5290 | BLOCK_INPUT; | ||
| 5291 | |||
| 5292 | XWarpMousePointer (FRAME_X_WINDOW (f), pix_x, pix_y); | ||
| 5293 | UNBLOCK_INPUT; | ||
| 5294 | } | ||
| 5295 | |||
| 5286 | #ifdef HAVE_X11 | 5296 | #ifdef HAVE_X11 |
| 5287 | x_focus_on_frame (f) | 5297 | x_focus_on_frame (f) |
| 5288 | struct frame *f; | 5298 | struct frame *f; |