VirtualGui: Ctrl::GetOwner() bounds check added. & missing Ctrl::GetCaretBlinkTime() implemented. (#107)

This commit is contained in:
İsmail Yılmaz 2022-10-11 11:35:17 +03:00 committed by GitHub
parent c400785beb
commit 91b95d12c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -42,6 +42,8 @@ private:
static void DeleteDesktopTop();
static int GetCaretBlinkTime() { return 500; }
protected:
static int PaintLock;

View file

@ -74,10 +74,12 @@ Ctrl *Ctrl::GetOwner()
{
GuiLock __;
int q = FindTopCtrl();
Top *top = topctrl[q]->GetTop();
if(q > 0 && top) {
Ctrl *x = top->owner_window;
return dynamic_cast<TopWindowFrame *>(x) ? x->GetOwner() : x;
if(q >= 0) {
Top *top = topctrl[q]->GetTop();
if(q > 0 && top) {
Ctrl *x = top->owner_window;
return dynamic_cast<TopWindowFrame *>(x) ? x->GetOwner() : x;
}
}
return NULL;
}