*ide, CtrlCore: fixed crashing of assist popup on mouse click

git-svn-id: svn://ultimatepp.org/upp/trunk@3814 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-09-04 14:57:06 +00:00
parent d868626d91
commit 65a46e5efc
2 changed files with 11 additions and 5 deletions

View file

@ -861,7 +861,7 @@ void Ctrl::KillFocus(Window window)
if(q < 0)
return;
XWindow& w = Xwindow()[q];
if(w.ctrl)
if(w.ctrl)
w.ctrl->KillFocusWnd();
}
@ -873,10 +873,13 @@ void Ctrl::SetWndFocus0(bool *b)
if(top && top->window != focusWindow && IsEnabled() && IsVisible()) {
LLOG("Setting focus... ");
LTIMING("XSetInfputFocus");
Ptr<Ctrl> _this = this;
KillFocus(focusWindow);
XSetInputFocus(Xdisplay, top->window, RevertToParent, CurrentTime);
focusWindow = top->window;
SetFocusWnd();
if(_this && top) {
XSetInputFocus(Xdisplay, top->window, RevertToParent, CurrentTime);
focusWindow = top->window;
SetFocusWnd();
}
*b = true;
}
}
@ -1003,8 +1006,10 @@ void Ctrl::SetWndForeground0()
w->last_active->SetWndForeground();
}
else {
Ptr<Ctrl> _this = this;
SetWndFocus();
XRaiseWindow(Xdisplay, top->window);
if(_this && top)
XRaiseWindow(Xdisplay, top->window);
}
}

View file

@ -23,6 +23,7 @@ AssistEditor::AssistEditor()
assist.NoHeader();
assist.NoGrid();
assist.AddColumn().Margin(0).SetDisplay(Single<CppItemInfoDisplay>());
assist.NoWantFocus();
assist.WhenLeftClick = THISBACK(AssistInsert);
type.NoHeader();
type.NoGrid();