summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2021-07-20 19:41:17 +0200
committerKim Woelders <kim@woelders.dk>2021-07-20 20:55:08 +0200
commit77c9525cea3e671141abd2a0120768922d2f1ed5 (patch)
tree9f3ec6bf64306b3a18db06fc9ae803e3da3defbd
parent13c4b29a98cee813d7a49a677cb0ee0ffa577150 (diff)
extinitwin: Fix parent/client synchronization
1) Clear ENLIGHTENMENT_RESTART_SCREEN property on start so we properly detect the client init condition. 2) Use SleepUs() instead of time() to properly force a delay. time() was interrupted by signals (SIGCHLDs) cutting the delay short.
-rw-r--r--src/extinitwin.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/extinitwin.c b/src/extinitwin.c
index 7f7b8826..ec718dc9 100644
--- a/src/extinitwin.c
+++ b/src/extinitwin.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors 2 * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
3 * Copyright (C) 2004-2020 Kim Woelders 3 * Copyright (C) 2004-2021 Kim Woelders
4 * 4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy 5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to 6 * of this software and associated documentation files (the "Software"), to
@@ -259,6 +259,7 @@ ExtInitWinCreate(void)
259 Eprintf("%s\n", __func__); 259 Eprintf("%s\n", __func__);
260 260
261 a = ex_atom_get("ENLIGHTENMENT_RESTART_SCREEN"); 261 a = ex_atom_get("ENLIGHTENMENT_RESTART_SCREEN");
262 ex_window_prop_window_set(WinGetXwin(RROOT), a, NULL, 0);
262 ESync(0); 263 ESync(0);
263 264
264 if (fork()) 265 if (fork())
@@ -272,7 +273,7 @@ ExtInitWinCreate(void)
272 Eprintf("%s: parent\n", __func__); 273 Eprintf("%s: parent\n", __func__);
273 274
274 /* Hack to give the child some space. Not foolproof. */ 275 /* Hack to give the child some space. Not foolproof. */
275 sleep(1); 276 SleepUs(500000);
276 277
277 if (ex_window_prop_window_get 278 if (ex_window_prop_window_get
278 (WinGetXwin(RROOT), a, &win_ex, 1) > 0) 279 (WinGetXwin(RROOT), a, &win_ex, 1) > 0)