aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/w32term.c b/src/w32term.c
index b7c0d61b633..8a0e9efc943 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1,6 +1,6 @@
1/* Implementation of GUI terminal on the Microsoft W32 API. 1/* Implementation of GUI terminal on the Microsoft W32 API.
2 2
3Copyright (C) 1989, 1993-2011 Free Software Foundation, Inc. 3Copyright (C) 1989, 1993-2012 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -1294,6 +1294,8 @@ x_draw_composite_glyph_string_foreground (struct glyph_string *s)
1294 old_font = SelectObject (s->hdc, FONT_HANDLE (font)); 1294 old_font = SelectObject (s->hdc, FONT_HANDLE (font));
1295 1295
1296 for (i = 0, j = s->cmp_from; i < s->nchars; i++, j++) 1296 for (i = 0, j = s->cmp_from; i < s->nchars; i++, j++)
1297 /* TAB in a composition means display glyphs with padding
1298 space on the left or right. */
1297 if (COMPOSITION_GLYPH (s->cmp, j) != '\t') 1299 if (COMPOSITION_GLYPH (s->cmp, j) != '\t')
1298 { 1300 {
1299 int xx = x + s->cmp->offsets[j * 2]; 1301 int xx = x + s->cmp->offsets[j * 2];
@@ -1439,7 +1441,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
1439 1441
1440 Nominally, highlight colors for `3d' faces are calculated by 1442 Nominally, highlight colors for `3d' faces are calculated by
1441 brightening an object's color by a constant scale factor, but this 1443 brightening an object's color by a constant scale factor, but this
1442 doesn't yield good results for dark colors, so for colors who's 1444 doesn't yield good results for dark colors, so for colors whose
1443 brightness is less than this value (on a scale of 0-255) have to 1445 brightness is less than this value (on a scale of 0-255) have to
1444 use an additional additive factor. 1446 use an additional additive factor.
1445 1447
@@ -1618,8 +1620,9 @@ x_setup_relief_colors (struct glyph_string *s)
1618 1620
1619static void 1621static void
1620w32_draw_relief_rect (struct frame *f, 1622w32_draw_relief_rect (struct frame *f,
1621 int left_x, int top_y, int right_x, int bottom_y, int width, 1623 int left_x, int top_y, int right_x, int bottom_y,
1622 int raised_p, int top_p, int bot_p, int left_p, int right_p, 1624 int width, int raised_p,
1625 int top_p, int bot_p, int left_p, int right_p,
1623 RECT *clip_rect) 1626 RECT *clip_rect)
1624{ 1627{
1625 int i; 1628 int i;
@@ -1880,7 +1883,8 @@ x_draw_image_relief (struct glyph_string *s)
1880 if (s->hl == DRAW_IMAGE_SUNKEN 1883 if (s->hl == DRAW_IMAGE_SUNKEN
1881 || s->hl == DRAW_IMAGE_RAISED) 1884 || s->hl == DRAW_IMAGE_RAISED)
1882 { 1885 {
1883 thick = tool_bar_button_relief >= 0 ? tool_bar_button_relief : DEFAULT_TOOL_BAR_BUTTON_RELIEF; 1886 thick = tool_bar_button_relief >= 0 ? tool_bar_button_relief
1887 : DEFAULT_TOOL_BAR_BUTTON_RELIEF;
1884 raised_p = s->hl == DRAW_IMAGE_RAISED; 1888 raised_p = s->hl == DRAW_IMAGE_RAISED;
1885 } 1889 }
1886 else 1890 else
@@ -2661,7 +2665,7 @@ x_scroll_run (struct window *w, struct run *run)
2661 } 2665 }
2662 else 2666 else
2663 { 2667 {
2664 /* Scolling down. Make sure we don't copy over the mode line. 2668 /* Scrolling down. Make sure we don't copy over the mode line.
2665 at the bottom. */ 2669 at the bottom. */
2666 if (to_y + run->height > bottom_y) 2670 if (to_y + run->height > bottom_y)
2667 height = bottom_y - to_y; 2671 height = bottom_y - to_y;
@@ -3282,8 +3286,8 @@ w32_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window,
3282 ***********************************************************************/ 3286 ***********************************************************************/
3283 3287
3284/* Handle mouse button event on the tool-bar of frame F, at 3288/* Handle mouse button event on the tool-bar of frame F, at
3285 frame-relative coordinates X/Y. EVENT_TYPE is either ButtionPress 3289 frame-relative coordinates X/Y. EVENT_TYPE is either ButtonPress
3286 or ButtonRelase. */ 3290 or ButtonRelease. */
3287 3291
3288static void 3292static void
3289w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event) 3293w32_handle_tool_bar_click (struct frame *f, struct input_event *button_event)
@@ -3384,7 +3388,7 @@ w32_set_scroll_bar_thumb (struct scroll_bar *bar,
3384 if (whole) 3388 if (whole)
3385 { 3389 {
3386 /* Position scroll bar at rock bottom if the bottom of the 3390 /* Position scroll bar at rock bottom if the bottom of the
3387 buffer is visible. This avoids shinking the thumb away 3391 buffer is visible. This avoids shrinking the thumb away
3388 to nothing if it is held at the bottom of the buffer. */ 3392 to nothing if it is held at the bottom of the buffer. */
3389 if (position + portion >= whole && !draggingp) 3393 if (position + portion >= whole && !draggingp)
3390 { 3394 {
@@ -3486,7 +3490,7 @@ my_destroy_window (struct frame * f, HWND hwnd)
3486 3490
3487/* Create a scroll bar and return the scroll bar vector for it. W is 3491/* Create a scroll bar and return the scroll bar vector for it. W is
3488 the Emacs window on which to create the scroll bar. TOP, LEFT, 3492 the Emacs window on which to create the scroll bar. TOP, LEFT,
3489 WIDTH and HEIGHT are.the pixel coordinates and dimensions of the 3493 WIDTH and HEIGHT are the pixel coordinates and dimensions of the
3490 scroll bar. */ 3494 scroll bar. */
3491 3495
3492static struct scroll_bar * 3496static struct scroll_bar *
@@ -3552,7 +3556,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
3552 /* Destroy the window. */ 3556 /* Destroy the window. */
3553 my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar)); 3557 my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar));
3554 3558
3555 /* Disassociate this scroll bar from its window. */ 3559 /* Dissociate this scroll bar from its window. */
3556 XWINDOW (bar->window)->vertical_scroll_bar = Qnil; 3560 XWINDOW (bar->window)->vertical_scroll_bar = Qnil;
3557 3561
3558 UNBLOCK_INPUT; 3562 UNBLOCK_INPUT;
@@ -3872,7 +3876,7 @@ w32_scroll_bar_handle_click (struct scroll_bar *bar, W32Msg *msg,
3872 si.fMask = SIF_POS; 3876 si.fMask = SIF_POS;
3873 si.nPos = y; 3877 si.nPos = y;
3874 /* Remember apparent position (we actually lag behind the real 3878 /* Remember apparent position (we actually lag behind the real
3875 position, so don't set that directly. */ 3879 position, so don't set that directly). */
3876 last_scroll_bar_drag_pos = y; 3880 last_scroll_bar_drag_pos = y;
3877 3881
3878 SetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, FALSE); 3882 SetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, FALSE);
@@ -4502,7 +4506,7 @@ w32_read_socket (struct terminal *terminal, int expected,
4502 } 4506 }
4503 4507
4504 /* If window has been obscured or exposed by another window 4508 /* If window has been obscured or exposed by another window
4505 being maximised or minimised/restored, then recheck 4509 being maximized or minimized/restored, then recheck
4506 visibility of all frames. Direct changes to our own 4510 visibility of all frames. Direct changes to our own
4507 windows get handled by WM_SIZE. */ 4511 windows get handled by WM_SIZE. */
4508#if 0 4512#if 0
@@ -4771,7 +4775,7 @@ w32_read_socket (struct terminal *terminal, int expected,
4771 pending_autoraise_frame = 0; 4775 pending_autoraise_frame = 0;
4772 } 4776 }
4773 4777
4774 /* Check which frames are still visisble, if we have enqueued any user 4778 /* Check which frames are still visible, if we have enqueued any user
4775 events or been notified of events that may affect visibility. We 4779 events or been notified of events that may affect visibility. We
4776 do this here because there doesn't seem to be any direct 4780 do this here because there doesn't seem to be any direct
4777 notification from Windows that the visibility of a window has 4781 notification from Windows that the visibility of a window has
@@ -5195,7 +5199,6 @@ x_catch_errors (dpy)
5195x_catch_errors_unwind (old_val) 5199x_catch_errors_unwind (old_val)
5196x_check_errors (dpy, format) 5200x_check_errors (dpy, format)
5197x_fully_uncatch_errors () 5201x_fully_uncatch_errors ()
5198x_catching_errors ()
5199x_had_errors_p (dpy) 5202x_had_errors_p (dpy)
5200x_clear_errors (dpy) 5203x_clear_errors (dpy)
5201x_uncatch_errors (dpy, count) 5204x_uncatch_errors (dpy, count)
@@ -5573,7 +5576,7 @@ x_raise_frame (struct frame *f)
5573 input focus anyway (so the window with focus will never be 5576 input focus anyway (so the window with focus will never be
5574 completely obscured) - if not, then just moving the mouse over it 5577 completely obscured) - if not, then just moving the mouse over it
5575 is sufficient to give it focus. On Windows, the user must actually 5578 is sufficient to give it focus. On Windows, the user must actually
5576 click on the frame (preferrably the title bar so as not to move 5579 click on the frame (preferably the title bar so as not to move
5577 point), which is more awkward. Also, no other Windows program 5580 point), which is more awkward. Also, no other Windows program
5578 raises a window to the top but leaves another window (possibly now 5581 raises a window to the top but leaves another window (possibly now
5579 completely obscured) with input focus. 5582 completely obscured) with input focus.
@@ -5687,15 +5690,15 @@ x_make_frame_visible (struct frame *f)
5687 5690
5688 f->output_data.w32->asked_for_visible = 1; 5691 f->output_data.w32->asked_for_visible = 1;
5689 5692
5690 /* The first of these seems to give more expected behavior, but 5693 /* According to a report in emacs-devel 2008-06-03, SW_SHOWNORMAL
5691 was added as a commented out line in Sept 1997, with the 5694 causes unexpected behavior when unminimizing frames that were
5692 second version remaining uncommented. There may have been 5695 previously maximized. But only SW_SHOWNORMAL works properly for
5693 some problem with it that led to it not being enabled, 5696 frames that were truely hidden (using make-frame-invisible), so
5694 so the old version remains commented out below in case we 5697 we need it to avoid Bug#5482. It seems that async_iconified
5695 decide we need to go back to it [23.0.60 2008-06-09]. */ 5698 is only set for minimized windows that are still visible, so
5699 use that to determine the appropriate flag to pass ShowWindow. */
5696 my_show_window (f, FRAME_W32_WINDOW (f), 5700 my_show_window (f, FRAME_W32_WINDOW (f),
5697 f->async_iconified ? SW_RESTORE : SW_SHOW); 5701 f->async_iconified ? SW_RESTORE : SW_SHOWNORMAL);
5698 /* my_show_window (f, FRAME_W32_WINDOW (f), SW_SHOWNORMAL); */
5699 } 5702 }
5700 5703
5701 /* Synchronize to ensure Emacs knows the frame is visible 5704 /* Synchronize to ensure Emacs knows the frame is visible
@@ -6161,7 +6164,7 @@ w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
6161 dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE; 6164 dpyinfo->has_palette = GetDeviceCaps (hdc, RASTERCAPS) & RC_PALETTE;
6162 ReleaseDC (NULL, hdc); 6165 ReleaseDC (NULL, hdc);
6163 6166
6164 /* initialise palette with white and black */ 6167 /* initialize palette with white and black */
6165 { 6168 {
6166 XColor color; 6169 XColor color;
6167 w32_defined_color (0, "white", &color, 1); 6170 w32_defined_color (0, "white", &color, 1);
@@ -6429,7 +6432,7 @@ baseline level. The default value is nil. */);
6429A value of nil means Emacs doesn't use toolkit scroll bars. 6432A value of nil means Emacs doesn't use toolkit scroll bars.
6430With the X Window system, the value is a symbol describing the 6433With the X Window system, the value is a symbol describing the
6431X toolkit. Possible values are: gtk, motif, xaw, or xaw3d. 6434X toolkit. Possible values are: gtk, motif, xaw, or xaw3d.
6432With MS Windows, the value is t. */); 6435With MS Windows or Nextstep, the value is t. */);
6433 Vx_toolkit_scroll_bars = Qt; 6436 Vx_toolkit_scroll_bars = Qt;
6434 6437
6435 staticpro (&last_mouse_motion_frame); 6438 staticpro (&last_mouse_motion_frame);