+ if( m_focussed_window )
+ {
+ m_focussed_window->KeyEvent(KeySym, "", Press);
+ }
+}
+
+CWindow* CCompositor::getWindowForCoord(unsigned int X, unsigned int Y)
+{
+ return m_windowIDBuffer.get(X, Y);
+}
+
+// --------------------------------------------------------------------
+CWindowIDBuffer::CWindowIDBuffer(unsigned int W, unsigned int H):
+ m_w(W),
+ m_buf(W*H)
+{
+}
+void CWindowIDBuffer::set(unsigned int X, unsigned int Y, unsigned int W, unsigned int H, CWindow* win)
+{
+ TWindowID ent = {
+ .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)
+{
+ if( X >= m_w )
+ return nullptr;
+ unsigned int pos = Y*m_w + X;
+ 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 ) {
+ //_SysDebug("CWindowIDBuffer::get client=%p", client);
+ return nullptr;
+ }
+ return client->GetWindow(id.Window);