]> code.delx.au - gnu-emacs/blobdiff - src/w32term.c
* cl-generic.el (cl-defmethod): Make docstring dynamic
[gnu-emacs] / src / w32term.c
index c16c8f4eecc1a80aa630243631122b4cb47307a9..8c2fdaf0f59f1e7523f3c3541a56fc5ae8408db0 100644 (file)
@@ -611,7 +611,7 @@ w32_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
   r.bottom = y1;
 
   hdc = get_frame_dc (f);
-  face = FACE_OPT_FROM_ID (f, VERTICAL_BORDER_FACE_ID);
+  face = FACE_FROM_ID_OR_NULL (f, VERTICAL_BORDER_FACE_ID);
   if (face)
     w32_fill_rect (f, hdc, face->foreground, &r);
   else
@@ -628,11 +628,11 @@ w32_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1)
 {
   struct frame *f = XFRAME (WINDOW_FRAME (w));
   HDC hdc = get_frame_dc (f);
-  struct face *face = FACE_OPT_FROM_ID (f, WINDOW_DIVIDER_FACE_ID);
+  struct face *face = FACE_FROM_ID_OR_NULL (f, WINDOW_DIVIDER_FACE_ID);
   struct face *face_first
-    = FACE_OPT_FROM_ID (f, WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID);
+    = FACE_FROM_ID_OR_NULL (f, WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID);
   struct face *face_last
-    = FACE_OPT_FROM_ID (f, WINDOW_DIVIDER_LAST_PIXEL_FACE_ID);
+    = FACE_FROM_ID_OR_NULL (f, WINDOW_DIVIDER_LAST_PIXEL_FACE_ID);
   unsigned long color = face ? face->foreground : FRAME_FOREGROUND_PIXEL (f);
   unsigned long color_first = (face_first
                               ? face_first->foreground
@@ -991,7 +991,7 @@ x_set_mouse_face_gc (struct glyph_string *s)
 
   /* What face has to be used last for the mouse face?  */
   face_id = MOUSE_HL_INFO (s->f)->mouse_face_face_id;
-  face = FACE_OPT_FROM_ID (s->f, face_id);
+  face = FACE_FROM_ID_OR_NULL (s->f, face_id);
   if (face == NULL)
     face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
 
@@ -1434,7 +1434,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
        {
          sprintf ((char *) buf, "%0*X",
                   glyph->u.glyphless.ch < 0x10000 ? 4 : 6,
-                  glyph->u.glyphless.ch);
+                  (unsigned int) glyph->u.glyphless.ch);
          str = buf;
        }
 
@@ -4198,6 +4198,7 @@ w32_scroll_bar_handle_click (struct scroll_bar *bar, W32Msg *msg,
       y = si.nPos;
 
     bar->dragging = 0;
+    struct frame *f;           /* Value is not used.  */
     FRAME_DISPLAY_INFO (f)->last_mouse_scroll_bar_pos = msg->msg.wParam;
 
     switch (sb_event)
@@ -4313,6 +4314,7 @@ w32_horizontal_scroll_bar_handle_click (struct scroll_bar *bar, W32Msg *msg,
     y = si.nMax - si.nPage;
 
     bar->dragging = 0;
+    struct frame *f;           /* Value is not used.  */
     FRAME_DISPLAY_INFO (f)->last_mouse_scroll_bar_pos = msg->msg.wParam;
 
     switch (sb_event)
@@ -5022,11 +5024,10 @@ w32_read_socket (struct terminal *terminal,
          /* wParam non-zero means Window is about to be shown, 0 means
             about to be hidden.  */
          /* Redo the mouse-highlight after the tooltip has gone.  */
-         if (!msg.msg.wParam && msg.msg.hwnd == tip_window)
-           {
-             tip_window = NULL;
-             x_redo_mouse_highlight (dpyinfo);
-           }
+         if (!msg.msg.wParam
+             && dpyinfo->w32_tooltip_frame
+             && FRAME_W32_WINDOW (dpyinfo->w32_tooltip_frame) == msg.msg.hwnd)
+           x_redo_mouse_highlight (dpyinfo);
 
          /* If window has been obscured or exposed by another window
             being maximized or minimized/restored, then recheck
@@ -5392,7 +5393,7 @@ w32_read_socket (struct terminal *terminal,
        struct frame *f = XFRAME (frame);
        /* The tooltip has been drawn already.  Avoid the
           SET_FRAME_GARBAGED below.  */
-       if (EQ (frame, tip_frame))
+       if (FRAME_TOOLTIP_P (f))
          continue;
 
        /* Check "visible" frames and mark each as obscured or not.
@@ -5869,7 +5870,7 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
       /* Don't change the size of a tip frame; there's no point in
         doing it because it's done in Fx_show_tip, and it leads to
         problems because the tip frame has no widget.  */
-      if (NILP (tip_frame) || XFRAME (tip_frame) != f)
+      if (!FRAME_TOOLTIP_P (f))
        adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
                           FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3,
                           false, Qfont);
@@ -6567,6 +6568,8 @@ x_free_frame_resources (struct frame *f)
     dpyinfo->w32_focus_event_frame = 0;
   if (f == dpyinfo->x_highlight_frame)
     dpyinfo->x_highlight_frame = 0;
+  if (f == dpyinfo->w32_tooltip_frame)
+    dpyinfo->w32_tooltip_frame = 0;
   if (f == hlinfo->mouse_face_mouse_frame)
     reset_mouse_highlight (hlinfo);