comparison src/w32term.c @ 40816:46a04c76845c

(x_display_and_set_cursor): Do not move system caret if cursor_glyph is NULL.
author Jason Rumney <jasonr@gnu.org>
date Wed, 07 Nov 2001 21:11:00 +0000
parents 205f4498ca85
children f66d09d1bb2f
comparison
equal deleted inserted replaced
40815:18a8015d9546 40816:46a04c76845c
9602 /* If this is the active cursor, we need to track it with the 9602 /* If this is the active cursor, we need to track it with the
9603 system caret, so third party software like screen magnifiers 9603 system caret, so third party software like screen magnifiers
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;
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 }
9630
9631 /* Move the system caret. */
9632 PostMessage (hwnd, WM_EMACS_TRACK_CARET, NULL, NULL);
9628 } 9633 }
9629
9630 /* Move the system caret. */
9631 PostMessage (hwnd, WM_EMACS_TRACK_CARET, NULL, NULL);
9632 } 9634 }
9633 9635
9634 switch (new_cursor_type) 9636 switch (new_cursor_type)
9635 { 9637 {
9636 case HOLLOW_BOX_CURSOR: 9638 case HOLLOW_BOX_CURSOR: