From 49798754e6176147d1ff34581f2f4ed715ebb9b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sun, 18 Oct 2015 20:23:07 +0800 Subject: [PATCH] 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 file changed, 19 insertions(+), 7 deletions(-) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 8d311371f1..b8d5030577 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; }