diff options
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 198 |
1 files changed, 115 insertions, 83 deletions
diff --git a/src/w32term.c b/src/w32term.c index a9afc99b959..95ccafe415b 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -204,7 +204,7 @@ int last_scroll_bar_drag_pos; | |||
| 204 | static RECT last_mouse_glyph; | 204 | static RECT last_mouse_glyph; |
| 205 | static Lisp_Object last_mouse_press_frame; | 205 | static Lisp_Object last_mouse_press_frame; |
| 206 | 206 | ||
| 207 | Lisp_Object Vw32_num_mouse_buttons; | 207 | int w32_num_mouse_buttons; |
| 208 | 208 | ||
| 209 | Lisp_Object Vw32_swap_mouse_buttons; | 209 | Lisp_Object Vw32_swap_mouse_buttons; |
| 210 | 210 | ||
| @@ -1371,7 +1371,8 @@ static void w32_draw_image_foreground_1 P_ ((struct glyph_string *, HBITMAP)); | |||
| 1371 | static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, | 1371 | static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, |
| 1372 | int, int, int)); | 1372 | int, int, int)); |
| 1373 | static void w32_draw_relief_rect P_ ((struct frame *, int, int, int, int, | 1373 | static void w32_draw_relief_rect P_ ((struct frame *, int, int, int, int, |
| 1374 | int, int, int, int, RECT *)); | 1374 | int, int, int, int, int, int, |
| 1375 | RECT *)); | ||
| 1375 | static void w32_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, | 1376 | static void w32_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, |
| 1376 | int, int, int, RECT *)); | 1377 | int, int, int, RECT *)); |
| 1377 | 1378 | ||
| @@ -1952,9 +1953,10 @@ x_setup_relief_colors (s) | |||
| 1952 | 1953 | ||
| 1953 | static void | 1954 | static void |
| 1954 | w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, | 1955 | w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, |
| 1955 | raised_p, left_p, right_p, clip_rect) | 1956 | raised_p, top_p, bot_p, left_p, right_p, clip_rect) |
| 1956 | struct frame *f; | 1957 | struct frame *f; |
| 1957 | int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p; | 1958 | int left_x, top_y, right_x, bottom_y, width; |
| 1959 | int top_p, bot_p, left_p, right_p, raised_p; | ||
| 1958 | RECT *clip_rect; | 1960 | RECT *clip_rect; |
| 1959 | { | 1961 | { |
| 1960 | int i; | 1962 | int i; |
| @@ -1969,10 +1971,11 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, | |||
| 1969 | w32_set_clip_rectangle (hdc, clip_rect); | 1971 | w32_set_clip_rectangle (hdc, clip_rect); |
| 1970 | 1972 | ||
| 1971 | /* Top. */ | 1973 | /* Top. */ |
| 1972 | for (i = 0; i < width; ++i) | 1974 | if (top_p) |
| 1973 | w32_fill_area (f, hdc, gc.foreground, | 1975 | for (i = 0; i < width; ++i) |
| 1974 | left_x + i * left_p, top_y + i, | 1976 | w32_fill_area (f, hdc, gc.foreground, |
| 1975 | right_x - left_x - i * (left_p + right_p ) + 1, 1); | 1977 | left_x + i * left_p, top_y + i, |
| 1978 | right_x - left_x - i * (left_p + right_p ) + 1, 1); | ||
| 1976 | 1979 | ||
| 1977 | /* Left. */ | 1980 | /* Left. */ |
| 1978 | if (left_p) | 1981 | if (left_p) |
| @@ -1987,10 +1990,11 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, | |||
| 1987 | gc.foreground = f->output_data.w32->white_relief.gc->foreground; | 1990 | gc.foreground = f->output_data.w32->white_relief.gc->foreground; |
| 1988 | 1991 | ||
| 1989 | /* Bottom. */ | 1992 | /* Bottom. */ |
| 1990 | for (i = 0; i < width; ++i) | 1993 | if (bot_p) |
| 1991 | w32_fill_area (f, hdc, gc.foreground, | 1994 | for (i = 0; i < width; ++i) |
| 1992 | left_x + i * left_p, bottom_y - i, | 1995 | w32_fill_area (f, hdc, gc.foreground, |
| 1993 | right_x - left_x - i * (left_p + right_p) + 1, 1); | 1996 | left_x + i * left_p, bottom_y - i, |
| 1997 | right_x - left_x - i * (left_p + right_p) + 1, 1); | ||
| 1994 | 1998 | ||
| 1995 | /* Right. */ | 1999 | /* Right. */ |
| 1996 | if (right_p) | 2000 | if (right_p) |
| @@ -2100,7 +2104,7 @@ x_draw_glyph_string_box (s) | |||
| 2100 | { | 2104 | { |
| 2101 | x_setup_relief_colors (s); | 2105 | x_setup_relief_colors (s); |
| 2102 | w32_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, | 2106 | w32_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, |
| 2103 | width, raised_p, left_p, right_p, &clip_rect); | 2107 | width, raised_p, 1, 1, left_p, right_p, &clip_rect); |
| 2104 | } | 2108 | } |
| 2105 | } | 2109 | } |
| 2106 | 2110 | ||
| @@ -2111,21 +2115,22 @@ static void | |||
| 2111 | x_draw_image_foreground (s) | 2115 | x_draw_image_foreground (s) |
| 2112 | struct glyph_string *s; | 2116 | struct glyph_string *s; |
| 2113 | { | 2117 | { |
| 2114 | int x; | 2118 | int x = s->x; |
| 2115 | int y = s->ybase - image_ascent (s->img, s->face); | 2119 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); |
| 2116 | 2120 | ||
| 2117 | /* If first glyph of S has a left box line, start drawing it to the | 2121 | /* If first glyph of S has a left box line, start drawing it to the |
| 2118 | right of that line. */ | 2122 | right of that line. */ |
| 2119 | if (s->face->box != FACE_NO_BOX | 2123 | if (s->face->box != FACE_NO_BOX |
| 2120 | && s->first_glyph->left_box_line_p) | 2124 | && s->first_glyph->left_box_line_p |
| 2121 | x = s->x + abs (s->face->box_line_width); | 2125 | && s->slice.x == 0) |
| 2122 | else | 2126 | x += abs (s->face->box_line_width); |
| 2123 | x = s->x; | ||
| 2124 | 2127 | ||
| 2125 | /* If there is a margin around the image, adjust x- and y-position | 2128 | /* If there is a margin around the image, adjust x- and y-position |
| 2126 | by that margin. */ | 2129 | by that margin. */ |
| 2127 | x += s->img->hmargin; | 2130 | if (s->slice.x == 0) |
| 2128 | y += s->img->vmargin; | 2131 | x += s->img->hmargin; |
| 2132 | if (s->slice.y == 0) | ||
| 2133 | y += s->img->vmargin; | ||
| 2129 | 2134 | ||
| 2130 | SaveDC (s->hdc); | 2135 | SaveDC (s->hdc); |
| 2131 | 2136 | ||
| @@ -2147,12 +2152,12 @@ x_draw_image_foreground (s) | |||
| 2147 | SetTextColor (s->hdc, RGB (255, 255, 255)); | 2152 | SetTextColor (s->hdc, RGB (255, 255, 255)); |
| 2148 | SetBkColor (s->hdc, RGB (0, 0, 0)); | 2153 | SetBkColor (s->hdc, RGB (0, 0, 0)); |
| 2149 | 2154 | ||
| 2150 | BitBlt (s->hdc, x, y, s->img->width, s->img->height, | 2155 | BitBlt (s->hdc, x, y, s->slice.width, s->slice.height, |
| 2151 | compat_hdc, 0, 0, SRCINVERT); | 2156 | compat_hdc, s->slice.x, s->slice.y, SRCINVERT); |
| 2152 | BitBlt (s->hdc, x, y, s->img->width, s->img->height, | 2157 | BitBlt (s->hdc, x, y, s->slice.width, s->slice.height, |
| 2153 | mask_dc, 0, 0, SRCAND); | 2158 | mask_dc, s->slice.x, s->slice.y, SRCAND); |
| 2154 | BitBlt (s->hdc, x, y, s->img->width, s->img->height, | 2159 | BitBlt (s->hdc, x, y, s->slice.width, s->slice.height, |
| 2155 | compat_hdc, 0, 0, SRCINVERT); | 2160 | compat_hdc, s->slice.x, s->slice.y, SRCINVERT); |
| 2156 | 2161 | ||
| 2157 | SelectObject (mask_dc, mask_orig_obj); | 2162 | SelectObject (mask_dc, mask_orig_obj); |
| 2158 | DeleteDC (mask_dc); | 2163 | DeleteDC (mask_dc); |
| @@ -2162,8 +2167,8 @@ x_draw_image_foreground (s) | |||
| 2162 | SetTextColor (s->hdc, s->gc->foreground); | 2167 | SetTextColor (s->hdc, s->gc->foreground); |
| 2163 | SetBkColor (s->hdc, s->gc->background); | 2168 | SetBkColor (s->hdc, s->gc->background); |
| 2164 | 2169 | ||
| 2165 | BitBlt (s->hdc, x, y, s->img->width, s->img->height, | 2170 | BitBlt (s->hdc, x, y, s->slice.width, s->slice.height, |
| 2166 | compat_hdc, 0, 0, SRCCOPY); | 2171 | compat_hdc, s->slice.x, s->slice.y, SRCCOPY); |
| 2167 | 2172 | ||
| 2168 | /* When the image has a mask, we can expect that at | 2173 | /* When the image has a mask, we can expect that at |
| 2169 | least part of a mouse highlight or a block cursor will | 2174 | least part of a mouse highlight or a block cursor will |
| @@ -2176,7 +2181,8 @@ x_draw_image_foreground (s) | |||
| 2176 | int r = s->img->relief; | 2181 | int r = s->img->relief; |
| 2177 | if (r < 0) r = -r; | 2182 | if (r < 0) r = -r; |
| 2178 | w32_draw_rectangle (s->hdc, s->gc, x - r, y - r , | 2183 | w32_draw_rectangle (s->hdc, s->gc, x - r, y - r , |
| 2179 | s->img->width + r*2 - 1, s->img->height + r*2 - 1); | 2184 | s->slice.width + r*2 - 1, |
| 2185 | s->slice.height + r*2 - 1); | ||
| 2180 | } | 2186 | } |
| 2181 | } | 2187 | } |
| 2182 | 2188 | ||
| @@ -2187,8 +2193,8 @@ x_draw_image_foreground (s) | |||
| 2187 | DeleteDC (compat_hdc); | 2193 | DeleteDC (compat_hdc); |
| 2188 | } | 2194 | } |
| 2189 | else | 2195 | else |
| 2190 | w32_draw_rectangle (s->hdc, s->gc, x, y, s->img->width -1, | 2196 | w32_draw_rectangle (s->hdc, s->gc, x, y, |
| 2191 | s->img->height - 1); | 2197 | s->slice.width - 1, s->slice.height - 1); |
| 2192 | 2198 | ||
| 2193 | RestoreDC (s->hdc ,-1); | 2199 | RestoreDC (s->hdc ,-1); |
| 2194 | } | 2200 | } |
| @@ -2203,21 +2209,22 @@ x_draw_image_relief (s) | |||
| 2203 | { | 2209 | { |
| 2204 | int x0, y0, x1, y1, thick, raised_p; | 2210 | int x0, y0, x1, y1, thick, raised_p; |
| 2205 | RECT r; | 2211 | RECT r; |
| 2206 | int x; | 2212 | int x = s->x; |
| 2207 | int y = s->ybase - image_ascent (s->img, s->face); | 2213 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); |
| 2208 | 2214 | ||
| 2209 | /* If first glyph of S has a left box line, start drawing it to the | 2215 | /* If first glyph of S has a left box line, start drawing it to the |
| 2210 | right of that line. */ | 2216 | right of that line. */ |
| 2211 | if (s->face->box != FACE_NO_BOX | 2217 | if (s->face->box != FACE_NO_BOX |
| 2212 | && s->first_glyph->left_box_line_p) | 2218 | && s->first_glyph->left_box_line_p |
| 2213 | x = s->x + abs (s->face->box_line_width); | 2219 | && s->slice.x == 0) |
| 2214 | else | 2220 | x += abs (s->face->box_line_width); |
| 2215 | x = s->x; | ||
| 2216 | 2221 | ||
| 2217 | /* If there is a margin around the image, adjust x- and y-position | 2222 | /* If there is a margin around the image, adjust x- and y-position |
| 2218 | by that margin. */ | 2223 | by that margin. */ |
| 2219 | x += s->img->hmargin; | 2224 | if (s->slice.x == 0) |
| 2220 | y += s->img->vmargin; | 2225 | x += s->img->hmargin; |
| 2226 | if (s->slice.y == 0) | ||
| 2227 | y += s->img->vmargin; | ||
| 2221 | 2228 | ||
| 2222 | if (s->hl == DRAW_IMAGE_SUNKEN | 2229 | if (s->hl == DRAW_IMAGE_SUNKEN |
| 2223 | || s->hl == DRAW_IMAGE_RAISED) | 2230 | || s->hl == DRAW_IMAGE_RAISED) |
| @@ -2233,12 +2240,17 @@ x_draw_image_relief (s) | |||
| 2233 | 2240 | ||
| 2234 | x0 = x - thick; | 2241 | x0 = x - thick; |
| 2235 | y0 = y - thick; | 2242 | y0 = y - thick; |
| 2236 | x1 = x + s->img->width + thick - 1; | 2243 | x1 = x + s->slice.width + thick - 1; |
| 2237 | y1 = y + s->img->height + thick - 1; | 2244 | y1 = y + s->slice.height + thick - 1; |
| 2238 | 2245 | ||
| 2239 | x_setup_relief_colors (s); | 2246 | x_setup_relief_colors (s); |
| 2240 | get_glyph_string_clip_rect (s, &r); | 2247 | get_glyph_string_clip_rect (s, &r); |
| 2241 | w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r); | 2248 | w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, |
| 2249 | s->slice.y == 0, | ||
| 2250 | s->slice.y + s->slice.height == s->img->height, | ||
| 2251 | s->slice.x == 0, | ||
| 2252 | s->slice.x + s->slice.width == s->img->width, | ||
| 2253 | &r); | ||
| 2242 | } | 2254 | } |
| 2243 | 2255 | ||
| 2244 | 2256 | ||
| @@ -2251,21 +2263,22 @@ w32_draw_image_foreground_1 (s, pixmap) | |||
| 2251 | { | 2263 | { |
| 2252 | HDC hdc = CreateCompatibleDC (s->hdc); | 2264 | HDC hdc = CreateCompatibleDC (s->hdc); |
| 2253 | HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap); | 2265 | HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap); |
| 2254 | int x; | 2266 | int x = 0; |
| 2255 | int y = s->ybase - s->y - image_ascent (s->img, s->face); | 2267 | int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice); |
| 2256 | 2268 | ||
| 2257 | /* If first glyph of S has a left box line, start drawing it to the | 2269 | /* If first glyph of S has a left box line, start drawing it to the |
| 2258 | right of that line. */ | 2270 | right of that line. */ |
| 2259 | if (s->face->box != FACE_NO_BOX | 2271 | if (s->face->box != FACE_NO_BOX |
| 2260 | && s->first_glyph->left_box_line_p) | 2272 | && s->first_glyph->left_box_line_p |
| 2261 | x = abs (s->face->box_line_width); | 2273 | && s->slice.x == 0) |
| 2262 | else | 2274 | x += abs (s->face->box_line_width); |
| 2263 | x = 0; | ||
| 2264 | 2275 | ||
| 2265 | /* If there is a margin around the image, adjust x- and y-position | 2276 | /* If there is a margin around the image, adjust x- and y-position |
| 2266 | by that margin. */ | 2277 | by that margin. */ |
| 2267 | x += s->img->hmargin; | 2278 | if (s->slice.x == 0) |
| 2268 | y += s->img->vmargin; | 2279 | x += s->img->hmargin; |
| 2280 | if (s->slice.y == 0) | ||
| 2281 | y += s->img->vmargin; | ||
| 2269 | 2282 | ||
| 2270 | if (s->img->pixmap) | 2283 | if (s->img->pixmap) |
| 2271 | { | 2284 | { |
| @@ -2281,12 +2294,12 @@ w32_draw_image_foreground_1 (s, pixmap) | |||
| 2281 | 2294 | ||
| 2282 | SetTextColor (hdc, RGB (0, 0, 0)); | 2295 | SetTextColor (hdc, RGB (0, 0, 0)); |
| 2283 | SetBkColor (hdc, RGB (255, 255, 255)); | 2296 | SetBkColor (hdc, RGB (255, 255, 255)); |
| 2284 | BitBlt (hdc, x, y, s->img->width, s->img->height, | 2297 | BitBlt (hdc, x, y, s->slice.width, s->slice.height, |
| 2285 | compat_hdc, 0, 0, SRCINVERT); | 2298 | compat_hdc, s->slice.x, s->slice.y, SRCINVERT); |
| 2286 | BitBlt (hdc, x, y, s->img->width, s->img->height, | 2299 | BitBlt (hdc, x, y, s->slice.width, s->slice.height, |
| 2287 | mask_dc, 0, 0, SRCAND); | 2300 | mask_dc, s->slice.x, s->slice.y, SRCAND); |
| 2288 | BitBlt (hdc, x, y, s->img->width, s->img->height, | 2301 | BitBlt (hdc, x, y, s->slice.width, s->slice.height, |
| 2289 | compat_hdc, 0, 0, SRCINVERT); | 2302 | compat_hdc, s->slice.x, s->slice.y, SRCINVERT); |
| 2290 | 2303 | ||
| 2291 | SelectObject (mask_dc, mask_orig_obj); | 2304 | SelectObject (mask_dc, mask_orig_obj); |
| 2292 | DeleteDC (mask_dc); | 2305 | DeleteDC (mask_dc); |
| @@ -2296,8 +2309,8 @@ w32_draw_image_foreground_1 (s, pixmap) | |||
| 2296 | SetTextColor (hdc, s->gc->foreground); | 2309 | SetTextColor (hdc, s->gc->foreground); |
| 2297 | SetBkColor (hdc, s->gc->background); | 2310 | SetBkColor (hdc, s->gc->background); |
| 2298 | 2311 | ||
| 2299 | BitBlt (hdc, x, y, s->img->width, s->img->height, | 2312 | BitBlt (hdc, x, y, s->slice.width, s->slice.height, |
| 2300 | compat_hdc, 0, 0, SRCCOPY); | 2313 | compat_hdc, s->slice.x, s->slice.y, SRCCOPY); |
| 2301 | 2314 | ||
| 2302 | /* When the image has a mask, we can expect that at | 2315 | /* When the image has a mask, we can expect that at |
| 2303 | least part of a mouse highlight or a block cursor will | 2316 | least part of a mouse highlight or a block cursor will |
| @@ -2309,8 +2322,9 @@ w32_draw_image_foreground_1 (s, pixmap) | |||
| 2309 | { | 2322 | { |
| 2310 | int r = s->img->relief; | 2323 | int r = s->img->relief; |
| 2311 | if (r < 0) r = -r; | 2324 | if (r < 0) r = -r; |
| 2312 | w32_draw_rectangle (hdc, s->gc, x - r, y - r , | 2325 | w32_draw_rectangle (hdc, s->gc, x - r, y - r, |
| 2313 | s->img->width + r*2 - 1, s->img->height + r*2 - 1); | 2326 | s->slice.width + r*2 - 1, |
| 2327 | s->slice.height + r*2 - 1); | ||
| 2314 | } | 2328 | } |
| 2315 | } | 2329 | } |
| 2316 | 2330 | ||
| @@ -2320,8 +2334,8 @@ w32_draw_image_foreground_1 (s, pixmap) | |||
| 2320 | DeleteDC (compat_hdc); | 2334 | DeleteDC (compat_hdc); |
| 2321 | } | 2335 | } |
| 2322 | else | 2336 | else |
| 2323 | w32_draw_rectangle (hdc, s->gc, x, y, s->img->width - 1, | 2337 | w32_draw_rectangle (hdc, s->gc, x, y, |
| 2324 | s->img->height - 1); | 2338 | s->slice.width - 1, s->slice.height - 1); |
| 2325 | 2339 | ||
| 2326 | SelectObject (hdc, orig_hdc_obj); | 2340 | SelectObject (hdc, orig_hdc_obj); |
| 2327 | DeleteDC (hdc); | 2341 | DeleteDC (hdc); |
| @@ -2380,19 +2394,22 @@ x_draw_image_glyph_string (s) | |||
| 2380 | taller than image or if image has a clip mask to reduce | 2394 | taller than image or if image has a clip mask to reduce |
| 2381 | flickering. */ | 2395 | flickering. */ |
| 2382 | s->stippled_p = s->face->stipple != 0; | 2396 | s->stippled_p = s->face->stipple != 0; |
| 2383 | if (height > s->img->height | 2397 | if (height > s->slice.height |
| 2384 | || s->img->hmargin | 2398 | || s->img->hmargin |
| 2385 | || s->img->vmargin | 2399 | || s->img->vmargin |
| 2386 | || s->img->mask | 2400 | || s->img->mask |
| 2387 | || s->img->pixmap == 0 | 2401 | || s->img->pixmap == 0 |
| 2388 | || s->width != s->background_width) | 2402 | || s->width != s->background_width) |
| 2389 | { | 2403 | { |
| 2390 | if (box_line_hwidth && s->first_glyph->left_box_line_p) | 2404 | x = s->x; |
| 2391 | x = s->x + box_line_hwidth; | 2405 | if (s->first_glyph->left_box_line_p |
| 2392 | else | 2406 | && s->slice.x == 0) |
| 2393 | x = s->x; | 2407 | x += box_line_hwidth; |
| 2408 | |||
| 2409 | y = s->y; | ||
| 2410 | if (s->slice.y == 0) | ||
| 2411 | y += box_line_vwidth; | ||
| 2394 | 2412 | ||
| 2395 | y = s->y + box_line_vwidth; | ||
| 2396 | #if 0 /* TODO: figure out if we need to do this on Windows. */ | 2413 | #if 0 /* TODO: figure out if we need to do this on Windows. */ |
| 2397 | if (s->img->mask) | 2414 | if (s->img->mask) |
| 2398 | { | 2415 | { |
| @@ -4311,8 +4328,7 @@ w32_read_socket (sd, expected, hold_quit) | |||
| 4311 | /* So people can tell when we have read the available input. */ | 4328 | /* So people can tell when we have read the available input. */ |
| 4312 | input_signal_count++; | 4329 | input_signal_count++; |
| 4313 | 4330 | ||
| 4314 | /* TODO: tool-bars, ghostscript integration, mouse | 4331 | /* TODO: ghostscript integration. */ |
| 4315 | cursors. */ | ||
| 4316 | while (get_next_msg (&msg, FALSE)) | 4332 | while (get_next_msg (&msg, FALSE)) |
| 4317 | { | 4333 | { |
| 4318 | struct input_event inev; | 4334 | struct input_event inev; |
| @@ -4495,10 +4511,16 @@ w32_read_socket (sd, expected, hold_quit) | |||
| 4495 | 4511 | ||
| 4496 | /* If the contents of the global variable help_echo_string | 4512 | /* If the contents of the global variable help_echo_string |
| 4497 | has changed, generate a HELP_EVENT. */ | 4513 | has changed, generate a HELP_EVENT. */ |
| 4514 | #if 0 /* The below is an invalid comparison when USE_LISP_UNION_TYPE. | ||
| 4515 | But it was originally changed to this to fix a bug, so I have | ||
| 4516 | not removed it completely in case the bug is still there. */ | ||
| 4498 | if (help_echo_string != previous_help_echo_string || | 4517 | if (help_echo_string != previous_help_echo_string || |
| 4499 | (!NILP (help_echo_string) && !STRINGP (help_echo_string) && f->mouse_moved)) | 4518 | (!NILP (help_echo_string) && !STRINGP (help_echo_string) && f->mouse_moved)) |
| 4519 | #else /* This is what xterm.c does. */ | ||
| 4520 | if (!NILP (help_echo_string) | ||
| 4521 | || !NILP (previous_help_echo_string)) | ||
| 4500 | do_help = 1; | 4522 | do_help = 1; |
| 4501 | 4523 | #endif | |
| 4502 | break; | 4524 | break; |
| 4503 | 4525 | ||
| 4504 | case WM_LBUTTONDOWN: | 4526 | case WM_LBUTTONDOWN: |
| @@ -4919,7 +4941,7 @@ w32_read_socket (sd, expected, hold_quit) | |||
| 4919 | 4941 | ||
| 4920 | if (do_help > 0) | 4942 | if (do_help > 0) |
| 4921 | { | 4943 | { |
| 4922 | if (help_echo_string == Qnil) | 4944 | if (NILP (help_echo_string)) |
| 4923 | { | 4945 | { |
| 4924 | help_echo_object = help_echo_window = Qnil; | 4946 | help_echo_object = help_echo_window = Qnil; |
| 4925 | help_echo_pos = -1; | 4947 | help_echo_pos = -1; |
| @@ -5068,28 +5090,38 @@ x_draw_hollow_cursor (w, row) | |||
| 5068 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 5090 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 5069 | HDC hdc; | 5091 | HDC hdc; |
| 5070 | RECT rect; | 5092 | RECT rect; |
| 5071 | int wd; | 5093 | int wd, h; |
| 5072 | struct glyph *cursor_glyph; | 5094 | struct glyph *cursor_glyph; |
| 5073 | HBRUSH hb = CreateSolidBrush (f->output_data.w32->cursor_pixel); | 5095 | HBRUSH hb = CreateSolidBrush (f->output_data.w32->cursor_pixel); |
| 5074 | 5096 | ||
| 5097 | /* Get the glyph the cursor is on. If we can't tell because | ||
| 5098 | the current matrix is invalid or such, give up. */ | ||
| 5099 | cursor_glyph = get_phys_cursor_glyph (w); | ||
| 5100 | if (cursor_glyph == NULL) | ||
| 5101 | return; | ||
| 5102 | |||
| 5075 | /* Compute frame-relative coordinates from window-relative | 5103 | /* Compute frame-relative coordinates from window-relative |
| 5076 | coordinates. */ | 5104 | coordinates. */ |
| 5077 | rect.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); | 5105 | rect.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); |
| 5078 | rect.top = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y) | 5106 | rect.top = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y) |
| 5079 | + row->ascent - w->phys_cursor_ascent); | 5107 | + row->ascent - w->phys_cursor_ascent); |
| 5080 | rect.bottom = rect.top + row->height; | ||
| 5081 | 5108 | ||
| 5082 | /* Get the glyph the cursor is on. If we can't tell because | 5109 | /* Compute the proper height and ascent of the rectangle, based |
| 5083 | the current matrix is invalid or such, give up. */ | 5110 | on the actual glyph. Using the full height of the row looks |
| 5084 | cursor_glyph = get_phys_cursor_glyph (w); | 5111 | bad when there are tall images on that row. */ |
| 5085 | if (cursor_glyph == NULL) | 5112 | h = max (min (FRAME_LINE_HEIGHT (f), row->height), |
| 5086 | return; | 5113 | cursor_glyph->ascent + cursor_glyph->descent); |
| 5114 | if (h < row->height) | ||
| 5115 | rect.top += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h; | ||
| 5116 | h--; | ||
| 5117 | |||
| 5118 | rect.bottom = rect.top + h; | ||
| 5087 | 5119 | ||
| 5088 | /* Compute the width of the rectangle to draw. If on a stretch | 5120 | /* Compute the width of the rectangle to draw. If on a stretch |
| 5089 | glyph, and `x-stretch-block-cursor' is nil, don't draw a | 5121 | glyph, and `x-stretch-block-cursor' is nil, don't draw a |
| 5090 | rectangle as wide as the glyph, but use a canonical character | 5122 | rectangle as wide as the glyph, but use a canonical character |
| 5091 | width instead. */ | 5123 | width instead. */ |
| 5092 | wd = cursor_glyph->pixel_width; | 5124 | wd = cursor_glyph->pixel_width; /* TODO: Why off by one compared with X? */ |
| 5093 | if (cursor_glyph->type == STRETCH_GLYPH | 5125 | if (cursor_glyph->type == STRETCH_GLYPH |
| 5094 | && !x_stretch_cursor_p) | 5126 | && !x_stretch_cursor_p) |
| 5095 | wd = min (FRAME_COLUMN_WIDTH (f), wd); | 5127 | wd = min (FRAME_COLUMN_WIDTH (f), wd); |
| @@ -6604,9 +6636,9 @@ syms_of_w32term () | |||
| 6604 | Qvendor_specific_keysyms = intern ("vendor-specific-keysyms"); | 6636 | Qvendor_specific_keysyms = intern ("vendor-specific-keysyms"); |
| 6605 | 6637 | ||
| 6606 | DEFVAR_INT ("w32-num-mouse-buttons", | 6638 | DEFVAR_INT ("w32-num-mouse-buttons", |
| 6607 | &Vw32_num_mouse_buttons, | 6639 | &w32_num_mouse_buttons, |
| 6608 | doc: /* Number of physical mouse buttons. */); | 6640 | doc: /* Number of physical mouse buttons. */); |
| 6609 | Vw32_num_mouse_buttons = Qnil; | 6641 | w32_num_mouse_buttons = 2; |
| 6610 | 6642 | ||
| 6611 | DEFVAR_LISP ("w32-swap-mouse-buttons", | 6643 | DEFVAR_LISP ("w32-swap-mouse-buttons", |
| 6612 | &Vw32_swap_mouse_buttons, | 6644 | &Vw32_swap_mouse_buttons, |