Commit 9c93676d authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

win32u: Return STATUS_ALREADY_COMPLETE from UpdateDisplayDevices.

When no display cache update is needed.
parent d525da59
...@@ -761,9 +761,9 @@ static INT nulldrv_GetDisplayDepth( LPCWSTR name, BOOL is_primary ) ...@@ -761,9 +761,9 @@ static INT nulldrv_GetDisplayDepth( LPCWSTR name, BOOL is_primary )
return -1; /* use default implementation */ return -1; /* use default implementation */
} }
static BOOL nulldrv_UpdateDisplayDevices( const struct gdi_device_manager *manager, BOOL force, void *param ) static UINT nulldrv_UpdateDisplayDevices( const struct gdi_device_manager *manager, BOOL force, void *param )
{ {
return FALSE; return STATUS_NOT_IMPLEMENTED;
} }
static BOOL nulldrv_CreateDesktop( const WCHAR *name, UINT width, UINT height ) static BOOL nulldrv_CreateDesktop( const WCHAR *name, UINT width, UINT height )
...@@ -1166,7 +1166,7 @@ static void loaderdrv_UpdateClipboard(void) ...@@ -1166,7 +1166,7 @@ static void loaderdrv_UpdateClipboard(void)
load_driver()->pUpdateClipboard(); load_driver()->pUpdateClipboard();
} }
static BOOL loaderdrv_UpdateDisplayDevices( const struct gdi_device_manager *manager, BOOL force, void *param ) static UINT loaderdrv_UpdateDisplayDevices( const struct gdi_device_manager *manager, BOOL force, void *param )
{ {
return load_driver()->pUpdateDisplayDevices( manager, force, param ); return load_driver()->pUpdateDisplayDevices( manager, force, param );
} }
......
...@@ -1888,7 +1888,7 @@ static BOOL add_virtual_source( struct device_manager_ctx *ctx ) ...@@ -1888,7 +1888,7 @@ static BOOL add_virtual_source( struct device_manager_ctx *ctx )
if (!write_source_to_registry( &virtual_source, &ctx->source_key )) if (!write_source_to_registry( &virtual_source, &ctx->source_key ))
{ {
WARN( "Failed to write source to registry\n" ); WARN( "Failed to write source to registry\n" );
return FALSE; return STATUS_UNSUCCESSFUL;
} }
ctx->source = virtual_source; ctx->source = virtual_source;
...@@ -1916,18 +1916,21 @@ static BOOL add_virtual_source( struct device_manager_ctx *ctx ) ...@@ -1916,18 +1916,21 @@ static BOOL add_virtual_source( struct device_manager_ctx *ctx )
add_monitor( &monitor, ctx ); add_monitor( &monitor, ctx );
add_virtual_modes( ctx, &current, &initial, &maximum ); add_virtual_modes( ctx, &current, &initial, &maximum );
return TRUE; return STATUS_SUCCESS;
} }
static BOOL update_display_devices( BOOL force, struct device_manager_ctx *ctx ) static UINT update_display_devices( BOOL force, struct device_manager_ctx *ctx )
{ {
if (user_driver->pUpdateDisplayDevices( &device_manager, force, ctx )) UINT status;
if (!(status = user_driver->pUpdateDisplayDevices( &device_manager, force, ctx )))
{ {
if (ctx->source_count && is_virtual_desktop()) return add_virtual_source( ctx ); if (ctx->source_count && is_virtual_desktop()) return add_virtual_source( ctx );
return TRUE; return status;
} }
return default_update_display_devices( force, ctx ); if (status == STATUS_NOT_IMPLEMENTED) return default_update_display_devices( force, ctx );
return status;
} }
BOOL update_display_cache( BOOL force ) BOOL update_display_cache( BOOL force )
...@@ -1936,7 +1939,7 @@ BOOL update_display_cache( BOOL force ) ...@@ -1936,7 +1939,7 @@ BOOL update_display_cache( BOOL force )
{'_','_','w','i','n','e','s','e','r','v','i','c','e','_','w','i','n','s','t','a','t','i','o','n',0}; {'_','_','w','i','n','e','s','e','r','v','i','c','e','_','w','i','n','s','t','a','t','i','o','n',0};
HWINSTA winstation = NtUserGetProcessWindowStation(); HWINSTA winstation = NtUserGetProcessWindowStation();
struct device_manager_ctx ctx = {0}; struct device_manager_ctx ctx = {0};
BOOL ret; UINT status;
WCHAR name[MAX_PATH]; WCHAR name[MAX_PATH];
/* services do not have any adapters, only a virtual monitor */ /* services do not have any adapters, only a virtual monitor */
...@@ -1950,10 +1953,10 @@ BOOL update_display_cache( BOOL force ) ...@@ -1950,10 +1953,10 @@ BOOL update_display_cache( BOOL force )
return TRUE; return TRUE;
} }
ret = update_display_devices( force, &ctx ); status = update_display_devices( force, &ctx );
release_display_manager_ctx( &ctx ); release_display_manager_ctx( &ctx );
if (!ret) WARN( "Failed to update display devices\n" ); if (status && status != STATUS_ALREADY_COMPLETE) WARN( "Failed to update display devices, status %#x\n", status );
if (!update_display_cache_from_registry()) if (!update_display_cache_from_registry())
{ {
......
...@@ -269,7 +269,7 @@ LONG ANDROID_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, H ...@@ -269,7 +269,7 @@ LONG ANDROID_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, H
/*********************************************************************** /***********************************************************************
* ANDROID_UpdateDisplayDevices * ANDROID_UpdateDisplayDevices
*/ */
BOOL ANDROID_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, BOOL force, void *param ) UINT ANDROID_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, BOOL force, void *param )
{ {
if (force || force_display_devices_refresh) if (force || force_display_devices_refresh)
{ {
...@@ -295,9 +295,11 @@ BOOL ANDROID_UpdateDisplayDevices( const struct gdi_device_manager *device_manag ...@@ -295,9 +295,11 @@ BOOL ANDROID_UpdateDisplayDevices( const struct gdi_device_manager *device_manag
current.dmFields |= DM_POSITION; current.dmFields |= DM_POSITION;
device_manager->add_modes( &current, 1, &mode, param ); device_manager->add_modes( &current, 1, &mode, param );
force_display_devices_refresh = FALSE; force_display_devices_refresh = FALSE;
return STATUS_SUCCESS;
} }
return TRUE; return STATUS_ALREADY_COMPLETE;
} }
......
...@@ -1110,7 +1110,7 @@ static BOOL is_same_devmode(const DEVMODEW *a, const DEVMODEW *b) ...@@ -1110,7 +1110,7 @@ static BOOL is_same_devmode(const DEVMODEW *a, const DEVMODEW *b)
a->dmDisplayFrequency == b->dmDisplayFrequency; a->dmDisplayFrequency == b->dmDisplayFrequency;
} }
BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, BOOL force, void *param ) UINT macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, BOOL force, void *param )
{ {
struct macdrv_adapter *adapters, *adapter; struct macdrv_adapter *adapters, *adapter;
struct macdrv_monitor *monitors, *monitor; struct macdrv_monitor *monitors, *monitor;
...@@ -1120,7 +1120,7 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage ...@@ -1120,7 +1120,7 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
DEVMODEW *mode, *modes; DEVMODEW *mode, *modes;
DWORD len; DWORD len;
if (!force && !force_display_devices_refresh) return TRUE; if (!force && !force_display_devices_refresh) return STATUS_ALREADY_COMPLETE;
force_display_devices_refresh = FALSE; force_display_devices_refresh = FALSE;
if (macdrv_get_displays(&displays, &display_count)) if (macdrv_get_displays(&displays, &display_count))
...@@ -1133,7 +1133,7 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage ...@@ -1133,7 +1133,7 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
if (macdrv_get_gpus(&gpus, &gpu_count)) if (macdrv_get_gpus(&gpus, &gpu_count))
{ {
ERR("could not get GPUs\n"); ERR("could not get GPUs\n");
return FALSE; return STATUS_UNSUCCESSFUL;
} }
TRACE("GPU count: %d\n", gpu_count); TRACE("GPU count: %d\n", gpu_count);
...@@ -1198,7 +1198,7 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage ...@@ -1198,7 +1198,7 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
macdrv_free_gpus(gpus); macdrv_free_gpus(gpus);
macdrv_free_displays(displays); macdrv_free_displays(displays);
return TRUE; return STATUS_SUCCESS;
} }
/*********************************************************************** /***********************************************************************
......
...@@ -129,7 +129,7 @@ extern LONG macdrv_ChangeDisplaySettings(LPDEVMODEW displays, LPCWSTR primary_na ...@@ -129,7 +129,7 @@ extern LONG macdrv_ChangeDisplaySettings(LPDEVMODEW displays, LPCWSTR primary_na
extern BOOL macdrv_GetCurrentDisplaySettings(LPCWSTR name, BOOL is_primary, LPDEVMODEW devmode); extern BOOL macdrv_GetCurrentDisplaySettings(LPCWSTR name, BOOL is_primary, LPDEVMODEW devmode);
extern INT macdrv_GetDisplayDepth(LPCWSTR name, BOOL is_primary); extern INT macdrv_GetDisplayDepth(LPCWSTR name, BOOL is_primary);
extern LRESULT macdrv_ClipboardWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp); extern LRESULT macdrv_ClipboardWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
extern BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, extern UINT macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manager,
BOOL force, void *param ); BOOL force, void *param );
extern BOOL macdrv_GetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp); extern BOOL macdrv_GetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp);
extern BOOL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp); extern BOOL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp);
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "config.h" #include "config.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "waylanddrv.h" #include "waylanddrv.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -275,7 +277,7 @@ static void wayland_add_device_modes(const struct gdi_device_manager *device_man ...@@ -275,7 +277,7 @@ static void wayland_add_device_modes(const struct gdi_device_manager *device_man
/*********************************************************************** /***********************************************************************
* UpdateDisplayDevices (WAYLAND.@) * UpdateDisplayDevices (WAYLAND.@)
*/ */
BOOL WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manager, UINT WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manager,
BOOL force, void *param) BOOL force, void *param)
{ {
struct wayland_output *output; struct wayland_output *output;
...@@ -283,7 +285,7 @@ BOOL WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manage ...@@ -283,7 +285,7 @@ BOOL WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manage
struct wl_array output_info_array; struct wl_array output_info_array;
struct output_info *output_info; struct output_info *output_info;
if (!force && !force_display_devices_refresh) return TRUE; if (!force && !force_display_devices_refresh) return STATUS_ALREADY_COMPLETE;
TRACE("force=%d force_refresh=%d\n", force, force_display_devices_refresh); TRACE("force=%d force_refresh=%d\n", force, force_display_devices_refresh);
...@@ -318,5 +320,5 @@ BOOL WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manage ...@@ -318,5 +320,5 @@ BOOL WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manage
pthread_mutex_unlock(&process_wayland.output_mutex); pthread_mutex_unlock(&process_wayland.output_mutex);
return TRUE; return STATUS_SUCCESS;
} }
...@@ -332,7 +332,7 @@ void WAYLAND_DestroyWindow(HWND hwnd); ...@@ -332,7 +332,7 @@ void WAYLAND_DestroyWindow(HWND hwnd);
void WAYLAND_SetCursor(HWND hwnd, HCURSOR hcursor); void WAYLAND_SetCursor(HWND hwnd, HCURSOR hcursor);
void WAYLAND_SetWindowText(HWND hwnd, LPCWSTR text); void WAYLAND_SetWindowText(HWND hwnd, LPCWSTR text);
LRESULT WAYLAND_SysCommand(HWND hwnd, WPARAM wparam, LPARAM lparam); LRESULT WAYLAND_SysCommand(HWND hwnd, WPARAM wparam, LPARAM lparam);
BOOL WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manager, UINT WAYLAND_UpdateDisplayDevices(const struct gdi_device_manager *device_manager,
BOOL force, void *param); BOOL force, void *param);
LRESULT WAYLAND_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp); LRESULT WAYLAND_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags, void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags,
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#endif #endif
#include "config.h" #include "config.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "x11drv.h" #include "x11drv.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -493,7 +496,7 @@ BOOL X11DRV_DisplayDevices_SupportEventHandlers(void) ...@@ -493,7 +496,7 @@ BOOL X11DRV_DisplayDevices_SupportEventHandlers(void)
static BOOL force_display_devices_refresh; static BOOL force_display_devices_refresh;
BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, BOOL force, void *param ) UINT X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, BOOL force, void *param )
{ {
struct x11drv_adapter *adapters; struct x11drv_adapter *adapters;
struct gdi_monitor *monitors; struct gdi_monitor *monitors;
...@@ -503,13 +506,13 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage ...@@ -503,13 +506,13 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
DEVMODEW *modes; DEVMODEW *modes;
UINT mode_count; UINT mode_count;
if (!force && !force_display_devices_refresh) return TRUE; if (!force && !force_display_devices_refresh) return STATUS_ALREADY_COMPLETE;
force_display_devices_refresh = FALSE; force_display_devices_refresh = FALSE;
TRACE( "via %s\n", debugstr_a(host_handler.name) ); TRACE( "via %s\n", debugstr_a(host_handler.name) );
/* Initialize GPUs */ /* Initialize GPUs */
if (!host_handler.get_gpus( &gpus, &gpu_count, TRUE )) return FALSE; if (!host_handler.get_gpus( &gpus, &gpu_count, TRUE )) return STATUS_UNSUCCESSFUL;
TRACE("GPU count: %d\n", gpu_count); TRACE("GPU count: %d\n", gpu_count);
for (gpu = 0; gpu < gpu_count; gpu++) for (gpu = 0; gpu < gpu_count; gpu++)
...@@ -558,7 +561,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage ...@@ -558,7 +561,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
} }
host_handler.free_gpus( gpus, gpu_count ); host_handler.free_gpus( gpus, gpu_count );
return TRUE; return STATUS_SUCCESS;
} }
void X11DRV_DisplayDevices_Init(BOOL force) void X11DRV_DisplayDevices_Init(BOOL force)
......
...@@ -217,7 +217,7 @@ extern BOOL X11DRV_SystrayDockRemove( HWND hwnd ); ...@@ -217,7 +217,7 @@ extern BOOL X11DRV_SystrayDockRemove( HWND hwnd );
extern LONG X11DRV_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, HWND hwnd, DWORD flags, LPVOID lpvoid ); extern LONG X11DRV_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, HWND hwnd, DWORD flags, LPVOID lpvoid );
extern BOOL X11DRV_GetCurrentDisplaySettings( LPCWSTR name, BOOL is_primary, LPDEVMODEW devmode ); extern BOOL X11DRV_GetCurrentDisplaySettings( LPCWSTR name, BOOL is_primary, LPDEVMODEW devmode );
extern INT X11DRV_GetDisplayDepth( LPCWSTR name, BOOL is_primary ); extern INT X11DRV_GetDisplayDepth( LPCWSTR name, BOOL is_primary );
extern BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manager, extern UINT X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manager,
BOOL force, void *param ); BOOL force, void *param );
extern BOOL X11DRV_CreateDesktop( const WCHAR *name, UINT width, UINT height ); extern BOOL X11DRV_CreateDesktop( const WCHAR *name, UINT width, UINT height );
extern BOOL X11DRV_CreateWindow( HWND hwnd ); extern BOOL X11DRV_CreateWindow( HWND hwnd );
......
...@@ -306,7 +306,7 @@ struct user_driver_funcs ...@@ -306,7 +306,7 @@ struct user_driver_funcs
LONG (*pChangeDisplaySettings)(LPDEVMODEW,LPCWSTR,HWND,DWORD,LPVOID); LONG (*pChangeDisplaySettings)(LPDEVMODEW,LPCWSTR,HWND,DWORD,LPVOID);
BOOL (*pGetCurrentDisplaySettings)(LPCWSTR,BOOL,LPDEVMODEW); BOOL (*pGetCurrentDisplaySettings)(LPCWSTR,BOOL,LPDEVMODEW);
INT (*pGetDisplayDepth)(LPCWSTR,BOOL); INT (*pGetDisplayDepth)(LPCWSTR,BOOL);
BOOL (*pUpdateDisplayDevices)(const struct gdi_device_manager *,BOOL,void*); UINT (*pUpdateDisplayDevices)(const struct gdi_device_manager *,BOOL,void*);
/* windowing functions */ /* windowing functions */
BOOL (*pCreateDesktop)(const WCHAR *,UINT,UINT); BOOL (*pCreateDesktop)(const WCHAR *,UINT,UINT);
BOOL (*pCreateWindow)(HWND); BOOL (*pCreateWindow)(HWND);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment