Commit Graph

2224 Commits

Author SHA1 Message Date
Jacek Caban 48cd631413 gdi32: Remove no longer used clipping driver entry points.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-04 21:48:28 +02:00
Jacek Caban eefca28ed3 gdi32: Don't use driver entry point for NtGdiSaveDC implementation.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-30 14:27:22 +02:00
Jacek Caban 626afcad71 gdi32: Remove no longer used driver entry points.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-29 15:40:44 +02:00
Jacek Caban e13e935be3 gdi32: Remove no longer used driver entry points.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-28 22:07:05 +02:00
Jacek Caban 1f5cc0e5ef gdi32: Remove no longer used Polygon and Polyline driver entry points.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:20:50 +02:00
Jacek Caban 3a7c1630ea winex11: Don't use pPolygon graphics driver entry point.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-22 13:19:49 +02:00
Dmitry Timoshkov 230e2d5f79 winex11.drv: Don't free cached DnD data after informing an application about the drop event.
If an application in its IDropTarget::Drop() implementation saves the passed in
IDataObject and later calls IDataObject::GetData() it fails because global cached
data is no longer available. Another solution is to create a copy of global data
and save it inside of IDataObject, but since all data including item contents is
global anyway this doesn't seem worth the trouble. Global cahed data will be freed
in next X11DRV_XDND_EnterEvent().

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-10 15:37:55 +02:00
Henri Verbeet 218f70b134 winex11: Request VK_KHR_display in get_gpu_properties_from_vulkan().
Required by VK_EXT_direct_mode_display. VK_KHR_display in turn requires
VK_KHR_surface.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 10:50:58 +02:00
Henri Verbeet dd25789fb2 winex11: Request VK_KHR_external_memory_capabilities in get_gpu_properties_from_vulkan().
Required for VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-08 10:50:55 +02:00
Zhiyi Zhang 0f820e9c94 winex11.drv: Cache the current mode for detached outputs.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-21 23:13:57 +02:00
Giovanni Mascellani 2a505efb1c winex11.drv: Do not pollute logs with misencoded bytes.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-09 23:38:44 +02:00
Giovanni Mascellani 054b7c8204 winex11.drv: Allow keyboard layout score to be negative.
The keyboard layout matching algorithm can assign a negative score
to a keyboard layout. If the user has a strange keyboard layout,
possibly a custom one, it might happen that all keyboard layouts
known by Wine get a negative score. This is not an error in itself,
and we should still strive to find the best match.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-09 23:38:44 +02:00
Torge Matthies 2e4bfa642e winex11.drv: Avoid race condition in X11 error handling.
The err_callback* globals need to be protected from being overwritten
before X11DRV_check_error is called, otherwise no or the wrong error
handler might be called.

Signed-off-by: Torge Matthies <openglfreak@googlemail.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
Zhiyi Zhang 211da181c9 winex11.drv: Always add MWM_FUNC_CLOSE to enabled windows.
Some window managers require MWM_FUNC_CLOSE to be present for a window to be allowed to close. For
example, on KWin, a window of style WS_POPUP | WS_VISIBLE has a close button drawn on top of its
taskbar preview. But when you press it, the window manager refuses to close it. On Mutter, windows
without MWN_FUNC_CLOSE doesn't have a close button on the window preview. On Windows 10, enabled
windows without WS_SYSMENU always has a close button on their taskbar window preview and can always
be closed with the close button. On Windows 7, enabled windows without WS_SYSMENU has no close
button on the window preview but still can be closed with the right-click menu on the taskbar.
This patch changes the behavior to match that of Windows 10.

Fix WeChat image preview window cannot be closed from KDE panels.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-31 21:06:25 +02:00
Rémi Bernon 454712a94d user32: Add a default WindowPosChanging implementation.
Which creates an off-screen window surface for top-level non-layered or
SLWA-layered windows.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-20 21:48:57 +02:00
Zhiyi Zhang 7fabcf6fed winex11.drv: Add a cache for querying XRandR 1.4 current modes.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51047
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 21:25:00 +02:00
Rémi Bernon 07b9f3f609 user32: Factor IsRectEmpty driver check in ShowWindow.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 20:37:04 +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
Rémi Bernon 4bec69b104 user32: Move (Un)LoadKeyboardLayoutW from winex11.drv to user32.
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 512112ebd5 user32: Set keyboard layout preload key on init.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-06 20:00:42 +02:00
Rémi Bernon c4e6d16271 user32: Factor GetKeyboardLayoutNameW implementations.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-06 19:50:40 +02:00
Rémi Bernon e2aa30f21d user32: Factor GetKeyboardLayout and remove driver call.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-05 21:57:53 +02:00
Rémi Bernon da9fc41814 user32: Factor ActivateKeyboardLayout previous layout logic.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-05 21:57:04 +02:00
Rémi Bernon f044f401f7 user32: Factor unsupported cases into ActivateKeyboardLayout.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 21:08:23 +02:00
Paul Gofman 011fabb2c4 winex11.drv: Handle Vulkan surface creation with NULL hwnd.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 21:05:31 +02:00
Ziqing Hui 57b1b21a84 winex11.drv: Correct a full screen condition.
The if condition here came from 47c54c4ae7,
which is to detect full screen window.

However, according to tests in previous commit, there is possibility
that a window without setting WS_CAPTION is not full screen, for example,
main window of Tencent WeChat. And windows like this can also be maximized
or restored. So that we can not treat WS_CAPTION as our full screen condition.

This fixes maximizing Tencent WeChat by dragging it to screen edge.

Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-27 16:52:30 +02:00
Connor McAdams 6d04e6c3a9 winex11.drv: Add mutable pixel format awareness.
Add the ability to check if the pixel format on the current window was
previously set by wglSetPixelFormatWine(), and if was, allow the
application to change it with a regular wglSetPixelFormat call.

Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-21 21:20:55 +02:00
Rémi Bernon 123c17aa92 user32: Add RAWINPUT parameter to __wine_send_input.
And send_hardware_message.

This makes it possible to use __wine_send_input to send extended input
data, such as HID device notifications and WM_INPUT messages carrying
HID reports.

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-15 10:37:52 +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 a358a25eda winex11.drv: Map coordinates before calling send_mouse_input.
Based on a patch from Gabriel Ivăncescu <gabrielopcode@gmail.com>.

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 9b6b09053a winex11.drv: Don't remap root_window relative coordinates.
We already converted coordinates from root to virtual screen, we
shouldn't need to remap them.

This is actually no-op because when window == root_window, hwnd is
the desktop window. In which case it isn't RTL, and MapWindowPoints is
no-op too.

It makes things less confusing and it will help later cases when we get
root-relative coordinates for other windows.

Based on a patch from Gabriel Ivăncescu <gabrielopcode@gmail.com>.

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 6444e4fade server: Remove tid from set_key_state request.
As it is always set to GetCurrentThreadId().

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:51:50 +02:00
Rémi Bernon 626870abe2 server: Remove tid from get_key_state request.
And replace it with an async param if we want the global async keystate.

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:51:21 +02:00
Rémi Bernon 29d56fcb8b winex11.drv: Update INPUT mouse coordinates directly.
Based on a patch from Gabriel Ivăncescu <gabrielopcode@gmail.com>.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46309
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-31 22:16:25 +02:00
Rémi Bernon 40f101e288 winex11.drv: Introduce new map_event_coords helper.
Based on a patch from Gabriel Ivăncescu <gabrielopcode@gmail.com>.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46309
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-31 22:16:25 +02:00
Zhiyi Zhang 6d26689484 winex11.drv: Call request_selection_contents() after the XFixes extension is initialized.
request_selection_contents() checks whether the XFixes extension is available and will start a timer
to check for clipboard content updates at an interval. Running request_selection_contents() before
the XFixes extension is initialized will always start a timer and sends unnecessary clipboard
content change notifications, causing Office right-click menus to disappear.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-18 22:04:01 +01:00
Rémi Bernon 99088fe17b winex11.drv: Fix invalid range when reading GTK_WORKAREAS_D0 (valgrind).
Invalid read of size 8
     at 0x559B816: get_work_area (display.c:296)
     by 0x55DC8C1: query_screens (xinerama.c:103)
     by 0x55DC8C1: xinerama_init (xinerama.c:275)
     by 0x55D6F47: process_attach (x11drv_main.c:602)
     by 0x55D6F47: DllMain (x11drv_main.c:721)
     by 0x7BC35819: call_dll_entry_point (loader.c:285)
     by 0x7BC35819: MODULE_InitDLL (loader.c:1317)
     by 0x7BC362ED: process_attach.part.0 (loader.c:1411)
     by 0x7BC3B843: process_attach (loader.c:1382)
     by 0x7BC3B843: LdrLoadDll (loader.c:2765)
     by 0x7B025C85: load_library (loader.c:172)
     by 0x7B026B72: LoadLibraryExW (loader.c:522)
     by 0x7B026BE5: LoadLibraryW (loader.c:492)
     by 0x40990D: load_graphics_driver (desktop.c:844)
     by 0x40990D: manage_desktop (desktop.c:1010)
     by 0x40C6B3: parse_command_line (explorer.c:836)
     by 0x40C6B3: wWinMain (explorer.c:865)
     by 0x4103F2: wmain (crt_wwinmain.c:55)
   Address 0x5272370 is 16 bytes before an unallocated block of size 3,132,512 in arena "client"

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Paul Gofman e392e0ac28 winex11.drv: Prioritize smaller depth formats when zero depth is requested in X11DRV_wglChoosePixelFormatARB().
Fixes Ancient Cities' black screen on Nvidia.

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 21:43:27 +01:00
Paul Gofman bfa3c95611 winex11.drv: Factor out describe_pixel_format() function.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-04 21:43:26 +01:00
Rémi Bernon 4cb6334b1b winex11.drv: Don't assume that GenericEvent has a window.
It doesn't, and we then lookup HWND from an invalid Window value.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-23 22:30:31 +01:00
Zebediah Figura 5c09d815f8 winex11: Send systray messages with SendNotifyMessage().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50441
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 11:02:06 +01:00
Zebediah Figura d91a87cea2 include: Fix the definition of NOTIFYICON_VERSION[_4].
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-01 11:02:00 +01:00
Georg Lehmann c1824d578a winevulkan: Fix surface functions if they aren't called by winevulkan.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50549
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-26 21:58:13 +01:00
Georg Lehmann d9c9b5ea61 winevulkan: Wrap VkSurfaceKHR in winevulkan.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 21:39:23 +01:00
Alexandre Julliard b79211efec winex11: Don't delay mapping 0-sized layered windows.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49575
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-04 13:56:58 +01:00
Zhiyi Zhang 798137dbf6 winex11.drv: Check that there are connected outputs before using XRandR 1.4.
On headless systems, Wine can still run through a VNC connection even though no outputs are
connected. Fallback to using the Xinerama display device handler in this case to report at least
one monitor.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49500
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-02 14:37:17 +01:00
Gabriel Ivăncescu 688fe7068c winex11.drv: Always enable minimize/maximize functions for minimized windows.
A window without a minimize or maximize box can still be programmatically
minimized by the Windows API. However, some WMs will refuse to change the
state and not allow it to be maximized again, despite it being minimized,
due to lacking those functions, thus not sending WM_STATE change notifications
when clicking the minimized window on the taskbar.

Heroes of Might and Magic V does this, for example, when losing focus. It
minimizes itself. When maximizing it by clicking on the taskbar it won't
send a WM_STATE change notification (since it was never changed) and fail
to maximize properly, showing a black screen (the game will still think it
is minimized).

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 13:41:53 +01:00
Alexandre Julliard 7b4e10c707 libport: Remove the usleep() function replacement.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-01 10:22:01 +01:00
Alexandre Julliard c7196dc945 libport: Move the case mapping table back to libwine and stop updating it.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-30 19:01:55 +01:00
Zhiyi Zhang ae79a91902 winex11.drv: Clarify parent in struct x11drv_win_data comments.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-17 20:57:27 +01:00
Zhiyi Zhang c4a15755de winex11.drv: Adjust the priority of NoRes display settings handler to 1.
A display settings handler with a priority of 0 can not be properly registered due to how
X11DRV_Settings_SetHandler() is implemented. Fix a regression introduced by 9c99d9bceb.

Spotted by Torge Matthies.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50135
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-16 17:51:30 +01:00
Zhiyi Zhang 2873527819 winex11.drv: Update a comment.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-30 10:35:12 +01:00
Rémi Bernon 16984895f0 winex11.drv: Forward clip_fullscreen_window to foreground thread.
If the current thread isn't the foreground thread. Otherwise we may
clip the cursor in the wrong thread, that isn't expecting mouse messages
or may not be checking its messages.

Red Faction has some race condition where this can happen for instance,
with clip_fullscreen_window called from X11DRV_DisplayDevices_Update
callback in a background thread. This thread starts clipping the cursor,
and the foreground thread isn't receiving MotionNotify events anymore.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-05 22:00:56 +02:00
Rémi Bernon 0120a1aa40 winex11.drv: Split clip cursor message in notify/request.
The message was sent to two different types of windows, with a different
semantic. We can now add parameters to the request without changing the
notify parameters semantics.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-05 22:00:53 +02:00
Matteo Bruni bd27af974a winex11: Add DriverDate registry property to display adapters.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-05 12:33:31 +02:00
Matteo Bruni 830f219189 winex11: Fix monitor_id_fmtW variable name typo.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-30 16:55:30 +02:00
Zhiyi Zhang 4a330b2921 winex11.drv: Support display orientations for XRandR 1.4 display settings handler.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 12:29:05 +02:00
Zhiyi Zhang bbae35f0fb winex11.drv: Support finding a full display mode with specified orientation.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 12:29:03 +02:00
Zhiyi Zhang ec245c7e30 winex11.drv: Sort display modes with orientation considered.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 12:29:00 +02:00
Rémi Bernon b16f552e19 gdi32: Use explicit CDECL in window_surface_funcs.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 11:30:00 +02:00
Rémi Bernon a404eb7272 gdi32: Use explicit CDECL in gdi_image_bits.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-22 11:29:54 +02:00
Zhipeng Zhao 05d9df73d1 winex11.drv: If the end of the sequence is '\r\n', there is no need to add extra '\r'.
Signed-off-by: Zhipeng Zhao <zhaozhipeng@uniontech.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-21 21:43:41 +02:00
Rémi Bernon 432858b285 winex11.drv: Don't wait for the desktop thread to store clipping window.
The messages are in flight, the state will be updated eventually in
the order they are received by the desktop thread, we shouldn't have
to wait. If the clipping window gets overwritten, it will also receive
a message from the desktop thread, which is sent asynchronously already.

Call of Duty: WWII calls ClipCursor in a loop on startup while the
foreground thread is stalled and the messages sometimes pile up. The
recursive message processing that SendMessageW induces can then cause
stack overflows.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49643
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-09-04 21:16:49 +02:00
Georg Lehmann 586f68f414 winex11.drv: Use vkGetPhysicalDeviceProperties2KHR to get gpu properties.
vkGetPhysicalDeviceProperties2 is a Vulkan 1.1 function but wine uses
a 1.0 instance, so use the extension function instead.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-31 21:41:06 +02:00
Zhiyi Zhang d9625e5a01 winex11.drv: Support clipping full screen windows on non-primary monitors.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 11:09:13 +02:00
Zhiyi Zhang 715a04daab winex11.drv: Support full screen windows on non-primary monitors.
A window can be maximized or full screen on non-primary monitors. In this
case we need to add _NET_WM_STATE_MAXIMIZED or _NET_WM_STATE_FULLSCREEN
hint to the window so that they can be handled correctly by window managers.
For example, a full screen window on the secondary monitor needs
_NET_WM_STATE_FULLSCREEN so that window managers prevent panels from obscuring it.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 11:09:10 +02:00
Zhiyi Zhang c5ec1585f6 winex11.drv: Always update _NET_WM_STATE in update_net_wm_states().
KWin treats a window covering exactly the whole monitor as maximized
when handling its first map request and expects applications to update
maximized state later. Wine doesn't know about this added maximized
state and expect it unchanged, making the window always maximized
as far as KWin is concerned. So always send _NET_WM_STATE updates
even if Wine doesn't expect changes to hint KWin that a window should
not be maximized.

Fix test failures when running the tests introduced by
36b720357b with KWin.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 11:09:05 +02:00
Zhiyi Zhang f04360cfbe winex11.drv: Allow setting a 0-bit color depth display mode.
Windows 8.1 and older allow setting a display mode with 0-bit color depth.

Fix a regression from 981fb4edb3.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 11:08:54 +02:00
Zhiyi Zhang 1aa7c9af90 winex11.drv: Store a full display mode in registry.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-26 11:08:46 +02:00
Zhiyi Zhang 2b484b1ac7 winex11.drv: Initialize new display device registry display settings.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-18 21:38:48 +02:00
Zhiyi Zhang aadae4d1ea winex11.drv: Report a GPU same as the host primary GPU in virtual desktop mode.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49631
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-18 21:38:38 +02:00
Zhiyi Zhang 440fab3870 winex11.drv: Zero initialize DEVMODE before passing it to EnumDisplaySettings().
EnumDisplaySettings() on Wine does not write beyond the end of DEVMODE because it doesn't use
dmDriverExtra currently, but this implementation detail should not be relied on.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-08-11 18:07:00 +02:00
Zhiyi Zhang b45c04f4c3 winex11.drv: Remove the old display settings handler interface.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:37:36 +02:00
Zhiyi Zhang 9c99d9bceb winex11.drv: Migrate NoRes display settings handler to a new interface.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:37:34 +02:00
Zhiyi Zhang 2116b49717 winex11.drv: Migrate XVidMode display settings handler to a new interface.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:37:32 +02:00
Zhiyi Zhang 5491e939bc winex11.drv: Migrate XRandR 1.0 display settings handler to a new interface.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:37:30 +02:00
Zhiyi Zhang d13b61b738 winex11.drv: Support detaching adapters.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:37:28 +02:00
Zhiyi Zhang 4a24816313 winex11.drv: Support automatic display position adjustment.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:37:26 +02:00
Piotr Caban 5bb4e4b36c user32: Support undocumented SC_SIZE flag that can be used to move window.
Fixes main window moving in Quicken 2020.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-30 16:33:22 +02:00
Francois Gouget 0d42388095 winex11.drv: Fix the spelling of a comment.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:42:57 +02:00
Zhiyi Zhang 7dd52f6d24 winex11.drv: Remove XRandR 1.2 display settings handler.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Zhiyi Zhang 9905a5a81d winex11.drv: Add XRandR 1.4 display settings handler.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Zhiyi Zhang 45d991d541 winex11.drv: Add set_screen_size() helper.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Zhiyi Zhang f5e6c086f9 winex11.drv: Move broken NVIDIA driver detection into a function.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Zhiyi Zhang a8b4cf7f2d winex11.drv: Sort display modes.
Although tests show that their order are not always guaranteed on Windows, most of the time it is
sorted. It also makes sure that when a 0Hz or 1Hz display mode is specified for
ChangeDisplaySettingsExW(), the chosen display mode is the one with the highest frequency.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-24 18:26:18 +02:00
Zhiyi Zhang 2a6de8d7f7 winex11.drv: Remove the old virtual desktop display settings handler.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 23:21:14 +02:00
Zhiyi Zhang 6f305dd881 winex11.drv: Support setting virtual desktop display mode using the new display settings handler interface.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 23:21:14 +02:00
Zhiyi Zhang 679ff72090 winex11.drv: Cache display modes for X11DRV_EnumDisplaySettingsEx().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 23:21:14 +02:00
Zhiyi Zhang 0b0ac41981 winex11.drv: Support virtual desktop display mode enumeration using the new display settings handler interface.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 23:21:14 +02:00
Zhiyi Zhang dd13b27410 winex11.drv: Migrate the virtual desktop display settings handler to a new interface.
The old display settings handler interface can only support one adapter.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 23:21:14 +02:00
Zhiyi Zhang 6436600db5 winex11.drv: Allow reporting a virtual desktop mode with the same width or height as the current mode.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-23 23:21:14 +02:00
Brendan Shanks 3a3c7cbd20 winex11.drv: Retrieve PCI IDs and device name from Vulkan.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-07 19:24:27 +02:00
Zhiyi Zhang 59c206f9dc winex11.drv: Use _GTK_WORKAREAS to get work areas if it is available.
_NET_WORKAREA reports a single rectangle as intersected work areas of
all monitors. So work areas on non-primary monitors may be incorrect.
For example, a dock only shown on the primary monitor reduces the work
areas on non-primary monitors.

There were attempts to extend _NET_WORKAREA to support work areas of
multiple monitors but they were rejected as EWMH is no longer being
maintained and _GTK_WORKAREAS was introduced instead.

Fix Office 2010 missing title bar on non-primary monitors on GNOME.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-01 10:59:35 +02:00
Zhiyi Zhang 5dd03cbc8f winex11.drv: Refactor query_work_area() to get intersected work area directly.
Refactor query_work_area() to pass in a monitor rectangle and check
if the resulting work area intersects with the monitor rectangle in
the function rather than doing it in the callers. Also move the function
to display.c and rename it to get_work_area().

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-07-01 10:59:35 +02:00
André Hentschel 9f974579b6 winex11.drv: Change slave to a more neutral word.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-18 19:56:43 +02:00
Paul Gofman 6f9d20806e winex11.drv: Handle X error from vkGetRandROutputDisplayEXT().
Nvidia implementation of vkGetRandROutputDisplayEXT() generates X exception
when rrOutput is from different provider (or if rrOutput is just
invalid). That can happen on certain multiple GPU configurations, on which
Wine is currently unable to initialize display driver and thus create
any window.

According to Vulkan spec, vkGetRandROutputDisplayEXT is supposed to just
return VK_NULL_HANDLE if there is no corresponding VkDisplayKHR. But it is
probably better to workaround the problem to avoid long standing regression.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49407
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-18 19:56:43 +02:00
Zhiyi Zhang 145cfce113 winex11.drv: Add a Vulkan UUID property for GPUs.
A Vulkan UUID property is used to find the corresponding GPU in SetupAPI.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 20:14:04 +02:00
André Hentschel 634cb775c2 winex11.drv: Change whitelist to a more neutral word.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-15 20:57:32 +02:00
Zhiyi Zhang c4a01d0a65 winex11.drv: Use the default frequency in ChangeDisplaySettingsExW() if dmDisplayFrequency is 1.
0 or 1 in dmDisplayFrequency means to use the default frequency.

Fix Disgaea PC and Ostriv failing to launch in exclusive fullscreen mode.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-12 17:16:25 +02:00