Commit Graph

3369 Commits

Author SHA1 Message Date
Zhiyi Zhang f8ce819ab5 user32: Report a fake monitor when running on an invisible window station.
The visible window station check was accidentally deleted in 95be042.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51590
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 11:44:06 +02:00
Akihiro Sagawa 247185ba78 user32/listbox: Fix redraw after LB_SETCOUNT message.
3ef790b968 accidentally dropped updating
LBS_DISPLAYCHANGED flag that had been done in LISTBOX_InvalidateItems()
if the count value was changed.
In fact, the newly added test shows LB_SETCOUNT message always causes
WM_DRAWITEM requests regardless of the count value.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51591
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Akihiro Sagawa a70ed810d5 user32/tests: Test pending redraw state with owner-drawn list box.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-12 17:30:21 +02:00
Rémi Bernon 2e3a0dac84 hidclass.sys: Rename WINE_HIDP_PREPARSED_DATA to struct hid_preparsed_data.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Francois Gouget a716b13974 server: Remove obsolete synthesized formats in release_clipboard().
Synthesized formats must be removed too if the format they depend on has
been removed.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51496
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Francois Gouget ce98c3b58e user32/tests: Test delayed clipboard rendering after window destruction.
If the window does not render the delayed-rendering clipboard formats
before it is destroyed, then they should be removed from the clipboard,
including the derived formats added by CloseClipboard().

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Francois Gouget 9bd3e3fbe9 user32/tests: GetClipboardData() returns no error for missing formats.
Despite the documentation that says if GetClipboardData() returns NULL
one can check GetLastError() to know why!

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 23:07:25 +02:00
Francois Gouget 1b36c21821 user32/tests: Use wine_dbgstr_a() instead of %.8s.
This should better handle NULL pointers and bad strings.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 23:06:57 +02:00
Zhiyi Zhang eedad8a8ee user32: Load uxtheme when theming is active.
In comctl32 DllMain(), IsThemeActive() is a delay-loaded function and shouldn't be called in
DllMain(). Instead, tests showed that uxtheme should be loaded by user32.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51540
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 11:40:14 +02:00
Zhiyi Zhang cbf7bdce28 user32/tests: Test that user32 loads uxtheme.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 11:40:11 +02:00
Zhiyi Zhang 883878e550 uxtheme: Support scroll bar state tracking in non-client areas.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-20 18:51:03 +02:00
Zhiyi Zhang 0a83027e20 uxtheme: Support drawing themed standard scroll bars.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39821
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-20 18:50:11 +02:00
Zhiyi Zhang b0e51ead0d uxtheme: Move themed dialog to uxtheme.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51137
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-20 18:49:55 +02:00
Zhiyi Zhang d9063802f2 uxtheme: Move themed scroll bar to uxtheme.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-20 18:49:49 +02:00
Francois Gouget 623f9569fd user32/tests: Fix the keyboard layout id in an ok() message.
The keyboard layout being tested is not the thread's default keyboard
layout.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-19 12:30:09 +02:00
Zhiyi Zhang 780e5c83dc user32: Draw scroll bar size box and size grip in a single function.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 09:55:52 +02:00
Zhiyi Zhang 09f43e0491 user32: Separate scroll bar window checks from actual drawing.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 09:55:50 +02:00
Zhiyi Zhang cead75ad56 user32: Separate scroll bar drawing calculation from actual drawing.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 09:55:48 +02:00
Zhiyi Zhang b2184e7bff user32: Pass a scroll bar tracking info parameter to SCROLL_DrawScrollBar().
Pack all scroll bar tracking information in a struct and pass that struct as a parameter to
SCROLL_DrawScrollBar() instead of using global variables.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 09:55:46 +02:00
Zhiyi Zhang e04e857a1f user32: Call SCROLL_DrawScrollBar() to draw tracks in SCROLL_HandleScrollEvent().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 09:55:43 +02:00
Zhiyi Zhang c3d8b39e9e user32: Call SCROLL_DrawScrollBar() to draw moving thumb in SCROLL_HandleScrollEvent().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-06 09:55:41 +02:00
Zhiyi Zhang b5abd53494 user32: Call SCROLL_DrawScrollBar() to draw arrows in SCROLL_HandleScrollEvent().
So that SCROLL_DrawScrollBar() can eventually be hooked by a themed scroll bar drawing function and
use a single function to draw scroll bars, instead of hooking multiple scroll bar drawing functions
that draw different parts.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 17:40:39 +02:00
Zhiyi Zhang 5541cf32c5 user32: Introduce a SCROLL_DrawNCScrollBar() to draw scroll bars in non-client area.
Having a SCROLL_DrawNCScrollBar() in scroll.c enables it to access global variables there. So that
global variables access in SCROLL_DrawScrollBar() can be moved outside of it and
SCROLL_DrawScrollBar() can then be refactored into a function without access to global variables.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 17:40:31 +02:00
Zhiyi Zhang ac6817de54 user32: Modify SCROLL_MovingThumb outside of SCROLL_DrawMovingThumb().
SCROLL_MovingThumb is a global variable. Gradually move it out of scroll bar drawing functions so
that those drawing functions can be refactored in a way that doesn't need access to global variables.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 17:40:14 +02:00
Zhiyi Zhang d164f06279 user32: Remove SCROLL_DrawInterior_9x().
SCROLL_DrawInterior_9x() has the same functionality as SCROLL_DrawInterior().

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 17:40:09 +02:00
Zhiyi Zhang 4819ea8509 user32: Avoid unnecessary scroll bar drawing.
These drawing operations are either overwritten by other drawing functions later or not needed at all.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-05 17:40:02 +02:00
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
Stefan Dösinger efa52619af user32: Delete info.hbmColor and hbmMask after copying.
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 20:49:27 +02:00
Stefan Dösinger 7ec5a7e1b6 user32: Release the icon frame in CopyImage.
Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-10 20:49:27 +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
Rémi Bernon dc7547a84b hidclass.sys: Factor HIDP_BUTTON_CAPS with HIDP_VALUE_CAPS.
Buttons are really just values with BitSize == 1, and having a union for
that makes the code more complicated than it needs.

We'll simplify the code a lot using HIDP_VALUE_CAPS everywhere, as the
two structure types are compatible.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-04 20:00:30 +02:00
Rémi Bernon 3f3d445383 user32: Use nameless unions in rawinput.c.
Signed-off-by: Rémi Bernon <rbernon@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 031aef852e user32: Debugstr_format() should not modify the last error.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-03 21:50:58 +02:00
Rémi Bernon fc64aa7e7c server: Send HID report data with the WM_INPUT messages.
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-05-31 12:31:21 +02:00
Rémi Bernon 1128a37e77 user32: Implement WM_INPUT / RIM_TYPEHID message dispatch.
Without any HID report data for now.

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-05-31 12:30:41 +02:00
Rémi Bernon ae7458aca6 user32: Inform rawinput_from_hardware_message of available buffer size.
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-05-31 12:30:36 +02:00
Rémi Bernon e8498788e8 server: Add hardware_msg_data size for variable size messages.
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-05-31 12:30:36 +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
Piotr Caban a1ca90d68a user32: Depend on SetWindowPos to refresh window manager hints in SetWindowRgn.
Otherwise both on Linux and Mac, the window will not restore title bar
when it becomes non-shaped until it's e.g. moved.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 21:25:56 +02:00
Zebediah Figura d2259665b4 user32: Blit the right bitmap when stretching monochrome icons in CopyImage().
Fixes: beb70a79e1
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-25 09:30:05 +02:00