9604 |
and speech synthesizers can follow the cursor. */ |
and speech synthesizers can follow the cursor. */ |
9605 |
if (active_cursor) |
if (active_cursor) |
9606 |
{ |
{ |
|
HWND hwnd = FRAME_W32_WINDOW (f); |
|
|
|
|
9607 |
struct glyph * cursor_glyph = get_phys_cursor_glyph (w); |
struct glyph * cursor_glyph = get_phys_cursor_glyph (w); |
9608 |
int caret_width = cursor_glyph->pixel_width; |
if (cursor_glyph) |
9609 |
w32_system_caret_x |
{ |
9610 |
= WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); |
HWND hwnd = FRAME_W32_WINDOW (f); |
9611 |
w32_system_caret_y |
int caret_width = cursor_glyph->pixel_width; |
9612 |
= (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y) |
w32_system_caret_x |
9613 |
+ glyph_row->ascent - w->phys_cursor_ascent); |
= 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 |
/* If the size of the active cursor changed, destroy the old |
9619 |
system caret. */ |
system caret. */ |
9620 |
if (w32_system_caret_hwnd |
if (w32_system_caret_hwnd |
9621 |
&& (w32_system_caret_height != w->phys_cursor_height |
&& (w32_system_caret_height != w->phys_cursor_height |
9622 |
|| w32_system_caret_width != caret_width)) |
|| w32_system_caret_width != caret_width)) |
9623 |
PostMessage (hwnd, WM_EMACS_DESTROY_CARET, NULL, NULL); |
PostMessage (hwnd, WM_EMACS_DESTROY_CARET, NULL, NULL); |
9624 |
|
|
9625 |
if (!w32_system_caret_hwnd) |
if (!w32_system_caret_hwnd) |
9626 |
{ |
{ |
9627 |
w32_system_caret_height = w->phys_cursor_height; |
w32_system_caret_height = w->phys_cursor_height; |
9628 |
w32_system_caret_width = caret_width; |
w32_system_caret_width = caret_width; |
9629 |
} |
} |
9630 |
|
|
9631 |
/* Move the system caret. */ |
/* Move the system caret. */ |
9632 |
PostMessage (hwnd, WM_EMACS_TRACK_CARET, NULL, NULL); |
PostMessage (hwnd, WM_EMACS_TRACK_CARET, NULL, NULL); |
9633 |
|
} |
9634 |
} |
} |
9635 |
|
|
9636 |
switch (new_cursor_type) |
switch (new_cursor_type) |