We are seeing a problem in Metacity where a fullscreen window obscures a
second created window that has a particular style: WS_DLGFRAME |
WS_THICKFRAME.
When window A is created fullscreen (WS_POPUP, size matches screen res)
and window B is created as an "owned window"
(WS_DLGFRAME|WS_THICKFRAME|WS_OVERLAPPED style with "A" as its parent)
you cannot see "B" if Metacity is running.
You can if other window managers are running. We tried kwin, xfce,
fluxbox, enlightenment or fvvm. So the problem is something specific to
Metacity.
You can also see window "B" if you remove either the WS_DLGFRAME or
WS_THICKFRAME bit from the style.
Any hints about where to look within Wine or what could be happening?
- mo
PS: the code (ctrl+c to quit)...
#include <windows.h>
const char g_szClassName[] = "myWindowClass";
// Step 4: the Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX wc;
HWND hwnd, hwnd4;
MSG Msg;
//Step 1: Registering the Window Class
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = g_szClassName;
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
if(!RegisterClassEx(&wc))
{
MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
// Step 2: Creating the Window
int width = ::GetSystemMetrics(SM_CXSCREEN);
int height = ::GetSystemMetrics(SM_CYSCREEN);
hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
"A",
WS_POPUP,
CW_USEDEFAULT, CW_USEDEFAULT, width, height,
NULL, NULL, hInstance, NULL);
if(hwnd == NULL)
{
MessageBox(NULL, "Window Creation Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
hwnd4 = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
"B",
#if 1 // invisible
WS_DLGFRAME|WS_THICKFRAME|WS_OVERLAPPED,
#else // visible
WS_THICKFRAME|WS_OVERLAPPED,
#endif
300, 300, 240, 120,
hwnd, NULL, hInstance, NULL);
if(hwnd4 == NULL)
{
MessageBox(NULL, "Window Creation Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK);
return 0;
}
ShowWindow(hwnd, nCmdShow);
ShowWindow(hwnd4, nCmdShow);
UpdateWindow(hwnd);
UpdateWindow(hwnd4);
// Step 3: The Message Loop
while(GetMessage(&Msg, NULL, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}