X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin4_src%2FServer%2Fcompositor.cpp;h=cf8192ec2b6beac1440071976cad3c9db7962d96;hb=6fbf6b93bec9b8b5bd6d7c683eefb0ebed8dff77;hp=42bb8b9b1d963564e6debc992a93ba49342fe6c4;hpb=8b16265b4394af76f64c30393e27d08c294c4bac;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin4_src/Server/compositor.cpp b/Usermode/Applications/axwin4_src/Server/compositor.cpp index 42bb8b9b..cf8192ec 100644 --- a/Usermode/Applications/axwin4_src/Server/compositor.cpp +++ b/Usermode/Applications/axwin4_src/Server/compositor.cpp @@ -16,6 +16,7 @@ namespace AxWin { CCompositor::CCompositor(CVideo& video): // TODO: Support multiple screens m_video(video), + m_focussed_window(nullptr), m_windowIDBuffer(video.width(), video.height()) { // @@ -54,7 +55,7 @@ void CCompositor::Redraw() { // Redraw the screen and clear damage rects if( m_damageRects.empty() ) { - _SysDebug("- No damaged regions"); + //_SysDebug("- No damaged regions"); return ; } @@ -107,12 +108,13 @@ void CCompositor::BlitFromSurface(const CSurface& dest, const CRect& src_rect) void CCompositor::MouseMove(unsigned int Cursor, unsigned int X, unsigned int Y, int dX, int dY) { - _SysDebug("MouseButton(%i, %i,%i, %+i,%+i)", Cursor, X, Y, dX, dY); + //_SysDebug("MouseButton(%i, %i,%i, %+i,%+i)", Cursor, X, Y, dX, dY); m_video.SetCursorPos(X+dX, Y+dY); CWindow *dstwin = getWindowForCoord(X, Y); if( dstwin ) { - // TODO: Pass event on to window + // Pass event on to window + dstwin->MouseMove(X, Y); } } @@ -120,17 +122,22 @@ void CCompositor::MouseButton(unsigned int Cursor, unsigned int X, unsigned int { _SysDebug("MouseButton(%i, %i,%i, %i=%i)", Cursor, X, Y, Button, Press); CWindow *dstwin = getWindowForCoord(X, Y); + _SysDebug("- dstwin = %p", dstwin); if( dstwin ) { // 1. Give focus and bring to front // 2. Send event - // TODO: Pass event on to window + dstwin->MouseButton(Button, X, Y, Press); } } void CCompositor::KeyState(unsigned int KeyboardID, uint32_t KeySym, bool Press, uint32_t Codepoint) { _SysDebug("KeyState(%i, 0x%x, %b, 0x%x)", KeyboardID, KeySym, Press, Codepoint); + if( m_focussed_window ) + { + m_focussed_window->KeyEvent(KeySym, "", Press); + } } CWindow* CCompositor::getWindowForCoord(unsigned int X, unsigned int Y) @@ -150,7 +157,12 @@ void CWindowIDBuffer::set(unsigned int X, unsigned int Y, unsigned int W, unsign .Client = win->client().id(), .Window = win->id(), }; - + for( unsigned int row = 0; row < H; row ++ ) + { + TWindowID* dst = &m_buf[ (Y+row) * m_w ]; + for( unsigned int col = 0; col < W; col ++ ) + dst[col] = ent; + } } CWindow* CWindowIDBuffer::get(unsigned int X, unsigned int Y) { @@ -160,9 +172,12 @@ CWindow* CWindowIDBuffer::get(unsigned int X, unsigned int Y) if( pos >= m_buf.size() ) return nullptr; auto id = m_buf[pos]; + //_SysDebug("CWindowIDBuffer::get id = {%i,%i}", id.Client, id.Window); auto client = ::AxWin::IPC::GetClientByID(id.Client); - if( client == nullptr ) + if( client == nullptr ) { + //_SysDebug("CWindowIDBuffer::get client=%p", client); return nullptr; + } return client->GetWindow(id.Window); }