From 998521f78d3ccf3b9205463797b57cd04e261119 Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Thu, 3 Feb 2005 22:50:48 +0000 Subject: [PATCH] Helped BWindow for calling the apropriate BView hook methods on some mouse and keyboard events git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11242 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/server/RootLayer.cpp | 9 ++++----- src/servers/app/server/WinBorder.cpp | 9 ++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/servers/app/server/RootLayer.cpp b/src/servers/app/server/RootLayer.cpp index efb1c2500e..a18c9ffefa 100644 --- a/src/servers/app/server/RootLayer.cpp +++ b/src/servers/app/server/RootLayer.cpp @@ -1288,10 +1288,8 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg) } keymsg.AddString("bytes",string); // keymsg.AddInt32("raw_char",raw_char); - -printf("RootLayer keyboard message:\n"); -keymsg.PrintToStream(); -printf("\n"); + keymsg.AddInt32("haiku:token", target->fViewToken); + win->SendMessageToClient(&keymsg); } } @@ -1386,7 +1384,8 @@ printf("\n"); } keymsg.AddString("bytes",string); keymsg.AddInt32("raw_char",raw_char); - + keymsg.AddInt32("haiku:token", target->fViewToken); + win->SendMessageToClient(&keymsg); } } diff --git a/src/servers/app/server/WinBorder.cpp b/src/servers/app/server/WinBorder.cpp index 861b6c4e39..05ac54bc8a 100644 --- a/src/servers/app/server/WinBorder.cpp +++ b/src/servers/app/server/WinBorder.cpp @@ -220,7 +220,8 @@ void WinBorder::MouseDown(PointerEvent& evt, bool sendMessage) } } } - else if (sendMessage && target && target != fTopLayer){ + else if (sendMessage && target && target != fTopLayer) + { BMessage msg; msg.what = B_MOUSE_DOWN; msg.AddInt64("when", evt.when); @@ -360,13 +361,15 @@ void WinBorder::MouseUp(PointerEvent& evt) return; } - if (fTopLayer->fFullVisible.Contains(evt.where)) + Layer *target = LayerAt(evt.where); + if (target && target != fTopLayer) { BMessage upmsg(B_MOUSE_UP); upmsg.AddInt64("when",evt.when); upmsg.AddPoint("where",evt.where); upmsg.AddInt32("modifiers",evt.modifiers); - + upmsg.AddInt32("haiku:token", target? target->fViewToken: B_NULL_TOKEN); + Window()->SendMessageToClient(&upmsg); } }