History log of /haiku/src/servers/app/ServerWindow.h
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>


# 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>


# d0fa6c78 28-Jan-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

BView: Allow resetting ClipToPicture

Just like for regions, ClipToPicture(NULL) removes any picture clipping
at the current state level (clipping in pushed states are not undone).


# c0494bc5 17-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add facility to communicate with the desktop listener over an app server link. The ServerWindow dispatch the message to the DesktopObservable which dispatch it to the correct listener.



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


# a5a64d54 27-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Renamed DirectWindowSupport/Data to DirectWindowInfo.
* Cleanup of the fullscreen stuff.


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


# 78ca6157 27-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Changed AS_GET_SCREEN_ID_FROM_WINDOW as well as AS_SCREEN_GET_MODE to no
longer hold the window lock. There is now a lock that guards screen changes
in particular. This fixes the deadlocks seen in apps using BDirectWindow.
* All direct window handling now sits in the Desktop class -
ServerWindow::HandleDirectConnection() is never called from anywhere else
anymore. Furthermore, it's now only called when actually needed.
* Resize/move actions now always send a B_CLIPPING_MODIFIED flag, too.
* When the screen changed, the driver state is supposed to be B_MODE_CHANGED,
not B_SCREEN_CHANGED (which is a message constant).
* Direct windows are no longer suspended too late on screen changes.
* Removed unused members of DirectWindowData, and cleaned it up a bit.
* Made MultiLocker's default, and copy constructors private - I accidently
used them, causing the ASSERT_MULTI_*LOCKED() macros to fail.
* Added Unlock() to AutoWriteLocker as well.
* Minor cleanup.


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


# d9135957 26-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Disabled BDirectWindow mode for the time being. +alphabranch


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


# fe9c291b 24-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Since ServerWindow::Window() can also be NULL in case the window hadn't been
added to the Desktop yet, we better make sure in AS_GET_SCREEN_ID_FROM_WINDOW
that this is not the case.
* Removed the now superfluous ServerWindow::IsOffscreen() again.
+alphabranch


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


# f277acc9 22-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't crash the app server if the user calls BScreen(BWindow *) supplying
an offscreen window (Magnify does that, and that's the cause of ticket #4304).


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


# a1bcb09b 17-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a ServerWindow::ScreenChanged() hook, which takes care of resizing
an eventual offscreen directwindow and sends the direct window notifications
(not yet, though, since a BDirectWindow on a non-visible workspace would
get the B_DIRECT_START notification and start drawing on a different workspace).



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


# 2a2d0f1d 14-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

After a B_DIRECT_STOP notification, the app_server could trigger a
B_DIRECT_MODIFY with, for example, B_CLIPPING_MODIFIED. This was ignored,
though. Now we combine this notification with the next ones, so that
on B_DIRECT_START, the client is informed of all the things which have
changed. Chart was relying on receiving the B_CLIPPING_MODIFIED notification
to exclude some stars from being erased, in case the window went offscreen.
Anyway, the net result is that Chart doesn't crash now, and we follow
more closely the original BDirectWindow protocol. Fixed ticket #1939.


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


# 3e20b062 14-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Work in progress towards cleaning up the directwindow server code:
Renamed direct_window_data to DirectWindowData and turned it into a
class.
Encapsulated some functionality inside the DirectWindowData class.
No functional change (yet).
More to come.


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


# 07e13b5f 11-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Removed superfluous ReplaceDecorator() method.
* Cleanup, no functional change.


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


# 3bd49667 03-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Now also hide/show the cursor when BDirectWindow::SetFullScreen() is called.
in the handler, instead of checking if the window is an offscreen one,
check if fDirectWindowData is NULL, and do nothing if it's the case.
When setting a clip region in ServerPicture, also invalidate the clipping.
To do so, I added a public ServerWindoow::UpdateCurrentDrawingRegion()
which just calls the private function. Please review and see if it can
be done better. This fixes the problem with BPicture and the
ConstrainClippingRegion() op (see ticket #1389)


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


# 4695f670 01-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Completed the server part of BDirectWindow::SetFullScreen(). The window is
now resized and moved correctly. Moved this functionality to its own method.
Should fix bug #4168.


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


# 431dc47d 15-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

Patch by Artur Wyszynski with some changes by myself:
* Resolved TODO: The type of the gradient is no longer encoded twice in the
app_server link protocoll.
* Moved instantiation of the BGradient into the LinkReceiver::ReadGradient()
method.
* Check success for (at least) ReadGradient() in ServerWindow.


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


# 991547ef 14-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

Patch by Artur Wyszynski:
* Implemented BGradient, BGradientLinear, BGradientRadial,
BGradientDiamond, BGradientConic and BGradientRadialFocus
new Interface Kit classes.
* Implemented all the (AGG-based) backend necessary in
the app_server to render gradients (Painter, DrawingEngine)
* app_server/View can convert a BGradient layout to screen
coordinates.
* Added BGradient methods of the Fill* methods in BView.
* Implemented a test app and added it to the image as a
demo.
* Adopted Icon-O-Matic and libs/icon in order to avoid
clashing with the new BGradient class. Re-use some
parts where possible.

Awesome work, Artur! Thanks a lot. Now a more modern
looking GUI has just become much easier to implement! :-)

TODO:
* Remove the need to have gradient type twice in the
app_server protocol.
* Refactor some parts of the patch to remove duplicated
code (Painter, DrawingEngine).
* Adopt the BPicture protocol to know about BGradients.
* Review some parts of the BArchivable implementation.


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


# 54f92239 08-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* The ServerWindow now memorizes the original BDirectWindow feel when switching
to full screen. Since BDirectWindows can have any feel, this does now
correctly restore it instead of always reverting to B_NORMAL_WINDOW_FEEL.
* This fixes part of bug #2808.
* Minor cleanup.


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


# f592fcef 01-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

stippi + bonefish:
Fixed race conditions when a ServerApp or ServerWindow is created. The
reply to the client that the object has been created successfully was
sent in the thread creating it. Preempted at the wrong time (right after
writing the message to the port) could lead to the object's thread using
the link at the same time, which would screw up all subsequent
communication via that link.
This fixes the problem that mimeset would sometimes fail when building
Haiku in Haiku (can't find the ticket). It probably also fixes #2331,
and the bug that sometimes when a window is opened (Terminal, crash
alert, shutdown window, etc.) it would come up with huge width/height
and tiny other dimension (can't find the ticket).


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


# 97d6a051 11-Mar-2008 Stephan Aßmus <superstippi@gmx.de>

GetClippingRegion() was implemented wrongly on the app_server side. It needs
to take the current effective drawing region of the view, but converted to
local coordinate space. Untested as of yet.


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


# 953d895e 07-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Got rid of the "Layer" part of WindowLayer, ViewLayer, WorkspacesLayer
(now WorkspacesView), OffscreenWindowLayer.
* Renamed ServerScreen.cpp/h to Screen.cpp/h (the class was already called
Screen).


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


# 4d1c4228 02-Oct-2007 Stephan Aßmus <superstippi@gmx.de>

* added a way for the ServerWindow message loop to determine the required type
of locking before processing the message (single/all window lock)
-> in most message cases, I could comment out the unlocking/locking which
switched to the different lock, because the required lock is now already held,
this removes some race conditions which were commented in the code already
* EventDispatcher::SetDragMessage() didn't lock the object, this would have
been bad if multiple windows tried to set a drag bitmap at once
* the Desktop object keeps track of mouse position and pressed buttons, so
that it doesn't need to lock the EventDispatcher for sending fake mouse
moves to windows on show/hide of windows (solves some cases of possible
dead locks with the new locking strategy)
* the keyboard EventFilter switches the current workspace asynchrnously from
the Desktop thread (another source of possible deadlocks)
* the "reader is trying to become writer" check in MultiLocker is only used
in DEBUG mode now

As a summary: It would be nice if ServerWindow used a readlock for all messages
it processes itself, and forwards all messages for which it needs a write lock
to the Desktop thread. All cases where either the Desktop or the ServerWindow
mess with the EventDispatcher are possible sources of deadlocks. This is solved
right now by making sure that the lock is released before using the
EventDispatcher.

I have not observed any deadlocks while switching workspaces and launching
many apps anymore, neither crashes. But I have not tested extensively except
for in the test environment. That being said, I could reproduce the problems
on first try before in Haiku.


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


# 0896fce5 18-Jul-2007 Stephan Aßmus <superstippi@gmx.de>

* since every window has it's own Painter instance, the drawing state does
not need to be "set" (transfered from the "current" view to the painter)
for each singly drawing command. Now, painter is synchronized whenever
the client changes the drawing state of the current view, or when the
current view changes.
* the screen offset of the current view has become part of the Painter state,
in the PatternHandler. This fixes a bug in which moving or scrolling a view
which used patterns for drawing, resulted in visual glitches (seams in the
pattern).

NOTE: this patch is a bit work in progress, most importantly, it is not
complete with regards to text rendering. More specifically, the server
applications and other parts of the appserver might set a font on the Painter
and this might mess up the synchronization. But this happens on the Desktop's
Painter instance (only?), and so it is not a problem. I did observe some
drawing bugs with this patch though, so bug reports are welcome, particularily
how to reproduce these bugs reliably.


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


# 3a44e6e3 19-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed a big race condition in the server code:
* ServerApp was accessing ServerWindow::Window() (while having the app window
lock held), but in fact, there was no guarantee it already existed, or was
added to the Desktop.
* Therefore, the Window() semantics have changed to only return a window in
case the window exists *and* has been added to the desktop (the latter
constraint might be lifted again, though). Therefore, it doesn't work
for offscreen windows, and should not be used within ServerWindow code
anymore.
* This fixes bug #686 and maybe others as well.


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


# 0ac013e6 23-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* Some refactoring: renamed OverlayCookie to Overlay and put it in its own
source file.
* An overlay is now also hidden in case its is removed from the window.


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


# bfe69873 28-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented private do_window_action() function, used by the Deskbar to bring
windows to front (or minimize them).
* Desktop::ActivateWindow() no longer crashes in case the window to be activated
is not on the current workspace - instead, it doesn't do anything at this
point. IOW it doesn't handle workspace activation at all, yet.
* Renamed ServerWindow::GetWindowLayer() to ServerWindow::Window().


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


# f8d8085d 27-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* Quitting a non-hidden window no longer deadlocks the app_server (_Hide() was called
without a lock).
* Renamed private methods to start with the '_' symbol.
* Removed superfluous SetLayer[Font]State() and moved back those one-liners into their
AS_* handlers.


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


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

no longer needed

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


# ee6bcb7d 04-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Initial support for recording (some, for now) drawing events into a BPicture

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


# 58290b7b 12-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

WindowLayer::ProcessDirtyRegions() no longer deadlock in case it can't send
the AS_REDRAW message.
The AS_REDRAW message is now only used as a notifier - it's arrival is not
critical anymore, IOW it's simply dropped when the queue is full.


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


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

This enables BDirectWindow support again.
It also fixed a bug in the old code - the handshake semaphores were created
acquirable, causing the BDirectWindow::DirectDaemonFunc() to call DirectConnected()
with an uninitialized buffer and way too early - this probably didn't show up
before since it called it before the BDirectWindow constructor ran through,
so that DirectConnected() would still point to the BDirectWindow version, and
not to the implemented one of its subclass...


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


# 3ea966ee 09-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Some cleanup, removed some remaining RootLayer references.


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


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

Some cleanup:
* look/feel are now window_look/window_feel instead of int32.
* removed the level stuff, I don't think this is needed.
* some other minor stuff.


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


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

Reenabled most of the workspaces functionality - the Workspaces window doesn't
show any windows, but everything else seems to work fine.


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


# 27adb969 28-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Massive RootLayer & Workspace tearing:
* workspace switch and subset windows functionality temporarily removed
(away with that mess!).
* no more RevealWMState() - we now have methods like ActivateWindow()
and SendWindowBehind() that do all the work - just a little cleaner
and with less overhead.
* Workspace is now a pretty passive class - it only stores configurations
of the windows and screens.
* added an evil work-around for a locking problem (in RootLayer::_SetFocus()).
* I'll plan to move pretty much all of the remaining root layer functionality
to Desktop - so that the all regions lock is only held in case clipping
regions are affected.


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


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

Renamed WinBorder to WindowLayer, and OffscreenWinBorder to OffscreenWindowLayer.


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


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

* reverted Adi's premature changes to BWindow and restored _DetermineTarget() and
task_looper() again.
* removed BMessenger::fPreferred - whenever you had to specify "usePreferred" separately,
you don't have to do that anymore - use B_PREFERRED_TOKEN instead.
* fixed BTokenSpace::GetToken() semantics: it will no longer touch the "object" argument
in case of failure.
* Introduced a BWindow::_DistributeMessage() that will be part of the event dispatcher
counterpart to the app_server (the other will be _DetermineTarget()).
* Made it easier to use Michael's Message4 implementation: just add the following line
to your UserBuildConfig:
AppendToConfigVar DEFINES : HAIKU_TOP src : USING_MESSAGE4 : global ;
* Introduced ServerWindow::HandlerMessenger() and FocusMessenger() - the first will
target the client handler, while the other will target the preferred handler of the
client looper (usually the view having focus).
* Fixed dano message unflattening in the Message4 code.
* Changed BMessage::PrintToStream() to no longer use macros in the Message4 implementation.
* I hope that's all - it's a huge change, but it's all connected.


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


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

* Forgot to update Screen.h with the last commit...
* Introduced and implemented AS_GET_SCREEN_ID_FROM_WINDOW - it only returns B_MAIN_SCREEN_ID,
though.
* renamed ServerWindow::fHandlerToken to fClientToken.
* The BScreen(BWindow *) constructor now really asks the server for the screen ID.
* ServerApp::fWindowList is now a BObjectList.


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


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

* last change set window title to "Unnamed Window" if the title was empty - but
that's probably not wanted, as a window without a title is perfectly okay.
* AS_CREATE_WINDOW will now return a proper error code on failure.
* The title read from the link is no longer adopted by the ServerWindow constructor,
but copied - while the previous version was a bit faster, this is a lot cleaner.


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


# 0266d3fd 08-Nov-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Made ServerWindow::_HandleDirectConnection() a public method. It will be called from WinBorder too.

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


# 2c8cfe2d 07-Nov-2005 Adi Oanca <adioanca@nowhere.fake>

Bye-bye old clipping codesvn update Some cleanup to follow.

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


# 2c2fd7b2 03-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed scale calculation. The scaling is still ignored for the drawing coordinations.


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


# 0c378a57 01-Nov-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Thanks to latest changes, BDirectWindow now draws something. Though, looks like either the clipping region is wrong, or the app_server overwrites what the BDirectWindow app writes.

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


# 094efed4 31-Oct-2005 Marcus Overhagen <marcusoverhagen@gmail.com>

restored 14604


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


# 051d07f0 31-Oct-2005 Marcus Overhagen <marcusoverhagen@gmail.com>

no longer free() a title pointer that wasn't malloced, but instead came from the outside (right from the middle of some port link stuff)


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


# 959a5a68 31-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

Removed global gDesktop variable - there is now an sDesktop variable in AppServer.cpp, but
that will go away, too.


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


# 66156adf 24-Oct-2005 Adi Oanca <adioanca@nowhere.fake>

In case SendMessageToClient() fails, it's good to know why

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


# ef064448 10-Oct-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented basic server side support for BDirectWindow. It doesn't fill the direct_buffer_info struct correctly, it just sends B_DIRECT_START/STOP messages on show/hide for now. Tested with dw_info

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


# 770c05d6 25-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

The Desktop class now gets its own message processing loop: moved application
creation/deletion (and management) over to that class.
ServerApp now gets a desktop pointer, and no longer uses gDesktop.
Converted private MessageLooper::_MessagePort() to a public method MessagePort()
so that the looper can be addressed from elsewhere without using PostMessage().
Added a real basic message loop to MessageLooper::_MessageLoop().
BApplication now only asks the app_server to get its desktop object which should
now be used for everything that's not in the realm of the application.


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


# c6a25272 24-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Split ServerWindow::Quit() into two parts, and moved the generic one to
the MessageLooper class - the other part is called from there as virtual
_PrepareQuit().
Moved the class documentation to the source file.


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


# 89ab121e 23-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Factored a MessageLooper class out of ServerWindow and ServerApp. Could still
be improved a bit (Quit() and _MessageLooper() are empty right now).
Removed ServerApp::PingTarget().
Hopefully cleared some confusion about ServerApp::fClientLooperPort and fClientToken
(previously fHandlerToken), even if it's currently unused.


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


# 2b1246d9 05-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed AS_WINDOW_TITLE to AS_SET_WINDOW_TITLE.
Fixed handling in ServerWindow as stippi's latest commit broke it.
It's now properly done with a separate ServerWindow::SetTitle() method,
that will also take care to rename the window's thread.
Changed naming the window thread in the app_server to "w:<team>:<title>".


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


# 6a0a0a80 05-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Implemented AS_GET_WINDOW_LIST and AS_GET_WINDOW_INFO.
Renamed Desktop::FindWinBorderByServerWindowTokenAndTeamID() to FindWinBorderByClientToken().
Every ServerWindow now gets a server token.


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


# 359c905c 05-Jul-2005 Stephan Aßmus <superstippi@gmx.de>

offscreen bitmaps work, tested on Haiku as well, supports all colorspaces that BBitmap::ImportBits() supports. It uses a fallback for non-B_RGB(A)32 bitmaps. Added support for B_SUB_PIXEL_PRECISION view flags, though it is a bit hacky, since I had to add it to LayerData, even though it is not a true part of stack data. Added Layer::SetFlags() to enforce code path and update fLayerData. Cleaned up DisplayDriverPainter and DisplayDriver API (changed some const BRect& rect to simply BRect rect in order to be able to reuse it in the code), moved Painter.h, the test environment only draws the changed part of the frame buffer again - this causes a lot less CPU overhead, Painter special cases stroke width of 1.0 to use square caps, which is similar to R5 implementation and removes a lot of problems with non-straight line drawing, ServerWindow uses the DisplayDriver from it's WinBorder instead of the one from the Desktop (needed for offscreen windows, which have their own DisplayDriverPainter), it also checks for GetRootLayer() == NULL, because offscreen layers are not attached to a RootLayer, there was a fix for scrolling which worked at least in the test environment, it is now defunced, because Adi moved _CopyBits to Layer... I need to reenable it later, LayerData has no more fEscapementDelta, also fixed fFontAliasing (which was thought to overriding the font flags, and now works as such again), Desktop initialises the menu_info and scroll_bar_info stuff, which makes ScrollBars work actually... hope I didn't forget something.

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


# f97b5cb5 28-Jun-2005 Adi Oanca <adioanca@nowhere.fake>

Moved CopyBits from ServerWindow to Layer. Also, made CopyBits code execute in RootLayer's thread

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


# 1b53e8af 23-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

The app_server now cleans up better after a team crashed; not only the
application and bitmaps are removed, the team's windows are now removed
as well.


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


# ce1639b2 23-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Some more cleanup:
- replaced fMsgSender/Receiver with a BPortLink fLink
- moved message loop into non-static method _MessageLooper()
- renamed Zoom()/Minimize()/Quit()/ScreenModeChanged() to Notify*(), and
Quit() to NotfiyQuitRequested() to make more clear what they do (they
don't operate on ServerWindow, they just notify its client)
- less insane way to init a window: there is no longer the constructor
and a separate method Init(); now there is the constructor (which
fully sets up the window), InitCheck(), and Run() which runs the
window's message loop
- moved the quitting stuff into a separate method Quit() and made
it callable from other threads.


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


# a38e46a0 23-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

ServerApp now maintains a list of all windows, ServerWindow's AS_DELETE_WINDOW
will update it automatically.
Renamed ServerWindow::fName to fTitle, made it a pointer - it will now just
adopt the title pointer that came from AS_CREATE_WINDOW.
Just another cleanup round: renamed Layer::GetName() to Name(), no
more layer->fName->String() accesses.


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


# fcb006dc 23-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Rewrote how the app_server and ServerApp's quit. As a side effect, the server
can now quit instantly.
AppServer must no longer call ServerApp's destructor once it's running - it now
has to call Quit() in this case. The ServerApp is now destructed in its own thread.
Some cleanup (like renaming ServerApp::MonitorThreadID() to Thread()).


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


# 1b5aeb31 17-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed class FMWList to SubWindowList. Cleaned up SubWindowList a bit.


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


# 53442520 15-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed a bad bug in the app_server:
fCurrentLayer was used to determine to which layer a new one would be
added to, but BView::AddChild() would only set this correctly for the
current view, ie. all children of the new child were added to the
wrong layer in the app_server.
Now, AS_LAYER_CREATE sends the parent's token to the server, and the
server relies on this to build the layer hierarchy.
All of a sudden a lot of hidden views are visible now. I noticed the
bug while refactoring the task manager, but a lot of apps were affected.


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


# dd10337f 14-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed BAppServerLink to AppServerLink, BPortLink to PortLink, LinkMsgReader
to LinkReceiver, LinkMsgSender to LinkSender, and put everything into the
BPrivate namespace.
Made AppServerLink a cheap object - it will use the applications receiver/sender
and not create its own buffers.
Fixed broken communication stuff here and there (mostly Font.cpp).
Put the newly introduced set|get_system_colors() into the BPrivate namespace -
please don't introduce private functions into the public namespace!!!
Also fixed their broken communication use, as Darkwyrm obviously forgot about
it again: the sequence Flush(); GetNextMessage() without error checking is
purely wrong and can make the app hang and/or crash! :-)
Other minor cleanup.
The input_server used some test mode with the haiku build target which is
probably wrong.
Hopefully I did not forget anything this time.


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


# 2c9931e9 10-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

no more friends for ServerWindow... Poor ServerWindow

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


# 7cb5e7b1 10-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

removed another friendship

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


# 45ca1c94 03-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Simplified code for BView::ClipToPicture() a lot (both server side and client side). Regions passed with that method should take the place of regions passed with BView::ConstrainClippingRegion(). Note that the needed server support hasn't yet been implemented.

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


# 7f2831b5 28-May-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed a couple of friendships, commented/removed unused stuff

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


# 280d1aac 26-May-2005 Axel Dörfler <axeld@pinc-software.de>

Tried something, didn't work, some cleanup left.


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


# 0c7e8ef8 26-May-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed "cl" to fCurrentLayer.


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


# ad6b4804 16-May-2005 Stephan Aßmus <superstippi@gmx.de>

Work in Progress. The server keeps the client window up to date on layer movement/resizing. This fixes quite a few problems and brings support for FrameMoved and Resized hooks. But implementing it this way has its own set of problem, most importantly: When a BView calles Window()->CurrentMessage() in its FrameMoved/Resized hooks, it will see something very different from what it would see in R5. This needs to be fixed, but I have not had a good idea how to do this other than faking the current message in BWindow, which I didn't look into.

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


# db7226db 27-Apr-2005 Stephan Aßmus <superstippi@gmx.de>

work in progress to get scrolling working, so Adi can have a look, no changes to existing functionality, cleanup in Layer.cpp

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


# d7c2c050 16-Apr-2005 Adi Oanca <adioanca@nowhere.fake>

Big cleanup.

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


# f694c0e3 30-Mar-2005 Adi Oanca <adioanca@nowhere.fake>

This may be a quick and dirty fix to the problems we've been having with the update code. However this requires something from DisplayDriver. I'll write about this in a moment on app_server list.

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


# 33bbe223 24-Mar-2005 Axel Dörfler <axeld@pinc-software.de>

Moved app_server files to app/.


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


# d0fa6c78f4efad4c2a2fd7a1dfd53624ed3a6471 28-Jan-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

BView: Allow resetting ClipToPicture

Just like for regions, ClipToPicture(NULL) removes any picture clipping
at the current state level (clipping in pushed states are not undone).


# c0494bc592de7d83d2cfea79063b7c90a6a7e780 17-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add facility to communicate with the desktop listener over an app server link. The ServerWindow dispatch the message to the DesktopObservable which dispatch it to the correct listener.



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


# a5a64d5481aadad0161c2db2ce1e7e9e0ffac79f 27-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Renamed DirectWindowSupport/Data to DirectWindowInfo.
* Cleanup of the fullscreen stuff.


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


# 78ca6157b696f676eaa004e60d7d055f186df204 27-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Changed AS_GET_SCREEN_ID_FROM_WINDOW as well as AS_SCREEN_GET_MODE to no
longer hold the window lock. There is now a lock that guards screen changes
in particular. This fixes the deadlocks seen in apps using BDirectWindow.
* All direct window handling now sits in the Desktop class -
ServerWindow::HandleDirectConnection() is never called from anywhere else
anymore. Furthermore, it's now only called when actually needed.
* Resize/move actions now always send a B_CLIPPING_MODIFIED flag, too.
* When the screen changed, the driver state is supposed to be B_MODE_CHANGED,
not B_SCREEN_CHANGED (which is a message constant).
* Direct windows are no longer suspended too late on screen changes.
* Removed unused members of DirectWindowData, and cleaned it up a bit.
* Made MultiLocker's default, and copy constructors private - I accidently
used them, causing the ASSERT_MULTI_*LOCKED() macros to fail.
* Added Unlock() to AutoWriteLocker as well.
* Minor cleanup.


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


# d913595783500a95677dc59d97624ab0216eabc9 26-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Disabled BDirectWindow mode for the time being. +alphabranch


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


# fe9c291b299b75ef0e1b2bb6f5ae31c3b03c4c67 24-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Since ServerWindow::Window() can also be NULL in case the window hadn't been
added to the Desktop yet, we better make sure in AS_GET_SCREEN_ID_FROM_WINDOW
that this is not the case.
* Removed the now superfluous ServerWindow::IsOffscreen() again.
+alphabranch


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


# f277acc9cd89243e00e3c63578abcb2be670040c 22-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Don't crash the app server if the user calls BScreen(BWindow *) supplying
an offscreen window (Magnify does that, and that's the cause of ticket #4304).


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


# a1bcb09b45a7175b1d179da139ef4850d22b7b74 17-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added a ServerWindow::ScreenChanged() hook, which takes care of resizing
an eventual offscreen directwindow and sends the direct window notifications
(not yet, though, since a BDirectWindow on a non-visible workspace would
get the B_DIRECT_START notification and start drawing on a different workspace).



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


# 2a2d0f1d10ac5233bd429637c3867ade4381be4f 14-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

After a B_DIRECT_STOP notification, the app_server could trigger a
B_DIRECT_MODIFY with, for example, B_CLIPPING_MODIFIED. This was ignored,
though. Now we combine this notification with the next ones, so that
on B_DIRECT_START, the client is informed of all the things which have
changed. Chart was relying on receiving the B_CLIPPING_MODIFIED notification
to exclude some stars from being erased, in case the window went offscreen.
Anyway, the net result is that Chart doesn't crash now, and we follow
more closely the original BDirectWindow protocol. Fixed ticket #1939.


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


# 3e20b06294cdca6dedd539222cd2733ba1f1466a 14-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Work in progress towards cleaning up the directwindow server code:
Renamed direct_window_data to DirectWindowData and turned it into a
class.
Encapsulated some functionality inside the DirectWindowData class.
No functional change (yet).
More to come.


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


# 07e13b5fe6ae57dc58bc6a0d0224b6bf8e57e267 11-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Removed superfluous ReplaceDecorator() method.
* Cleanup, no functional change.


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


# 3bd49667008d037333b876c7b01325bf17f146f2 03-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Now also hide/show the cursor when BDirectWindow::SetFullScreen() is called.
in the handler, instead of checking if the window is an offscreen one,
check if fDirectWindowData is NULL, and do nothing if it's the case.
When setting a clip region in ServerPicture, also invalidate the clipping.
To do so, I added a public ServerWindoow::UpdateCurrentDrawingRegion()
which just calls the private function. Please review and see if it can
be done better. This fixes the problem with BPicture and the
ConstrainClippingRegion() op (see ticket #1389)


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


# 4695f670190abd26d95f348f53b7d86b94214672 01-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Completed the server part of BDirectWindow::SetFullScreen(). The window is
now resized and moved correctly. Moved this functionality to its own method.
Should fix bug #4168.


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


# 431dc47ddeaddc4ad9467b87c09f6777d99fbe1c 15-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

Patch by Artur Wyszynski with some changes by myself:
* Resolved TODO: The type of the gradient is no longer encoded twice in the
app_server link protocoll.
* Moved instantiation of the BGradient into the LinkReceiver::ReadGradient()
method.
* Check success for (at least) ReadGradient() in ServerWindow.


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


# 991547ef6c1fca650f0fba855206296ef54bc441 14-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

Patch by Artur Wyszynski:
* Implemented BGradient, BGradientLinear, BGradientRadial,
BGradientDiamond, BGradientConic and BGradientRadialFocus
new Interface Kit classes.
* Implemented all the (AGG-based) backend necessary in
the app_server to render gradients (Painter, DrawingEngine)
* app_server/View can convert a BGradient layout to screen
coordinates.
* Added BGradient methods of the Fill* methods in BView.
* Implemented a test app and added it to the image as a
demo.
* Adopted Icon-O-Matic and libs/icon in order to avoid
clashing with the new BGradient class. Re-use some
parts where possible.

Awesome work, Artur! Thanks a lot. Now a more modern
looking GUI has just become much easier to implement! :-)

TODO:
* Remove the need to have gradient type twice in the
app_server protocol.
* Refactor some parts of the patch to remove duplicated
code (Painter, DrawingEngine).
* Adopt the BPicture protocol to know about BGradients.
* Review some parts of the BArchivable implementation.


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


# 54f92239a2cca528b78c0aa1b457d0e63fb5ca50 08-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* The ServerWindow now memorizes the original BDirectWindow feel when switching
to full screen. Since BDirectWindows can have any feel, this does now
correctly restore it instead of always reverting to B_NORMAL_WINDOW_FEEL.
* This fixes part of bug #2808.
* Minor cleanup.


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


# f592fcef43a871aaa0e89bf306e14ec71500d7df 01-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

stippi + bonefish:
Fixed race conditions when a ServerApp or ServerWindow is created. The
reply to the client that the object has been created successfully was
sent in the thread creating it. Preempted at the wrong time (right after
writing the message to the port) could lead to the object's thread using
the link at the same time, which would screw up all subsequent
communication via that link.
This fixes the problem that mimeset would sometimes fail when building
Haiku in Haiku (can't find the ticket). It probably also fixes #2331,
and the bug that sometimes when a window is opened (Terminal, crash
alert, shutdown window, etc.) it would come up with huge width/height
and tiny other dimension (can't find the ticket).


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


# 97d6a0515e8e5d37ca46e1cc453face79e93aeb6 11-Mar-2008 Stephan Aßmus <superstippi@gmx.de>

GetClippingRegion() was implemented wrongly on the app_server side. It needs
to take the current effective drawing region of the view, but converted to
local coordinate space. Untested as of yet.


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


# 953d895e020ece5d50cfc2e76d9f370ceb5c45e7 07-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Got rid of the "Layer" part of WindowLayer, ViewLayer, WorkspacesLayer
(now WorkspacesView), OffscreenWindowLayer.
* Renamed ServerScreen.cpp/h to Screen.cpp/h (the class was already called
Screen).


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


# 4d1c4228028075b8982d13c645cd206a28419df7 02-Oct-2007 Stephan Aßmus <superstippi@gmx.de>

* added a way for the ServerWindow message loop to determine the required type
of locking before processing the message (single/all window lock)
-> in most message cases, I could comment out the unlocking/locking which
switched to the different lock, because the required lock is now already held,
this removes some race conditions which were commented in the code already
* EventDispatcher::SetDragMessage() didn't lock the object, this would have
been bad if multiple windows tried to set a drag bitmap at once
* the Desktop object keeps track of mouse position and pressed buttons, so
that it doesn't need to lock the EventDispatcher for sending fake mouse
moves to windows on show/hide of windows (solves some cases of possible
dead locks with the new locking strategy)
* the keyboard EventFilter switches the current workspace asynchrnously from
the Desktop thread (another source of possible deadlocks)
* the "reader is trying to become writer" check in MultiLocker is only used
in DEBUG mode now

As a summary: It would be nice if ServerWindow used a readlock for all messages
it processes itself, and forwards all messages for which it needs a write lock
to the Desktop thread. All cases where either the Desktop or the ServerWindow
mess with the EventDispatcher are possible sources of deadlocks. This is solved
right now by making sure that the lock is released before using the
EventDispatcher.

I have not observed any deadlocks while switching workspaces and launching
many apps anymore, neither crashes. But I have not tested extensively except
for in the test environment. That being said, I could reproduce the problems
on first try before in Haiku.


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


# 0896fce5fb6672058acb2a99990d3a4cd082105c 18-Jul-2007 Stephan Aßmus <superstippi@gmx.de>

* since every window has it's own Painter instance, the drawing state does
not need to be "set" (transfered from the "current" view to the painter)
for each singly drawing command. Now, painter is synchronized whenever
the client changes the drawing state of the current view, or when the
current view changes.
* the screen offset of the current view has become part of the Painter state,
in the PatternHandler. This fixes a bug in which moving or scrolling a view
which used patterns for drawing, resulted in visual glitches (seams in the
pattern).

NOTE: this patch is a bit work in progress, most importantly, it is not
complete with regards to text rendering. More specifically, the server
applications and other parts of the appserver might set a font on the Painter
and this might mess up the synchronization. But this happens on the Desktop's
Painter instance (only?), and so it is not a problem. I did observe some
drawing bugs with this patch though, so bug reports are welcome, particularily
how to reproduce these bugs reliably.


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


# 3a44e6e37d60b599f911009054aeac3a729f794f 19-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed a big race condition in the server code:
* ServerApp was accessing ServerWindow::Window() (while having the app window
lock held), but in fact, there was no guarantee it already existed, or was
added to the Desktop.
* Therefore, the Window() semantics have changed to only return a window in
case the window exists *and* has been added to the desktop (the latter
constraint might be lifted again, though). Therefore, it doesn't work
for offscreen windows, and should not be used within ServerWindow code
anymore.
* This fixes bug #686 and maybe others as well.


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


# 0ac013e66f75c5733fcd6bca47300d126b293279 23-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* Some refactoring: renamed OverlayCookie to Overlay and put it in its own
source file.
* An overlay is now also hidden in case its is removed from the window.


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


# bfe698736ddb0a6dabeb8688120c2b1d20bcbf0a 28-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented private do_window_action() function, used by the Deskbar to bring
windows to front (or minimize them).
* Desktop::ActivateWindow() no longer crashes in case the window to be activated
is not on the current workspace - instead, it doesn't do anything at this
point. IOW it doesn't handle workspace activation at all, yet.
* Renamed ServerWindow::GetWindowLayer() to ServerWindow::Window().


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


# f8d8085d7a29b26d5793c449a53ffa7e595996fc 27-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* Quitting a non-hidden window no longer deadlocks the app_server (_Hide() was called
without a lock).
* Renamed private methods to start with the '_' symbol.
* Removed superfluous SetLayer[Font]State() and moved back those one-liners into their
AS_* handlers.


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


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

no longer needed

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


# ee6bcb7d78be5099d9dee83c87311cb0dab6d06e 04-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Initial support for recording (some, for now) drawing events into a BPicture

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


# 58290b7b3734b8b517a8e2ba0b65cb4af107f59f 12-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

WindowLayer::ProcessDirtyRegions() no longer deadlock in case it can't send
the AS_REDRAW message.
The AS_REDRAW message is now only used as a notifier - it's arrival is not
critical anymore, IOW it's simply dropped when the queue is full.


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


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

This enables BDirectWindow support again.
It also fixed a bug in the old code - the handshake semaphores were created
acquirable, causing the BDirectWindow::DirectDaemonFunc() to call DirectConnected()
with an uninitialized buffer and way too early - this probably didn't show up
before since it called it before the BDirectWindow constructor ran through,
so that DirectConnected() would still point to the BDirectWindow version, and
not to the implemented one of its subclass...


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


# 3ea966eee389560360712bc5f061884455cd5d8b 09-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Some cleanup, removed some remaining RootLayer references.


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


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

Some cleanup:
* look/feel are now window_look/window_feel instead of int32.
* removed the level stuff, I don't think this is needed.
* some other minor stuff.


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


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

Reenabled most of the workspaces functionality - the Workspaces window doesn't
show any windows, but everything else seems to work fine.


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


# 27adb969620d656c8d92dfa608cd85c35f4d37e3 28-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Massive RootLayer & Workspace tearing:
* workspace switch and subset windows functionality temporarily removed
(away with that mess!).
* no more RevealWMState() - we now have methods like ActivateWindow()
and SendWindowBehind() that do all the work - just a little cleaner
and with less overhead.
* Workspace is now a pretty passive class - it only stores configurations
of the windows and screens.
* added an evil work-around for a locking problem (in RootLayer::_SetFocus()).
* I'll plan to move pretty much all of the remaining root layer functionality
to Desktop - so that the all regions lock is only held in case clipping
regions are affected.


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


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

Renamed WinBorder to WindowLayer, and OffscreenWinBorder to OffscreenWindowLayer.


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


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

* reverted Adi's premature changes to BWindow and restored _DetermineTarget() and
task_looper() again.
* removed BMessenger::fPreferred - whenever you had to specify "usePreferred" separately,
you don't have to do that anymore - use B_PREFERRED_TOKEN instead.
* fixed BTokenSpace::GetToken() semantics: it will no longer touch the "object" argument
in case of failure.
* Introduced a BWindow::_DistributeMessage() that will be part of the event dispatcher
counterpart to the app_server (the other will be _DetermineTarget()).
* Made it easier to use Michael's Message4 implementation: just add the following line
to your UserBuildConfig:
AppendToConfigVar DEFINES : HAIKU_TOP src : USING_MESSAGE4 : global ;
* Introduced ServerWindow::HandlerMessenger() and FocusMessenger() - the first will
target the client handler, while the other will target the preferred handler of the
client looper (usually the view having focus).
* Fixed dano message unflattening in the Message4 code.
* Changed BMessage::PrintToStream() to no longer use macros in the Message4 implementation.
* I hope that's all - it's a huge change, but it's all connected.


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


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

* Forgot to update Screen.h with the last commit...
* Introduced and implemented AS_GET_SCREEN_ID_FROM_WINDOW - it only returns B_MAIN_SCREEN_ID,
though.
* renamed ServerWindow::fHandlerToken to fClientToken.
* The BScreen(BWindow *) constructor now really asks the server for the screen ID.
* ServerApp::fWindowList is now a BObjectList.


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


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

* last change set window title to "Unnamed Window" if the title was empty - but
that's probably not wanted, as a window without a title is perfectly okay.
* AS_CREATE_WINDOW will now return a proper error code on failure.
* The title read from the link is no longer adopted by the ServerWindow constructor,
but copied - while the previous version was a bit faster, this is a lot cleaner.


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


# 0266d3fd18be706f197da9b07459c11426efb940 08-Nov-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Made ServerWindow::_HandleDirectConnection() a public method. It will be called from WinBorder too.

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


# 2c8cfe2dfcfc090dd49ff4d2a9e4d1bf36b29e83 07-Nov-2005 Adi Oanca <adioanca@nowhere.fake>

Bye-bye old clipping codesvn update Some cleanup to follow.

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


# 2c2fd7b2379219c253bed0a0ffd99aadba4303fa 03-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed scale calculation. The scaling is still ignored for the drawing coordinations.


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


# 0c378a571401c3b0953796331ea12f75f638ee25 01-Nov-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Thanks to latest changes, BDirectWindow now draws something. Though, looks like either the clipping region is wrong, or the app_server overwrites what the BDirectWindow app writes.

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


# 094efed4345dd4b97a0fa029641dc6e24a0d0bae 31-Oct-2005 Marcus Overhagen <marcusoverhagen@gmail.com>

restored 14604


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


# 051d07f0fc584c371837ac8026dcc5574351f262 31-Oct-2005 Marcus Overhagen <marcusoverhagen@gmail.com>

no longer free() a title pointer that wasn't malloced, but instead came from the outside (right from the middle of some port link stuff)


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


# 959a5a68bcb01c877ea6fe66211e60d54bab1ecd 31-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

Removed global gDesktop variable - there is now an sDesktop variable in AppServer.cpp, but
that will go away, too.


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


# 66156adf92f73c77f919f2cfb9f7cf72d38b858d 24-Oct-2005 Adi Oanca <adioanca@nowhere.fake>

In case SendMessageToClient() fails, it's good to know why

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


# ef06444893d89c578678f37a2a8708ca1be8b775 10-Oct-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Implemented basic server side support for BDirectWindow. It doesn't fill the direct_buffer_info struct correctly, it just sends B_DIRECT_START/STOP messages on show/hide for now. Tested with dw_info

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


# 770c05d6cc602b2e545e2ccae5a17c576881dc9c 25-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

The Desktop class now gets its own message processing loop: moved application
creation/deletion (and management) over to that class.
ServerApp now gets a desktop pointer, and no longer uses gDesktop.
Converted private MessageLooper::_MessagePort() to a public method MessagePort()
so that the looper can be addressed from elsewhere without using PostMessage().
Added a real basic message loop to MessageLooper::_MessageLoop().
BApplication now only asks the app_server to get its desktop object which should
now be used for everything that's not in the realm of the application.


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


# c6a25272973999ab0f24dc010b70c7ea811fa35f 24-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Split ServerWindow::Quit() into two parts, and moved the generic one to
the MessageLooper class - the other part is called from there as virtual
_PrepareQuit().
Moved the class documentation to the source file.


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


# 89ab121e66e7cd6136e4e561805b85acea3d046a 23-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Factored a MessageLooper class out of ServerWindow and ServerApp. Could still
be improved a bit (Quit() and _MessageLooper() are empty right now).
Removed ServerApp::PingTarget().
Hopefully cleared some confusion about ServerApp::fClientLooperPort and fClientToken
(previously fHandlerToken), even if it's currently unused.


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


# 2b1246d968e93ad26e5d054142037c65f73d663d 05-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed AS_WINDOW_TITLE to AS_SET_WINDOW_TITLE.
Fixed handling in ServerWindow as stippi's latest commit broke it.
It's now properly done with a separate ServerWindow::SetTitle() method,
that will also take care to rename the window's thread.
Changed naming the window thread in the app_server to "w:<team>:<title>".


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


# 6a0a0a80daf7b99da86f3d6085aff3525dd13b50 05-Jul-2005 Axel Dörfler <axeld@pinc-software.de>

Implemented AS_GET_WINDOW_LIST and AS_GET_WINDOW_INFO.
Renamed Desktop::FindWinBorderByServerWindowTokenAndTeamID() to FindWinBorderByClientToken().
Every ServerWindow now gets a server token.


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


# 359c905c57c9d43ce84badcaef859fa94322897c 05-Jul-2005 Stephan Aßmus <superstippi@gmx.de>

offscreen bitmaps work, tested on Haiku as well, supports all colorspaces that BBitmap::ImportBits() supports. It uses a fallback for non-B_RGB(A)32 bitmaps. Added support for B_SUB_PIXEL_PRECISION view flags, though it is a bit hacky, since I had to add it to LayerData, even though it is not a true part of stack data. Added Layer::SetFlags() to enforce code path and update fLayerData. Cleaned up DisplayDriverPainter and DisplayDriver API (changed some const BRect& rect to simply BRect rect in order to be able to reuse it in the code), moved Painter.h, the test environment only draws the changed part of the frame buffer again - this causes a lot less CPU overhead, Painter special cases stroke width of 1.0 to use square caps, which is similar to R5 implementation and removes a lot of problems with non-straight line drawing, ServerWindow uses the DisplayDriver from it's WinBorder instead of the one from the Desktop (needed for offscreen windows, which have their own DisplayDriverPainter), it also checks for GetRootLayer() == NULL, because offscreen layers are not attached to a RootLayer, there was a fix for scrolling which worked at least in the test environment, it is now defunced, because Adi moved _CopyBits to Layer... I need to reenable it later, LayerData has no more fEscapementDelta, also fixed fFontAliasing (which was thought to overriding the font flags, and now works as such again), Desktop initialises the menu_info and scroll_bar_info stuff, which makes ScrollBars work actually... hope I didn't forget something.

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


# f97b5cb5864f348b7f4160d2031e35ff21054983 28-Jun-2005 Adi Oanca <adioanca@nowhere.fake>

Moved CopyBits from ServerWindow to Layer. Also, made CopyBits code execute in RootLayer's thread

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


# 1b53e8af26fec8abbba112529036233f3b071e2e 23-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

The app_server now cleans up better after a team crashed; not only the
application and bitmaps are removed, the team's windows are now removed
as well.


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


# ce1639b2bf1fc9f842e8f22a4a4cb035d2599a21 23-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Some more cleanup:
- replaced fMsgSender/Receiver with a BPortLink fLink
- moved message loop into non-static method _MessageLooper()
- renamed Zoom()/Minimize()/Quit()/ScreenModeChanged() to Notify*(), and
Quit() to NotfiyQuitRequested() to make more clear what they do (they
don't operate on ServerWindow, they just notify its client)
- less insane way to init a window: there is no longer the constructor
and a separate method Init(); now there is the constructor (which
fully sets up the window), InitCheck(), and Run() which runs the
window's message loop
- moved the quitting stuff into a separate method Quit() and made
it callable from other threads.


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


# a38e46a046cbb27fef680a1c9f93b000663d70c9 23-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

ServerApp now maintains a list of all windows, ServerWindow's AS_DELETE_WINDOW
will update it automatically.
Renamed ServerWindow::fName to fTitle, made it a pointer - it will now just
adopt the title pointer that came from AS_CREATE_WINDOW.
Just another cleanup round: renamed Layer::GetName() to Name(), no
more layer->fName->String() accesses.


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


# fcb006dcf5e3396d905e09d127c085f7efb9b017 23-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Rewrote how the app_server and ServerApp's quit. As a side effect, the server
can now quit instantly.
AppServer must no longer call ServerApp's destructor once it's running - it now
has to call Quit() in this case. The ServerApp is now destructed in its own thread.
Some cleanup (like renaming ServerApp::MonitorThreadID() to Thread()).


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


# 1b5aeb312ea3a59d30160a6dd2be02899326888c 17-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed class FMWList to SubWindowList. Cleaned up SubWindowList a bit.


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


# 53442520cc7c5284373e7b65a8ab55d403ef583d 15-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed a bad bug in the app_server:
fCurrentLayer was used to determine to which layer a new one would be
added to, but BView::AddChild() would only set this correctly for the
current view, ie. all children of the new child were added to the
wrong layer in the app_server.
Now, AS_LAYER_CREATE sends the parent's token to the server, and the
server relies on this to build the layer hierarchy.
All of a sudden a lot of hidden views are visible now. I noticed the
bug while refactoring the task manager, but a lot of apps were affected.


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


# dd10337fd005a67a4947714fdeecf2121485b91d 14-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed BAppServerLink to AppServerLink, BPortLink to PortLink, LinkMsgReader
to LinkReceiver, LinkMsgSender to LinkSender, and put everything into the
BPrivate namespace.
Made AppServerLink a cheap object - it will use the applications receiver/sender
and not create its own buffers.
Fixed broken communication stuff here and there (mostly Font.cpp).
Put the newly introduced set|get_system_colors() into the BPrivate namespace -
please don't introduce private functions into the public namespace!!!
Also fixed their broken communication use, as Darkwyrm obviously forgot about
it again: the sequence Flush(); GetNextMessage() without error checking is
purely wrong and can make the app hang and/or crash! :-)
Other minor cleanup.
The input_server used some test mode with the haiku build target which is
probably wrong.
Hopefully I did not forget anything this time.


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


# 2c9931e9113c12cf6161e36f443149460d3b2650 10-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

no more friends for ServerWindow... Poor ServerWindow

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


# 7cb5e7b1460dc0fb830332a8d0e4f331396757d7 10-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

removed another friendship

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


# 45ca1c948cba0471b3107e037489e54500215c50 03-Jun-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Simplified code for BView::ClipToPicture() a lot (both server side and client side). Regions passed with that method should take the place of regions passed with BView::ConstrainClippingRegion(). Note that the needed server support hasn't yet been implemented.

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


# 7f2831b56b4add56f2cffdb506575f10b01349f3 28-May-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Removed a couple of friendships, commented/removed unused stuff

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


# 280d1aac5bb1d7982c84cad6c9e8e82e7249ee2c 26-May-2005 Axel Dörfler <axeld@pinc-software.de>

Tried something, didn't work, some cleanup left.


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


# 0c7e8ef8f43fe5ec58c8e3126d5be9dfb0560f68 26-May-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed "cl" to fCurrentLayer.


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


# ad6b480400e921f46a444359fc92be5251ab6ac4 16-May-2005 Stephan Aßmus <superstippi@gmx.de>

Work in Progress. The server keeps the client window up to date on layer movement/resizing. This fixes quite a few problems and brings support for FrameMoved and Resized hooks. But implementing it this way has its own set of problem, most importantly: When a BView calles Window()->CurrentMessage() in its FrameMoved/Resized hooks, it will see something very different from what it would see in R5. This needs to be fixed, but I have not had a good idea how to do this other than faking the current message in BWindow, which I didn't look into.

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


# db7226db9d3de3be44b52085559b68ef6ad69514 27-Apr-2005 Stephan Aßmus <superstippi@gmx.de>

work in progress to get scrolling working, so Adi can have a look, no changes to existing functionality, cleanup in Layer.cpp

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


# d7c2c05061210a81952d3a32a464a0e23f008c48 16-Apr-2005 Adi Oanca <adioanca@nowhere.fake>

Big cleanup.

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


# f694c0e30e986c3a4a19ce452dfc3c6c4941ac91 30-Mar-2005 Adi Oanca <adioanca@nowhere.fake>

This may be a quick and dirty fix to the problems we've been having with the update code. However this requires something from DisplayDriver. I'll write about this in a moment on app_server list.

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


# 33bbe223914093509b4bc56bea8a90c81af80a37 24-Mar-2005 Axel Dörfler <axeld@pinc-software.de>

Moved app_server files to app/.


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