[gtk+/master.fcw: 531/648] Revert "GDK-Win32 Implement is_composited() and set_composited()"



commit 757bb9656a3d1208d98d1a142fb9ade37760e4cb
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jan 21 16:42:57 2015 +0800

    Revert "GDK-Win32 Implement is_composited() and set_composited()"
    
    This reverts commit 8edfc14ea30ea5c2852a245274c769536906647e.

 gdk/win32/gdkmain-win32.c    |   36 ------------------------------------
 gdk/win32/gdkprivate-win32.h |   42 ------------------------------------------
 gdk/win32/gdkscreen-win32.c  |   22 +---------------------
 gdk/win32/gdkwindow-win32.c  |   28 +---------------------------
 4 files changed, 2 insertions(+), 126 deletions(-)
---
diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c
index e97f5f4..905c729 100644
--- a/gdk/win32/gdkmain-win32.c
+++ b/gdk/win32/gdkmain-win32.c
@@ -150,42 +150,6 @@ _gdk_other_api_failed (const gchar *where,
   g_warning ("%s: %s failed", where, api);
 }
 
-/* Remove this after XP support dropped, just check whether
- * we are on Windows 8/Server 2012 or later at that time
- */
-GdkWin32DwmCapabilities *
-gdk_win32_get_dwm_capabilities (void)
-{
-  static GdkWin32DwmCapabilities capabilities;
-  static gsize capabilities_inited;
-
-  if (g_once_init_enter (&capabilities_inited))
-    {
-      HMODULE dwmdll = LoadLibraryW (L"dwmapi.dll");
-
-      capabilities.is_win8_or_later = g_win32_windows_is_at_least (6, 2, 0, G_WIN32_OS_ANY);
-      if (dwmdll == NULL)
-        {
-          capabilities.dwmIsCompositionEnabled = NULL;
-          capabilities.dwmEnableComposition = NULL;
-          capabilities.dwmEnableBlurBehindWindow = NULL;
-        }
-      else
-        {
-          capabilities.dwmIsCompositionEnabled =
-            (PFN_DwmIsCompositionEnabled) GetProcAddress (dwmdll, "DwmIsCompositionEnabled");
-          capabilities.dwmEnableComposition =
-            (PFN_DwmEnableComposition) GetProcAddress (dwmdll, "DwmEnableComposition");
-          capabilities.dwmEnableBlurBehindWindow =
-            (PFN_DwmEnableBlurBehindWindow) GetProcAddress (dwmdll, "DwmEnableBlurBehindWindow");
-
-          FreeLibrary (dwmdll);
-        }
-
-      g_once_init_leave (&capabilities_inited, 1);
-    }
-  return &capabilities;
-}
 
 #ifdef G_ENABLE_DEBUG
 
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index f5c2add..acc3fca 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -508,46 +508,4 @@ void _gdk_events_init (void);
 void _gdk_input_init  (GdkDisplay *display);
 void _gdk_input_wintab_init_check (GdkDeviceManager *device_manager);
 
-/* for XP run-time compatibility, remove once XP support dropped */
-#ifndef DWM_BLURBEHIND
-typedef struct
-{
-  DWORD dwFlags;
-  BOOL fEnable;
-  HRGN hRgnBlur;
-  BOOL fTransitionOnMaximized;
-} DWM_BLURBEHIND;
-#endif
-
-#ifndef DWM_EC_DISABLECOMPOSITION
-#define DWM_EC_DISABLECOMPOSITION 0
-#endif
-#ifndef DWM_EC_ENABLECOMPOSITION
-#define DWM_EC_ENABLECOMPOSITION 1
-#endif
-
-#ifndef DWM_BB_ENABLE
-#define DWM_BB_ENABLE 0x00000001
-#endif
-
-#ifndef DWM_BB_BLURREGION
-#define DWM_BB_BLURREGION 0x00000002
-#endif
-
-typedef HRESULT (WINAPI *PFN_DwmIsCompositionEnabled) (BOOL *);
-typedef HRESULT (WINAPI *PFN_DwmEnableComposition) (UINT);
-typedef HRESULT (WINAPI *PFN_DwmEnableBlurBehindWindow) (HWND, const DWM_BLURBEHIND *);
-
-typedef struct
-{
-  PFN_DwmIsCompositionEnabled dwmIsCompositionEnabled;
-  PFN_DwmEnableComposition dwmEnableComposition;
-  PFN_DwmEnableBlurBehindWindow dwmEnableBlurBehindWindow;
-
-  /* Only check whether we are on Windows 8 or Server 2012 or later after dropping XP support */
-  gboolean is_win8_or_later;
-} GdkWin32DwmCapabilities;
-
-GdkWin32DwmCapabilities *gdk_win32_get_dwm_capabilities (void);
-
 #endif /* __GDK_PRIVATE_WIN32_H__ */
diff --git a/gdk/win32/gdkscreen-win32.c b/gdk/win32/gdkscreen-win32.c
index fed661e..8c6fb03 100644
--- a/gdk/win32/gdkscreen-win32.c
+++ b/gdk/win32/gdkscreen-win32.c
@@ -195,29 +195,9 @@ gdk_win32_screen_get_window_stack (GdkScreen *screen)
 static gboolean
 gdk_win32_screen_is_composited (GdkScreen *screen)
 {
-  /* XXX: Call DwmIsCompositionEnabled() directly when we drop Windows XP Support */
-  GdkWin32DwmCapabilities *capabilities;
-
-  gboolean is_composited;
-
   g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
 
-  capabilities = gdk_win32_get_dwm_capabilities ();
-
-  /* Windows 8/Server 2012 and later are always composited.
-     Use g_win32_windows_is_at_least (6, 2, 0, G_WIN32_OS_ANY) when XP support dropped */
-  if (capabilities->is_win8_or_later)
-    return TRUE;
-
-  /* not Windows 8+/Server 2012+, check further
-     DwmIsCompositionEnabled() is only on Vista and later */
-  if (capabilities->dwmIsCompositionEnabled == NULL)
-    return FALSE;
-
-  if (capabilities->dwmIsCompositionEnabled (&is_composited) != S_OK)
-    return FALSE;
-
-  return is_composited;
+  return FALSE;
 }
 
 static void
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 9599bcd..3e568a4 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -3363,32 +3363,6 @@ gdk_win32_ref_cairo_surface (GdkWindow *window)
 }
 
 static void
-gdk_win32_window_set_composited (GdkWindow *window,
-                                 gboolean composited)
-{
-  /* XXX: Call DwmEnableComposition() directly when we drop Windows XP Support */
-  GdkWin32DwmCapabilities *capabilities = gdk_win32_get_dwm_capabilities ();
-
-  guint action;
-
-  /* we can't set whether the Window is composited or not on Windows 8+/Server 2012+,
-     as it is always composited.
-     Use g_win32_windows_is_at_least (6, 2, 0, G_WIN32_OS_ANY) when XP support dropped */
-  if (capabilities->is_win8_or_later)
-    return;
-
-  /* There isn't DWM on XP either, so can't set this as well */
-  if (capabilities->dwmEnableComposition == NULL)
-    return;
-  if (composited)
-    action = DWM_EC_ENABLECOMPOSITION;
-  else
-    action = DWM_EC_DISABLECOMPOSITION;
-
-  capabilities->dwmEnableComposition (action);
-}
-
-static void
 gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -3463,7 +3437,7 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
   impl_class->begin_resize_drag = gdk_win32_window_begin_resize_drag;
   impl_class->begin_move_drag = gdk_win32_window_begin_move_drag;
   impl_class->set_opacity = gdk_win32_window_set_opacity;
-  impl_class->set_composited = gdk_win32_window_set_composited;
+  //impl_class->set_composited = gdk_win32_window_set_composited;
   impl_class->destroy_notify = gdk_win32_window_destroy_notify;
   impl_class->get_drag_protocol = _gdk_win32_window_get_drag_protocol;
   impl_class->register_dnd = _gdk_win32_window_register_dnd;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]