Commit Graph

2104 Commits

Author SHA1 Message Date
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
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
Zhiyi Zhang 1b33e0f72e winex11.drv: Set DM_POSITION and DM_DISPLAYORIENTATION when reporting registry display settings.
Set DM_POSITION and DM_DISPLAYORIENTATION when calling
EnumDisplaySettings(ENUM_REGISTRY_SETTINGS). DM_DISPLAYFIXEDOUTPUT
is not set because it is not necessarily reported according to tests.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-09 21:23:33 +02:00
Francois Gouget f622224c58 winex11.drv: Avoid using the mailing list address in error messages.
Also let users decide whether to report bugs and let them figure out
how.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-01 22:10:28 +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 f1e7d5bbd6 user32: Fake success for detaching adapters.
It is currently unsupported. This helps later patches so that
settings handlers using a new interface can be introduced without
detaching adapter support, making patches smaller.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-27 16:20:06 +02:00
Zhiyi Zhang ae4804d502 winex11.drv: Fake success for changing non-primary adapter settings.
Changing non-primary adapter settings is currently unsupported. Return
success for non-primary adapter settings changes so that the primary
adapter settings don't get changed unintentionally.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-27 16:19:54 +02:00
Zhiyi Zhang 8a4ec0addb user32: Handle NULL device and mode parameters in ChangeDisplaySettingsExW().
NULL device and mode parameters mean to restore all adapters to their
registry settings. Since all user graphics drivers only support a
primary adapter now, it's okay to restore only the primary adapter.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-27 16:19:49 +02:00
Gabriel Ivăncescu fff3642747 winex11.drv: Fix X11DRV_X_to_window_rect to handle windows smaller than the decoration.
A window can be resized to a smaller size than the decoration (title +
borders), such as when it is minimized. In such cases it is necessary
to recompute the minimum bounds, as it is done in the opposite function
X11DRV_window_to_X_rect, since the real information was lost.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48490
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-20 20:52:26 +02:00
Gabriel Ivăncescu df0d8ac5be winex11.drv: Use a helper to retrieve the decoration rect for managed windows.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-20 20:52:21 +02:00
Murray Colpman 893080e4df winex11.drv: Interpret mouse 6/7 as horiz scroll.
X11 Mouse buttons 6 and 7 were set to translate into browser
back/forward button events. However, this is based on an old convention
where buttons 6 and 7 could either mean horizontal scroll or browser
back/forward. Nowadays, 6 and 7 solely mean horizontal scroll, 8 and 9
being used for back/forward. In addition, the wide adoption of
two-finger two-dimensional scrolling on laptop trackpads since this code
was written has meant that back/forward events may be generated
unintentionally, which can be very disruptive when using tools such as
web browsers.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49142
Signed-off-by: Murray Colpman <muzer@tim32.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-14 23:12: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 c69bb0342c winex11.drv: Update _NET_WM_STATE before resizing windows.
According to the Extended Window Manager Hints (EWMH) spec 1.3 regarding
_NET_WM_STATE_FULLSCREEN, "the Window Manager is responsible for
restoring the original geometry after a switch from fullscreen back to
normal window.", which means that removing _NET_WM_STATE_FULLSCREEN from
a window may cause the window to receive a ConfigureNotify event to
restore the window size, thus causing a application resize action to be
overwritten by the window managers.

Fix a game called Mugsters becomes maximized after exiting full screen.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-07 20:13:16 +02:00
Alexandre Julliard b0e2d046fc opengl32: Make wgl driver entry points WINAPI.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-23 13:33:20 +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 fb69b6aeb2 winex11.drv: Fix incorrect frequency for double scan and interlaced modes.
Double scan modes have double the dots to be scanned and interlaced
modes only have half the dots to be scanned.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-20 21:10:31 +02:00
Zhiyi Zhang 562702c69b winex11.drv: Ignore disconnected outputs when finding mirroring slaves.
Some graphics drivers keep CRTCs attached to disconnected outputs.
This could cause the XRandR 1.4 display device handler to incorrectly
mark outputs as mirrored. So enumerate outputs instead of CRTCs when
finding mirroring slaves.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48932
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-20 21:10:25 +02:00
Francois Gouget 6eb05dab7c winex11: Set res_class to the program name for Crostini.
GNOME implements the startup notification protocol correctly which
means it checks StartupWMClass against both WM name (res_name) and
WM class (res_class). Thus it does not need this patch.
The situation is different for desktop environments that thunk to
Wayland such as Crostini. Wayland does not have separate concepts
that WM name and WM class can be mapped to. So Crostini decided to
only use res_class resulting in it trying to match 'Wine' to the
program name stored in StartupWMClass.
While Crostini's choice is unfortunate for Wine, most other
applications (e.g. all GTK applications) already store the same value
in both WM name and class. So in the interest of compatiblity it makes
sense for Wine to do the same.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 11:51:10 +02:00