cvsimport

* refs/heads/master:
  Only when mapping clients from an initial wm start or restart, query the pointer and if it matches the child window, activate it; new clients will not need to make this roundtrip to the server.
  On execwm, we should properly release resources before exec'ing into a new window manager; so allow CWM_EXEC_WM to assign new wm to wm_argv and pass through cwm_status (now EXECWM) so that x_teardown() gets called before exec'ing the new window manager.  Removes the need for a separate x_restart() now, using new wm_argv; and consolidates errno for execvp.
This commit is contained in:
okan
2015-09-23 14:09:40 +00:00
6 changed files with 49 additions and 20 deletions

View File

@@ -48,6 +48,9 @@ client_init(Window win, struct screen_ctx *sc)
struct client_ctx *cc;
XWindowAttributes wattr;
int mapped;
Window rwin, cwin;
int x, y, wx, wy, activate = 0;
unsigned int mask;
if (win == None)
return(NULL);
@@ -97,6 +100,10 @@ client_init(Window win, struct screen_ctx *sc)
client_move(cc);
if ((cc->wmh) && (cc->wmh->flags & StateHint))
client_set_wm_state(cc, cc->wmh->initial_state);
} else {
if ((XQueryPointer(X_Dpy, cc->win, &rwin, &cwin,
&x, &y, &wx, &wy, &mask)) && (cwin != None))
activate = 1;
}
XSelectInput(X_Dpy, cc->win, ColormapChangeMask | EnterWindowMask |
@@ -134,6 +141,9 @@ out:
XSync(X_Dpy, False);
XUngrabServer(X_Dpy);
if (activate)
client_setactive(cc);
return(cc);
}