summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/w32fns.c3
-rw-r--r--src/w32term.c48
-rw-r--r--src/xterm.c24
4 files changed, 60 insertions, 27 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c3af54910a2..59e39614af8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
+2014-03-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ Fix regression introduced by patch for Bug#10500.
+ * xterm.c (x_draw_image_relief): Respect Vtool_bar_button_margin.
+ * w32term.c (x_draw_image_relief): Likewise.
+
+2014-03-21 Martin Rudalics <rudalics@gmx.at>
+
+ * w32fns.c (w32_wnd_proc): For WM_WINDOWPOSCHANGING don't
+ constrain frame size in SW_SHOWMAXIMIZED case so we can truly
+ maximize a frame for odd default fonts.
+
2014-03-21 Glenn Morris <rgm@gnu.org>
* minibuf.c (history-length): Increase default from 30 to 100.
diff --git a/src/w32fns.c b/src/w32fns.c
index a79135374ed..fff1e3efde6 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3805,7 +3805,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
wp.length = sizeof (WINDOWPLACEMENT);
GetWindowPlacement (hwnd, &wp);
- if (wp.showCmd != SW_SHOWMINIMIZED && (lppos->flags & SWP_NOSIZE) == 0)
+ if (wp.showCmd != SW_SHOWMAXIMIZED && wp.showCmd != SW_SHOWMINIMIZED
+ && (lppos->flags & SWP_NOSIZE) == 0)
{
RECT rect;
int wdiff;
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
x_draw_image_relief (struct glyph_string *s)
{
int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p;
+ int extra_x, extra_y;
RECT r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
@@ -1925,16 +1926,31 @@ x_draw_image_relief (struct glyph_string *s)
x1 = x + s->slice.width - 1;
y1 = y + s->slice.height - 1;
+
+ extra_x = extra_y = 0;
+ if (s->face->id == TOOL_BAR_FACE_ID)
+ {
+ if (CONSP (Vtool_bar_button_margin)
+ && INTEGERP (XCAR (Vtool_bar_button_margin))
+ && INTEGERP (XCDR (Vtool_bar_button_margin)))
+ {
+ extra_x = XINT (XCAR (Vtool_bar_button_margin));
+ extra_y = XINT (XCDR (Vtool_bar_button_margin));
+ }
+ else if (INTEGERP (Vtool_bar_button_margin))
+ extra_x = extra_y = XINT (Vtool_bar_button_margin);
+ }
+
top_p = bot_p = left_p = right_p = 0;
if (s->slice.x == 0)
- x -= thick, left_p = 1;
+ x -= thick + extra_x, left_p = 1;
if (s->slice.y == 0)
- y -= thick, top_p = 1;
+ y -= thick + extra_y, top_p = 1;
if (s->slice.x + s->slice.width == s->img->width)
- x1 += thick, right_p = 1;
+ x1 += thick + extra_x, right_p = 1;
if (s->slice.y + s->slice.height == s->img->height)
- y1 += thick, bot_p = 1;
+ y1 += thick + extra_y, bot_p = 1;
x_setup_relief_colors (s);
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
if (!frame_resize_pixelwise)
{
/* If we don't resize frames pixelwise, round sizes to multiples
- of character sizes. Otherwise, Windows may clip our frame
- rectangle at a character size boundary and we risk losing our
- mode line. Bug#16923 might be a consequence of this.
-
- So far, this is a Windows specific problem; other toolkits may
- prefer to not resize the frame if the delta is not large enough
- (GTK) or resize the frame pixelwise as requested (Lucid,
- Motif). Windows just doesn't call us back (probably because of
- the size hint settings which it apparently interprets strictly)
- neither when the user tries to mouse-drag a frame border by,
- nor when calling `set-frame-size' with a delta of less than the
- canonical character size. If w32_enable_frame_resize_hack is
- enabled (which it now is by default) we'd then below resize the
- frame's root window in preparation of a WM_SIZE message to come
- which, however, is not going to happen. */
+ of character sizes here. Otherwise, when enforcing size hints
+ while processing WM_WINDOWPOSCHANGING in w32_wnd_proc, we might
+ clip our frame rectangle to a multiple of the frame's character
+ size and subsequently lose our mode line or scroll bar.
+ Bug#16923 could be one possible consequence of this. */
int unit_width = FRAME_COLUMN_WIDTH (f);
int unit_height = FRAME_LINE_HEIGHT (f);
@@ -5695,9 +5701,7 @@ x_set_window_size (struct frame *f, int change_gravity, int width, int height, b
}
/* If w32_enable_frame_resize_hack is non-nil, immediately apply the
- new pixel sizes to the frame and its subwindows. This approach is
- fragile because Windows might not honor the resize request issued
- by my_set_window_pos with a WM_SIZE message (see previous comment).
+ new pixel sizes to the frame and its subwindows.
Jason Rumney earlier refused to call change_frame_size right here
with the following argument:
diff --git a/src/xterm.c b/src/xterm.c
index c7f56e1f1f2..31e1b9cb74f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2162,6 +2162,7 @@ static void
x_draw_image_relief (struct glyph_string *s)
{
int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p;
+ int extra_x, extra_y;
XRectangle r;
int x = s->x;
int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
@@ -2194,16 +2195,31 @@ x_draw_image_relief (struct glyph_string *s)
x1 = x + s->slice.width - 1;
y1 = y + s->slice.height - 1;
+
+ extra_x = extra_y = 0;
+ if (s->face->id == TOOL_BAR_FACE_ID)
+ {
+ if (CONSP (Vtool_bar_button_margin)
+ && INTEGERP (XCAR (Vtool_bar_button_margin))
+ && INTEGERP (XCDR (Vtool_bar_button_margin)))
+ {
+ extra_x = XINT (XCAR (Vtool_bar_button_margin));
+ extra_y = XINT (XCDR (Vtool_bar_button_margin));
+ }
+ else if (INTEGERP (Vtool_bar_button_margin))
+ extra_x = extra_y = XINT (Vtool_bar_button_margin);
+ }
+
top_p = bot_p = left_p = right_p = 0;
if (s->slice.x == 0)
- x -= thick, left_p = 1;
+ x -= thick + extra_x, left_p = 1;
if (s->slice.y == 0)
- y -= thick, top_p = 1;
+ y -= thick + extra_y, top_p = 1;
if (s->slice.x + s->slice.width == s->img->width)
- x1 += thick, right_p = 1;
+ x1 += thick + extra_x, right_p = 1;
if (s->slice.y + s->slice.height == s->img->height)
- y1 += thick, bot_p = 1;
+ y1 += thick + extra_y, bot_p = 1;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);