]> git.eshelyaron.com Git - emacs.git/commitdiff
(x_display_and_set_cursor): Do not move system caret
authorJason Rumney <jasonr@gnu.org>
Wed, 7 Nov 2001 21:11:00 +0000 (21:11 +0000)
committerJason Rumney <jasonr@gnu.org>
Wed, 7 Nov 2001 21:11:00 +0000 (21:11 +0000)
if cursor_glyph is NULL.

src/w32term.c

index 7a5185820a1e11e1902396e2bc27b8844cfb96b9..1c6b35f14aafc4bc6b51587c31cd637f2c34b1d4 100644 (file)
@@ -9604,31 +9604,33 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
         and speech synthesizers can follow the cursor.  */
       if (active_cursor)
        {
-         HWND hwnd = FRAME_W32_WINDOW (f);
-
          struct glyph * cursor_glyph = get_phys_cursor_glyph (w);
-         int caret_width = cursor_glyph->pixel_width;
-         w32_system_caret_x
-           = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
-         w32_system_caret_y
-           = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y)
-              + glyph_row->ascent - w->phys_cursor_ascent);
-
-         /* If the size of the active cursor changed, destroy the old
-            system caret.  */
-         if (w32_system_caret_hwnd
-             && (w32_system_caret_height != w->phys_cursor_height
-                 || w32_system_caret_width != caret_width))
-           PostMessage (hwnd, WM_EMACS_DESTROY_CARET, NULL, NULL);
-
-         if (!w32_system_caret_hwnd)
+         if (cursor_glyph)
            {
-             w32_system_caret_height = w->phys_cursor_height;
-             w32_system_caret_width = caret_width;
-           }
+             HWND hwnd = FRAME_W32_WINDOW (f);
+             int caret_width = cursor_glyph->pixel_width;
+             w32_system_caret_x
+               = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
+             w32_system_caret_y
+               = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y)
+                  + glyph_row->ascent - w->phys_cursor_ascent);
+
+             /* If the size of the active cursor changed, destroy the old
+                system caret.  */
+             if (w32_system_caret_hwnd
+                 && (w32_system_caret_height != w->phys_cursor_height
+                     || w32_system_caret_width != caret_width))
+               PostMessage (hwnd, WM_EMACS_DESTROY_CARET, NULL, NULL);
+
+             if (!w32_system_caret_hwnd)
+               {
+                 w32_system_caret_height = w->phys_cursor_height;
+                 w32_system_caret_width = caret_width;
+               }
 
-         /* Move the system caret.  */
-         PostMessage (hwnd, WM_EMACS_TRACK_CARET, NULL, NULL);
+             /* Move the system caret.  */
+             PostMessage (hwnd, WM_EMACS_TRACK_CARET, NULL, NULL);
+           }
        }
 
       switch (new_cursor_type)