aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-12-22 15:22:25 +0200
committerEli Zaretskii2012-12-22 15:22:25 +0200
commitb2faf49cd91a9270a5532d1be7b1b6f438c56fcc (patch)
tree7336ef78c883771d1cffc24cdd893d912e6eca3e /src
parenta170fe53e3e2c807e7969b008877c5555d3adb80 (diff)
downloademacs-b2faf49cd91a9270a5532d1be7b1b6f438c56fcc.tar.gz
emacs-b2faf49cd91a9270a5532d1be7b1b6f438c56fcc.zip
Support 'fullscreen' frame parameter on MS-Windows.
src/w32term.c (w32fullscreen_hook): New function. (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/w32term.c73
2 files changed, 77 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index acd8d4481e7..19cb4935c7b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-12-22 Eli Zaretskii <eliz@gnu.org>
2
3 * w32term.c (w32fullscreen_hook): New function.
4 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
5
12012-12-21 Eli Zaretskii <eliz@gnu.org> 62012-12-21 Eli Zaretskii <eliz@gnu.org>
2 7
3 * fileio.c (Finsert_file_contents): Doc fix. 8 * fileio.c (Finsert_file_contents): Doc fix.
diff --git a/src/w32term.c b/src/w32term.c
index 7c53097e313..4ccdaa72a3b 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -5648,6 +5648,77 @@ x_check_fullscreen (struct frame *f)
5648 } 5648 }
5649} 5649}
5650 5650
5651static void
5652w32fullscreen_hook (FRAME_PTR f)
5653{
5654 static int normal_width, normal_height, normal_top, normal_left;
5655
5656 if (f->async_visible)
5657 {
5658 int width, height, top_pos, left_pos, pixel_height, pixel_width;
5659 int cur_w = FRAME_COLS (f), cur_h = FRAME_LINES (f);
5660 RECT workarea_rect;
5661
5662 block_input ();
5663 if (normal_height <= 0)
5664 normal_height = cur_h;
5665 if (normal_width <= 0)
5666 normal_width = cur_w;
5667 x_real_positions (f, &f->left_pos, &f->top_pos);
5668 x_fullscreen_adjust (f, &width, &height, &top_pos, &left_pos);
5669
5670 SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0);
5671 pixel_height = workarea_rect.bottom - workarea_rect.top;
5672 pixel_width = workarea_rect.right - workarea_rect.left;
5673
5674 switch (f->want_fullscreen)
5675 {
5676 /* No difference between these two when there is no WM */
5677 case FULLSCREEN_MAXIMIZED:
5678 PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, 0xf030, 0);
5679 break;
5680 case FULLSCREEN_BOTH:
5681 height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2;
5682 width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width);
5683 left_pos = workarea_rect.left;
5684 top_pos = workarea_rect.top;
5685 break;
5686 case FULLSCREEN_WIDTH:
5687 width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixel_width);
5688 if (normal_height > 0)
5689 height = normal_height;
5690 left_pos = workarea_rect.left;
5691 break;
5692 case FULLSCREEN_HEIGHT:
5693 height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixel_height) - 2;
5694 if (normal_width > 0)
5695 width = normal_width;
5696 top_pos = workarea_rect.top;
5697 break;
5698 case FULLSCREEN_NONE:
5699 if (normal_height > 0)
5700 height = normal_height;
5701 else
5702 normal_height = height;
5703 if (normal_width > 0)
5704 width = normal_width;
5705 else
5706 normal_width = width;
5707 /* FIXME: Should restore the original position of the frame. */
5708 top_pos = left_pos = 0;
5709 break;
5710 }
5711
5712 if (cur_w != width || cur_h != height)
5713 {
5714 x_set_offset (f, left_pos, top_pos, 1);
5715 x_set_window_size (f, 1, width, height);
5716 do_pending_window_change (0);
5717 }
5718 unblock_input ();
5719 }
5720}
5721
5651/* Call this to change the size of frame F's x-window. 5722/* Call this to change the size of frame F's x-window.
5652 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity 5723 If CHANGE_GRAVITY is 1, we change to top-left-corner window gravity
5653 for this size change and subsequent size changes. 5724 for this size change and subsequent size changes.
@@ -6338,7 +6409,7 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
6338 terminal->mouse_position_hook = w32_mouse_position; 6409 terminal->mouse_position_hook = w32_mouse_position;
6339 terminal->frame_rehighlight_hook = w32_frame_rehighlight; 6410 terminal->frame_rehighlight_hook = w32_frame_rehighlight;
6340 terminal->frame_raise_lower_hook = w32_frame_raise_lower; 6411 terminal->frame_raise_lower_hook = w32_frame_raise_lower;
6341 /* terminal->fullscreen_hook = XTfullscreen_hook; */ 6412 terminal->fullscreen_hook = w32fullscreen_hook;
6342 terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar; 6413 terminal->set_vertical_scroll_bar_hook = w32_set_vertical_scroll_bar;
6343 terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars; 6414 terminal->condemn_scroll_bars_hook = w32_condemn_scroll_bars;
6344 terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar; 6415 terminal->redeem_scroll_bar_hook = w32_redeem_scroll_bar;