Index: epiphany-browser-3.14.2/src/ephy-window.c
===================================================================
--- epiphany-browser-3.14.2.orig/src/ephy-window.c
+++ epiphany-browser-3.14.2/src/ephy-window.c
@@ -3240,9 +3240,18 @@ setup_toolbar (EphyWindow *window)
 	EphyWindowPrivate *priv = window->priv;
 	EphyEmbedShellMode app_mode;
 	EphyTitleBox *title_box;
+	const char* session;
 
 	toolbar = ephy_toolbar_new (window);
-	gtk_window_set_titlebar (GTK_WINDOW (window), toolbar);
+	session = g_getenv ("XDG_CURRENT_DESKTOP");
+	if (session && strstr (session, "GNOME")) {
+		gtk_window_set_titlebar (GTK_WINDOW (window), toolbar);
+	} else {
+		gtk_box_pack_start (GTK_BOX (priv->main_vbox),
+			            toolbar, FALSE, FALSE, 0);
+		gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (toolbar), FALSE);
+	}
+
 	gtk_widget_show (toolbar);
 
 	app_mode = ephy_embed_shell_get_mode (ephy_embed_shell_get_default ());
