mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Merge pull request #6094 from aliaspider/master
(win32) disable WS_EX_LAYERED when opacity == 100.
This commit is contained in:
commit
b2ec210fd6
@ -813,11 +813,14 @@ bool win32_window_create(void *data, unsigned style,
|
||||
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500 /* 2K */
|
||||
/* Windows 2000 and above use layered windows to enable transparency */
|
||||
SetWindowLongPtr(main_window.hwnd,
|
||||
GWL_EXSTYLE,
|
||||
GetWindowLongPtr(main_window.hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
|
||||
SetLayeredWindowAttributes(main_window.hwnd, 0, (255 *
|
||||
settings->uints.video_window_opacity) / 100, LWA_ALPHA);
|
||||
if(settings->uints.video_window_opacity < 100)
|
||||
{
|
||||
SetWindowLongPtr(main_window.hwnd,
|
||||
GWL_EXSTYLE,
|
||||
GetWindowLongPtr(main_window.hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
|
||||
SetLayeredWindowAttributes(main_window.hwnd, 0, (255 *
|
||||
settings->uints.video_window_opacity) / 100, LWA_ALPHA);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return true;
|
||||
|
@ -113,8 +113,20 @@ static bool win32_set_window_opacity(void *data, unsigned opacity)
|
||||
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500
|
||||
/* Set window transparency on Windows 2000 and above */
|
||||
if (SetLayeredWindowAttributes(hwnd, 0, (255 * opacity) / 100, LWA_ALPHA))
|
||||
if(opacity < 100)
|
||||
{
|
||||
SetWindowLongPtr(hwnd,
|
||||
GWL_EXSTYLE,
|
||||
GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
|
||||
return SetLayeredWindowAttributes(hwnd, 0, (255 * opacity) / 100, LWA_ALPHA);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowLongPtr(hwnd,
|
||||
GWL_EXSTYLE,
|
||||
GetWindowLongPtr(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user