diff options
| author | Jason Rumney | 2001-11-07 21:11:00 +0000 |
|---|---|---|
| committer | Jason Rumney | 2001-11-07 21:11:00 +0000 |
| commit | 1f41b196a34a1381ed8be9640bd04dc715a58be6 (patch) | |
| tree | 16ce01919836d89e4535d72da4c50cecce1ec041 /src | |
| parent | 8cce89168563d23297c2821d501f1a68e23d4c87 (diff) | |
| download | emacs-1f41b196a34a1381ed8be9640bd04dc715a58be6.tar.gz emacs-1f41b196a34a1381ed8be9640bd04dc715a58be6.zip | |
(x_display_and_set_cursor): Do not move system caret
if cursor_glyph is NULL.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32term.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/src/w32term.c b/src/w32term.c index 7a5185820a1..1c6b35f14aa 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -9604,31 +9604,33 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 9604 | and speech synthesizers can follow the cursor. */ | 9604 | and speech synthesizers can follow the cursor. */ |
| 9605 | if (active_cursor) | 9605 | if (active_cursor) |
| 9606 | { | 9606 | { |
| 9607 | HWND hwnd = FRAME_W32_WINDOW (f); | ||
| 9608 | |||
| 9609 | struct glyph * cursor_glyph = get_phys_cursor_glyph (w); | 9607 | struct glyph * cursor_glyph = get_phys_cursor_glyph (w); |
| 9610 | int caret_width = cursor_glyph->pixel_width; | 9608 | if (cursor_glyph) |
| 9611 | w32_system_caret_x | ||
| 9612 | = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); | ||
| 9613 | w32_system_caret_y | ||
| 9614 | = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y) | ||
| 9615 | + glyph_row->ascent - w->phys_cursor_ascent); | ||
| 9616 | |||
| 9617 | /* If the size of the active cursor changed, destroy the old | ||
| 9618 | system caret. */ | ||
| 9619 | if (w32_system_caret_hwnd | ||
| 9620 | && (w32_system_caret_height != w->phys_cursor_height | ||
| 9621 | || w32_system_caret_width != caret_width)) | ||
| 9622 | PostMessage (hwnd, WM_EMACS_DESTROY_CARET, NULL, NULL); | ||
| 9623 | |||
| 9624 | if (!w32_system_caret_hwnd) | ||
| 9625 | { | 9609 | { |
| 9626 | w32_system_caret_height = w->phys_cursor_height; | 9610 | HWND hwnd = FRAME_W32_WINDOW (f); |
| 9627 | w32_system_caret_width = caret_width; | 9611 | int caret_width = cursor_glyph->pixel_width; |
| 9628 | } | 9612 | w32_system_caret_x |
| 9613 | = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); | ||
| 9614 | w32_system_caret_y | ||
| 9615 | = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y) | ||
| 9616 | + glyph_row->ascent - w->phys_cursor_ascent); | ||
| 9617 | |||
| 9618 | /* If the size of the active cursor changed, destroy the old | ||
| 9619 | system caret. */ | ||
| 9620 | if (w32_system_caret_hwnd | ||
| 9621 | && (w32_system_caret_height != w->phys_cursor_height | ||
| 9622 | || w32_system_caret_width != caret_width)) | ||
| 9623 | PostMessage (hwnd, WM_EMACS_DESTROY_CARET, NULL, NULL); | ||
| 9624 | |||
| 9625 | if (!w32_system_caret_hwnd) | ||
| 9626 | { | ||
| 9627 | w32_system_caret_height = w->phys_cursor_height; | ||
| 9628 | w32_system_caret_width = caret_width; | ||
| 9629 | } | ||
| 9629 | 9630 | ||
| 9630 | /* Move the system caret. */ | 9631 | /* Move the system caret. */ |
| 9631 | PostMessage (hwnd, WM_EMACS_TRACK_CARET, NULL, NULL); | 9632 | PostMessage (hwnd, WM_EMACS_TRACK_CARET, NULL, NULL); |
| 9633 | } | ||
| 9632 | } | 9634 | } |
| 9633 | 9635 | ||
| 9634 | switch (new_cursor_type) | 9636 | switch (new_cursor_type) |