aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorokan2013-04-03 19:20:50 +0000
committerokan2013-04-03 19:20:50 +0000
commit4b8a3bc2b98550fcd3752bc06b7400efc34e1592 (patch)
treea06305f950bb9ce879f58e88e96bfe7619f86a7c /client.c
parentec37fa13b410764298c987ad53961c0728080b95 (diff)
downloadcwm-4b8a3bc2b98550fcd3752bc06b7400efc34e1592.tar.gz
move XUngrabServer to the end of client_new() to avoid races where clients,
such as those using sdl, attempt to manage the clients themselves when the clients aren't fully ready. other wm's grab the xserver during the whole client setup process, so match. behavior found by jsg.
Diffstat (limited to '')
-rw-r--r--client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/client.c b/client.c
index 9845a32..96f63f4 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: client.c,v 1.119 2013/01/08 15:16:05 okan Exp $
+ * $OpenBSD: client.c,v 1.120 2013/04/03 19:20:50 okan Exp $
*/
#include <sys/param.h>
@@ -121,9 +121,6 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
(state == IconicState) ? client_hide(cc) : client_unhide(cc);
xu_setstate(cc, cc->state);
- XSync(X_Dpy, False);
- XUngrabServer(X_Dpy);
-
TAILQ_INSERT_TAIL(&sc->mruq, cc, mru_entry);
TAILQ_INSERT_TAIL(&Clientq, cc, entry);
@@ -135,6 +132,9 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
if (mapped)
group_autogroup(cc);
+ XSync(X_Dpy, False);
+ XUngrabServer(X_Dpy);
+
return (cc);
}