diff options
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/src/w32term.c b/src/w32term.c index 2981320e136..15b502b7c1b 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -1892,6 +1892,7 @@ static void | |||
| 1892 | x_draw_image_relief (struct glyph_string *s) | 1892 | x_draw_image_relief (struct glyph_string *s) |
| 1893 | { | 1893 | { |
| 1894 | int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p; | 1894 | int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p; |
| 1895 | int extra_x, extra_y; | ||
| 1895 | RECT r; | 1896 | RECT r; |
| 1896 | int x = s->x; | 1897 | int x = s->x; |
| 1897 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); | 1898 | int y = s->ybase - image_ascent (s->img, s->face, &s->slice); |
| @@ -1925,16 +1926,31 @@ x_draw_image_relief (struct glyph_string *s) | |||
| 1925 | 1926 | ||
| 1926 | x1 = x + s->slice.width - 1; | 1927 | x1 = x + s->slice.width - 1; |
| 1927 | y1 = y + s->slice.height - 1; | 1928 | y1 = y + s->slice.height - 1; |
| 1929 | |||
| 1930 | extra_x = extra_y = 0; | ||
| 1931 | if (s->face->id == TOOL_BAR_FACE_ID) | ||
| 1932 | { | ||
| 1933 | if (CONSP (Vtool_bar_button_margin) | ||
| 1934 | && INTEGERP (XCAR (Vtool_bar_button_margin)) | ||
| 1935 | && INTEGERP (XCDR (Vtool_bar_button_margin))) | ||
| 1936 | { | ||
| 1937 | extra_x = XINT (XCAR (Vtool_bar_button_margin)); | ||
| 1938 | extra_y = XINT (XCDR (Vtool_bar_button_margin)); | ||
| 1939 | } | ||
| 1940 | else if (INTEGERP (Vtool_bar_button_margin)) | ||
| 1941 | extra_x = extra_y = XINT (Vtool_bar_button_margin); | ||
| 1942 | } | ||
| 1943 | |||
| 1928 | top_p = bot_p = left_p = right_p = 0; | 1944 | top_p = bot_p = left_p = right_p = 0; |
| 1929 | 1945 | ||
| 1930 | if (s->slice.x == 0) | 1946 | if (s->slice.x == 0) |
| 1931 | x -= thick, left_p = 1; | 1947 | x -= thick + extra_x, left_p = 1; |
| 1932 | if (s->slice.y == 0) | 1948 | if (s->slice.y == 0) |
| 1933 | y -= thick, top_p = 1; | 1949 | y -= thick + extra_y, top_p = 1; |
| 1934 | if (s->slice.x + s->slice.width == s->img->width) | 1950 | if (s->slice.x + s->slice.width == s->img->width) |
| 1935 | x1 += thick, right_p = 1; | 1951 | x1 += thick + extra_x, right_p = 1; |
| 1936 | if (s->slice.y + s->slice.height == s->img->height) | 1952 | if (s->slice.y + s->slice.height == s->img->height) |
| 1937 | y1 += thick, bot_p = 1; | 1953 | y1 += thick + extra_y, bot_p = 1; |
| 1938 | 1954 | ||
| 1939 | x_setup_relief_colors (s); | 1955 | x_setup_relief_colors (s); |
| 1940 | get_glyph_string_clip_rect (s, &r); | 1956 | get_glyph_string_clip_rect (s, &r); |
| @@ -5651,21 +5667,11 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b | |||
| 5651 | if (!frame_resize_pixelwise) | 5667 | if (!frame_resize_pixelwise) |
| 5652 | { | 5668 | { |
| 5653 | /* If we don't resize frames pixelwise, round sizes to multiples | 5669 | /* If we don't resize frames pixelwise, round sizes to multiples |
| 5654 | of character sizes. Otherwise, Windows may clip our frame | 5670 | of character sizes here. Otherwise, when enforcing size hints |
| 5655 | rectangle at a character size boundary and we risk losing our | 5671 | while processing WM_WINDOWPOSCHANGING in w32_wnd_proc, we might |
| 5656 | mode line. Bug#16923 might be a consequence of this. | 5672 | clip our frame rectangle to a multiple of the frame's character |
| 5657 | 5673 | size and subsequently lose our mode line or scroll bar. | |
| 5658 | So far, this is a Windows specific problem; other toolkits may | 5674 | Bug#16923 could be one possible consequence of this. */ |
| 5659 | prefer to not resize the frame if the delta is not large enough | ||
| 5660 | (GTK) or resize the frame pixelwise as requested (Lucid, | ||
| 5661 | Motif). Windows just doesn't call us back (probably because of | ||
| 5662 | the size hint settings which it apparently interprets strictly) | ||
| 5663 | neither when the user tries to mouse-drag a frame border by, | ||
| 5664 | nor when calling `set-frame-size' with a delta of less than the | ||
| 5665 | canonical character size. If w32_enable_frame_resize_hack is | ||
| 5666 | enabled (which it now is by default) we'd then below resize the | ||
| 5667 | frame's root window in preparation of a WM_SIZE message to come | ||
| 5668 | which, however, is not going to happen. */ | ||
| 5669 | int unit_width = FRAME_COLUMN_WIDTH (f); | 5675 | int unit_width = FRAME_COLUMN_WIDTH (f); |
| 5670 | int unit_height = FRAME_LINE_HEIGHT (f); | 5676 | int unit_height = FRAME_LINE_HEIGHT (f); |
| 5671 | 5677 | ||
| @@ -5695,9 +5701,7 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b | |||
| 5695 | } | 5701 | } |
| 5696 | 5702 | ||
| 5697 | /* If w32_enable_frame_resize_hack is non-nil, immediately apply the | 5703 | /* If w32_enable_frame_resize_hack is non-nil, immediately apply the |
| 5698 | new pixel sizes to the frame and its subwindows. This approach is | 5704 | new pixel sizes to the frame and its subwindows. |
| 5699 | fragile because Windows might not honor the resize request issued | ||
| 5700 | by my_set_window_pos with a WM_SIZE message (see previous comment). | ||
| 5701 | 5705 | ||
| 5702 | Jason Rumney earlier refused to call change_frame_size right here | 5706 | Jason Rumney earlier refused to call change_frame_size right here |
| 5703 | with the following argument: | 5707 | with the following argument: |