mirror of
https://github.com/vale981/spectrwm
synced 2025-03-05 09:51:38 -05:00
sprinkle more if p == null return.
we should audit all functions for this.
This commit is contained in:
parent
db031f1cc5
commit
f0c9f65a11
1 changed files with 14 additions and 1 deletions
15
scrotwm.c
15
scrotwm.c
|
@ -997,6 +997,9 @@ client_msg(struct ws_win *win, Atom a)
|
|||
{
|
||||
XClientMessageEvent cm;
|
||||
|
||||
if (win == NULL)
|
||||
return;
|
||||
|
||||
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);
|
||||
|
||||
if (win == NULL)
|
||||
return;
|
||||
|
||||
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;
|
||||
|
||||
if (win == NULL)
|
||||
return;
|
||||
|
||||
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->ws == NULL)
|
||||
return;
|
||||
if (win->ws->r == NULL)
|
||||
return;
|
||||
|
||||
|
@ -1296,6 +1307,8 @@ focus_win(struct ws_win *win)
|
|||
|
||||
if (win == NULL)
|
||||
return;
|
||||
if (win->ws == NULL)
|
||||
return;
|
||||
|
||||
/* use big hammer to make sure it works under all use cases */
|
||||
unfocus_all();
|
||||
|
|
Loading…
Add table
Reference in a new issue