--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: wine: d3d9 doesn't work on WS_CHILD windows
- From: Alfred Agrell <blubban@gmail.com>
- Date: Sat, 05 Aug 2023 12:36:37 +0200
- Message-id: <169123179727.730948.2439466112547124164.reportbug@iceberg>
Package: wine
Version: 8.0~repack-4
Severity: normal
X-Debbugs-Cc: blubban@gmail.com
Dear Maintainer,
please compile and run the following program (x86_64-w64-mingw32-gcc test.c -ld3d9 && wine a.exe):
#include <stdio.h>
#include <stdint.h>
#include <windows.h>
#include <d3d9.h>
HWND wnd_parent;
HWND wnd;
int f;
LRESULT myWindowProcA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
printf("%d %u %d\n", hWnd==wnd, Msg, f++);
if (Msg == WM_CLOSE)
exit(0);
return DefWindowProcA(hWnd, Msg, wParam, lParam);
}
int main()
{
WNDCLASSEXA wcex = { sizeof(WNDCLASSEX), CS_DBLCLKS, myWindowProcA, 0L, 0L, NULL, NULL, NULL, NULL, NULL, "windowclass", NULL };
RegisterClassEx(&wcex);
WNDCLASSEXA wcex2 = { sizeof(WNDCLASSEX), 0, myWindowProcA, 0L, 0L, NULL, NULL, NULL, NULL, NULL, "windowclass_child", NULL };
RegisterClassEx(&wcex2);
uint32_t wstyle = WS_CAPTION|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE|WS_SYSMENU|WS_MINIMIZEBOX;
uint32_t wstyleex = WS_EX_ACCEPTFILES|WS_EX_WINDOWEDGE|WS_EX_CONTROLPARENT;
wnd_parent = CreateWindowExA(wstyleex, "windowclass", "parent", wstyle, 0, 0, 640, 480, NULL, NULL, NULL, NULL );
ShowWindow(wnd_parent, SW_SHOWDEFAULT);
UpdateWindow(wnd_parent);
wnd = CreateWindowExA(0, "windowclass_child", "child", WS_CHILD, 0, 0, 320, 240, wnd_parent, NULL, NULL, NULL );
ShowWindow(wnd, SW_SHOWDEFAULT);
UpdateWindow(wnd);
IDirect3D9* d3d = Direct3DCreate9(D3D_SDK_VERSION);
DWORD BehaviorFlags = D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED;
D3DPRESENT_PARAMETERS d3dpp = {};
D3DDISPLAYMODE dm;
IDirect3D9_GetAdapterDisplayMode(d3d, D3DADAPTER_DEFAULT, &dm);
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_COPY;
d3dpp.BackBufferFormat = dm.Format;
d3dpp.BackBufferHeight = 640;
d3dpp.BackBufferWidth = 480;
d3dpp.hDeviceWindow = wnd_parent;
IDirect3DDevice9* d3ddev;
IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, BehaviorFlags, &d3dpp, &d3ddev);
IDirect3D9* d3d2 = Direct3DCreate9(D3D_SDK_VERSION);
d3dpp.hDeviceWindow = wnd;
IDirect3DDevice9* d3ddev2;
IDirect3D9_CreateDevice(d3d2, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, BehaviorFlags, &d3dpp, &d3ddev2);
for (int frame=0;frame<600;frame++)
{
IDirect3DDevice9_Clear(d3ddev, 0,NULL,D3DCLEAR_TARGET,D3DCOLOR_RGBA(255,0,frame*4,0),1.0f,0);
IDirect3DDevice9_Present(d3ddev, NULL, NULL, NULL, NULL );
IDirect3DDevice9_Clear(d3ddev2, 0,NULL,D3DCLEAR_TARGET,D3DCOLOR_RGBA(0,255,frame*4,0),1.0f,0);
IDirect3DDevice9_Present(d3ddev2, NULL, NULL, NULL, NULL );
MSG msg;
while( (PeekMessage( &msg, NULL, 0, 0, PM_REMOVE )) != 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
Expected behavior:
Should show an animated green-teal rectangle, and an animated red-magenta L shape.
Actual behavior:
Shows a black rectangle, and the expected red-magenta L shape. Dragging another window over the black rectangle leaves the pixels unchanged, duplicating the window border a bunch of times.
I have verified that the expected result shows up
- if I build Wine 8.0 from source
- if I build latest Wine git from source (somewhere around version 8.13)
- on Ubuntu 22.04's Wine package (6.0.3~repack-1)
- on Arch's Wine package (8.13-1)
- on Windows 7
- on Windows 10
therefore I believe that this bug is Debian-specific somehow.
-- Package-specific info:
/usr/bin/wine points to /usr/bin/wine-stable.
-- System Information:
Debian Release: 12.1
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.1.0-10-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages wine depends on:
ii wine32 8.0~repack-4
ii wine64 8.0~repack-4
wine recommends no packages.
Versions of packages wine suggests:
ii dosbox 0.74-3-4+b1
pn exe-thumbnailer | kio-extras <none>
pn playonlinux <none>
pn q4wine <none>
pn winbind <none>
pn wine-binfmt <none>
pn winetricks <none>
Versions of packages libwine depends on:
ii libasound2 1.2.8-1+b1
ii libc6 2.36-9+deb12u1
ii libcapi20-3 1:3.27-3+b1
ii libfontconfig1 2.14.1-4
ii libfreetype6 2.12.1+dfsg-5
ii libglib2.0-0 2.74.6-2
ii libgphoto2-6 2.5.30-1
ii libgphoto2-port12 2.5.30-1
ii libgstreamer-plugins-base1.0-0 1.22.0-3+deb12u1
ii libgstreamer1.0-0 1.22.0-2
ii libpcap0.8 1.10.3-1
ii libpulse0 16.1+dfsg1-2+b1
ii libudev1 252.12-1~deb12u1
ii libunwind8 1.6.2-3
ii libusb-1.0-0 2:1.0.26-1
ii libx11-6 2:1.8.4-2+deb12u1
ii libxext6 2:1.3.4-1+b1
ii libz-mingw-w64 1.2.13+dfsg-1
ii ocl-icd-libopencl1 [libopencl1] 2.3.1-1
Versions of packages libwine recommends:
ii fonts-liberation 1:1.07.4-11
ii fonts-wine 8.0~repack-4
ii gstreamer1.0-plugins-good 1.22.0-5+deb12u1
ii libasound2-plugins 1.2.7.1-1
ii libcups2 2.4.2-3+deb12u1
ii libdbus-1-3 1.14.8-2~deb12u1
ii libgl1 1.6.0-1
ii libgl1-mesa-dri 22.3.6-1+deb12u1
ii libgnutls30 3.7.9-2
ii libgssapi-krb5-2 1.20.1-2
ii libkrb5-3 1.20.1-2
ii libodbc2 2.3.11-2+deb12u1
ii libosmesa6 22.3.6-1+deb12u1
ii libsdl2-2.0-0 2.26.5+dfsg-1
ii libv4l-0 1.22.1-5+b2
ii libvulkan1 1.3.239.0-1
ii libxcomposite1 1:0.4.5-1
ii libxcursor1 1:1.2.1-1
ii libxfixes3 1:6.0.0-2
ii libxi6 2:1.8-1+b1
ii libxinerama1 2:1.1.4-3
ii libxrandr2 2:1.5.2-2+b1
ii libxrender1 1:0.9.10-1.1
ii libxxf86vm1 1:1.1.4-1+b2
Versions of packages libwine suggests:
pn cups-bsd <none>
ii gstreamer1.0-libav 1.22.0-2
ii gstreamer1.0-plugins-bad 1.22.0-4+deb12u1
ii gstreamer1.0-plugins-ugly 1.22.0-2
pn ttf-mscorefonts-installer <none>
Versions of packages wine32 depends on:
ii libc6 2.36-9+deb12u1
ii libwine 8.0~repack-4
wine32 recommends no packages.
Versions of packages wine32 suggests:
pn wine32-preloader <none>
Versions of packages wine64 depends on:
ii libc6 2.36-9+deb12u1
ii libwine 8.0~repack-4
Versions of packages wine64 recommends:
ii wine32 8.0~repack-4
Versions of packages wine64 suggests:
pn wine64-preloader <none>
Versions of packages wine is related to:
pn dxvk <none>
pn dxvk-wine32-development <none>
pn dxvk-wine64-development <none>
ii fonts-wine 8.0~repack-4
-- no debconf information
--- End Message ---