Commit Graph

1770 Commits

Author SHA1 Message Date
Francois Gouget f593babf6d user32/tests: Fix the wording of an ok() message.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 11:59:19 +02:00
Francois Gouget ce0b7342c0 user32/tests: Use WineTest contexts to simplify test_mdi().
This also fixes the many ok() calls that were missing context
information.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 11:59:12 +02:00
Zhiyi Zhang 04b4d0f380 gdi32: Partially implement HALFTONE stretch mode.
COLORONCOLOR(STRETCH_DELETESCANS) was used in place of HALFTONE. COLORONCOLOR mode may delete rows
of pixels without trying to preserve information so it will cause Wine to render poorly when the
destination rectangle is small.

According to tests, HALFTONE mode uses box filter when doing integer downscaling and nearest
neighbor interpolation when doing upscaling in both horizontally and vertically. In other cases,
HALFTONE mode uses a lanczos3 like algorithm to interpolate pixels. There are also other heuristics
involved. For example, shrinking a 2x2 image to 1x1 may not use box filter depending on image data.
Since this algorithm is undocumented, it's difficult to reverse engineer the original algorithm and
produce identical results. Instead, this patch uses a naive implementation of bilinear interpolation
to implement HALFTONE mode and it produces good quality images.

For 8-bit and lower color depth images, nulldrv_StretchBlt should resize the images first and then
converts color depth.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46375
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-15 20:43:55 +02:00
Francois Gouget a21d4fb8e3 user32/tests: Use the caller line number for open_clipboard() & co.
In particular this stops the traces in open_clipboard() and
has_no_open_wnd() from clobbering the line number when used in
expressions such as ok(has_no_open_wnd(), ...).

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 18:45:44 +02:00
Francois Gouget 91a791e517 user32/tests: Preserve the initial GetLastError() value for test_ClipboardOwner().
One of the tests expects GetLastError() to still return 0xdeadbeef after
has_no_open_wnd(), which would not be the case if another process did
open the clipboard.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-11 18:45:44 +02:00
Francois Gouget 222d2d94e0 user32/tests: Use winetest contexts to simplify set_clipboard_data_process().
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-08 22:28:44 +02:00
Zhiyi Zhang d171d11167 gdi32: Return correct color depth for display DCs in GetDeviceCaps().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=29184
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-07 21:31:54 +02:00
Francois Gouget f58505d1db user32/tests: Protect GetOpenClipboardWindow() from interference.
As for OpenClipboard(), if another application opened the clipboard,
GetOpenClipboardWindow() will not return the expected value.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Francois Gouget 316eec8f66 user32/tests: Protect OpenClipboard() from interference.
Applications using ole32's clipboard API (e.g. Radeon / QT5) end up
monitoring the content of the clipboard and calling OpenClipboard()
while user32:clipboard runs. This causes the test's own
OpenClipboard() calls to fail.
Similarly the KDE clipboard manager may query the Wine clipboard
content while the test runs, causing winex11.drv to call
OpenClipboard() with the same effect.
So call OpenClipboard() again when it fails due to the clipboard
already being open. If opening the clipboard still fails, trace who
opened the clipboard, particularly the window class name to help
identify the source of interference.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Francois Gouget 76a027b75d user32/tests: Use winetest contexts to simplify test_string().
This ensures all traces have the relevant context information, in
particular the OpenClipboard() checks, and simplifies the ok() calls.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-03 21:54:41 +02:00
Francois Gouget c59cd90633 user32/tests: Use wine_{push,pop}_context() to simplify test_synthesized().
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-03 21:54:39 +02:00
Francois Gouget 35180d368a user32/tests: Trace GetLastError() when OpenClipboard() fails in edit.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-28 21:54:19 +02:00
Francois Gouget 764e7d0854 user32/tests: Fix a typo in a comment.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-28 21:54:08 +02:00
Zebediah Figura 0da35c26a1 user32: Implement InternalGetWindowIcon().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47915
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 11:42:37 +02:00
Zebediah Figura beb70a79e1 user32: Implement stretching of cursor and icon objects in CopyImage().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 11:42:37 +02:00
Zebediah Figura db2b266c57 user32: Handle monochrome icons in CreateIcon() and CreateCursor() instead of CreateIconIndirect().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-24 11:42:37 +02:00
Francois Gouget cf85253a9c user32/tests: Fix the clipboard format id vs. atom table checks.
One cannot assume that a random integer has zero chance of being a valid
atom.
Reenable the GlobalFindAtomA() check in a todo_wine.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-21 08:56:33 +02:00
Rémi Bernon ba7d543c5c user32/tests: Use int for wait_move_event delay type.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-20 22:05:32 +02:00
Francois Gouget 948f20312b user32/tests: Fix the clipboard CF_LOCALE test.
By default CF_LOCALE matches the current input language, not the default
user LCID.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-20 22:05:32 +02:00
Francois Gouget a5639d62b5 user32/tests: Avoid copying the clipboard buffer sizes everywhere.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-20 22:05:32 +02:00
Zhiyi Zhang c5ed4893b3 user32/tests: Add display DC color depth tests.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 20:35:05 +02:00
Zhiyi Zhang a92ab08688 winex11.drv: Support reporting emulated display depth.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 20:35:01 +02:00
Zhiyi Zhang cad102465d user32/tests: Do not change adapters to every available modes.
This reduce the time to run the monitor test from 6 minutes to 25 seconds.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50086
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 20:32:05 +02:00
Rémi Bernon acecfc6336 user32/tests: Recreate the window to make it more likely to have focus.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-14 20:56:10 +02:00
Rémi Bernon 516c7e0dd8 user32/tests: Initialize the cursor position in test_GetRawInputBuffer.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-14 20:56:08 +02:00
Rémi Bernon 1cfc34551e user32/tests: Skip inconsistent OemKeyScan tests on non-us keyboard.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-14 20:56:05 +02:00
Francois Gouget 07293cfe7d user32/tests: Remove the Cygwin/XFree86 checks.
They are very old and likely no longer relevant.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-07 22:22:49 +02:00
Rémi Bernon b943a69c1b user32/tests: Add tests for keyboard layout preload list.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-07 22:22:49 +02:00
Rémi Bernon 82211cd478 user32: Remove unnecessary MOUSE / KEYBOARD special cases.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-04 21:33:15 +02:00
Rémi Bernon 6a0eb7a5f2 user32: Set last error codes on GetRawInputDeviceInfoW failure.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-04 21:33:15 +02:00
Rémi Bernon f2759829f8 user32: Use rawinput device handles to identify devices.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 23:20:41 +02:00
Ziqing Hui 1ab8710016 user32/tests: Add tests for maximizing and restoring windows without WS_CAPTION.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 16:52:30 +02:00
Rémi Bernon 60c7823dcb user32/tests: Add more GetKeyboardLayout(Name) tests.
At least on recent Windows, the HKL values are a combination of user
selected UI language in the low word, and keyboard layout id in the high
word.

The keyboard layout id used in HKL is sometimes different from its name,
as returned by GetKeyboardLayoutName, in which case it's the "Layout Id"
value in the corresponding registry key under the layout name.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 16:52:30 +02:00
Rémi Bernon 092c7a09a5 user32: Implement SendInput INPUT_HARDWARE check.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 21:23:06 +02:00
Rémi Bernon 2f8da3c12a user32/tests: Add more SendInput tests.
Validating that SendInput with INPUT_HARDWARE type should be no-op.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50506
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 21:23:02 +02:00
Rémi Bernon 5a8bc554ef winex11.drv: Use X11 root-relative coordinates when possible.
Since whole_rect / client_rect are updated asynchronously, there may be
a small lag between X11 and Wine regarding the expected window position.

Then, as events' x and y fields are reported relative to the X11 window
position, this lag can cause inconsistencies when we compute absolute
mouse positions.

Also, applications that control their own position while being moved
cause additional whole_rect / client_rect updates, before X11 knows
about it.

This can make applications like Winamp go nuts when they are being moved
and move all over the place "randomly".

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46309
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-06 22:46:12 +02:00
Rémi Bernon 6d6b420243 user32/tests: Add a test for SetCursorPos / SetWindowPos interactions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-06 22:46:12 +02:00
Rémi Bernon ee7c17c16d user32/tests: Add GetKeyState tests vs SetKeyboardState calls.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27238
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31899
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35907
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45385
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 22:50:08 +02:00
Rémi Bernon 53a6b55ff6 user32/tests: Repeat each GetKeyState test a few times.
As it changes the results on the second and later iterations.

This shows for instance that without a thread message queue, the first
key press is always missed but then the thread input will follow desktop
async keystate updates.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27238
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31899
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35907
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45385
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 22:50:04 +02:00
Rémi Bernon c19cba3f03 user32/tests: Factor GetKeyState test checks together.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27238
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=31899
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35907
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45385
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 22:49:59 +02:00
Piotr Caban 4bb337fb63 user32: Add clipping region tests on window resize.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-18 22:04:01 +01:00
Alexandre Julliard 0d017b12cf user32/tests: Remove todo from a test that seems to succeed reliably now.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-10 20:44:47 +01:00
Zhiyi Zhang a11ffeec96 user32/tests: Add optional messages to test sequences.
Fix a possible test failure on Win10 2009.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 18:48:07 +01:00
Zhiyi Zhang 068cf6f02c user32/tests: Fix a test failure on w7u_2qxl TestBot VM.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-22 18:41:55 +01:00
Zhiyi Zhang 3898ad408b user32: Send a WM_ACTIVATE message after restoring a minimized top level window.
The WmShowRestoreMinimizedOverlappedSeq message sequence in tests
clearly show that there is a WM_ACTIVATE message at the end of
ShowWindow() calls after restoring a minimized window, and it's
not from SetFocus().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47507
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-18 22:39:34 +01:00
Rémi Bernon 9942948097 user32/tests: Add tests for SetKeyboardState / GetKeyState interactions.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 22:21:13 +01:00
Rémi Bernon 70e67d1d20 user32/tests: Add tests for GetKeyState / GetKeyboardState interactions.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 22:21:13 +01:00
Rémi Bernon e10cf973d5 user32/tests: Add more tests for GetKeyState from background thread.
It looks like that GetKeyState is supposed to catch key presses when
called from a background thread even after its thread message queue and
thread input structures have been created.

This happens in Bioshock 2 Remaster, and causes the game to stay forever
on a "Press space to continue" screen, as the thread checking for space
key press calls GetKeyState repeatedly (and PeekMessage), although it's
in background.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=26269
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-17 22:21:13 +01:00
Gabriel Ivăncescu dd417540bb user32: Keep toplevel minimized windows offscreen if they're already.
Some applications (e.g. Lego Worlds, Hitman 2) use (-32000,-32000) to
determine whether a window is minimized.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 23:11:22 +01:00
Gabriel Ivăncescu 9ef33b5e20 user32/tests: Test minimized window placement after trying to change position.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-04 23:11:22 +01:00