From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Erik Charlebois Newsgroups: gmane.emacs.bugs Subject: bug#13053: PATCH: Fullscreen frame support on Windows Date: Sat, 1 Dec 2012 21:57:54 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0408386ba17eef04cfd5cc3c X-Trace: ger.gmane.org 1354419243 17177 80.91.229.3 (2 Dec 2012 03:34:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2012 03:34:03 +0000 (UTC) To: 13053@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 02 04:34:14 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tf0Jj-0007B3-N7 for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Dec 2012 04:34:08 +0100 Original-Received: from localhost ([::1]:36923 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tf0JY-0002wo-6b for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Dec 2012 22:33:56 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tf0JT-0002wM-9j for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 22:33:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tf0JQ-0005jk-PG for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 22:33:51 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tf0JQ-0005jg-K2 for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 22:33:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tf0La-0008Bl-Jn for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 22:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Erik Charlebois Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Dec 2012 03:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13053 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.135441933231433 (code B ref -1); Sun, 02 Dec 2012 03:36:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Dec 2012 03:35:32 +0000 Original-Received: from localhost ([127.0.0.1]:49042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tf0L4-0008Au-C9 for submit@debbugs.gnu.org; Sat, 01 Dec 2012 22:35:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46538) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tezn2-0007PP-LM for submit@debbugs.gnu.org; Sat, 01 Dec 2012 22:00:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tezkp-0006DR-SL for submit@debbugs.gnu.org; Sat, 01 Dec 2012 21:58:06 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:39170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tezkp-0006DN-Le for submit@debbugs.gnu.org; Sat, 01 Dec 2012 21:58:03 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tezkm-00051V-Eu for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 21:58:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tezkj-0006CC-Df for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 21:58:00 -0500 Original-Received: from mail-la0-f41.google.com ([209.85.215.41]:59824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tezki-0006C8-SY for bug-gnu-emacs@gnu.org; Sat, 01 Dec 2012 21:57:57 -0500 Original-Received: by mail-la0-f41.google.com with SMTP id m15so1482136lah.0 for ; Sat, 01 Dec 2012 18:57:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=SpWV8hPae8LIUQMcmhrLj9ZiMprm+C2rkWPNKVDR4zs=; b=TsDToGdrotAz/YsKgELEeaMnI7ERAFxp5sfo3eJpJSuEDS7Xlh30P+xTrPL19eGdSX AXY+lI/IOHOhkjvinVKln+p4OKDv2vyYAG5NxEmqaPKCFv0aTlUo1vjE7ibbhUVOYila znasPe/sTjbi5Y25zWCw5lOdE9i6oZ+5ItXcYK+s9ZptDEnv1lPW//OiOB33rjxw3Rwl 2BV3ezTaBkCMZM0lCrpeIf/uzGRdVR1oXQ8cgr9raiSdc4Yh+xh1DMh0oknhD3ThegFi C4rbI+wmp7ypgR9cTBF6Trpn1ROZZReqP3arI2aA4Gj6t7+xERHC2oIfjNah7T1qRlZ/ g+ng== Original-Received: by 10.152.114.100 with SMTP id jf4mr5676130lab.47.1354417074962; Sat, 01 Dec 2012 18:57:54 -0800 (PST) Original-Received: by 10.114.14.232 with HTTP; Sat, 1 Dec 2012 18:57:54 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Sat, 01 Dec 2012 22:35:28 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:67758 Archived-At: --f46d0408386ba17eef04cfd5cc3c Content-Type: text/plain; charset=UTF-8 I've kept this patch going for a few years; probably time I get it in for real. I have not signed the FSF copyright assignment. If someone could give me some guidance on that (I'm Canadian), I'd appreciate it. This patch adds fullscreen frame support to Windows so that setting the frame parameter 'fullscreen to 'fullboth makes the frame take up the entire screen, with no window decoration and covering the taskbar. The function: (defun toggle-fullscreen () "Toggle full screen on X11" (interactive) (set-frame-parameter nil 'fullscreen (when (not (frame-parameter nil 'fullscreen)) 'fullboth))) now has the same behavior on X11 and Windows. There's a bit of added complexity to support multiple monitors and resolution changes correctly. 2012-12-01 Erik Charlebois * src/w32fns.c: Add w32_set_fullscreen for switching to fullscreen. Handle WM_DISPLAYCHANGE for changes in resolution and monitor configuration. Handle frame-parameter 'fullscreen changes by possibly going to fullscreen. * src/w32term.h: Add state to w32_output for tracking monitor and window placement. * src/w32term.c: Use w32_set_fullscreen for fullscreen_hook. === modified file 'src/w32fns.c' *** src/w32fns.c 2012-11-21 04:47:55 +0000 --- src/w32fns.c 2012-12-01 23:11:52 +0000 *************** typedef HWND (WINAPI * ImmSetComposition *** 162,167 **** --- 162,173 ---- typedef HMONITOR (WINAPI * MonitorFromPoint_Proc) (IN POINT pt, IN DWORD flags); typedef BOOL (WINAPI * GetMonitorInfo_Proc) (IN HMONITOR monitor, OUT struct MONITOR_INFO* info); + typedef HMONITOR (WINAPI * MonitorFromWindow_Proc) + (IN HWND hwnd, IN DWORD dwFlags); + typedef BOOL (CALLBACK * MONITOR_ENUM_PROC) (HMONITOR, HDC, LPRECT, LPARAM); + typedef BOOL (WINAPI * EnumDisplayMonitors_Proc) + (IN HDC hdc, IN LPCRECT lprcClip, IN MONITOR_ENUM_PROC lpfnEnum, + IN LPARAM dwData); TrackMouseEvent_Proc track_mouse_event_fn = NULL; ImmGetCompositionString_Proc get_composition_string_fn = NULL; *************** ImmReleaseContext_Proc release_ime_conte *** 170,175 **** --- 176,183 ---- ImmSetCompositionWindow_Proc set_ime_composition_window_fn = NULL; MonitorFromPoint_Proc monitor_from_point_fn = NULL; GetMonitorInfo_Proc get_monitor_info_fn = NULL; + MonitorFromWindow_Proc monitor_from_window_fn = NULL; + EnumDisplayMonitors_Proc enum_display_monitors_fn = NULL; #ifdef NTGUI_UNICODE #define unicode_append_menu AppendMenuW *************** x_real_positions (FRAME_PTR f, int *xptr *** 372,377 **** --- 380,454 ---- *yptr = rect.top; } + + void + w32_set_fullscreen (struct frame *f) + { + #ifdef HAVE_WINDOW_SYSTEM + if (f) + { + HWND hwnd = FRAME_W32_WINDOW (f); + if (f->want_fullscreen != FULLSCREEN_BOTH + && f->output_data.w32->fullscreen) + { + /* Restore the window style and placement. */ + f->output_data.w32->fullscreen = 0; + if (f->output_data.w32->window_placement.showCmd == SW_HIDE) + { + SetWindowLong (hwnd, GWL_STYLE, + f->output_data.w32->dwStyle | WS_CLIPCHILDREN); + SetWindowPos (hwnd, HWND_TOP, 30, 30, 640, 480, + SWP_NOSENDCHANGING | SWP_SHOWWINDOW); + } + else + { + SetWindowLong (hwnd, GWL_STYLE, f->output_data.w32->style); + SetWindowPlacement (hwnd, &f->output_data.w32->window_placement); + SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); + } + } + else if (f->want_fullscreen == FULLSCREEN_BOTH + && !f->output_data.w32->fullscreen) + { + /* Save the window style and placement. */ + struct MONITOR_INFO info; + RECT monitor_rect; + monitor_rect.left = 0; + monitor_rect.right = GetSystemMetrics (SM_CXSCREEN); + monitor_rect.top = 0; + monitor_rect.bottom = GetSystemMetrics (SM_CYSCREEN); + + f->output_data.w32->fullscreen = 1; + f->output_data.w32->window_placement.length = + sizeof (WINDOWPLACEMENT); + GetWindowPlacement (hwnd, &f->output_data.w32->window_placement); + + f->output_data.w32->style = GetWindowLong (hwnd, GWL_STYLE); + SetWindowLong (hwnd, GWL_STYLE, + ( f->output_data.w32->style + & (~(WS_CAPTION | WS_THICKFRAME)))); + + /* If multiple monitor support is available, make the window + fullscreen on the appropriate screen. */ + if (monitor_from_window_fn && get_monitor_info_fn) + { + f->output_data.w32->monitor = + monitor_from_window_fn (hwnd, MONITOR_DEFAULT_TO_NEAREST); + info.cbSize = sizeof (struct MONITOR_INFO); + get_monitor_info_fn (f->output_data.w32->monitor, &info); + monitor_rect = info.rcMonitor; + } + + SetWindowPos (FRAME_W32_WINDOW(f), HWND_TOP, monitor_rect.left, + monitor_rect.top, monitor_rect.right - monitor_rect.left, + monitor_rect.bottom - monitor_rect.top, + SWP_NOSENDCHANGING | SWP_SHOWWINDOW); + } + } + #endif + } + DEFUN ("w32-define-rgb-color", Fw32_define_rgb_color, *************** post_character_message (HWND hwnd, UINT *** 2706,2711 **** --- 2783,2810 ---- my_post_msg (&wmsg, hwnd, msg, wParam, lParam); } + + struct w32_monitor_info + { + HMONITOR seeking; + int found; + }; + + + static BOOL + w32_enum_monitors (HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, + LPARAM dwData) + { + struct w32_monitor_info* minfo = + (struct w32_monitor_info*) dwData; + if (minfo->seeking == hMonitor) + { + minfo->found = 1; + return FALSE; + } + return TRUE; + } + /* Main window procedure */ static LRESULT CALLBACK *************** w32_wnd_proc (HWND hwnd, UINT msg, WPARA *** 2763,2768 **** --- 2862,2926 ---- release_frame_dc (f, get_frame_dc (f)); } return 0; + case WM_DISPLAYCHANGE: + f = x_window_to_frame (dpyinfo, hwnd); + if (f && f->output_data.w32->fullscreen) + { + /* If multiple monitor support is available, check if the monitor + the window was fullscreened on still exists. If not, kick it out + of fullscreen and let Windows reposition it. */ + if (monitor_from_window_fn && get_monitor_info_fn + && enum_display_monitors_fn) + { + struct w32_monitor_info minfo = { + f->output_data.w32->monitor, 0 + }; + enum_display_monitors_fn (NULL, NULL, w32_enum_monitors, + (LPARAM) &minfo); + if (!minfo.found) + { + f->output_data.w32->fullscreen = 0; + + if (f->output_data.w32->window_placement.showCmd == SW_HIDE) + { + SetWindowLong (hwnd, GWL_STYLE, + f->output_data.w32->dwStyle | WS_CLIPCHILDREN); + SetWindowPos (hwnd, HWND_TOP, 30, 30, 640, 480, + SWP_NOSENDCHANGING | SWP_SHOWWINDOW); + } + else + { + SetWindowLong (hwnd, GWL_STYLE, f->output_data.w32->style); + SetWindowPlacement (hwnd, + &f->output_data.w32->window_placement); + SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0, + (SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER + | SWP_FRAMECHANGED)); + } + } + else + { + /* The monitor still exists. Resize to fullscreen to account + for a possible resolution change. */ + struct MONITOR_INFO info; + info.cbSize = sizeof(struct MONITOR_INFO); + get_monitor_info_fn (f->output_data.w32->monitor, &info); + SetWindowPos (hwnd, HWND_TOP, info.rcMonitor.left, + info.rcMonitor.top, + info.rcMonitor.right - info.rcMonitor.left, + info.rcMonitor.bottom - info.rcMonitor.top, + SWP_NOSENDCHANGING | SWP_SHOWWINDOW); + } + } + else + { + /* Resize to fullscreen to account for resolution change. */ + SetWindowPos (hwnd, HWND_TOP, 0, 0, GetSystemMetrics(SM_CXSCREEN), + GetSystemMetrics(SM_CYSCREEN), + SWP_NOSENDCHANGING | SWP_SHOWWINDOW); + } + } + return 0; case WM_PAINT: { PAINTSTRUCT paintStruct; *************** w32_wnd_proc (HWND hwnd, UINT msg, WPARA *** 3861,3869 **** case WM_EMACS_SETWINDOWPOS: { ! WINDOWPOS * pos = (WINDOWPOS *) wParam; ! return SetWindowPos (hwnd, pos->hwndInsertAfter, ! pos->x, pos->y, pos->cx, pos->cy, pos->flags); } case WM_EMACS_DESTROYWINDOW: --- 4019,4061 ---- case WM_EMACS_SETWINDOWPOS: { ! f = x_window_to_frame (dpyinfo, hwnd); ! if (f && f->output_data.w32->fullscreen) ! { ! SetWindowLong (hwnd, GWL_STYLE, ! ( f->output_data.w32->style ! & (~(WS_CAPTION | WS_THICKFRAME)))); ! ! /* Force the window to be fullscreen. This will cause frame ! position and size changes to be ignored. It also keeps the ! window correctly fullscreen when the menu or scroll bars are ! toggled. */ ! if (monitor_from_window_fn && get_monitor_info_fn ! && enum_display_monitors_fn) ! { ! struct MONITOR_INFO info; ! info.cbSize = sizeof (struct MONITOR_INFO); ! get_monitor_info_fn (f->output_data.w32->monitor, &info); ! return SetWindowPos (hwnd, HWND_TOP, info.rcMonitor.left, ! info.rcMonitor.top, ! info.rcMonitor.right - info.rcMonitor.left, ! info.rcMonitor.bottom - info.rcMonitor.top, ! SWP_NOSENDCHANGING | SWP_SHOWWINDOW); ! } ! else ! { ! return SetWindowPos (hwnd, HWND_TOP, 0, 0, ! GetSystemMetrics(SM_CXSCREEN), ! GetSystemMetrics(SM_CYSCREEN), ! SWP_NOSENDCHANGING | SWP_SHOWWINDOW); ! } ! } ! else ! { ! WINDOWPOS * pos = (WINDOWPOS *) wParam; ! return SetWindowPos (hwnd, pos->hwndInsertAfter, ! pos->x, pos->y, pos->cx, pos->cy, pos->flags); ! } } case WM_EMACS_DESTROYWINDOW: *************** globals_of_w32fns (void) *** 7685,7690 **** --- 7877,7886 ---- GetProcAddress (user32_lib, "MonitorFromPoint"); get_monitor_info_fn = (GetMonitorInfo_Proc) GetProcAddress (user32_lib, "GetMonitorInfoA"); + monitor_from_window_fn = (MonitorFromWindow_Proc) + GetProcAddress (user32_lib, "MonitorFromWindow"); + enum_display_monitors_fn = (EnumDisplayMonitors_Proc) + GetProcAddress (user32_lib, "EnumDisplayMonitors"); { HMODULE imm32_lib = GetModuleHandle ("imm32.dll"); === modified file 'src/w32term.c' *** src/w32term.c 2012-12-01 02:38:11 +0000 --- src/w32term.c 2012-12-01 22:56:36 +0000 *************** w32_create_terminal (struct w32_display_ *** 6211,6217 **** 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->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; --- 6211,6217 ---- 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 = w32_set_fullscreen; 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; === modified file 'src/w32term.h' *** src/w32term.h 2012-11-23 15:39:48 +0000 --- src/w32term.h 2012-12-01 22:57:00 +0000 *************** struct w32_palette_entry { *** 71,76 **** --- 71,77 ---- }; extern void w32_regenerate_palette (struct frame *f); + extern void w32_set_fullscreen (struct frame *f); /* For each display (currently only one on w32), we have a structure that *************** struct w32_output *** 361,366 **** --- 362,379 ---- /* The background for which the above relief GCs were set up. They are changed only when a different background is involved. */ unsigned long relief_background; + + /* Nonzero means the frame is in fullscreen mode. */ + char fullscreen; + + /* Window placement prior to the frame going fullscreen. */ + WINDOWPLACEMENT window_placement; + + /* Window style in place when the frame went fullscreen. */ + DWORD style; + + /* Monitor that the frame is fullscreen on. */ + HMONITOR monitor; }; extern struct w32_output w32term_display; --f46d0408386ba17eef04cfd5cc3c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I've kept this patch going for a few years; probably time I get it in f= or real. I have not signed the FSF copyright assignment. If someone could g= ive me some guidance on that (I'm Canadian), I'd appreciate it.
This patch adds fullscreen frame support to Windows so that = setting the frame parameter 'fullscreen to 'fullboth makes the fram= e take up the entire screen, with no window decoration and covering the tas= kbar. The function:

(defun toggle-fullscreen ()
=C2=A0 "= ;Toggle full screen on X11"
=C2=A0 (interactive)
= =C2=A0 (set-frame-parameter
=C2=A0 =C2=A0nil 'fullscreen
=C2=A0 =C2=A0(when (not (frame-parameter nil 'fullscreen)) 'f= ullboth)))

now has the same behavior on X11 and Windows. The= re's a bit of added complexity to support multiple monitors and resolut= ion changes correctly.



2012-12-01 =C2=A0Erik Charlebois= =C2=A0<erikcharlebois@gmail= .com>

=C2=A0 =C2=A0 =C2=A0 =C2=A0 * src/w32= fns.c: Add w32_set_fullscreen for switching to
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fullscreen. Handle = WM_DISPLAYCHANGE for changes in resolution
=C2=A0 =C2=A0 =C2=A0 =C2=A0 and = monitor configuration. Handle frame-parameter 'fullscreen
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 chang= es by possibly going to fullscreen.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 * sr= c/w32term.h: Add state to w32_output for tracking monitor
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 and windo= w placement.
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 * src/w32term.c: Use w32_set_fullscreen for fullscreen= _hook.



=3D=3D=3D modified file = 9;src/w32fns.c'
*** src/w32fns.c 2012-11-21 04:47:55 +0000
--- src/w32fns.c<= span class=3D"" style=3D"white-space:pre"> 2012-12-01 23:11:52 +0000=
*************** typedef HWND (WINAPI * ImmSetComposition
***= 162,167 ****
--- 162,173 ----
=C2=A0 typedef HMONITOR = (WINAPI * MonitorFromPoint_Proc) (IN POINT pt, IN DWORD flags);
= =C2=A0 typedef BOOL (WINAPI * GetMonitorInfo_Proc)
=C2=A0 =C2=A0 (IN HMONITOR monitor, OUT struct MONITOR_INFO* info);
+ typedef HMONITOR (WINAPI * MonitorFromWindow_Proc)
+ = =C2=A0 (IN HWND hwnd, IN DWORD dwFlags);
+ typedef BOOL (CALLBACK= * MONITOR_ENUM_PROC) (HMONITOR, HDC, LPRECT, LPARAM);
+ typedef BOOL (WINAPI * EnumDisplayMonitors_Proc)
+ =C2=A0 = (IN HDC hdc, IN LPCRECT lprcClip, IN MONITOR_ENUM_PROC lpfnEnum,
= + =C2=A0 =C2=A0IN LPARAM dwData);
=C2=A0=C2=A0
=C2=A0 T= rackMouseEvent_Proc track_mouse_event_fn =3D NULL;
=C2=A0 ImmGetCompositionString_Proc get_composition_string_fn =3D NULL= ;
*************** ImmReleaseContext_Proc release_ime_conte
<= div>*** 170,175 ****
--- 176,183 ----
=C2=A0 ImmSetComp= ositionWindow_Proc set_ime_composition_window_fn =3D NULL;
=C2=A0 MonitorFromPoint_Proc monitor_from_point_fn =3D NULL;
=C2=A0 GetMonitorInfo_Proc get_monitor_info_fn =3D NULL;
+ Monit= orFromWindow_Proc monitor_from_window_fn =3D NULL;
+ EnumDisplayM= onitors_Proc enum_display_monitors_fn =3D NULL;
=C2=A0=C2=A0
=C2=A0 #ifdef NTGUI_UNICODE
=C2=A0 #d= efine unicode_append_menu AppendMenuW
*************** x_real_posi= tions (FRAME_PTR f, int *xptr
*** 372,377 ****
--- 380,= 454 ----
=C2=A0 =C2=A0 *yptr =3D rect.top;
=C2=A0 }
=C2=A0=C2=A0=
+=C2=A0
+ void
+ w32_set_fullscreen (struct = frame *f)
+ {
+ #ifdef HAVE_WINDOW_SYSTEM
+ = =C2=A0 if (f)
+ =C2=A0 =C2=A0 {
+ =C2=A0 =C2=A0 =C2=A0 HWND hwnd =3D FRAME_W32_WINDOW (f);
+= =C2=A0 =C2=A0 =C2=A0 if (f->want_fullscreen !=3D FULLSCREEN_BOTH
<= div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 && f->output_data.w32-&= gt;fullscreen)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
+ =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Restore the window style and placement. */<= /div>
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f->output_data.w32->fullscr= een =3D 0;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (f->output_= data.w32->window_placement.showCmd =3D=3D SW_HIDE)
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 SetWindowLong (hwnd, GWL_STYLE,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f->= ;output_data.w32->dwStyle | WS_CLIPCHILDREN);
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowPos (hwnd, HWND_TOP, 30, 30, 64= 0, 480,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 SWP_NOSENDCHANGING | SWP_SHOWWINDOW);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 else
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 S= etWindowLong (hwnd, GWL_STYLE, f->output_data.w32->style);
= + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowPlacement (hwnd= , &f->output_data.w32->window_placement);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowPos (hwnd,= HWND_TOP, 0, 0, 0, 0,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAME= CHANGED);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+ =C2=A0 =C2=A0 =C2=A0 else if (= f->want_fullscreen =3D=3D FULLSCREEN_BOTH
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&& !f= ->output_data.w32->fullscreen)
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Save the window sty= le and placement. */
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct = MONITOR_INFO info;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RECT moni= tor_rect;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 monitor_rect.left =3D 0;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 monitor_rect.right =3D GetSystemMetr= ics (SM_CXSCREEN);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 monitor_r= ect.top =3D 0;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 monitor_rect.= bottom =3D GetSystemMetrics (SM_CYSCREEN);
+=C2=A0
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f->output_da= ta.w32->fullscreen =3D 1;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= f->output_data.w32->window_placement.length =3D
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 sizeof (WINDOWPLACEMENT);
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 GetWindowPlacement (hwnd, &f->output_dat= a.w32->window_placement);
+=C2=A0
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f->output_da= ta.w32->style =3D GetWindowLong (hwnd, GWL_STYLE);
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowLong (hwnd, GWL_STYLE,
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ( =C2=A0f->output_data.w32= ->style
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0& (~(WS_CAPTIO= N | WS_THICKFRAME))));
+=C2=A0
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 /* If multiple monitor support is available, make the window<= /div>
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fullscreen on t= he appropriate screen. */
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (monitor_from_window_fn &&= amp; get_monitor_info_fn)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f->= ;output_data.w32->monitor =3D
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 monitor_from_window_fn (hwnd, MONITOR_DE= FAULT_TO_NEAREST);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.cbSize =3D siz= eof (struct MONITOR_INFO);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 get_monitor_info_fn (f->output_data.w32->monitor, &= info);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 monitor= _rect =3D info.rcMonitor;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+=C2=A0
<= div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowPos (FRAME_W32_WINDOW(f),= HWND_TOP, monitor_rect.left,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 monitor_rect.top, monitor_rect.right - monitor_rect.left,=
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 monitor_rect.= bottom - monitor_rect.top,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SWP_NOSENDCHANGING = | SWP_SHOWWINDOW);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+ = =C2=A0 =C2=A0 }
+ #endif
+ }
+=C2=A0
=C2=A0 =0C
=C2=A0=C2=A0
=C2=A0 DEFUN ("w32-defin= e-rgb-color", Fw32_define_rgb_color,
*************** post_character_message (HWND hwnd, UINT
*** = 2706,2711 ****
--- 2783,2810 ----
=C2=A0 =C2=A0 my_post= _msg (&wmsg, hwnd, msg, wParam, lParam);
=C2=A0 }
= =C2=A0=C2=A0
+=C2=A0
+ struct w32_monitor_info
+ {
+ =C2= =A0 =C2=A0 HMONITOR seeking;
+ =C2=A0 =C2=A0 int found;
+ };
+=C2=A0
+=C2=A0
+ static BOOL
+ w32_enum_monitors (HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor= ,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0LPARAM dwData)
+ {
+ =C2=A0 struct w32_monitor_info*= minfo =3D
+ =C2=A0 =C2=A0 =C2=A0 (struct w32_monitor_info*) dwDa= ta;
+ =C2=A0 if (minfo->seeking =3D=3D hMonitor)
+ = =C2=A0 =C2=A0 {
+ =C2=A0 =C2=A0 =C2=A0 minfo->found =3D 1;
+ =C2=A0 =C2= =A0 =C2=A0 return FALSE;
+ =C2=A0 =C2=A0 }
+ =C2=A0 ret= urn TRUE;
+ }
+=C2=A0
=C2=A0 /* Main window p= rocedure */
=C2=A0=C2=A0
=C2=A0 static LRESULT CALLBACK=
*************** w32_wnd_proc (HWND hwnd, UINT msg, WPARA
***= 2763,2768 ****
--- 2862,2926 ----
=C2=A0 =C2=A0 =C2=A0release_frame_dc (f, = get_frame_dc (f));
=C2=A0 }
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0;
+ =C2=A0 =C2=A0 case WM_DIS= PLAYCHANGE:
+ =C2=A0 =C2=A0 =C2=A0 f =3D x_window_to_frame (dpyin= fo, hwnd);
+ =C2=A0 =C2=A0 =C2=A0 if (f && f->output_d= ata.w32->fullscreen)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 /* If multiple monitor support is available, check if the monito= r
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0the window wa= s fullscreened on still exists. If not, kick it out
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0of fullscreen and let Windows reposit= ion it. */
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (monitor_from_window_fn &&= amp; get_monitor_info_fn
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 && enum_display_monitors_fn)
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 struct w32_monitor_info minfo =3D {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f->= ;output_data.w32->monitor, 0
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 };
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 enum_display_monitors_fn (NULL, NULL, w32_enum_monitors,
+= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (LPARAM) &a= mp;minfo);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!minfo.found)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
<= div>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f->= output_data.w32->fullscreen =3D 0;
+=C2=A0
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (f->output_da= ta.w32->window_placement.showCmd =3D=3D SW_HIDE)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 SetWindowLong (hwnd, GWL_STYLE,
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 f->output_data.w32->dwStyle | WS_CLIPCHILDREN);
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 SetWindowPos (hwnd, HWND_TOP, 30, 30, 640, 480,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 SWP_NOSENDCHANGING | SWP_SHOWWINDOW);
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 els= e
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowLong (hwnd, GWL_STYLE, f->output_da= ta.w32->style);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 SetWindowPlacement (hwnd,
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &f-&= gt;output_data.w32->window_placement);
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowPos (hwnd,= HWND_TOP, 0, 0, 0, 0,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER
= + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0| SWP_FRAMECHANGED));
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
= + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* The mon= itor still exists. Resize to fullscreen to account
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for a possible = resolution change. */
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 struct MONITOR_INFO info;
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.= cbSize =3D sizeof(struct MONITOR_INFO);
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 get_monitor_info_fn (f->output= _data.w32->monitor, &info);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowPos (hwnd, HWND_TOP, info.rcMon= itor.left,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 info.rcMonitor.top,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.rcMonitor.right - info.r= cMonitor.left,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.rcMonitor.bottom - info.rcMonitor.top,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 SWP_NOSENDCHANGING | SWP_SHOWWINDOW);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
= + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 else
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Resiz= e to fullscreen to account for resolution change. */
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowPos (hwnd, HWND_TOP, 0, 0, = GetSystemMetrics(SM_CXSCREEN),
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 GetSy= stemMetrics(SM_CYSCREEN),
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 SWP_NOSENDCHANGING | SWP_SHOWWINDOW);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 }
+ =C2=A0 =C2=A0 =C2=A0 return 0;
=C2=A0= =C2=A0 =C2=A0 case WM_PAINT:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
=C2=A0 =C2=A0 PAINTSTRUCT paintStruct;
*****= ********** w32_wnd_proc (HWND hwnd, UINT msg, WPARA
*** 3861,3869= ****
=C2=A0=C2=A0
=C2=A0 =C2=A0 =C2=A0 case WM_EMACS_S= ETWINDOWPOS:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
! WINDOWPOS * pos =3D (WINDOWPOS *) wParam;
= ! return SetWindowPos (h= wnd, pos->hwndInsertAfter,
! =C2=A0 =C2=A0 = pos->x, pos->y, pos->cx, pos->cy, pos->flags);
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0=C2=A0
=C2=A0 =C2=A0 = =C2=A0 case WM_EMACS_DESTROYWINDOW:
--- 4019,4061 ----
=C2=A0=C2=A0
=C2=A0 =C2=A0 =C2=A0 case WM_EMACS_SETWINDOWPOS= :
=C2=A0 =C2=A0 =C2=A0 =C2=A0 {
! =C2=A0 =C2=A0 =C2=A0 = =C2=A0 f =3D x_window_to_frame (dpyinfo, hwnd);
! =C2=A0 =C2=A0 = =C2=A0 =C2=A0 if (f && f->output_data.w32->fullscreen)
<= div>! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SetWindowLong (hwnd, GWL_S= TYLE,
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0( =C2=A0f->output_data.w32->= style
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 & (~(WS_CAPTION | WS_THICKFRA= ME))));
!=C2=A0
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Force the window to be = fullscreen. This will cause frame
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0position and size changes to be ignored. It also= keeps the
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0window correctly fullscreen when the menu or scroll bars are
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0toggled. */
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (monitor_from_windo= w_fn && get_monitor_info_fn
! =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 && =C2=A0enum_display_monitors_fn)
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
! =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct MONITOR_INFO in= fo;
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.cbSize = =3D sizeof (struct MONITOR_INFO);
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 get_monitor_info_fn (f->output_data.w32->= monitor, &info);
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 return SetWindowPos (hwnd, HWND_TOP, info.rcMonitor.left,
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 info.rcMonitor.top,
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 info.rcMonitor.right - info.rcMonitor.left,=
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 info.rcMonitor.bottom - info.rcMonitor.top,
! =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SWP_NOSENDCHANG= ING | SWP_SHOWWINDOW);
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
! =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else
! =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 return SetWindowPos (hwnd, HWND_TOP, 0, 0,
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 GetSystemMetrics(SM_CXSCREEN),
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Get= SystemMetrics(SM_CYSCREEN),
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SWP_NOSENDCHANGING | SWP_SHOWWINDOW);
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
! = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
! =C2=A0 =C2=A0 =C2=A0 =C2= =A0 else
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 WINDOWPOS * pos =3D (WINDO= WPOS *) wParam;
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 retur= n SetWindowPos (hwnd, pos->hwndInsertAfter,
! =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pos->x, pos->y, pos->cx,= pos->cy, pos->flags);
! =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 }
=C2=A0=C2=A0
=C2=A0 =C2=A0 =C2=A0 case WM_EMAC= S_DESTROYWINDOW:
*************** globals_of_w32fns (void)
*** 7685,7690 ****
--- 7877,7886 ----
=C2=A0 =C2=A0 = =C2=A0 GetProcAddress (user32_lib, "MonitorFromPoint");
=C2=A0 =C2=A0 get_monitor_info_fn =3D (GetMonitorInfo_Proc)
= =C2=A0 =C2=A0 =C2=A0 GetProcAddress (user32_lib, "GetMonitorInfoA"= ;);
+ =C2=A0 monitor_from_window_fn =3D (MonitorFromWindow_Proc)<= /div>
+ =C2=A0 =C2=A0 GetProcAddress (user32_lib, "MonitorFromWind= ow");
+ =C2=A0 enum_display_monitors_fn =3D (EnumDisplayMonitors_Proc)
=
+ =C2=A0 =C2=A0 GetProcAddress (user32_lib, "EnumDisplayMonitors&= quot;);
=C2=A0=C2=A0
=C2=A0 =C2=A0 {
=C2=A0 = =C2=A0 =C2=A0 HMODULE imm32_lib =3D GetModuleHandle ("imm32.dll")= ;

=3D=3D=3D modified file 'src/w32term.c'
*** src/w32term.c 2012= -12-01 02:38:11 +0000
--- src/w32term.c 2012-12-01 22:56:36 +0000
*************** w32_create_terminal (struct w32_display_
***= 6211,6217 ****
=C2=A0 =C2=A0 terminal->mouse_position_hook = =3D w32_mouse_position;
=C2=A0 =C2=A0 terminal->frame_rehighli= ght_hook =3D w32_frame_rehighlight;
=C2=A0 =C2=A0 terminal->frame_raise_lower_hook =3D w32_frame_raise_= lower;
! =C2=A0 /* terminal->fullscreen_hook =3D XTfullscreen_= hook; */
=C2=A0 =C2=A0 terminal->set_vertical_scroll_bar_hook = =3D w32_set_vertical_scroll_bar;
=C2=A0 =C2=A0 terminal->condemn_scroll_bars_hook =3D w32_condemn_sc= roll_bars;
=C2=A0 =C2=A0 terminal->redeem_scroll_bar_hook =3D = w32_redeem_scroll_bar;
--- 6211,6217 ----
=C2=A0 =C2=A0= terminal->mouse_position_hook =3D w32_mouse_position;
=C2=A0 =C2=A0 terminal->frame_rehighlight_hook =3D w32_frame_rehigh= light;
=C2=A0 =C2=A0 terminal->frame_raise_lower_hook =3D w32_= frame_raise_lower;
! =C2=A0 terminal->fullscreen_hook =3D w32_= set_fullscreen;
=C2=A0 =C2=A0 terminal->set_vertical_scroll_ba= r_hook =3D w32_set_vertical_scroll_bar;
=C2=A0 =C2=A0 terminal->condemn_scroll_bars_hook =3D w32_condemn_sc= roll_bars;
=C2=A0 =C2=A0 terminal->redeem_scroll_bar_hook =3D = w32_redeem_scroll_bar;

=3D=3D=3D modified file = 9;src/w32term.h'
*** src/w32term.h 20= 12-11-23 15:39:48 +0000
--- src/w32term.h 2012-12-01 22:57:00 +0000
**********= ***** struct w32_palette_entry {
*** 71,76 ****
--- 71,77 ----
=C2=A0 };
= =C2=A0=C2=A0
=C2=A0 extern void w32_regenerate_palette (struct fr= ame *f);
+ extern void w32_set_fullscreen (struct frame *f);
=C2=A0=C2=A0
=C2=A0 =0C
=C2=A0 /* For each display (currently only one on w32)= , we have a structure that
*************** struct w32_output
*** 361,366 ****
--- 362,379 ----
=C2=A0 =C2=A0 /= * The background for which the above relief GCs were set up.
=C2=A0 =C2=A0 =C2=A0 =C2=A0They are changed only when a different back= ground is involved. =C2=A0*/
=C2=A0 =C2=A0 unsigned long relief_b= ackground;
+=C2=A0
+ =C2=A0 /* Nonzero means the frame = is in fullscreen mode. */
+ =C2=A0 char fullscreen;
+=C2=A0
+ =C2=A0 /* Window placement prior to the frame goin= g fullscreen. */
+ =C2=A0 WINDOWPLACEMENT window_placement;
=
+=C2=A0
+ =C2=A0 /* Window style in place when the frame wen= t fullscreen. */
+ =C2=A0 DWORD style;
+=C2=A0
+ =C2=A0 /* Monitor = that the frame is fullscreen on. */
+ =C2=A0 HMONITOR monitor;
=C2=A0 };
=C2=A0=C2=A0
=C2=A0 extern struct w32= _output w32term_display;

--f46d0408386ba17eef04cfd5cc3c--