[amiwm] Fix NULL scr issue

If the clock timer fires when global scr is NULL then we end up calling
redrawmenubar() with a NULL global scr, but a valid local scr.

So just pass in the scr used when doing "stuff" into redrawmenubar(),
making the 'scr' in redrawmenubar() also local scope.
This commit is contained in:
Adrian Chadd
2022-09-05 16:03:55 -07:00
parent 21423a0c10
commit 229d2b2c4d
3 changed files with 12 additions and 12 deletions

View File

@@ -28,7 +28,7 @@ extern Display *dpy;
extern XContext client_context, screen_context;
extern Cursor wm_curs;
extern int shape_extn;
extern void redrawmenubar(Window);
extern void redrawmenubar(Scrn *, Window);
void reshape_frame(Client *c);
Window creategadget(Client *c, Window p, int x, int y, int w, int h)
@@ -510,7 +510,7 @@ void clickenter()
{
if((scr=mbdscr)&& clickwindow == scr->menubardepth) {
mbdclick = scr;
redrawmenubar(scr->menubardepth);
redrawmenubar(scr, scr->menubardepth);
} else {
scr = clickclient->scr;
redraw(clickclient, clickclient->clicked=clickwindow);
@@ -521,7 +521,7 @@ void clickleave()
{
if((scr=mbdscr)&& clickwindow == scr->menubardepth) {
mbdclick = NULL;
redrawmenubar(scr->menubardepth);
redrawmenubar(scr, scr->menubardepth);
} else {
scr = clickclient->scr;
clickclient->clicked=None;