Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sprinkle more if p == null return.
[spectrwm.git]
/
scrotwm.c
diff --git
a/scrotwm.c
b/scrotwm.c
index
3f1566a
..
5be409d
100644
(file)
--- a/
scrotwm.c
+++ b/
scrotwm.c
@@
-997,6
+997,9
@@
client_msg(struct ws_win *win, Atom a)
{
XClientMessageEvent cm;
{
XClientMessageEvent cm;
+ if (win == NULL)
+ return;
+
bzero(&cm, sizeof cm);
cm.type = ClientMessage;
cm.window = win->id;
bzero(&cm, sizeof cm);
cm.type = ClientMessage;
cm.window = win->id;
@@
-1014,6
+1017,10
@@
config_win(struct ws_win *win)
DNPRINTF(SWM_D_MISC, "config_win: win %lu x %d y %d w %d h %d\n",
win->id, win->g.x, win->g.y, win->g.w, win->g.h);
DNPRINTF(SWM_D_MISC, "config_win: win %lu x %d y %d w %d h %d\n",
win->id, win->g.x, win->g.y, win->g.w, win->g.h);
+
+ if (win == NULL)
+ return;
+
ce.type = ConfigureNotify;
ce.display = display;
ce.event = win->id;
ce.type = ConfigureNotify;
ce.display = display;
ce.event = win->id;
@@
-1123,6
+1130,9
@@
fake_keypress(struct ws_win *win, int keysym, int modifiers)
{
XKeyEvent event;
{
XKeyEvent event;
+ if (win == NULL)
+ return;
+
event.display = display; /* Ignored, but what the hell */
event.window = win->id;
event.root = win->s->root;
event.display = display; /* Ignored, but what the hell */
event.window = win->id;
event.root = win->s->root;
@@
-1261,7
+1271,8
@@
unfocus_win(struct ws_win *win)
{
if (win == NULL)
return;
{
if (win == NULL)
return;
-
+ if (win->ws == NULL)
+ return;
if (win->ws->r == NULL)
return;
if (win->ws->r == NULL)
return;
@@
-1296,6
+1307,8
@@
focus_win(struct ws_win *win)
if (win == NULL)
return;
if (win == NULL)
return;
+ if (win->ws == NULL)
+ return;
/* use big hammer to make sure it works under all use cases */
unfocus_all();
/* use big hammer to make sure it works under all use cases */
unfocus_all();
@@
-1321,6
+1334,9
@@
switchws(struct swm_region *r, union arg *args)
struct ws_win *win, *winfocus = NULL, *parent = NULL;
struct workspace *new_ws, *old_ws;
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];
this_r = r;
old_ws = this_r->ws;
new_ws = &this_r->s->ws[wsid];
@@
-1329,7
+1345,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);
"%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 */
return;
/* get focus window */
@@
-3444,8
+3460,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 */
/* alter window position if quirky */
if (win->quirks & SWM_Q_ANYWHERE) {
win->manual = 1; /* don't center the quirky windows */
@@
-3501,6
+3515,9
@@
unmanage_window(struct ws_win *win)
DNPRINTF(SWM_D_MISC, "unmanage_window: %lu\n", win->id);
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)
if (win->transient) {
parent = find_window(win->transient);
if (parent)
@@
-4183,7
+4200,6
@@
setup_screens(void)
/* attach windows to a region */
/* normal windows */
for (j = 0; j < no; j++) {
/* 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))
if (!XGetWindowAttributes(display, wins[j], &wa) ||
wa.override_redirect ||
XGetTransientForHint(display, wins[j], &d1))
@@
-4196,7
+4212,8
@@
setup_screens(void)
}
/* transient windows */
for (j = 0; j < no; j++) {
}
/* 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]);
continue;
state = getstate(wins[j]);