(Not yet supported, see TODO in x_draw_glyph_string.) */
int x_use_underline_position_properties;
+/* Non-zero means to draw the underline at the same place as the descent line. */
+
+int x_underline_at_descent_line;
+
extern unsigned int msh_mousewheel;
extern void free_frame_menubar ();
{
/* For overstriking (to simulate bold-face), draw the
characters again shifted to the right by one pixel. */
+ int old_BkMode = SetBkMode (s->hdc, TRANSPARENT);
w32_text_out (s, x + 1, s->ybase - boff, s->char2b, s->nchars);
+ if (old_BkMode && old_BkMode != TRANSPARENT)
+ SetBkMode (s->hdc, old_BkMode);
}
}
if (s->font && s->font->hfont)
int background_width = s->background_width;
int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA);
- if (x < left_x)
+ /* Don't draw into left margin, fringe or scrollbar area
+ except for header line and mode line. */
+ if (x < left_x && !s->row->mode_line_p)
{
background_width -= left_x - x;
x = left_x;
&& (s->font->bdf || !s->font->tm.tmUnderlined))
{
unsigned long h = 1;
- unsigned long dy = s->height - h;
+ unsigned long dy = 0;
- /* TODO: Use font information for positioning and thickness
- of underline. See OUTLINETEXTMETRIC, and xterm.c.
- Note: If you make this work, don't forget to change the
- doc string of x-use-underline-position-properties below. */
+ if (x_underline_at_descent_line)
+ dy = s->height - h;
+ else
+ {
+ /* TODO: Use font information for positioning and thickness of
+ underline. See OUTLINETEXTMETRIC, and xterm.c. Note: If
+ you make this work, don't forget to change the doc string of
+ x-use-underline-position-properties below. */
+ dy = s->height - h;
+ }
if (s->face->underline_defaulted_p)
{
w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x,
- s->y + dy, s->width, 1);
+ s->y + dy, s->background_width, 1);
}
else
{
w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x,
- s->y + dy, s->width, 1);
+ s->y + dy, s->background_width, 1);
}
}
if (s->face->overline_color_defaulted_p)
{
w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x,
- s->y + dy, s->width, h);
+ s->y + dy, s->background_width, h);
}
else
{
w32_fill_area (s->f, s->hdc, s->face->overline_color, s->x,
- s->y + dy, s->width, h);
+ s->y + dy, s->background_width, h);
}
}
if (f)
{
/* Generate SELECT_WINDOW_EVENTs when needed. */
- if (mouse_autoselect_window)
+ if (!NILP (Vmouse_autoselect_window))
{
Lisp_Object window;
int x = LOWORD (msg.msg.lParam);
/* Ignore any mouse motion that happened before this
event; any subsequent mouse-movement Emacs events
should reflect only motion after the
- ButtonPress. */
+ ButtonPress. */
f->mouse_moved = 0;
}
last_mouse_frame = f;
{
int flags = f->size_hint_flags;
- /* Treat negative positions as relative to the leftmost bottommost
+ /* The sum of the widths of the frame's left and right borders, and
+ the sum of the heights of the frame's top and bottom borders (in
+ pixels) drawn by Windows. */
+ unsigned int left_right_borders_width, top_bottom_borders_height;
+
+ /* Try to get the actual values of these two variables. We compute
+ the border width (height) by subtracting the width (height) of
+ the frame's client area from the width (height) of the frame's
+ entire window. */
+ WINDOWPLACEMENT wp = { 0 };
+ RECT client_rect = { 0 };
+
+ if (GetWindowPlacement (FRAME_W32_WINDOW (f), &wp)
+ && GetClientRect (FRAME_W32_WINDOW (f), &client_rect))
+ {
+ left_right_borders_width =
+ (wp.rcNormalPosition.right - wp.rcNormalPosition.left) -
+ (client_rect.right - client_rect.left);
+
+ top_bottom_borders_height =
+ (wp.rcNormalPosition.bottom - wp.rcNormalPosition.top) -
+ (client_rect.bottom - client_rect.top);
+ }
+ else
+ {
+ /* Use sensible default values. */
+ left_right_borders_width = 8;
+ top_bottom_borders_height = 32;
+ }
+
+ /* Treat negative positions as relative to the rightmost bottommost
position that fits on the screen. */
if (flags & XNegative)
f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width
- FRAME_PIXEL_WIDTH (f)
- + f->left_pos);
+ + f->left_pos
+ - (left_right_borders_width - 1));
if (flags & YNegative)
f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height
- FRAME_PIXEL_HEIGHT (f)
- + f->top_pos);
- /* The left_pos and top_pos
- are now relative to the top and left screen edges,
- so the flags should correspond. */
+ + f->top_pos
+ - (top_bottom_borders_height - 1));
+
+ /* The left_pos and top_pos are now relative to the top and left
+ screen edges, so the flags should correspond. */
f->size_hint_flags &= ~ (XNegative | YNegative);
}
\f
/* Set up use of W32. */
-DWORD w32_msg_worker ();
+DWORD WINAPI w32_msg_worker (void * arg);
void
x_flush (struct frame * f)
PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE);
hWindowsThread = CreateThread (NULL, 0,
- (LPTHREAD_START_ROUTINE) w32_msg_worker,
- 0, 0, &dwWindowsThreadId);
+ w32_msg_worker,
+ 0, 0, &dwWindowsThreadId);
GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
}
NOTE: Not supported on MS-Windows yet. */);
x_use_underline_position_properties = 0;
+ DEFVAR_BOOL ("x-underline-at-descent-line",
+ &x_underline_at_descent_line,
+ doc: /* *Non-nil means to draw the underline at the same place as the descent line.
+nil means to draw the underline according to the value of the variable
+`x-use-underline-position-properties', which is usually at the baseline
+level. The default value is nil. */);
+ x_underline_at_descent_line = 0;
+
DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
doc: /* If not nil, Emacs uses toolkit scroll bars. */);
Vx_toolkit_scroll_bars = Qt;