X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=scrotwm.c;h=52927256bc94e257c85a4810abee9c771b8c4852;hb=db031f1cc5b0329becb5ffd12eeadc429dc08495;hp=3f1566ae6f46fdd72f182486b837fbfa8754a87f;hpb=841e741913acb91111fabae2f93b7257e845722e;p=spectrwm.git diff --git a/scrotwm.c b/scrotwm.c index 3f1566a..5292725 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -1321,6 +1321,9 @@ switchws(struct swm_region *r, union arg *args) struct ws_win *win, *winfocus = NULL, *parent = NULL; struct workspace *new_ws, *old_ws; + if (!(r && r->s)) + return; + this_r = r; old_ws = this_r->ws; new_ws = &this_r->s->ws[wsid]; @@ -1329,7 +1332,7 @@ switchws(struct swm_region *r, union arg *args) "%d -> %d\n", r->s->idx, WIDTH(r), HEIGHT(r), X(r), Y(r), old_ws->idx, wsid); - if (new_ws == old_ws) + if (new_ws == NULL || old_ws == NULL || new_ws == old_ws) return; /* get focus window */ @@ -3444,8 +3447,6 @@ manage_window(Window id) } } - if (win->java && win->transient) { - } /* alter window position if quirky */ if (win->quirks & SWM_Q_ANYWHERE) { win->manual = 1; /* don't center the quirky windows */ @@ -3501,6 +3502,9 @@ unmanage_window(struct ws_win *win) DNPRINTF(SWM_D_MISC, "unmanage_window: %lu\n", win->id); + /* needed for restart wm */ + set_win_state(win, WithdrawnState); + if (win->transient) { parent = find_window(win->transient); if (parent) @@ -4183,7 +4187,6 @@ setup_screens(void) /* attach windows to a region */ /* normal windows */ for (j = 0; j < no; j++) { - XGetWindowAttributes(display, wins[j], &wa); if (!XGetWindowAttributes(display, wins[j], &wa) || wa.override_redirect || XGetTransientForHint(display, wins[j], &d1)) @@ -4196,7 +4199,8 @@ setup_screens(void) } /* transient windows */ for (j = 0; j < no; j++) { - if (!XGetWindowAttributes(display, wins[j], &wa)) + if (!XGetWindowAttributes(display, wins[j], &wa) || + wa.override_redirect) continue; state = getstate(wins[j]);