This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
RE: Patch for maximize-restore positioning
- From: Jean-Claude Gervais <jc dot gervais at videotron dot ca>
- To: cygwin-xfree at cygwin dot com
- Date: Mon, 12 May 2003 20:07:50 -0400
- Subject: RE: Patch for maximize-restore positioning
- Reply-to: cygwin-xfree at cygwin dot com
Could this patch address the problem I was having where when I would run a
DirectX app on one monitor (at a different resolution than the second
monitor) when the app would end, the X desktop would no longer be at 0,0 but
rather moved over like at 800,0 ?
-----Original Message-----
From: cygwin-xfree-owner@cygwin.com [mailto:cygwin-xfree-owner@cygwin.com]On
Behalf Of Harold L Hunt II
Sent: Monday, May 12, 2003 4:41 PM
To: cygwin-xfree@cygwin.com
Subject: Re: Patch for maximize-restore positioning
Earle,
Could you flip the order that you pass the filenames to diff? Notice
that it has '-'s in front of your new lines, whereas they should be
'+'s, since you added them.
Thanks for contributing,
Harold
Earle F. Philhower, III wrote:
> I thought about it some more and it's not too hard to restore the proper
> position of a maximized window, we WILL get a WM_SIZE when it's restored,
> we just need to cache a flag saying that for this WM_SIZE event we
> need to move the window...
>
> Here's a diff -U3 patch. We need to change winwindow.h and
> winmultiwindow.c...
>
> -----------8<-------------------------
> --- winmultiwindowwindow.c 2003-05-12 13:31:05.000000000 -0700
> +++ /tmp/x/newwinmultiwindowwindow.c 2003-05-11
17:49:31.000000000 -0700
> @@ -126,7 +126,6 @@
> pWinPriv->hWnd = NULL;
> pWinPriv->pScreenPriv = winGetScreenPriv(pWin->drawable.pScreen);
> pWinPriv->fXKilled = FALSE;
> - pWinPriv->fNeedRestore = FALSE;
>
> return fResult;
> }
> @@ -1238,31 +1237,14 @@
> /* of current screen. Now it is save for X to know about this.
*/
> if (wParam==SIZE_MAXIMIZED) {
> POINT home;
> -
> - pWinPriv->fNeedRestore = TRUE;
> - pWinPriv->ptRestore.x = pWinPriv->iX;
> - pWinPriv->ptRestore.y = pWinPriv->iY;
> home.x = 0;
> home.y = 0;
> ClientToScreen(hwnd, &home);
> -
> /* Map from screen (-X,-Y) to (0,0) root coords */
> winMoveXWindow (pWin,
> home.x - wBorderWidth (pWin) -
GetSystemMetrics(SM_XVIRTUALSCREEN),
> home.y - wBorderWidth (pWin) -
GetSystemMetrics(SM_YVIRTUALSCREEN));
> - } else if (wParam==SIZE_RESTORED && pWinPriv->fNeedRestore) {
> - /* If need restore and !maximized then move to cached position
*/
> - WINDOWPLACEMENT windPlace;
> - windPlace.length = sizeof(WINDOWPLACEMENT);
> - GetWindowPlacement(hwnd, &windPlace);
> - if (windPlace.showCmd!=SW_MAXIMIZE &&
windPlace.showCmd!=SW_SHOWMAXIMIZED)
> - {
> - pWinPriv->fNeedRestore = FALSE;
> - winMoveXWindow (pWin,
> - pWinPriv->ptRestore.x - wBorderWidth
(pWin) - GetSystemMetrics(SM_XVIRTUALSCREEN),
> - pWinPriv->ptRestore.y - wBorderWidth
(pWin) - GetSystemMetrics(SM_YVIRTUALSCREEN));
> - }
> - }
> + }
>
> winResizeXWindow (pWin,
> LOWORD(lParam),
> @@ -1365,8 +1347,6 @@
> }
>
> --------8<----------------------
> --- winwindow.h 2003-05-12 11:45:28.000000000 -0700
> +++ /tmp/x/winwindow.h 2003-05-01 09:31:04.000000000 -0700
> @@ -70,8 +70,6 @@
> int iWidth;
> int iHeight;
> Bool fXKilled;
> - Bool fNeedRestore;
> - POINT ptRestore;
> } winPrivWinRec, *winPrivWinPtr;
>
> typedef struct _winWMMessageRec{
> ------------------8<--------------------