## Description: Open windows on correct screen.
## Origin/Author: Alberts Muktupāvels <alberts.muktupavels@gmail.com>
## Bug: https://bugzilla.gnome.org/show_bug.cgi?id=705317
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -1849,8 +1849,20 @@
 NautilusApplication *
 nautilus_application_new (void)
 {
+	const gchar *display = g_getenv ("DISPLAY");
+	const gchar *application_id = "org.gnome.Nautilus";
+
+	if (display != NULL) {
+		int number_display;
+		int number_screen;
+		
+		if (sscanf (display, ":%d.%d", &number_display, &number_screen) == 2) {
+			application_id = g_strdup_printf ("org.gnome.Nautilus.Display_%d_%d", number_display, number_screen);
+		}
+	}
+	
 	return g_object_new (NAUTILUS_TYPE_APPLICATION,
-			     "application-id", "org.gnome.Nautilus",
+			     "application-id", application_id,
 			     "flags", G_APPLICATION_HANDLES_OPEN,
 			     "inactivity-timeout", 12000,
 			     "register-session", TRUE,
