[gtk+] wayland: Make window type conditions switches



commit 49798754e6176147d1ff34581f2f4ed715ebb9b7
Author: Jonas Ådahl <jadahl gmail com>
Date:   Sun Oct 18 20:23:07 2015 +0800

    wayland: Make window type conditions switches
    
    In order to make it easier to add/remove in future commits.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756780

 gdk/wayland/gdkwindow-wayland.c |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 8d31137..b8d5030 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -1226,8 +1226,14 @@ should_map_as_subsurface (GdkWindow *window)
   if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_SUBSURFACE)
     return TRUE;
 
-  if (impl->hint == GDK_WINDOW_TYPE_HINT_TOOLTIP)
-    return TRUE;
+  switch (impl->hint)
+    {
+    case GDK_WINDOW_TYPE_HINT_TOOLTIP:
+      return TRUE;
+
+    default:
+      break;
+    }
 
   return FALSE;
 }
@@ -1237,11 +1243,17 @@ should_map_as_popup (GdkWindow *window)
 {
   GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
 
-  if (impl->hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU ||
-      impl->hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU ||
-      impl->hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
-      impl->hint == GDK_WINDOW_TYPE_HINT_COMBO)
-    return TRUE;
+  switch (impl->hint)
+    {
+    case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
+    case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
+    case GDK_WINDOW_TYPE_HINT_UTILITY:
+    case GDK_WINDOW_TYPE_HINT_COMBO:
+      return TRUE;
+
+    default:
+      break;
+    }
 
   return FALSE;
 }


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