]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/175-startup-notification.t
test: set the _NET_STARTUP_ID before mapping the window
[i3/i3] / testcases / t / 175-startup-notification.t
index 2257b3e455a4e10b5e831c3ee7575d2c29076507..710b3af753b3fa1eb2e03e4dc28028991f6059e5 100644 (file)
@@ -28,11 +28,11 @@ use Inline C => <<'END_OF_C_CODE';
 
 static SnDisplay *sndisplay;
 static SnLauncheeContext *ctx;
+static xcb_connection_t *conn;
 
 // TODO: this should use $x
 void init_ctx() {
     int screen;
-    xcb_connection_t *conn;
     if ((conn = xcb_connect(NULL, &screen)) == NULL ||
         xcb_connection_has_error(conn))
         errx(1, "x11 conn failed");
@@ -48,6 +48,7 @@ const char *get_startup_id() {
 
 void mark_window(int window) {
     sn_launchee_context_setup_window(ctx, (Window)window);
+    xcb_flush(conn);
 }
 
 void complete_startup() {
@@ -95,8 +96,12 @@ my $second_ws = fresh_workspace;
 
 is(@{get_ws_content($second_ws)}, 0, 'no containers on the second workspace yet');
 
-my $win = open_window($x);
+my $win = open_window($x, { dont_map => 1 });
 mark_window($win->id);
+$win->map;
+wait_for_map($x);
+# We sync with i3 here to make sure $x->input_focus is updated.
+sync_with_i3($x);
 
 is(@{get_ws_content($second_ws)}, 0, 'still no containers on the second workspace');
 is(@{get_ws_content($first_ws)}, 1, 'one container on the first workspace');