Fix closing logout dialog when using key bindings.

SVN revision: 24164
This commit is contained in:
Kim Woelders 2006-07-24 20:53:49 +00:00
parent 65341833e2
commit 699f4238b7
3 changed files with 19 additions and 2 deletions

View File

@ -201,6 +201,7 @@ struct _dialog
char redraw;
char update;
char close;
int xu1, yu1, xu2, yu2;
};
@ -680,8 +681,14 @@ DialogShowCentered(Dialog * d)
DialogShowArranged(d, 1);
}
static void
void
DialogClose(Dialog * d)
{
d->close = 1;
}
static void
_DialogClose(Dialog * d)
{
if (!d)
return;
@ -2167,6 +2174,9 @@ DialogHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
DialogEventKeyPress(d, ev);
break;
}
if (d->close)
_DialogClose(d);
}
static void
@ -2493,6 +2503,9 @@ DButtonHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
if (db->close)
DialogClose(d);
}
if (d->close)
_DialogClose(d);
}
/*

View File

@ -78,6 +78,7 @@ void DialogShow(Dialog * d);
void DialogShowCentered(Dialog * d);
void DialogShowSimple(const DialogDef * dd, void *data);
void DialogRedraw(Dialog * d);
void DialogClose(Dialog * d);
void DialogAddButton(Dialog * d, const char *text,
DialogCallbackFunc * func, char doclose,
@ -86,6 +87,7 @@ void DialogAddHeader(Dialog * d, const char *img,
const char *txt);
void DialogAddFooter(Dialog * d, int flags,
DialogCallbackFunc * cb);
DItem *DialogInitItem(Dialog * d);
DItem *DialogAddItem(DItem * dii, int type);
Dialog *DialogItemGetDialog(DItem * di);

View File

@ -602,7 +602,7 @@ SessionLogout(void)
}
static void
LogoutCB(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
LogoutCB(Dialog * d, int val, void *data __UNUSED__)
{
#ifdef HAVE_X11_SM_SMLIB_H
if (sm_conn)
@ -630,6 +630,8 @@ LogoutCB(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
break;
}
}
DialogClose(d);
}
static void