Xming: Correctly parent XA_WM_TRANSIENT_FOR windows in -multiwindow mode when a windows window is created.
Fix internal WM to correctly parent XA_WM_TRANSIENT_FOR windows in -multiwindow mode when a windows window is created, and to de-iconize parent windows when a child window acquires focus. XXX: Perhaps we should also shuffle parent(s) forward through Z-order when a child acquires focus? Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This commit is contained in:
parent
8d82d806ee
commit
d84e0e3877
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
|
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
|
||||||
|
*Copyright (C) Colin Harrison 2005-2008
|
||||||
*
|
*
|
||||||
*Permission is hereby granted, free of charge, to any person obtaining
|
*Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
@ -28,6 +29,7 @@
|
||||||
* Authors: Kensuke Matsuzaki
|
* Authors: Kensuke Matsuzaki
|
||||||
* Earle F. Philhower, III
|
* Earle F. Philhower, III
|
||||||
* Harold L Hunt II
|
* Harold L Hunt II
|
||||||
|
* Colin Harrison
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_XWIN_CONFIG_H
|
#ifdef HAVE_XWIN_CONFIG_H
|
||||||
|
@ -476,6 +478,7 @@ winCreateWindowsWindow (WindowPtr pWin)
|
||||||
int iWidth;
|
int iWidth;
|
||||||
int iHeight;
|
int iHeight;
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
|
HWND hFore = NULL;
|
||||||
WNDCLASSEX wc;
|
WNDCLASSEX wc;
|
||||||
winWindowPriv(pWin);
|
winWindowPriv(pWin);
|
||||||
HICON hIcon;
|
HICON hIcon;
|
||||||
|
@ -486,6 +489,7 @@ winCreateWindowsWindow (WindowPtr pWin)
|
||||||
static int s_iWindowID = 0;
|
static int s_iWindowID = 0;
|
||||||
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
|
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
|
||||||
WinXSizeHints hints;
|
WinXSizeHints hints;
|
||||||
|
WindowPtr pDaddy;
|
||||||
|
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
|
ErrorF ("winCreateWindowsWindow - pWin: %08x\n", pWin);
|
||||||
|
@ -560,6 +564,15 @@ winCreateWindowsWindow (WindowPtr pWin)
|
||||||
wc.lpszClassName = pszClass;
|
wc.lpszClassName = pszClass;
|
||||||
RegisterClassEx (&wc);
|
RegisterClassEx (&wc);
|
||||||
|
|
||||||
|
if (winMultiWindowGetTransientFor (pWin, &pDaddy))
|
||||||
|
{
|
||||||
|
if (pDaddy)
|
||||||
|
{
|
||||||
|
hFore = GetForegroundWindow();
|
||||||
|
if (hFore && (pDaddy != (WindowPtr)GetProp(hFore, WIN_WID_PROP))) hFore = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Create the window */
|
/* Create the window */
|
||||||
/* Make it OVERLAPPED in create call since WS_POPUP doesn't support */
|
/* Make it OVERLAPPED in create call since WS_POPUP doesn't support */
|
||||||
/* CW_USEDEFAULT, change back to popup after creation */
|
/* CW_USEDEFAULT, change back to popup after creation */
|
||||||
|
@ -571,7 +584,7 @@ winCreateWindowsWindow (WindowPtr pWin)
|
||||||
iY, /* Vertical position */
|
iY, /* Vertical position */
|
||||||
iWidth, /* Right edge */
|
iWidth, /* Right edge */
|
||||||
iHeight, /* Bottom edge */
|
iHeight, /* Bottom edge */
|
||||||
(HWND) NULL, /* No parent or owner window */
|
hFore, /* Null or Parent window if transient*/
|
||||||
(HMENU) NULL, /* No menu */
|
(HMENU) NULL, /* No menu */
|
||||||
GetModuleHandle (NULL), /* Instance handle */
|
GetModuleHandle (NULL), /* Instance handle */
|
||||||
pWin); /* ScreenPrivates */
|
pWin); /* ScreenPrivates */
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
|
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
|
||||||
|
*Copyright (C) Colin Harrison 2005-2008
|
||||||
*
|
*
|
||||||
*Permission is hereby granted, free of charge, to any person obtaining
|
*Permission is hereby granted, free of charge, to any person obtaining
|
||||||
* a copy of this software and associated documentation files (the
|
* a copy of this software and associated documentation files (the
|
||||||
|
@ -28,6 +29,7 @@
|
||||||
* Authors: Kensuke Matsuzaki
|
* Authors: Kensuke Matsuzaki
|
||||||
* Earle F. Philhower, III
|
* Earle F. Philhower, III
|
||||||
* Harold L Hunt II
|
* Harold L Hunt II
|
||||||
|
* Colin Harrison
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_XWIN_CONFIG_H
|
#ifdef HAVE_XWIN_CONFIG_H
|
||||||
|
@ -654,6 +656,12 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
|
||||||
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
|
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
{
|
||||||
|
/* Get the parent window for transient handling */
|
||||||
|
HWND hParent = GetParent(hwnd);
|
||||||
|
if (hParent && IsIconic(hParent)) ShowWindow (hParent, SW_RESTORE);
|
||||||
|
}
|
||||||
|
|
||||||
winRestoreModeKeyStates ();
|
winRestoreModeKeyStates ();
|
||||||
|
|
||||||
/* Add the keyboard hook if possible */
|
/* Add the keyboard hook if possible */
|
||||||
|
|
Loading…
Reference in New Issue