if (sb_width > 0)
{
- int left = WINDOW_SCROLL_BAR_AREA_X (w);
- int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
- * FRAME_COLUMN_WIDTH (f));
+ int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w);
+ int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
+ * FRAME_COLUMN_WIDTH (f));
if (bx < 0)
{
/* Bitmap fills the fringe. */
- if (left + width == p->x)
- bx = left + sb_width;
- else if (p->x + p->wd == left)
- bx = left;
+ if (bar_area_x + bar_area_width == p->x)
+ bx = bar_area_x + sb_width;
+ else if (p->x + p->wd == bar_area_x)
+ bx = bar_area_x;
if (bx >= 0)
{
int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w);
- nx = width - sb_width;
+ nx = bar_area_width - sb_width;
by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height,
row->y));
ny = row->visible_height;
}
else
{
- if (left + width == bx)
+ if (bar_area_x + bar_area_width == bx)
{
- bx = left + sb_width;
- nx += width - sb_width;
+ bx = bar_area_x + sb_width;
+ nx += bar_area_width - sb_width;
}
- else if (bx + nx == left)
- nx += width - sb_width;
+ else if (bx + nx == bar_area_x)
+ nx += bar_area_width - sb_width;
}
}
}
Faces to use in the mode line have already been computed when the
matrix was built, so there isn't much to do, here. */
-static INLINE void
+static inline void
x_set_mode_line_face_gc (struct glyph_string *s)
{
s->gc = s->face->gc;
S->stippled_p to a non-zero value if the face of S has a stipple
pattern. */
-static INLINE void
+static inline void
x_set_glyph_string_gc (struct glyph_string *s)
{
PREPARE_FACE_FOR_DISPLAY (s->f, s->face);
/* Set clipping for output of glyph string S. S may be part of a mode
line or menu if we don't have X toolkit support. */
-static INLINE void
+static inline void
x_set_glyph_string_clipping (struct glyph_string *s)
{
RECT *r = s->clip;
/* Fill rectangle X, Y, W, H with background color of glyph string S. */
-static INLINE void
+static inline void
x_clear_glyph_string_rect (struct glyph_string *s,
int x, int y, int w, int h)
{
else if (! s->first_glyph->u.cmp.automatic)
{
int y = s->ybase;
- int width = 0;
HFONT old_font;
old_font = SelectObject (s->hdc, FONT_HANDLE (font));
for (i = 0, j = s->cmp_from; i < s->nchars; i++, j++)
+ /* TAB in a composition means display glyphs with padding
+ space on the left or right. */
if (COMPOSITION_GLYPH (s->cmp, j) != '\t')
{
int xx = x + s->cmp->offsets[j * 2];
Nominally, highlight colors for `3d' faces are calculated by
brightening an object's color by a constant scale factor, but this
- doesn't yield good results for dark colors, so for colors who's
+ doesn't yield good results for dark colors, so for colors whose
brightness is less than this value (on a scale of 0-255) have to
use an additional additive factor.
static void
w32_draw_relief_rect (struct frame *f,
- int left_x, int top_y, int right_x, int bottom_y, int width,
- int raised_p, int top_p, int bot_p, int left_p, int right_p,
+ int left_x, int top_y, int right_x, int bottom_y,
+ int width, int raised_p,
+ int top_p, int bot_p, int left_p, int right_p,
RECT *clip_rect)
{
int i;
if (s->hl == DRAW_IMAGE_SUNKEN
|| s->hl == DRAW_IMAGE_RAISED)
{
- thick = tool_bar_button_relief >= 0 ? tool_bar_button_relief : DEFAULT_TOOL_BAR_BUTTON_RELIEF;
+ thick = tool_bar_button_relief >= 0 ? tool_bar_button_relief
+ : DEFAULT_TOOL_BAR_BUTTON_RELIEF;
raised_p = s->hl == DRAW_IMAGE_RAISED;
}
else
fringes of W. */
window_box (w, -1, &x, &y, &width, &height);
+ /* If the fringe is adjacent to the left (right) scroll bar of a
+ leftmost (rightmost, respectively) window, then extend its
+ background to the gap between the fringe and the bar. */
+ if ((WINDOW_LEFTMOST_P (w)
+ && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
+ || (WINDOW_RIGHTMOST_P (w)
+ && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)))
+ {
+ int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
+
+ if (sb_width > 0)
+ {
+ int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w);
+ int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
+ * FRAME_COLUMN_WIDTH (f));
+
+ if (bar_area_x + bar_area_width == x)
+ {
+ x = bar_area_x + sb_width;
+ width += bar_area_width - sb_width;
+ }
+ else if (x + width == bar_area_x)
+ width += bar_area_width - sb_width;
+ }
+ }
+
from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y);
to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y);
bottom_y = y + height;
/* Handle mouse button event on the tool-bar of frame F, at
frame-relative coordinates X/Y. EVENT_TYPE is either ButtionPress
- or ButtonRelase. */
+ or ButtonRelease. */
static void
w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event)
/* Create a scroll bar and return the scroll bar vector for it. W is
the Emacs window on which to create the scroll bar. TOP, LEFT,
- WIDTH and HEIGHT are.the pixel coordinates and dimensions of the
+ WIDTH and HEIGHT are the pixel coordinates and dimensions of the
scroll bar. */
static struct scroll_bar *
si.fMask = SIF_POS;
si.nPos = y;
/* Remember apparent position (we actually lag behind the real
- position, so don't set that directly. */
+ position, so don't set that directly). */
last_scroll_bar_drag_pos = y;
SetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, FALSE);
}
/* If window has been obscured or exposed by another window
- being maximised or minimised/restored, then recheck
+ being maximized or minimized/restored, then recheck
visibility of all frames. Direct changes to our own
windows get handled by WM_SIZE. */
#if 0
pending_autoraise_frame = 0;
}
- /* Check which frames are still visisble, if we have enqueued any user
+ /* Check which frames are still visible, if we have enqueued any user
events or been notified of events that may affect visibility. We
do this here because there doesn't seem to be any direct
notification from Windows that the visibility of a window has
x_catch_errors_unwind (old_val)
x_check_errors (dpy, format)
x_fully_uncatch_errors ()
-x_catching_errors ()
x_had_errors_p (dpy)
x_clear_errors (dpy)
x_uncatch_errors (dpy, count)
input focus anyway (so the window with focus will never be
completely obscured) - if not, then just moving the mouse over it
is sufficient to give it focus. On Windows, the user must actually
- click on the frame (preferrably the title bar so as not to move
+ click on the frame (preferably the title bar so as not to move
point), which is more awkward. Also, no other Windows program
raises a window to the top but leaves another window (possibly now
completely obscured) with input focus.
f->output_data.w32->asked_for_visible = 1;
- /* The first of these seems to give more expected behavior, but
- was added as a commented out line in Sept 1997, with the
- second version remaining uncommented. There may have been
- some problem with it that led to it not being enabled,
- so the old version remains commented out below in case we
- decide we need to go back to it [23.0.60 2008-06-09]. */
+ /* According to a report in emacs-devel 2008-06-03, SW_SHOWNORMAL
+ causes unexpected behavior when unminimizing frames that were
+ previously maximized. But only SW_SHOWNORMAL works properly for
+ frames that were truely hidden (using make-frame-invisible), so
+ we need it to avoid Bug#5482. It seems that async_iconified
+ is only set for minimized windows that are still visible, so
+ use that to determine the appropriate flag to pass ShowWindow. */
my_show_window (f, FRAME_W32_WINDOW (f),
- f->async_iconified ? SW_RESTORE : SW_SHOW);
- /* my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL); */
+ f->async_iconified ? SW_RESTORE : SW_SHOWNORMAL);
}
/* Synchronize to ensure Emacs knows the frame is visible
dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE;
ReleaseDC (NULL, hdc);
- /* initialise palette with white and black */
+ /* initialize palette with white and black */
{
XColor color;
w32_defined_color (0, "white", &color, 1);