Commit Graph

53 Commits

Author SHA1 Message Date
Jacek Caban 10f38c0600 winex11: Move user driver to unixlib.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-06 19:18:22 +02:00
Jacek Caban aa9072998f winex11: Use inline intersect_rect helper instead of IntersectRect.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-28 16:12:24 +02:00
Jacek Caban 12cb04fd2f winex11: Directly use ntdll in display_device_init mutex.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-19 17:36:57 +02:00
Jacek Caban 2906275967 winex11: Use build_hwnd_list for X11DRV_DisplayDevices_Update 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>
2022-04-19 17:35:44 +02:00
Jacek Caban 262831bc63 winex11: Directly use win32u in more places.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-15 20:54:36 +02:00
Jacek Caban 523a6eba02 winex11: Remove no longer needed helpers.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 18:13:34 +02:00
Jacek Caban 7f64eead50 win32u: Introduce inline helpers for NtUserCallOneParam calls.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 18:13:06 +02:00
Jacek Caban f6524f7a3a win32u: Don't use CDECL for user driver functions.
They are no longer used from PE code.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-07 22:44:39 +02:00
Jacek Caban 656edbb508 winex11: Get primary monitor rect from win32u.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Jacek Caban 586f377b46 winex11: Get virtual screen rect from win32u.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-18 22:10:47 +01:00
Jacek Caban 548bc54bf3 winex11.drv: Use UpdateDisplayDevices driver entry point for registering devices.
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-11-30 22:07:21 +01:00
Jacek Caban b502a3e3c6 winex11.drv: Use gdi driver types for display device handler.
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-11-30 22:07:21 +01:00
Jacek Caban fd675485be user32: Use user_driver_funcs to expose user driver function from drivers.
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-11-11 18:39:48 +01:00
Zhiyi Zhang 2adf4376d8 winex11.drv: Pass size in bytes to RegQueryValueExW().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-20 11:22:23 +02:00
Zhiyi Zhang 82938e833f winex11.drv: Set hkey to NULL after RegCloseKey() in X11DRV_InitGpu().
Although it's unlikely, RegCloseKey() may close an already closed key if
the following SetupDiGetDeviceRegistryPropertyW() failed.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-19 11:33:05 +02:00
Dmitry Timoshkov b54199101f winex11.drv: Add GPU hardware information values to the registry.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-18 17:54:48 +02:00
Zhiyi Zhang 12411935c8 winex11.drv: Register GUID_DEVINTERFACE_MONITOR interface for monitors.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Paul Gofman 6d290cf229 winex11.drv: Register GUID_DISPLAY_DEVICE_ARRIVAL interface for GPUs.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Zhiyi Zhang a7ec245f84 winex11.drv: Register GUID_DEVINTERFACE_DISPLAY_ADAPTER interface for GPUs.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Eduard Permyakov dedda40e5d winex11.drv: Add 'EDID' registry key to every monitor device.
Extended display identification data (EDID) is a set of data that
is provided by a display to describe its capabilities to a graphics
adapter. EDID data allows a computer to detect the type of monitor
that is connected to it. EDID data includes the manufacturer name,
the product type, the timings that are supported by the display, the
display size, as well as other display characteristics. EDID is
defined by a standard published by the Video Electronics Standards
Association (VESA).

In Windows, every display device has an associated 'EDID' registry
key containing this data. Applications can read and parse it to get
the display capabilities. In Linux, we can get each monitor's EDID
using the RANDR X extension.

This patch fixes, for example, monitor detection in the UE-based game
'Industries of Titan'.

Signed-off-by: Eduard Permyakov <epermyakov@codeweavers.com>
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-14 18:35:34 +02:00
Zhiyi Zhang 975194590a winex11.drv: Use length returned from sprintfW().
A minor optimization.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 11:44:16 +02: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
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
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 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 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
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
Zhiyi Zhang 3db619d46e winex11.drv: Support multiple adapter display settings in registry.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-11 16:51:54 +02:00
Brendan Shanks e3eb89d5eb winex11.drv: Ensure output IDs are unique for mirrored displays.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-10 22:40:50 +02:00
Brendan Shanks 707fcb99a6 winex11.drv: Set output id property for monitors.
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-05-28 20:18:31 +02:00
Brendan Shanks 8cd6245b76 winex11.drv: Set GPU LUID property for monitors.
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-05-28 20:18:31 +02:00
Zhiyi Zhang 26b26a2e0e winex11.drv: Move update_windows_on_desktop_resize().
Move update_windows_on_desktop_resize() to be in X11DRV_DisplayDevices_Update()
and rename it to update_windows_on_display_change(), which is a more appropriate
name because the desktop is unnecessarily resized when display devices change.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 23:10:22 +02:00
Zhiyi Zhang fd6f50c0d3 winex11.drv: Resize desktop upon display change events.
Otherwise, Wine still has the old desktop size after a user changed
display resolution using host system utilities.

X11DRV_DisplayDevices_Update() is introduced so that display devices
reinitialization is separated from desktop resizing. Otherwise,
X11DRV_DisplayDevices_Init() would have to be called twice to resize
the desktop with up-to-date primary monitor dimensions, wasting resources.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48441
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 23:10:18 +02:00
Zhiyi Zhang de94f8a1d6 winex11.drv: Allocate LUID for GPUs.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-22 08:57:16 +02:00
Zhiyi Zhang acf03ed9da winex11.drv: Get virtual desktop size limit from the host primary display.
After 25167fb286, get_primary_monitor_rect()
maybe invalid before display device initialization or returns the desktop
rectangle after desktop initialization in virtual desktop mode, which is
wrong. The desktop size limit should come from host system.

This fixes a regression from efbbe66669.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47815
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 17:30:53 +01:00
Zhiyi Zhang 914b5519b1 winex11.drv: Use a separate virtual desktop display device handler.
If we want to query host monitor dimensions, we need to use XRandR
or Xinerama handler. However when in virtual desktop mode, its display
device handler overrides other handlers. So we need to separate them.
Then we can implement features that require host monitor dimensions like
checking whether the virtual desktop window is fullscreen.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 17:30:50 +01:00
Zhiyi Zhang 413aad3913 winex11.drv: Handle display device events in the desktop thread.
This fixes a regression from 22795243b2,
which calls thread_init_display() and eventually XOpenIM() before
X11DRV_InitXIM() is called.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47821
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-01 17:13:40 +01:00
Zhiyi Zhang 9ae8da6bb4 winex11.drv: Retrieve virtual and primary monitor rectangles from SetupAPI.
So that a process can still get the correct virtual and primary monitor
rectangles if display devices are reinitialized in another process.
Note that we can't use EnumDisplayMonitor() and GetMonitorInfo() here
because they are not loaded when loading winex11.drv.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-01 17:13:34 +01:00
Zhiyi Zhang de94cfa775 winex11.drv: Use underscore style for struct x11drv_display_device_handler.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 19:30:10 +01:00
Zhiyi Zhang 10b2a996ba winex11.drv: Trace display device counts.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-25 16:28:36 +02:00
Zhiyi Zhang 25167fb286 winex11.drv: Make screen helpers independent of Xinerama.
So that other display device handlers such as XRandR can be introduced
because they might report a virtual screen size with different top-left
corner and the primary screen may be different as well.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-21 14:18:49 +02:00
Francois Gouget 66873d5fec winex11.drv: A spelling fix and slight rewording in a comment.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-08 17:53:36 +02:00
Zhiyi Zhang 7d70d45984 winex11.drv: Add DriverDateData registry property to display adapters.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-31 09:34:40 +02:00
Zhiyi Zhang cb350fc979 winex11.drv: Specify enumerator when calling SetupDiGetClassDevsW.
This reduces some search time.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-01 20:42:42 +02:00
Zhiyi Zhang 23b28323cb winex11.drv: Use generic GetMonitorInfo.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-25 13:22:17 +02:00
Zhiyi Zhang 074abfe097 winex11.drv: Use generic EnumDisplayMonitors.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-25 13:22:17 +02:00
Zhiyi Zhang 7f57cda707 winex11.drv: Handle display device changes.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-13 08:21:00 +02:00
Zhiyi Zhang 31445c3264 winex11.drv: Initialize monitor registry data.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-13 08:21:00 +02:00