-#undef I3__FILE__
-#define I3__FILE__ "manage.c"
/*
* vim:ts=4:sw=4:expandtab
*
*
*/
#include "all.h"
+
#include "yajl_utils.h"
#include <yajl/yajl_gen.h>
if (xcb_reply_contains_atom(state_reply, A__NET_WM_STATE_STICKY))
nc->sticky = true;
- if (cwindow->wm_desktop == NET_WM_DESKTOP_ALL) {
+ /* We ignore the hint for an internal workspace because windows in the
+ * scratchpad also have this value, but upon restarting i3 we don't want
+ * them to become sticky windows. */
+ if (cwindow->wm_desktop == NET_WM_DESKTOP_ALL && (ws == NULL || !con_is_internal(ws))) {
DLOG("This window has _NET_WM_DESKTOP = 0xFFFFFFFF. Will float it and make it sticky.\n");
nc->sticky = true;
want_floating = true;
xcb_discard_reply(conn, wm_user_time_cookie.sequence);
}
+ if (set_focus) {
+ /* Even if the client doesn't want focus, we still need to focus the
+ * container to not break focus workflows. Our handling towards X will
+ * take care of not setting the input focus. However, one exception to
+ * this are clients using the globally active input model which we
+ * don't want to focus at all. */
+ if (nc->window->doesnt_accept_focus && !nc->window->needs_take_focus) {
+ set_focus = false;
+ }
+ }
+
/* Defer setting focus after the 'new' event has been sent to ensure the
* proper window event sequence. */
- if (set_focus && !nc->window->doesnt_accept_focus && nc->mapped) {
+ if (set_focus && nc->mapped) {
DLOG("Now setting focus.\n");
con_focus(nc);
}