forked from Mirrors/wine-wine
winex11.drv: Throttle calls to XResetScreenSaver.
Frequent calls to XResetScreenSaver cause performance problems on some GPU drivers, see https://bugs.freedesktop.org/show_bug.cgi?id=110659 Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>stable
parent
f05dd8cba5
commit
cb703739e5
|
@ -1793,10 +1793,20 @@ static LRESULT CALLBACK desktop_wndproc_wrapper( HWND hwnd, UINT msg, WPARAM wp,
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case WM_WINE_NOTIFY_ACTIVITY:
|
case WM_WINE_NOTIFY_ACTIVITY:
|
||||||
XResetScreenSaver( gdi_display );
|
{
|
||||||
XFlush( gdi_display );
|
static ULONGLONG last = 0;
|
||||||
|
ULONGLONG now = GetTickCount64();
|
||||||
|
/* calling XResetScreenSaver too often can cause performance
|
||||||
|
* problems, so throttle it */
|
||||||
|
if (now > last + 5000)
|
||||||
|
{
|
||||||
|
XResetScreenSaver( gdi_display );
|
||||||
|
XFlush( gdi_display );
|
||||||
|
last = now;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return desktop_orig_wndproc( hwnd, msg, wp, lp );
|
return desktop_orig_wndproc( hwnd, msg, wp, lp );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue