Commit Graph

3386 Commits

Author SHA1 Message Date
Connor McAdams 0c92fa4472 user32/tests: Fix ShowWindow() message sequences to support winevents.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:27:50 +02:00
Connor McAdams 7dc032e851 user32/tests: Mark some winevents optional in the ShowWindow sequences.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:27:47 +02:00
Connor McAdams a4e4ef1926 user32/tests: Add optional message to fix ShowWindow test.
Windows 7 sometimes sends an optional WM_WINDOWPOSCHANGED message along
with the optional WM_WINDOWPOSCHANGING message.

Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:27:44 +02:00
Connor McAdams a526091307 user32/tests: Fix SetParent/SetFocus message sequences to support winevents.
Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:27:41 +02:00
Connor McAdams 8ef2f0c9ee user32/tests: Mark some winevents optional in the SetParent sequence.
Earlier patch set messages within the sequence to be optional, update
winevents in sequence to match this.

Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:27:31 +02:00
Zhiyi Zhang 52c44bd8f0 user32: Scale scroll bar minimum thumb size according to DPI.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 10:21:43 +02:00
Zhiyi Zhang e0c0f0f19a user32: Change scroll bar minimum thumb size to 8 pixels.
It's 8 pixels on XP and Win 7. On Win 10, it's the same size as themed scroll bar thumb.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-09 10:21:34 +02:00
Gabriel Ivăncescu 54eea6f072 user32: Don't save maximized pos of top-level wnds covering whole work rect.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51672
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 17:06:53 +02:00
Gabriel Ivăncescu d8252025d1 user32: Add a helper to retrieve the work rect.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 17:06:28 +02:00
Zhiyi Zhang 2d51077a22 user32/tests: Add DisplayConfigSetDeviceInfo() tests.
Test that DisplayConfigSetDeviceInfo() can be used for getting and setting display DPI.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-01 17:06:22 +02:00
Francois Gouget e2b0fb9857 user32: Fix ASCII / ANSI mixups in comments.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-31 16:07:28 +02:00
Francois Gouget 261956b6fd user32/tests: Use WineTest contexts to simplify test_LoadImage{Bitmap,File}().
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-27 20:27:22 +02:00
Tim Clem b4333216a7 user32: Load libpng in DllMain.
libpng is currently loaded on the first attempt to access a PNG icon
or cursor. That creates a race condition that can deadlock the loader
in certain circumstances if LoadIcon or LoadCursor is called while the
loader lock is held, e.g. from a DllMain.

Signed-off-by: Tim Clem <tclem@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-27 18:06:29 +02:00
Francois Gouget fa18bc5660 user32/tests: Fix ASCII / ANSI mixups in dde comments.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 21:49:09 +02:00
Francois Gouget 2d52e16f2a user32/tests: Fix an ASCII / ANSI mixup in a dde ok() message.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-26 21:49:09 +02:00
Francois Gouget 37f492ae55 services/tests: Vista+ returns fixed 1024x768 WinDisc monitor information.
Unlike Windows XP which returned the actual display information to
non-interactive services.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-23 12:08:18 +02:00
Dmitry Timoshkov be8501ac6f user32: Check control type in the STM_SETIMAGE/STM_SETICON handlers before calling the helpers.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-18 20:08:44 +02:00
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