History log of /haiku/src/servers/app/EventDispatcher.h
Revision Date Author Comments
# d99d8dbd 27-Aug-2020 X512 <danger_mail@list.ru>

app_server memory management: use ObjectDeleter to mark ownership

Make object ownership explicit by use of ObjectDeleter where possible.

Change-Id: I499a00aa3390d1510ae284419e73faffa5166430
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2695
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 60d30785 27-Aug-2020 X512 <danger_mail@list.ru>

app_server memory management fixes: use BReference

Use BReference for more automated reference counting in app_server,
fixing some use-after-free and other problems.

Extracted from https://review.haiku-os.org/c/haiku/+/2695

Change-Id: I141bb248229405896b29feff3338447f7257b0b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3175
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 8f5d92f9 12-Dec-2013 John Scipione <jscipione@gmail.com>

EventDispatcher: Style fixes


# 95530739 17-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Reworked EventDispatcher::SendFakeMouseMoved() after an idea by Stephan
that solves most app_server locking headaches: it now works asynchronously,
and therefore doesn't need to lock the EventDispatcher anymore.
* EventStreams now allow to inject messages into the stream to allow the above
functionality.
* InputServerStream::GetNextEvent() no longer returns when there is no event.
* Desktop::ActivateWindow() now locks all windows before checking the
workspaces of the windows, fixing a race condition that could lead to
Window::Foremost() being called for a window that isn't on the current
workspace, leading to a crash.
* I currently cannot access Trac, but I recall there should be an open bug
report about this.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28224 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6ae06ef8 29-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

Implemented AS_IDLE_TIME, this closes bug #1593.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22758 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34bd8bf5 13-May-2007 Jérôme Duval <korli@users.berlios.de>

cleanup, fixed some warnings


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21128 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6869c8a5 23-Dec-2006 Ryan Leavengood <leavengood@gmail.com>

The app_server now starts and restarts (if needed) the input_server. The use of
a debugger call in _LaunchInputServer may be overkill, but at least you could
conceivably cleanly restart the machine in the debugger (I think.) Because
without the input_server the machine is pretty useless.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19615 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5c87242e 24-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Improved the fake mouse-moved mechanism quite a bit:
* EventDispatcher now adopts the cursor position from the HWInterface upon
assignment, so that even the initial cursor reports match the on screen
visuals.
* The message was never sent because "target" in Desktop::_SendFakeMouseMoved()
was never set.
* EventDispatcher::SendFakeMouseMoved() now accepts an EventTarget and no
longer a BMessenger (fits better to the rest of the API).
* EventDispatcher::SendFakeMouseMoved() now sends out the exit transit message
to the previous target directly (doesn't wait until the next actual mouse
move), and updates the previous target as well, so that scrolling now
works in that new window.
* This only partially fixes bug #762, though, as GetMouse() can still steal
this mouse message (BTextViews do that in WindowActivated()).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18596 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 604c8038 16-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Since the keyboard filter compared targets by their pointers, it could happen
that it didn't reset the EventDispatcher's focus target even though the object
underneath that same pointer had change, which caused the EventDispatcher to
drop the event.
This fixes bug #416, and should fix bug #409, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17141 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39cdae74 10-Apr-2006 Michael Lotz <mmlr@mlotz.ch>

First steps at getting drag & drop to work properly. Simple drag & drop (draging Tracker items) should work now. Not sure about the negotiated version (with mimetype exchange). Fixed left behind drag bitmaps. Some cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17058 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a1a04a47 01-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* A fake B_MOUSE_MOVED message is now send on workspace change, and when
a window is closed, too (only happened when a new window was shown
before). This is done via the new Desktop::_SendFakeMouseMoved()
method. This fixes bug #342.
* The MouseFilter now always sets Desktop::fWindowUnderMouse, so that
one can differentiate between no window under mouse, and decorator
under mouse.
* EventDispatcher::SendFakeMouseMoved() now expects a BMessenger instead
of an EventTarget as target - this guarantees that it can safely be
called with any window now (instead of only the current window).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16953 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1e766d46 10-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

Moved the ViewUnderMouse() functionality from the EventDispatcher to the Desktop;
this saves us some locking headaches and solves a possible deadlock in
ServerApp::Activate().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16688 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 907e89c6 08-Mar-2006 Stephan Aßmus <superstippi@gmx.de>

* The EventDispatcher takes care of reference counting the ServerBitmap
used for the drag bitmap, see NOTEs on why that is...
* moved reference counting of the ServerCursor from Desktop into
HWInterface where it is actually used
* I hope to have fixed the problems with _DrawCursor when dragging
something. At least the reference counting of the ServerCursor was
for real, since the HWInterface rejected changes to the cursor while
something was dragged, which caused the old cursor to be Released() and
deleted each time the mouse moved...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16657 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4aaa5aa1 26-Feb-2006 Stephan Aßmus <superstippi@gmx.de>

* added a way to retrieve the view under the mouse
via token

(coded by axeld)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16518 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 92b292f5 10-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Implemented B_NO_POINTER_HISTORY. Window moving/resizing uses this mechanism
as well now, and makes quite a difference in Qemu.
Not tested for standard BViews, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15907 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e83820ed 07-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Merged app_server_new_clipping branch changes r15290 to 15418 back into trunk.
Also fixed Jamfile for the test environment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15419 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 15918e4f 30-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* new windows now get a fake B_MOUSE_MOVED message in case they are opened
directly under the mouse cursor.
* Added Desktop::ShowWindow() and HideWindow().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15238 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f89b4c9a 29-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Have I said input event handling is done?
* didn't realize that mouse events always go to the view under the mouse, not
only if its the focus window (FFM can really do harm, after all :-)).
* removed a TODO from the list: EventDispatcher::Target is now a public
class EventTarget, and every ServerWindow has one.
* as a result, EventDispatcher no longer manages targets itself, it
just maintains a list of them. You no longer set messengers, you
only set targets.
* customization of the message filters, they no longer inherit from
BMessageFilter (but EventFilter).
* a message target is no longer set explicetly anywhere, it's only
changed in the message filters if needed.
* therefore, no more locking mess in the EventDispatcher needed.
* this also made the EventDispatcher::fLastFocus stuff superfluous.
* moved the RootLayer::MouseEventHandler() into the message filter.
* Replaced RootLayer::_ChildAt() with WindowAt().
* WindowLayer now has an idea if it has focus or not, it no longer needs
to query the RootLayer for this - maybe we should rename "focus" to
"active", though (as far as layers are concerned).
* the "_view_token" data is now added from the EventDispatcher, not
the (Window)Layer class anymore.
* removed Layer::MouseWheelChanged() as we currently don't need it
(if the need arises, we can add it back later again)
* there is still no mouse moved message sent when opening a window
under the cursor, though...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15228 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39b345c7 25-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Added temporary hack so that windows don't get mouse messages if the cursor
is not over them - this should be better integrated with the rest of the
code (later, when we don't rely on RootLayer for everything anymore).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15151 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 85d98137 24-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Quick fix for our broken locking model:
The mouse filter needs to lock RootLayer, but the event dispatcher lock is held
during that time, too, so that the focus cannot change in the mean time.
On the other side, ServerWindow needs to lock the event dispatcher when adding
or removing a listener, or for AS_GET_MOUSE - but since it always helds the
root layer lock during message dispatching this easily resulted in a deadlock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15146 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0a9634a6 24-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Minor cleanup: removed unused stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15126 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5afc0648 24-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

In anticipation of Stippi's new clipping code, I refactored the EventDispatcher
a bit:
* listeners are now managed per target (ie. per messenger) (by the Target class)
* therefore, the fFocusTokens/fLastFocusTokens lists are no longer needed; every
Target knows its listeners already.
* this also fixes the obvious bug that the focus window's views would get both
keyboard and pointer events, no matter which of them they originally wanted.
* renamed event_target to event_listener (there was actually a mix up in naming
before - to the outside it was "listener", and internally, "target" was used)
* WinBorder::MouseMoved()/MouseUp() now also add the view token to the message;
the messages weren't received by the target before (unless the view used
tracking via BView::SetMouseEventMask()...) - maybe the client should only
update fLastMouseMoved on B_MOUSE_MOVED events, and direct B_MOUSE_UP/DOWN
(plus wheel changes) always to fLastMouseMoved...
* some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15123 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 876a3803 23-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* removed adding "be:transit" stuff in the EventDispatcher - this is now only done
client side (or will be, with the next commit).
* added GetMouse() functionality.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15084 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b0952015 21-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* changed the way a message is forwarded to the focus view (instead of adding
a suspend focus field to the message, there is now a "feed focus" field in
case the message should be forwarded).
* added a comment to the BPoint version of _FindView() (since it's broken)
* _DistributeMessage() is now called after _DetermineTarget() - so that it
can prevent sending the message twice to the focus view.
* removed BWindow::DoUpdate() as it's no longer used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15066 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 82d87448 21-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* now all event targets of the focus window get into the focus list - that
way, we always send only one message per event, no matter how many targets
there are in the window (the focus event list was not always maintained
correctly before, too).
* the current mouse filter eats all B_MOUSE_UP events, and therefore, the
temporary event targets were never removed.
* changed the way BWindow::_DistributeMessage() recognizes if it should forward
the event - not yet final, though.
* naming is now more consistent (events -> event_mask).
* some minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15058 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 55d6d70e 18-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* EventDispatcher::AddListener() now honors the BView semantics and will only
update the options in case the specified eventMask was zero.
* Added missing EventDispatcher::RemoveTemporaryTarget().
* Layers setting their event mask are now added to the EventDispatcher.
* The RootLayer is no longer contacted for SetEventMask() - it still handles
SetMouseEventMask(), tough - as a result, SetEventMask() temporarily doesn't
work anymore.
* Added Layer::ViewToken() method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15023 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fa26723b 18-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* Moved workspace keyboard switch and dump screen capability from RootLayer
into a Desktop keyboard filter.
* Removed keyboard handling code from RootLayer and Layer.
* Renamed Desktop::ActiveRootLayer() to RootLayer() as there is only one
root layer per desktop.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15018 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f6859878 18-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* the keyboard events are now using the new EventDispatcher, B_KEYBOARD_EVENTS don't
work yet, though, as the dispatcher is not yet notified about those.
* no more mouse cursor jumping - the cursor will now start in the middle of the screen;
this should be part of the initial input_server handshake, though.
* ServerWindow can now return a BMessenger of its client window.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15017 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f7598223 18-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* the new input event dispatcher is now actually used, although it doesn't
distribute any messages to the clients yet.
* removed the working thread from RootLayer - for now, its event handlers are
still called using input filters in the new event dispatcher, though (to
get things started).
* ServerApp is now using a BMessenger to identify its client, and no longer
stores the port/token separately.
* the input_server handshake is a bit simpler now, as it can now just reply
to the app_server message, removed unused code from ServerProtocol.h
* calmed down the MultiLocker (it always printed thread statistics on startup,
because it's compiled in debug mode).
* removed the cursor thread stuff from AppServer.cpp
* the new event dispatcher now uses a cursor thread when supported (only in
native mode, not in the test environment), although it improves cursor
movement under Qemu, the effect is not as good as expected - this might
need some more investigations (might just be a thread priority problem).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15012 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0307fbb1 17-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Implemented support for Set[Mouse]EventMask() functionality - still untested, though.
Also supports the B_SUSPEND_VIEW_FOCUS options, B_NO_POINTER_HISTORY is not yet there,
and B_LOCK_WINDOW_FOCUS has to be implemented somewhere else (its outside of the
scope of this class).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15007 a95241bf-73f2-0310-859d-f6bbb57e9c96


# afe5450a 17-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* Fixed the most obvious copy&paste bugs.
* no longer allocates focus messengers on the heap but keeps them around.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14992 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08f35604 17-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

The basics of the new event handling - not yet connected to anything, and therefore
neither used nor tested. It's not even complete yet (support for Set[Mouse]EventMask()
is missing), but it will get there :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14990 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8f5d92f98d963afd3dcc85609b62189ddaf196a8 12-Dec-2013 John Scipione <jscipione@gmail.com>

EventDispatcher: Style fixes


# 955307393fad754aaff5d372cb1cc139e6c4159c 17-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Reworked EventDispatcher::SendFakeMouseMoved() after an idea by Stephan
that solves most app_server locking headaches: it now works asynchronously,
and therefore doesn't need to lock the EventDispatcher anymore.
* EventStreams now allow to inject messages into the stream to allow the above
functionality.
* InputServerStream::GetNextEvent() no longer returns when there is no event.
* Desktop::ActivateWindow() now locks all windows before checking the
workspaces of the windows, fixing a race condition that could lead to
Window::Foremost() being called for a window that isn't on the current
workspace, leading to a crash.
* I currently cannot access Trac, but I recall there should be an open bug
report about this.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28224 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6ae06ef86a9612a2fb6ce22d177c48722b28a9a3 29-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

Implemented AS_IDLE_TIME, this closes bug #1593.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22758 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34bd8bf599a6bd2b73b6c5d9e644847572258d22 13-May-2007 Jérôme Duval <korli@users.berlios.de>

cleanup, fixed some warnings


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21128 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6869c8a59ad386b82f039a82239ac8f6a3587edf 23-Dec-2006 Ryan Leavengood <leavengood@gmail.com>

The app_server now starts and restarts (if needed) the input_server. The use of
a debugger call in _LaunchInputServer may be overkill, but at least you could
conceivably cleanly restart the machine in the debugger (I think.) Because
without the input_server the machine is pretty useless.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19615 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5c87242ea3e9024f22ae6ac9f59b2a3beff009ed 24-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Improved the fake mouse-moved mechanism quite a bit:
* EventDispatcher now adopts the cursor position from the HWInterface upon
assignment, so that even the initial cursor reports match the on screen
visuals.
* The message was never sent because "target" in Desktop::_SendFakeMouseMoved()
was never set.
* EventDispatcher::SendFakeMouseMoved() now accepts an EventTarget and no
longer a BMessenger (fits better to the rest of the API).
* EventDispatcher::SendFakeMouseMoved() now sends out the exit transit message
to the previous target directly (doesn't wait until the next actual mouse
move), and updates the previous target as well, so that scrolling now
works in that new window.
* This only partially fixes bug #762, though, as GetMouse() can still steal
this mouse message (BTextViews do that in WindowActivated()).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18596 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 604c8038ff4dee882edbcb6170d80a27e9dd638f 16-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Since the keyboard filter compared targets by their pointers, it could happen
that it didn't reset the EventDispatcher's focus target even though the object
underneath that same pointer had change, which caused the EventDispatcher to
drop the event.
This fixes bug #416, and should fix bug #409, too.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17141 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39cdae74a7fc098db3a59a3e9db03b6ad57ab991 10-Apr-2006 Michael Lotz <mmlr@mlotz.ch>

First steps at getting drag & drop to work properly. Simple drag & drop (draging Tracker items) should work now. Not sure about the negotiated version (with mimetype exchange). Fixed left behind drag bitmaps. Some cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17058 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a1a04a47421178983ce94aa6050922b23f57cbff 01-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* A fake B_MOUSE_MOVED message is now send on workspace change, and when
a window is closed, too (only happened when a new window was shown
before). This is done via the new Desktop::_SendFakeMouseMoved()
method. This fixes bug #342.
* The MouseFilter now always sets Desktop::fWindowUnderMouse, so that
one can differentiate between no window under mouse, and decorator
under mouse.
* EventDispatcher::SendFakeMouseMoved() now expects a BMessenger instead
of an EventTarget as target - this guarantees that it can safely be
called with any window now (instead of only the current window).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16953 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1e766d4688da9cbaea73b0f10564fb0b3d708806 10-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

Moved the ViewUnderMouse() functionality from the EventDispatcher to the Desktop;
this saves us some locking headaches and solves a possible deadlock in
ServerApp::Activate().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16688 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 907e89c6e83770685f47219bb625d411602c4694 08-Mar-2006 Stephan Aßmus <superstippi@gmx.de>

* The EventDispatcher takes care of reference counting the ServerBitmap
used for the drag bitmap, see NOTEs on why that is...
* moved reference counting of the ServerCursor from Desktop into
HWInterface where it is actually used
* I hope to have fixed the problems with _DrawCursor when dragging
something. At least the reference counting of the ServerCursor was
for real, since the HWInterface rejected changes to the cursor while
something was dragged, which caused the old cursor to be Released() and
deleted each time the mouse moved...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16657 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4aaa5aa1008af3c44f3b505ffefd56ee9a1c3972 26-Feb-2006 Stephan Aßmus <superstippi@gmx.de>

* added a way to retrieve the view under the mouse
via token

(coded by axeld)



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16518 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 92b292f540c9d73b8fe35519a82ad2b86f8974ab 10-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Implemented B_NO_POINTER_HISTORY. Window moving/resizing uses this mechanism
as well now, and makes quite a difference in Qemu.
Not tested for standard BViews, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15907 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e83820ed5720395d39a1ff809991b4fd76326548 07-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Merged app_server_new_clipping branch changes r15290 to 15418 back into trunk.
Also fixed Jamfile for the test environment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15419 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 15918e4fa5bcbea5fc7ed8c77b7858374621308f 30-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* new windows now get a fake B_MOUSE_MOVED message in case they are opened
directly under the mouse cursor.
* Added Desktop::ShowWindow() and HideWindow().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15238 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f89b4c9a23a12a1bae426cc920dccfb6b0d022db 29-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Have I said input event handling is done?
* didn't realize that mouse events always go to the view under the mouse, not
only if its the focus window (FFM can really do harm, after all :-)).
* removed a TODO from the list: EventDispatcher::Target is now a public
class EventTarget, and every ServerWindow has one.
* as a result, EventDispatcher no longer manages targets itself, it
just maintains a list of them. You no longer set messengers, you
only set targets.
* customization of the message filters, they no longer inherit from
BMessageFilter (but EventFilter).
* a message target is no longer set explicetly anywhere, it's only
changed in the message filters if needed.
* therefore, no more locking mess in the EventDispatcher needed.
* this also made the EventDispatcher::fLastFocus stuff superfluous.
* moved the RootLayer::MouseEventHandler() into the message filter.
* Replaced RootLayer::_ChildAt() with WindowAt().
* WindowLayer now has an idea if it has focus or not, it no longer needs
to query the RootLayer for this - maybe we should rename "focus" to
"active", though (as far as layers are concerned).
* the "_view_token" data is now added from the EventDispatcher, not
the (Window)Layer class anymore.
* removed Layer::MouseWheelChanged() as we currently don't need it
(if the need arises, we can add it back later again)
* there is still no mouse moved message sent when opening a window
under the cursor, though...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15228 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 39b345c7b634a8c5f3748d980b0e0cc4ea1655a9 25-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Added temporary hack so that windows don't get mouse messages if the cursor
is not over them - this should be better integrated with the rest of the
code (later, when we don't rely on RootLayer for everything anymore).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15151 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 85d981378a48b19a49cc0dadf80288b68b4e6447 24-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Quick fix for our broken locking model:
The mouse filter needs to lock RootLayer, but the event dispatcher lock is held
during that time, too, so that the focus cannot change in the mean time.
On the other side, ServerWindow needs to lock the event dispatcher when adding
or removing a listener, or for AS_GET_MOUSE - but since it always helds the
root layer lock during message dispatching this easily resulted in a deadlock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15146 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0a9634a6f4a5988a606973517ee1f06ea47fbedb 24-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Minor cleanup: removed unused stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15126 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5afc0648313fdc72d216da5a864ce88d04ba1339 24-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

In anticipation of Stippi's new clipping code, I refactored the EventDispatcher
a bit:
* listeners are now managed per target (ie. per messenger) (by the Target class)
* therefore, the fFocusTokens/fLastFocusTokens lists are no longer needed; every
Target knows its listeners already.
* this also fixes the obvious bug that the focus window's views would get both
keyboard and pointer events, no matter which of them they originally wanted.
* renamed event_target to event_listener (there was actually a mix up in naming
before - to the outside it was "listener", and internally, "target" was used)
* WinBorder::MouseMoved()/MouseUp() now also add the view token to the message;
the messages weren't received by the target before (unless the view used
tracking via BView::SetMouseEventMask()...) - maybe the client should only
update fLastMouseMoved on B_MOUSE_MOVED events, and direct B_MOUSE_UP/DOWN
(plus wheel changes) always to fLastMouseMoved...
* some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15123 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 876a3803df771cbc7f6f7d5bfa99c3652d7bac63 23-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* removed adding "be:transit" stuff in the EventDispatcher - this is now only done
client side (or will be, with the next commit).
* added GetMouse() functionality.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15084 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b0952015032d9df40d5f92a5cef46398abb401d9 21-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* changed the way a message is forwarded to the focus view (instead of adding
a suspend focus field to the message, there is now a "feed focus" field in
case the message should be forwarded).
* added a comment to the BPoint version of _FindView() (since it's broken)
* _DistributeMessage() is now called after _DetermineTarget() - so that it
can prevent sending the message twice to the focus view.
* removed BWindow::DoUpdate() as it's no longer used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15066 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 82d8744887947d18f2ee276b4fbac0f9bbb850ca 21-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* now all event targets of the focus window get into the focus list - that
way, we always send only one message per event, no matter how many targets
there are in the window (the focus event list was not always maintained
correctly before, too).
* the current mouse filter eats all B_MOUSE_UP events, and therefore, the
temporary event targets were never removed.
* changed the way BWindow::_DistributeMessage() recognizes if it should forward
the event - not yet final, though.
* naming is now more consistent (events -> event_mask).
* some minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15058 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 55d6d70ee59eb2e2473c2195b5e6b26ee29380d3 18-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* EventDispatcher::AddListener() now honors the BView semantics and will only
update the options in case the specified eventMask was zero.
* Added missing EventDispatcher::RemoveTemporaryTarget().
* Layers setting their event mask are now added to the EventDispatcher.
* The RootLayer is no longer contacted for SetEventMask() - it still handles
SetMouseEventMask(), tough - as a result, SetEventMask() temporarily doesn't
work anymore.
* Added Layer::ViewToken() method.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15023 a95241bf-73f2-0310-859d-f6bbb57e9c96


# fa26723bb29d97b4bcb3437a60da21d59cd266b1 18-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* Moved workspace keyboard switch and dump screen capability from RootLayer
into a Desktop keyboard filter.
* Removed keyboard handling code from RootLayer and Layer.
* Renamed Desktop::ActiveRootLayer() to RootLayer() as there is only one
root layer per desktop.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15018 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f68598780e4aa2a311b1fc8fce0b89b871bc9a9d 18-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* the keyboard events are now using the new EventDispatcher, B_KEYBOARD_EVENTS don't
work yet, though, as the dispatcher is not yet notified about those.
* no more mouse cursor jumping - the cursor will now start in the middle of the screen;
this should be part of the initial input_server handshake, though.
* ServerWindow can now return a BMessenger of its client window.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15017 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f7598223274c44c551f1ed581030e6ed5268fe68 18-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* the new input event dispatcher is now actually used, although it doesn't
distribute any messages to the clients yet.
* removed the working thread from RootLayer - for now, its event handlers are
still called using input filters in the new event dispatcher, though (to
get things started).
* ServerApp is now using a BMessenger to identify its client, and no longer
stores the port/token separately.
* the input_server handshake is a bit simpler now, as it can now just reply
to the app_server message, removed unused code from ServerProtocol.h
* calmed down the MultiLocker (it always printed thread statistics on startup,
because it's compiled in debug mode).
* removed the cursor thread stuff from AppServer.cpp
* the new event dispatcher now uses a cursor thread when supported (only in
native mode, not in the test environment), although it improves cursor
movement under Qemu, the effect is not as good as expected - this might
need some more investigations (might just be a thread priority problem).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15012 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0307fbb17d2de81f23804cb71a5c43ef1a67b877 17-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Implemented support for Set[Mouse]EventMask() functionality - still untested, though.
Also supports the B_SUSPEND_VIEW_FOCUS options, B_NO_POINTER_HISTORY is not yet there,
and B_LOCK_WINDOW_FOCUS has to be implemented somewhere else (its outside of the
scope of this class).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15007 a95241bf-73f2-0310-859d-f6bbb57e9c96


# afe5450a833231122ba24c78d2b5a5a6c3b8fc1d 17-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* Fixed the most obvious copy&paste bugs.
* no longer allocates focus messengers on the heap but keeps them around.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14992 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 08f35604b00adf5e47a170f586fa91ee5d53c4a5 17-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

The basics of the new event handling - not yet connected to anything, and therefore
neither used nor tested. It's not even complete yet (support for Set[Mouse]EventMask()
is missing), but it will get there :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14990 a95241bf-73f2-0310-859d-f6bbb57e9c96