xwm: use override_redirect for determining or not top-level windows

"top-level window is a window whose override-redirect attribute is False",
ICCCM 4.1.1

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index 3094601..b79e477 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -109,6 +109,7 @@
 	int width, height;
 	int x, y;
 	int decorate;
+	int override_redirect;
 };
 
 static struct weston_wm_window *
@@ -691,7 +692,7 @@
 
 static void
 weston_wm_window_create(struct weston_wm *wm,
-			xcb_window_t id, int width, int height)
+			xcb_window_t id, int width, int height, int override)
 {
 	struct weston_wm_window *window;
 	uint32_t values[1];
@@ -709,7 +710,7 @@
 	window->wm = wm;
 	window->id = id;
 	window->properties_dirty = 1;
-
+	window->override_redirect = override;
 	window->width = width;
 	window->height = height;
 
@@ -740,7 +741,8 @@
 		return;
 
 	weston_wm_window_create(wm, create_notify->window,
-				create_notify->width, create_notify->height);
+				create_notify->width, create_notify->height,
+				create_notify->override_redirect);
 }
 
 static void
@@ -776,7 +778,8 @@
 		reparent_notify->event);
 
 	if (reparent_notify->parent == wm->screen->root) {
-		weston_wm_window_create(wm, reparent_notify->window, 10, 10);
+		weston_wm_window_create(wm, reparent_notify->window, 10, 10,
+					reparent_notify->override_redirect);
 	} else if (!our_resource(wm, reparent_notify->parent)) {
 		window = hash_table_lookup(wm->window_hash,
 					   reparent_notify->window);
@@ -1321,7 +1324,8 @@
 						      window->surface,
 						      &shell_client);
 
-	if (!window->transient_for) {
+	/* ICCCM 4.1.1 */
+	if (!window->override_redirect) {
 		shell_interface->set_toplevel(window->shsurf);
 		return;
 	}