CtrlCore: Improved endsession behaviour in Win32

git-svn-id: svn://ultimatepp.org/upp/trunk@3706 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-07-23 22:39:22 +00:00
commit c318ff462f
11 changed files with 89 additions and 45 deletions

View file

@ -400,6 +400,7 @@ void Ctrl::EventLoop0(Ctrl *ctrl)
ASSERT(IsMainThread());
ASSERT(LoopLevel == 0 || ctrl);
LoopLevel++;
int64 loopno = ++EventLoopNo;
LLOG("Entering event loop at level " << LoopLevel << LOG_BEGIN);
Ctrl *ploop;
if(ctrl) {
@ -408,7 +409,7 @@ void Ctrl::EventLoop0(Ctrl *ctrl)
ctrl->inloop = true;
}
while(ctrl ? ctrl->InLoop() && ctrl->IsOpen() : GetTopCtrls().GetCount()) {
while(loopno > EndSessionLoopNo && (ctrl ? ctrl->InLoop() && ctrl->IsOpen() : GetTopCtrls().GetCount())) {
XEvent event;
fd_set fdset;
FD_ZERO(&fdset);