Commit Graph

53 Commits

Author SHA1 Message Date
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 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
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 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 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
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 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 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
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
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
Zhiyi Zhang 981fb4edb3 user32: Move ChangeDisplaySettingsExW() common code to user32.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-10 22:46:22 +01:00
Zhiyi Zhang 427152ec7b winex11.drv: Fix NoRes mode handler having an empty mode.
After 25167fb286 get_primary_monitor_rect()
returns an empty rectangle before X11DRV_DisplayDevices_Init() is called.
So use get_host_primary_monitor_rect() to get the current X desktop size.
It's also more intuitive this way.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-05 17:31:05 +01:00
Rob Walker 70fbfa2cb8 winex11: Improve ChangeDisplaySettingsEx failed mode message.
The failed mode error message dumps all the mode fields, that were
being tested. Change this output so that only the mode fields
explicitly being matched against are displayed.  Make the failed
message use formatting consist with the trace message, earlier in this
function.

Signed-off-by: Rob Walker <bob.mt.wya@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-24 20:12:05 +02:00
Alexandre Julliard 0f03f264b7 winex11: Add a helper function to return the primary monitor rectangle. 2013-10-14 17:26:14 +02:00
Alexandre Julliard 900b5f4b79 winex11: Remove some remainders of the ddraw HAL support. 2012-10-22 14:36:31 +02:00
Henri Verbeet 3ea8de2637 winex11: Use our own structure for mode information. 2012-07-03 14:57:07 +02:00
Alexandre Julliard f13c65b4f5 winex11: Get rid of the old ddraw HAL support. 2011-04-12 17:42:12 +02:00
Roderick Colenbrander 2c39733eab winex11: X11DRV_nores_SetCurrentMode return DISP_CHANGE_SUCCESSFUL when switching to the current mode. 2010-08-18 17:17:23 +02:00
Mikhail Maroukhine 3069ad44cb winex11.drv: Fix compiler warnings with flag -Wcast-qual. 2010-03-29 12:17:46 +02:00
Dmitry Timoshkov 48973dad53 winex11: Indicate that dmDisplayFlags is also initialized. 2009-01-05 12:40:50 +01:00
Maarten Lankhorst 0a6459598a user32/winex11.drv: Change all user32 operations to use CDECL. 2008-12-23 13:06:04 +01:00
Dmitry Timoshkov fa61eac0f7 winex11.drv: Set the size of returned DEVMODE to least common one as XP does. 2008-05-05 12:54:05 +02:00
Marcus Meissner 75de624377 winex11: Set last error on enumerating display settings. 2008-01-09 13:38:03 +01:00
Dmitry Timoshkov 78718a41c7 user32: Add a test for an invalid DEVMODE passed to ChangeDisplaySettings, make it pass under Wine. 2007-12-20 10:47:49 +01:00
Stefan Dösinger 5461d505d7 winex11: Activate the depth-bpp difference. 2007-12-17 12:25:50 +01:00
Stefan Dösinger ccab10bd46 winex11: Distinguish between bpp and depth. 2007-12-17 12:24:51 +01:00
Stefan Dösinger 211f429579 winex11: Remove an unused variable. 2007-12-13 13:09:46 +01:00
Dmitry Timoshkov a7dba33cf3 winex11.drv: Use registry settings as a default display mode. 2007-12-05 12:21:32 +01:00
Dmitry Timoshkov e388a49308 winex11.drv: Don't forget to initialize dmFields. 2007-12-05 12:21:10 +01:00
Dmitry Timoshkov efda990877 winex11.drv: Use display device guid managed by explorer. 2007-11-19 15:00:11 +01:00
Francois Gouget 83e2f44268 winex11: Fix compilation on systems that don't support either nameless unions or nameless structs. 2007-11-05 15:06:35 +01:00
Dmitry Timoshkov 407db36684 winex11.drv: Initialize buffer size. 2007-11-02 12:35:57 +01:00
Dmitry Timoshkov 7bb12b9e8c winex11.drv: Add support for saving/reading display settings. 2007-11-01 12:41:39 +01:00
Dmitry Timoshkov 2712eb50b1 user32: Initialize more fields in the DEVMODE structure. 2007-11-01 12:41:30 +01:00
Kolbjørn Fredheim c960cae979 winex11.drv: Echo the video mode requested in the error message when not finding a matching mode. 2007-06-15 13:24:27 +02:00
Jan Zerebecki 85d9b0249f winex11.drv: Set the refresh rate for NoRes to 60 instead of 0. 2007-02-23 11:24:29 +01:00
Francois Gouget 3e6aa43229 winex11.drv: Catch and report screen resolution change errors. 2007-02-23 11:24:16 +01:00
Vitaliy Margolen 6069d0d596 winex11drv: Win64 printf format warning fixes. 2006-10-09 15:23:33 +02:00