Commit cb703739 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

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=110659Signed-off-by: 's avatarAndrew Eikum <aeikum@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f05dd8cb
......@@ -1793,10 +1793,20 @@ static LRESULT CALLBACK desktop_wndproc_wrapper( HWND hwnd, UINT msg, WPARAM wp,
switch (msg)
{
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;
}
}
return desktop_orig_wndproc( hwnd, msg, wp, lp );
}
......
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