diff options
| author | Tom Tromey <tromey@redhat.com> | 2013-01-05 19:36:45 -0700 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2013-01-05 19:36:45 -0700 |
| commit | e078a23febca14bc919c5806670479c395e3253e (patch) | |
| tree | e9e4ed91feef744d525264c31974c3ed00146bcd /src/w32term.c | |
| parent | 63d535c829a930207b64fe733228f15a554644b1 (diff) | |
| parent | 7a2657fa3bedbd977f4e11fe030cb4a210c04ab4 (diff) | |
| download | emacs-e078a23febca14bc919c5806670479c395e3253e.tar.gz | |
merge from trunk
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 82 |
1 files changed, 77 insertions, 5 deletions
diff --git a/src/w32term.c b/src/w32term.c index 7c53097e313..36ae4d7797f 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -1,6 +1,6 @@ /* Implementation of GUI terminal on the Microsoft Windows API. -Copyright (C) 1989, 1993-2012 Free Software Foundation, Inc. +Copyright (C) 1989, 1993-2013 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -358,7 +358,7 @@ w32_restore_glyph_string_clip (struct glyph_string *s) void w32_draw_underwave (struct glyph_string *s, COLORREF color) { - int wave_height = 2, wave_length = 3; + int wave_height = 3, wave_length = 2; int dx, dy, x0, y0, width, x1, y1, x2, y2, odd, xmax; XRectangle wave_clip, string_clip, final_clip; RECT w32_final_clip, w32_string_clip; @@ -367,7 +367,7 @@ w32_draw_underwave (struct glyph_string *s, COLORREF color) dx = wave_length; dy = wave_height - 1; x0 = s->x; - y0 = s->ybase + 1; + y0 = s->ybase - wave_height + 3; width = s->width; xmax = x0 + width; @@ -2456,7 +2456,8 @@ x_draw_glyph_string (struct glyph_string *s) unsigned long thickness, position; int y; - if (s->prev && s->prev->face->underline_p) + if (s->prev && s->prev->face->underline_p + && s->prev->face->underline_type == FACE_UNDER_LINE) { /* We use the same underline style as the previous one. */ thickness = s->prev->underline_thickness; @@ -5648,6 +5649,77 @@ x_check_fullscreen (struct frame *f) } } +static void +w32fullscreen_hook (FRAME_PTR f) +{ + static int normal_width, normal_height, normal_top, normal_left; + + if (f->async_visible) + { + int width, height, top_pos, left_pos, pixel_height, pixel_width; + int cur_w = FRAME_COLS (f), cur_h = FRAME_LINES (f); + RECT workarea_rect; + + block_input (); + if (normal_height <= 0) + normal_height = cur_h; + if (normal_width <= 0) + normal_width = cur_w; + x_real_positions (f, &f->left_pos, &f->top_pos); + x_fullscreen_adjust (f, &width, &height, &top_pos, &left_pos); + + SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0); + pixel_height = workarea_rect.bottom - workarea_rect.top; + pixel_width = workarea_rect.right - workarea_rect.left; + + switch (f->want_fullscreen) + { + /* No difference between these two when there is no WM */ + case FULLSCREEN_MAXIMIZED: + PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, 0xf030, 0); + break; + case FULLSCREEN_BOTH: + height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2; + width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width); + left_pos = workarea_rect.left; + top_pos = workarea_rect.top; + break; + case FULLSCREEN_WIDTH: + width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width); + if (normal_height > 0) + height = normal_height; + left_pos = workarea_rect.left; + break; + case FULLSCREEN_HEIGHT: + height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2; + if (normal_width > 0) + width = normal_width; + top_pos = workarea_rect.top; + break; + case FULLSCREEN_NONE: + if (normal_height > 0) + height = normal_height; + else + normal_height = height; + if (normal_width > 0) + width = normal_width; + else + normal_width = width; + /* FIXME: Should restore the original position of the frame. */ + top_pos = left_pos = 0; + break; + } + + if (cur_w != width || cur_h != height) + { + x_set_offset (f, left_pos, top_pos, 1); + x_set_window_size (f, 1, width, height); + do_pending_window_change (0); + } + unblock_input (); + } +} + /* Call this to change the size of frame F's x-window. If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity for this size change and subsequent size changes. @@ -6338,7 +6410,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo) terminal->mouse_position_hook = w32_mouse_position; terminal->frame_rehighlight_hook = w32_frame_rehighlight; terminal->frame_raise_lower_hook = w32_frame_raise_lower; - /* terminal->fullscreen_hook = XTfullscreen_hook; */ + terminal->fullscreen_hook = w32fullscreen_hook; terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar; terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars; terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar; |
