History log of /haiku/src/servers/app/EventStream.cpp
Revision Date Author Comments
# 779ab335 09-Dec-2020 X512 <danger_mail@list.ru>

use .IsSet() instead if .Get() != NULL

Change-Id: Ia2b7a719fd398e78cc3b11d4f7b02cb81179f65f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3488
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 6fd22743 26-Aug-2020 X512 <danger_mail@list.ru>

app_server pointer/ownership cleanup: trivial changes

Split apart the work done in https://review.haiku-os.org/c/haiku/+/2695
in smaller, easier to review parts.

This commit contains self-contained/local changes that are unlikely to
cause problems.

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


# 23121bac 10-Aug-2019 Augustin Cavalier <waddlesplash@gmail.com>

app_server: Set B_CLONEABLE_AREA where applicable.

This is all that is needed to boot a minimum image with userland
area cloning protections enabled (media_server is not included
in such builds.)


# 91e3b801 01-Nov-2014 Michael Lotz <mmlr@mlotz.ch>

{app|input}_server: Provide app_server team id to input_server.

For cases where a BMessage is passed by area, the remote team id needs
to be passed into BMessage::_SendMessage() so it can transfer the area
to the target team. It falls back to detecting the port owner if said
information is missing. However, since the input_server owns the port
in this situation, the remote team needs to be specified explicitly.
Add the app_server team id to the input acquire message, so input_server
gets the needed info.

As messages that exceed the pass by area threshold are rather rare in
general and shouldn't happen at all in this situation, this does not
fix any immediate problem.


# 057c8708 26-Oct-2013 Julian Harnath <julian.harnath@rwth-aachen.de>

Move B_MOUSE_IDLE generation to app_server.

* BWindow used to generate the B_MOUSE_IDLE events by sending a
delayed message with a one-shot BMessageRunner to itself.
Every creation and deletion of BMessageRunners causes synchronous
messaging between the application under the mouse cursor and the
registrar. This creates large amounts of calls to set_port_owner()
in the kernel whenever moving the mouse.

* Now, B_MOUSE_IDLE is sent by the cursor loop inside the app_server
instead. When the mouse wasn't moved for the tooltip delay time,
it inserts a B_MOUSE_IDLE message into the event stream.

* The tooltip delay thus becomes a system-wide constant and is not
configurable per-application anymore (no code currently in the
Haiku repo makes use of that anyhow).


# 3fed1a15 05-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Get app_server working on x86_64.

With this commit, app_server now compiles and runs at boot! Nothing
particularly interesting happens, just the blue background and a mouse
pointer. Remote backends are broken and not compiled in, see #8834.
Note that it won't be possible to build this quite yet, need to get
the FreeType package uploaded.


# 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


# 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


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

EventDispatcher::_Unset() did not wait for the event looper thread under BeOS, as
wait_for_thread() always returns B_BAD_ADDRESS when the second argument is NULL
(it works fine under Haiku).
Instead of enqueuing a B_QUIT_REQUESTED message, InputStream now directly quits
when the 'quit' code is read from the port (B_QUIT_REQUESTED was never handled
by the event loop either, it just didn't get noticed because of the wrong
wait_for_thread() usage).


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


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

The input_server is now notified when the screen resolution is changed.


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


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

Some minor fixes.


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


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

Turns out there were a couple of problems:
* RootLayer still set the mouse cursor...
* mixed up "x" and "y" in the cursor thread
* but that didn't get noticed, as B_RELEASE_ALL doesn't seem to work
(will look into that next)!

The cursor finally works as good as expected in Qemu :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15013 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


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

Fixed the app_server build in the test environment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15005 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


# 91e3b80197cfa6b624c216ce61298ce1463ba4f8 01-Nov-2014 Michael Lotz <mmlr@mlotz.ch>

{app|input}_server: Provide app_server team id to input_server.

For cases where a BMessage is passed by area, the remote team id needs
to be passed into BMessage::_SendMessage() so it can transfer the area
to the target team. It falls back to detecting the port owner if said
information is missing. However, since the input_server owns the port
in this situation, the remote team needs to be specified explicitly.
Add the app_server team id to the input acquire message, so input_server
gets the needed info.

As messages that exceed the pass by area threshold are rather rare in
general and shouldn't happen at all in this situation, this does not
fix any immediate problem.


# 057c8708f216514c6874b7c49f6ca170760b3cf0 26-Oct-2013 Julian Harnath <julian.harnath@rwth-aachen.de>

Move B_MOUSE_IDLE generation to app_server.

* BWindow used to generate the B_MOUSE_IDLE events by sending a
delayed message with a one-shot BMessageRunner to itself.
Every creation and deletion of BMessageRunners causes synchronous
messaging between the application under the mouse cursor and the
registrar. This creates large amounts of calls to set_port_owner()
in the kernel whenever moving the mouse.

* Now, B_MOUSE_IDLE is sent by the cursor loop inside the app_server
instead. When the mouse wasn't moved for the tooltip delay time,
it inserts a B_MOUSE_IDLE message into the event stream.

* The tooltip delay thus becomes a system-wide constant and is not
configurable per-application anymore (no code currently in the
Haiku repo makes use of that anyhow).


# 3fed1a15f58e8d6fe6b492f3b94bb3625ffeddbd 05-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Get app_server working on x86_64.

With this commit, app_server now compiles and runs at boot! Nothing
particularly interesting happens, just the blue background and a mouse
pointer. Remote backends are broken and not compiled in, see #8834.
Note that it won't be possible to build this quite yet, need to get
the FreeType package uploaded.


# 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


# 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


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

EventDispatcher::_Unset() did not wait for the event looper thread under BeOS, as
wait_for_thread() always returns B_BAD_ADDRESS when the second argument is NULL
(it works fine under Haiku).
Instead of enqueuing a B_QUIT_REQUESTED message, InputStream now directly quits
when the 'quit' code is read from the port (B_QUIT_REQUESTED was never handled
by the event loop either, it just didn't get noticed because of the wrong
wait_for_thread() usage).


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


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

The input_server is now notified when the screen resolution is changed.


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


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

Some minor fixes.


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


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

Turns out there were a couple of problems:
* RootLayer still set the mouse cursor...
* mixed up "x" and "y" in the cursor thread
* but that didn't get noticed, as B_RELEASE_ALL doesn't seem to work
(will look into that next)!

The cursor finally works as good as expected in Qemu :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15013 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


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

Fixed the app_server build in the test environment.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15005 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