W32: Implement composition check for GDK
Also move DWM function grabbing and make those functions available to all of GDK-Win32. https://bugzilla.gnome.org/show_bug.cgi?id=727316
This commit is contained in:
@ -174,6 +174,23 @@ gdk_win32_screen_is_composited (GdkScreen *screen)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
|
||||
|
||||
return _gdk_win32_is_desktop_composition_enabled ();
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_win32_is_desktop_composition_enabled ()
|
||||
{
|
||||
BOOL b;
|
||||
DWORD sysver, major, minor;
|
||||
sysver = GetVersion ();
|
||||
major = (DWORD)(LOBYTE (LOWORD (sysver)));
|
||||
minor = (DWORD)(HIBYTE (LOWORD (sysver)));
|
||||
/* Composition is always enabled in W8 */
|
||||
if (major >= 6 && minor >= 2)
|
||||
return TRUE;
|
||||
|
||||
if (dwmIsCompositionEnabled && (S_OK == dwmIsCompositionEnabled (&b)))
|
||||
return b;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user