mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Fixed resize
This commit is contained in:
parent
7e0b387e69
commit
fad624205f
@ -282,6 +282,7 @@ namespace GraphicalUserInterface
|
||||
{
|
||||
KernelCallback callback;
|
||||
MouseData Mouse;
|
||||
bool FoundMouseDriver = false;
|
||||
if (DriverManager->GetDrivers().size() > 0)
|
||||
{
|
||||
foreach (auto Driver in DriverManager->GetDrivers())
|
||||
@ -307,11 +308,22 @@ namespace GraphicalUserInterface
|
||||
Mouse.Left = callback.InputCallback.Mouse.Buttons.Left;
|
||||
Mouse.Right = callback.InputCallback.Mouse.Buttons.Right;
|
||||
Mouse.Middle = callback.InputCallback.Mouse.Buttons.Middle;
|
||||
FoundMouseDriver = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!FoundMouseDriver)
|
||||
{
|
||||
Mouse.X = 0;
|
||||
Mouse.Y = 0;
|
||||
Mouse.Z = 0;
|
||||
Mouse.Left = false;
|
||||
Mouse.Right = false;
|
||||
Mouse.Middle = false;
|
||||
}
|
||||
|
||||
Event eTemplate;
|
||||
memset(&eTemplate, 0, sizeof(Event));
|
||||
foreach (auto wnd in this->Windows)
|
||||
@ -453,7 +465,7 @@ namespace GraphicalUserInterface
|
||||
|
||||
Rect WndPos = wnd->GetPosition();
|
||||
|
||||
// Draw window
|
||||
// Draw window content
|
||||
DrawOverBitmap(this->BackBuffer,
|
||||
wndBuffer,
|
||||
WndPos.Top,
|
||||
|
@ -13,7 +13,19 @@ namespace GraphicalUserInterface
|
||||
{
|
||||
void Window::OnResize(Event *e)
|
||||
{
|
||||
fixme("Window::OnResize() not implemented");
|
||||
// TODO: Optimize this
|
||||
this->mem->FreePages(this->Buffer->Data, TO_PAGES(this->Buffer->Size));
|
||||
delete this->Buffer;
|
||||
|
||||
this->Buffer = new ScreenBitmap;
|
||||
this->Buffer->Width = e->Resize.Width;
|
||||
this->Buffer->Height = e->Resize.Height;
|
||||
this->Buffer->BitsPerPixel = Display->GetBitsPerPixel();
|
||||
this->Buffer->Pitch = Display->GetPitch();
|
||||
this->Buffer->Size = this->Buffer->Pitch * e->Resize.Height;
|
||||
this->Buffer->Data = (uint8_t *)this->mem->RequestPages(TO_PAGES(this->Buffer->Size));
|
||||
memset(this->Buffer->Data, 0, this->Buffer->Size);
|
||||
this->OnPaint(e);
|
||||
}
|
||||
|
||||
void Window::OnMinimize(Event *e)
|
||||
@ -33,7 +45,10 @@ namespace GraphicalUserInterface
|
||||
|
||||
void Window::OnPaintBackground(Event *e)
|
||||
{
|
||||
PutRect(this->Buffer, this->Position, /*0x121212*/ 0xFF00FF);
|
||||
Rect PaintPosition = this->Position;
|
||||
PaintPosition.Left = 0;
|
||||
PaintPosition.Top = 0;
|
||||
PutRect(this->Buffer, PaintPosition, /*0x121212*/ 0xFF00FF);
|
||||
}
|
||||
|
||||
void Window::OnPaintForeground(Event *e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user