History log of /haiku/src/servers/app/Desktop.cpp
Revision Date Author Comments
# b5ba4bad 12-Feb-2023 X512 <danger_mail@list.ru>

app_server: clear background immediately on expose

Reduce stamping artifacts when application slowly responds to redraw requests.

This fixes and reintroduces logic previously removed in hrev53711.
Previous logic was incorrect as it didn't take the possibility of multiple
invalidations of different kinds (expose, update request) into account.
Now separate update and expose regions are maintained and only expose region
is cleared immediately.

Change-Id: I0fd98cb1b45ccec285154e8c0d8e3a1400d156d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6067
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 85b82f85 19-Jul-2022 Dale Cieslak <dcieslak@yahoo.com>

BFont: allow loading of user fonts from disk or memory

This patch adds an API call to BFont, called LoadFont, that
takes a string path to a font file. The user fonts are managed
via a new class called AppFontManager that inherits from the base
class FontManagerBase but adds the methods to add and remove user
fonts from disk or memory. There is also a new method called UnloadFont
to remove a user font, but on exit of an app all user fonts should be
automatically cleaned up.

Global/system fonts are managed by the GlobalFontManager, which is
a new class that also inherits from the base class FontManagerBase,
replacing the old "FontManager" class.

A maximum of 128 user fonts may be loaded, and memory fonts
may not exceed 20MB.

There's also an overloaded version of LoadFont that accepts
an area_id and loads the font from memory. A size and offset may
optionally be provided to allow for an area that contains more
than just a font.

Change-Id: I6add42bdf0c0cefc0e2e2a4984fd848c3e7269e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4790
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 56761ebf 22-Oct-2022 Augustin Cavalier <waddlesplash@gmail.com>

app_server: Granularize whether font settings were loaded in DesktopSettings.

As per axeld's review.

Change-Id: Idd817156d53ebf535f162285bfd08f0566ac3901
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5755
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# a180a40b 19-Oct-2022 Augustin Cavalier <waddlesplash@gmail.com>

app_server: Only increase default font sizes if settings were not loaded.

Thanks to axeld for the review.


# 9004d85e 30-Sep-2022 Augustin Cavalier <waddlesplash@gmail.com>

app_server: Automatically pick a larger font size on HiDPI screens.

Ideally DesktopSettings would take care of this. However, we cannot
put this logic into its _SetDefaults, because that runs before
we actually set (or confirm) a display mode, and so attempts to fetch
the display mode in that function will fail.

(FontManager initializes even earlier and thus also is an unsuitable
place for this logic.)

At present, it merely uses a 2x larger font size at resolutions >"4K"
and a 1.5x larger font size at resolutions between 1080p and 4K.
Further adjustments can be made as necessary later on.


# 0716e509 30-Sep-2022 Augustin Cavalier <waddlesplash@gmail.com>

app_server: Print specific error when failing to initialize virtual screens.


# 124ae7cc 06-Sep-2022 Jérôme Duval <jerome.duval@gmail.com>

app_server: store the brightness with the current screen config if absent

when no screen configuration is found, the preferred mode is then selected,
and we now use this as current screen configuration. Otherwise, the user
would adjust the brightness, but it would never be stored for the next boot.

Change-Id: Ia855f8a29eb5e429747f3e0bc89a46587fa42f59
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5624
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# ba3ee26a 23-Nov-2021 Augustin Cavalier <waddlesplash@gmail.com>

WindowInfo: Use char[0] for FLA instead of char[1].

This is a private structure, so despite being an ABI break,
it should not cause any problems.


# 1c88f77d 22-Aug-2021 Adrien Destugues <pulkomandy@pulkomandy.tk>

app_server: turn DPMS on only after setting a valid mode

It's not allowed to enable the screen before having set a mode. At least
in the case of the intel_extreme driver, this creates some problem. Move
the call just a bit later in the init process, where the mode is already
set.

Change-Id: Iaa665f0edc15316890032f1a5928f33634dc8749
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4362
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: François Revol <revol@free.fr>
Reviewed-by: <BeagleJoe13@gmail.com>


# 773d5303 19-Jul-2018 Tri-Edge AI <triedgeai@gmail.com>

app_server: Implement B_OUTLINE_RESIZE

- Allows applications to be resized without the window contents resizing with the window frame.
- Due to the nature of out-of-tree decorators using private APIs, this will require all pre-existing decorators to be rebuilt
- Newer decorators won't work on older versions of Haiku...
- Also has some formatting with license headers.
- Fixes #2724

Change-Id: Id0b45e7bbc0b636e6dffbd396eb584bf348b5296
Reviewed-on: https://review.haiku-os.org/c/haiku/+/344
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jacob Secunda <secundaja@gmail.com>


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


# be3fde6d 18-Nov-2020 X512 <danger_mail@list.ru>

app_server: perform NULL check before use

Fixes #16610.

Change-Id: Ic377a2faef7279f607298b3b80bc44bc1c6aae36
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3401
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>


# 7ace34a6 28-Sep-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

app_server: don't reset brightness when switching workspaces

Fixes #16538.


# 8b2b3010 18-Jul-2020 Adrien Destugues <adrien.destugues@opensource.viveris.fr>

app_server: save/restore screen brightness settings

The brightness is saved in the screen configurations of the first
workspace. For now, all screens get the same brightness (I can't get
screen IDs to work today). Since we only support setting the brightness
for laptop displays for now, this shouldn't matter. It can be fixed when
app_server gets actual multiple display support.

Fixes #14254

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


# 77402344 07-Feb-2020 Murai Takashi <tmurai01@gmail.com>

app_server: Add missing 'else'

Fix PVS V646

Change-Id: I8f8f33b4c7cd3f7454e1605c445d6e942a554999
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2230
Reviewed-by: Jérôme Duval <jerome.duval@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.)


# f3e8ed4d 21-Nov-2017 Michael Lotz <mmlr@mlotz.ch>

app_server: Implement screen changed hooks and notifications.

The ScreenOwner interface gets an additional ScreenChanged() hook. It
is implemented in the Desktop class to automatically set the preferred
screen mode on the changed screen.

The HWInterfaceListener, previously only used by the downstream
DrawingEngine, gets an additional ScreenChanged() hook as well to inform
an upstream client of a changed screen.

The ScreenManager ties these two mechanisms together.


# b6d62e21 16-Nov-2016 Humdinger <humdingerb@gmail.com>

Stylefix

Thanks to eagle-eyed axeld. Sorry for not getting an almost one-liner
right on first try...


# a07a1391 16-Nov-2016 Humdinger <humdingerb@gmail.com>

Use shift+ctrl+cmd+esc for emergency video safe mode

Used to be just ctrl+cmd+esc. The added shift key should prevent accidental
video safe mode activation.


# eb69155b 04-Aug-2016 Axel Dörfler <axeld@pinc-software.de>

app_server: Fixed/documented uses of new without nothrow.

* This should fix all occurrences except for those in the drawing
sub directory.
* In some cases, the use of new without nothrow was okay, though.


# f744935b 04-Aug-2016 Axel Dörfler <axeld@pinc-software.de>

app_server: Fixed broken ServerApp allocation.

* Did not use std::nothrow, but exceptions were not catched.
* MessageLooper::Run() now returns a status code.
* There are a lot more cases of a new without nothrow that need to
be investigated.


# 871a4f63 09-Mar-2013 Axel Dörfler <axeld@pinc-software.de>

app_server: Fixed crash if there is no window.


# 7f9368ca 09-Dec-2015 looncraz <looncraz@looncraz.net>

Set*UIColor, etc.

The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.

BView gains:

HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()

BWindow gains a simple helper method:
IsOffscreenWindow()

BMessage gains:

AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()

Previous private ColorTools methods are made public and moved into GraphicsDefs:

mix_color, blend_color, disable_color

These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.

In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR

These changes are documented in their proper user documentation files.

In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.

On the app_server side, the following has changed:

Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.

Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.

In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.

Decorator changes are live now, which required some reworking.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# fa6fca91 21-May-2015 Axel Dörfler <axeld@pinc-software.de>

app_server: Fixed some send fake mouse event issues.

* Activating a window never send a faked mouse message. This was
noticeable when switching windows using the keyboard; if you then
scrolled with the mouse wheel you could scroll in the previous window
still.
* Also, using MouseEventWindow() in _SendFakeMouseMoved() doesn't work
when you click the window to send it to behind: it's moved on button
press, but the mouse event window is only released on button release,
ie. too late.
* This is fixed by always using the current window under the mouse as
target for the fake event.


# c895d331 12-May-2013 Axel Dörfler <axeld@pinc-software.de>

app_server: added an ASSERT to Desktop::_Windows().

* So that something like #9595 should not happen again.


# 9e1a0720 10-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix FFM focus loss on window close

kFocusList is an invalid index for _Windows(). fWorkspaces would be
accessed out of bounds.


# 486aaa49 07-Feb-2013 John Scipione <jscipione@gmail.com>

Check to make sure lastFocus is not NULL before using it.

This prevents an app_server crash on startup for me most likely
introduced in hrev45252. (Just a few commits ago)


# 4db1a8c6 07-Feb-2013 Axel Dörfler <axeld@pinc-software.de>

app_server: reworked SetFocusWindow() logic a bit.

* The normal mouse mode now only uses the window that had focus last if that
window is one that does not support to be the front window (such as the
desktop).
* This should keep the logic of r41264 without the drawbacks (see #7280 for
more information).
* Added _WindowCanHaveFocus() method.
* This should fix #7630.


# 6078d891 06-Nov-2012 czeidler <haiku@clemens-zeidler.de>

Move stacked windows to a different workspace correctly.

When moving a window of a stacked window group to a different workspace all windows in the stack have to be moved. This fixes #8855.


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


# d5df7842 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed input server start fallback

After failing to start the input server by signature, the fallback
didn't append the input server name to the servers directory returned by
find_directory().


# 323b6546 21-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Filtered flat import of Oliver's svn package management branch

Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.


# f33cf3fd 13-Aug-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Activating all windows in a stack caused flickering. The reason to activate all windows was to get all windows form a stack into the upper window layers, otherwise it was possible that the top layer stack window is activated but another window in the stack is at the bottommost layer position. Sending this window to the back does not triggered sending the complete stack to the back. The send behind call is now redirected to the top most stack window to ensure the stack is send behind.



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


# cd67c205 09-Aug-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Only remove a window from the S&T group when the hide event is not triggered by a minimize call.



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


# cdb351d4 04-Aug-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

When activating a window also bring all windows in the stack to the front layer. I used the ActivateWindow method because there is some magic involved when changing the layer position, utilising this method seems to be a safe way to do it.



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


# 55fbf11f 02-Aug-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

If a window is hidden remove it from the S&T group. This happens when MediaPlayer goes fullscreen. Maybe not optimal but at least consistent with terminal which also left the S&T group in fullscreen mode. This is because the terminal has no decorator in fullscreen mode and thus can't be stacked any more (maybe this should be solved in the future...). Fixes #7895, #7896.



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


# 2dae355e 31-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix window stack api and Desktop::WindowForClientLooperPort lock assert.



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


# 8313747b 26-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

As done in move, resize only the top layer window. The top layer window resizes the lower windows separately.
Use auto locker.



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


# 6a0ed7da 26-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Move S&T back into the app server.



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


# 7c5525e8 25-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Only allow windows with a normal thick border to S&T. Fixes #6647.



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


# 89887831 24-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix todo and only unload listener from the last add-on.



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


# f4f30311 24-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Cleanup app server directory a bit by creating a font and a decorator sub folder.



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


# bb2e9b06 24-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add multi tab support to the default decorator as discussed on the mailing list. Windows can be stacked on top of one another. All windows using the same decorator instance. This makes it easier to draw the stacked tabs and makes it possible to design more fancy looks for stacked windows. This also helps to fix some issues in S&T, e.g. when activating one window in a stacked group all windows have to be activated to ensure that all tabs are on top. This causes some flickering in tracker.

* Each Window has a reference counted WindowStack class which can be shared between stacked Windows. To keep the Decorator separated from Window there is another tab list in the Decorator now. The index of the stacked Window in the window stack is the same as the index of the tab in the Decorator. Properties like title or window focus are managed on a per tab basis now. This mean when you set the title in the Decorator you also have to specify the tab id which is equal to the window position in the stack.

* When drawing the decorator its important that only the top window is doing the drawing. Also the top window drawing engine should be used.
Actually that is only a problem directly after a window is stacked and the other window has still a none empty dirty region. In this case we clear the dirty region of this window and stop the drawing (the top window will draw everything).

* Track if shifting of a tab is still ongoing, i.e. mouse still down.

* The key event filter called the DesktopListener without holding the window write lock. This probably caused #7801 and #7796.

* Commented out assert's in Window::SetScreen and Window::Screen. Add TODO because I'm not sure about the screen access.

This breaks all existing decorators again, sorry guys! Haven't looked into any other then the default decorator (and the SAT decorator). Will not fix the others in the near future so go for it! Since applications should be able to rely on S&T features the other decorator must be able to handle multiple tabs as well. A simple solution would be to draw all title bars in multiple rows. That probably looks quit poorly. Think the better solution would be to draw a tab interface in the title bar, e.g. like in KDE.



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


# 0d792bb3 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed input server start fallback

After failing to start the input server by signature, the fallback
didn't append the input server name to the servers directory returned by
find_directory().


# 3dfd9cb9 16-Jun-2011 Oliver Tappe <zooey@hirschkaefer.de>

Flat commit of all changes from package-management branch in svn


# c30f4641 29-Jun-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Be more clean and use a auto lock, thanks Axel.



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


# ccc37bbb 24-Jun-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Don't forget to unlock when there is no desktop listener for the message.



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


# b46615c5 19-May-2011 Stephan Aßmus <superstippi@gmx.de>

Applied patch by Joseph "looncraz" Groover from ticket #7445.
This changes how Decorators are managed and applied. The app_server
no longer scans and maintains the available ones himself, but is
simply asked to load a Decorator add-on from a provided path.
The Decorator scanning is moved into DecorInfo and DecorInfoUtil,
private classes in the InterfaceKit. The bin command 'setdecor'
uses those.
I cleaned up all the coding style violations that I could find,
removed chunks of code which didn't make sense (if you never put
a NULL pointer into a list, you don't need to check for this and
so on) and also cleaned up other passages for improved clarity
and simplicity.
I also tested the functionality and it works fine. Would even be
Ok to include in Alpha 3, IMHO. Thanks for the patch!


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


# 18ebc791 18-Apr-2011 Axel Dörfler <axeld@pinc-software.de>

* Temporary commit to be able to test new focus behaviour, see #7280.


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


# 5c9b2476 02-Jan-2011 Rene Gollent <anevilyak@gmail.com>

The cmd+` shortcut wasn't taking into account if the user was currently holding a
window with the mouse, and as such didn't take it along to the new workspace
as the cmd+F# shortcuts do. Fixes #7057.



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


# d65593aa 27-Dec-2010 Michael Lotz <mmlr@mlotz.ch>

CID 1420: fTargetScreen was leaked.


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


# 673481f3 27-Dec-2010 Michael Lotz <mmlr@mlotz.ch>

CID 2502: Check the FindMessage return which also safes a needless FindRect call
in the error case.


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


# 951366c5 27-Dec-2010 Michael Lotz <mmlr@mlotz.ch>

CID 10231: Remove unused fInputPort member and initilize fShutdownCount, even
though it's used only in the special case of running as BApplication.


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


# 5377c49b 23-Dec-2010 Michael Lotz <mmlr@mlotz.ch>

CID 4383 and 4384: Fix wrong checks of index values against kMaxWorkspaces that
could otherwise lead to out of bound access.


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


# 83cdf43f 06-Dec-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Give the option for the desktop listener to "absorb" key events.
- Make the S&T groups navigateable by pressing the S&T key + arrow down/up. Arrow down means to send the active S&T group to the bottom. Arrow up means to rise the bottom S&T group to the front. If no S&T group is selected, in both cases the front-most S&T group is activated.



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


# 92998b40 02-Dec-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Take the window when dragging the window and switching the workspace using the cmd + F1-12. Thanks Ingo.



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


# dc2dd40c 02-Dec-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix #6925 and #6935.
- If the event window was set the window was moved also if the moveFocusWindow flag was not set.
- Use ProcessDirtyRegion to redraw the dirty region.



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


# 8689fe06 26-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added method SetManagementCursor() that allows to set a cursor that overrides
the normal cursor set with SetCursor(). Intended for window management
interactions.


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


# 427788e0 24-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Extended the Desktop's MouseFilter to reset the mouse-down messages' "clicks"
field. It does that when the modifiers, the pressed buttons, or the click
target changes between the clicks, or when the distance between the click
points is >= four pixels.
* Adjusted the Window::MouseDown() and WindowBehavior::MouseDown() interfaces
and implementation accordingly (we now also pass and return click count and
click targets).
* Removed the no longer need multi-click handling from DefaultWindowBehaviour.

Fixes #6841 and #6867.


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


# 76107eeb 24-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added ModifiersChanged() hook to Window and [Default]WindowBehavior.


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


# e3feb1f8 23-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Added a new AS_DUMP_BITMAPS command.
* Extended app_server_debug command to be able to send it, too.


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


# 9ff327de 19-Nov-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Make MessageForListener a bit more flexible, passing a fix ServerLink is sometimes not enough and a separate sender and receiver is needed.
- Add communication part to restore and save S&T groups.
- Fix call of GetDecoratorSettings listener hook.



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


# 1d219b3a 15-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Added AS_DUMP_ALLOCATOR command that dumps an applications memory allocator to
the syslog/serial output.
* Added app_server_debug command that currently just sends this command to the
specified teams.


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


# 4772e0b2 08-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Fixed a typo. No functional change.


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


# 7306ba04 19-Sep-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Watch the window look and remove a window from a S&T group if the look changed to B_NO_BORDER_WINDOW_LOOK.



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


# cd469219 31-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Revert my last changes for now.



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


# d4272f88 30-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix SendWindowBehind. It now sets the window layer position behind the specified window. If behindOf is NULL it is send to the bottom. Please review if it really was broken! At least it has not worked as I had expected and what I read from bebook.



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


# 52ede95c 18-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

* Removed outdated USE_MULTI_LOCKER build option
* Don't acquire the read-lock in WindowForClientLooperPort,
since MultiLocker does not support nested read-locks.
Use an assert instead, however the method does not appear
to be used anywhere at the moment.


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


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

Add Notify* prefix to DesktopObservable hooks.



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


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

Lock WindowForClientLooperPort method and add comment that the window lock has to be held if accessing the a WindowList.



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


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

Add function to find a window in the app server by the client looper port id. Need this for the stacking api e.g. to stack window x on window y.



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


# c84e1250 12-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Rework listener interface as suggested by Axel.



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


# 5483fa4e 12-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Make RebuildAndRedrawAfterWindowChange public. This is useful when changing the window footprint from the outside. In this case RebuildAndRedrawAfterWindowChange recalculate the clipping and everything. Need this when I switch a decorator into a SAT stacking mode which is not a standard desktop operation. In this case the tab size is adjusted and also the window clipping need to be recalculated.
- First unregister listener reload decorators and then register new listener.



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


# d25313d4 12-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add listener for the tab location.



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


# 691749c0 05-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Changed mouse down behavior for all mouse modes while dragging a window: now
a second click on the right mouse button will raise the window again.
* Desktop::SendWindowBehind() now locks a bit earlier, as some of the things
it did shouln't really be done without holding a lock (depending from where
it was called).


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


# d6734c08 04-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Notify listener when they are registered and unregistered.
- First reload decorators and then the listeners. (my SAT listener caches the decorator when it is registered so the new one should already be loaded)
- Make the Desktop all window list accessible, help full when a listener is registered and want to iterate over the existing windows.



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


# b6ba2290 02-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Introduce a new DecorAddOn class which provide the DecorManager with the needed Decorator, WindowBehaviour and DesktopListener.



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


# 0265102f 29-Jul-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

-Make Windows private again and lock the iteration over the windows when reloading the decorators.
- Make the used decorator persistent.



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


# bb86786a 28-Jul-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Make _Windows public.
- Reload all decorators when the decorator has changed in the DecorManager.
- Update copyrights.



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


# 860dfc9a 28-Jul-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Introduce a DesktopListener interface to the Desktop class (needed for SAT).
- Add a minimize method to desktop.
- Make _CurrentWindows public.



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


# 8104bd54 02-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Always set the focus to the moved window on workspace switch.
* This fixes a part of ticket #5675.


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


# b6486ac2 11-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

bonefish + axeld:
* When moving a window to another workspace (using the mouse or the keyboard),
the fLastWorkspaceFocus array of the old workspace could still point to that
window.
* This could also lead to a stale pointer and might have caused crashes in
SetFocusWindow(). This should fix #5124, and its duplicates #5294, and #5688.


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


# a0b37b6e 11-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Tried to fix all issues with running a DEBUG build of app_server.
* CopyRegion should not need the HWInterface to be exclusive locked.
* BitmapDrawingInterface does not need to be locked at all, since
it doesn't use a shared HWInterface instance.
* Window and Desktop should lock the HWInterface appropriately
before invoking CopyRegion() on the DrawingEngine.


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


# e59dc33e 07-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

* Added BCursorID enumeration in App Kit's Cursor.h and new constructor which
takes such an id.
* Reused the existing mechanism to to have hardcoded tokens for the system
cursors, i.e. removed cursor_which enumeration from ServerProtocol.h and
used BCursorID where cursor_which was previously used.
* Reworked CursorManager.h and CursorSet.h accordingly and removed some methods
that where intended to replace system cursors with client cursors, since
those would break the reference counting and forget to maintain the cursor
list.
* Replaced the cursors in CursorData.h/cpp with the new ones I just designed.
* Removed HaikuSystemCursor.h and HaikuLogo.h from the source, as those are/were
no longer used.

I hope I will not get too much beating for this one... :-) I know the new
default cursor is slightly larger, but I believe the old one was just too small.
Also I noticed that the cursor may be slightly too dark, at least the old one
seems noticeably brighter when compared side by side (the new one has a slight
gradient). That is something I may correct at least. Otherwise I hope nothing
is broken, I've tested in QEMU and so far everything works as intended.


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


# aeb68978 15-Feb-2010 Axel Dörfler <axeld@pinc-software.de>

* Removed ServerCursorReference in favour of BReference.
* Simplified the Desktop::SetCursor() code a bit.


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


# f7d39828 03-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Always take the last window when choosing a new focus window in normal mouse
mode. This fixes focus issues as describen in bug #5020.


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


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

* Moved the B_NOT_MINIMIZABLE flag check into ServerWindow::NotifyMinimize()
as this fixes some more incorrect minimizations on the app_server side.


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


# 00173144 29-Nov-2009 Philippe Saint-Pierre <stpere@gmail.com>

Don't minimize windows (when hiding applications) if they have
the B_NOT_MINIMIZABLE flag. It should more properly fix #4337.



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


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

* We now store the last window having focus in a separate array, or else the
windows visible on more than one workspace destroy the FFM experience (ie.
restoring the last window that had focus on a workspace switch).


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


# 47212ddd 18-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Made the Alt-Shift-Fx behaviour consistent with Ctrl-Alt-Shift-Arrow (ie.
take the active window to the new workspace).


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


# 0296ba19 18-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* For dead keys, the keyboard input device now sends a B_UNMAPPED_KEY_DOWN
event.
* This allows applications to listen to keys independent to their dead key
status.
* The app_server keyboard filter now also check for B_UNMAPPED_KEY_DOWN.


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


# 842aad23 18-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed focus behaviour of FFM on workspace switch - let SetFocusWindow() decide
which window to give focus, it already does the right thing.


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


# 85d512ed 30-Oct-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Revert Stack & Tile patch (r33814) and first fixes done by axel (r33824, r33826)
The stack & tile feature developement & fixes would be done in
branches/features/stack-and-tile branch, until it's ready enough to be merge
into trunk.


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


# 23e00a25 29-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed millions of coding style violations introduced by the stack & tile
patch. Grmbl.


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


# ef831a1d 28-Oct-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Applied Stack & Tile patch by Hong Yul Yang, formely by Christof Lutteroth.


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


# b85716cb 25-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Not sure why Brecht changed the behaviour of FFM here. This should hopefully
fix most of the issues.


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


# c3d0a5e8 25-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed the style violations introduced by r33732, nothing too bad, though.


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


# 926e63c8 22-Oct-2009 Brecht Machiels <brecht@mos6581.org>

* added click to focus mouse mode; right-click for bring-to-front and send-to-back
(might cause some regressions in FFM)
* made accept first click user configurable
* updated the Mouse preflet to use the layout kit
* removed the warp and instant warp modes from the Mouse preflet
* changed internal representation of mouse modes (warp modes moved)
* coding style fixes



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


# a406b1e6 21-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* When switching the workspace while moving a window around, that window got
added to the window list without considering its frontmost window. That caused
problems with all feels that were always on top, like
B_ALL_WINDOW_FLOATING_FEEL. This was causing bug #4700.
* Disabled the "previous window keep keyboard focus" heuristic - it doesn't
really work that well. There should be a central mechanism that detects active
typing that could also be used to disable touchpads.


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


# 931cd377 07-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Added a new flag kAcceptKeyboardFocusFlag that allows B_AVOID_FOCUS windows
to still receive keyboard events. This is now used for menu windows (before,
the menu feel alone would trigger that behaviour).
* This also fixes bug #4691, as tool tip windows use the menu feel as well.


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


# b4a7d0bc 05-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Do not forward the Command-~ to the apps, like with the other workspace
switching keys.


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


# 68667bf4 04-Oct-2009 Michael Lotz <mmlr@mlotz.ch>

* Adding a remote desktop interface that operates on app_server drawing
primitives by providing a RemoteDrawingEngine and a RemoteHWInterface.
Not really optimized yet, still a bit WIP.
* Adding corresponding infrastructure like a blocking ring buffer and network
sender/receiver that are attached to the buffers to feed/drain them as well
as a RemoteMessage helper that provides a message based interface.
* Adding target screen concept to request an app to be run on a specific screen.
It's controlled by the TARGET_SCREEN environment variable which is added on
the app side and sent to the app_server.
* Right now only remote target screens are supported, in which case a new
RemoteHWInterface is created that tries to connect to the given host:port.
* Fix shape bounds when drawing, they need to be translated by the pen position
and converted to screen like the points as well. Wasn't visible though as the
bounds weren't used in the normal DrawingEngine.


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


# 60a981fb 03-Sep-2009 Michael Lotz <mmlr@mlotz.ch>

When a focus locked window is hidden, we need to remove the focus lock.
Otherwise the focus cannot be changed to another window. In one case this could
have a severe sideeffect: When a window is quit it is hidden to remove focus and
remove it from screen. If this didn't work due to the focus lock, the fFocus
member would become a stale pointer after the window was quit and deleted. The
app_server would crash or corrupt memory on the next focus change. Easily seen
when moderately quickly clicking away a few alert windows.


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


# 2a0cda50 28-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Added proper locking to _ResizeToFullScreen().
* Desktop::{Move|Resize}WindowBy() could be called with zeros in which case it
doesn't have to do anything.


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


# 9fe35223 26-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* BWindowScreens had no sychronization mechanism whatsoever - since the
workspace activation message was asynchronous, whether or not the
BWindowScreen stopped drawing in time was pure luck (this also caused crashes
with the VESA driver, as that one unmaps its frame buffer during mode switch).
Introduced a new AS_DIRECT_SCREEN_LOCK protocol for this.
* In the long term, we should let BWindowScreen use the same mechanism as
BDirectWindows, though.
* Removed superfluous locking in BDirectWindow::_InitData().


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


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

* Resolved a TODO and got rid of Desktop::ActiveScreen().


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


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

* Shuffled methods around to match their location in the header.
* Made ScreenChanged() private, and renamed it to _ScreenChanged().


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


# 5e3f4c41 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* ServerApp now maintains a mask of workspaces with temporary mode settings,
and reverts the modes if the app goes away (ie. if it crashes).
* Desktop::SetScreenMode() also set the mode on the current screen, even if
it should have been set on another screen.
* Cleaned up the Desktop.h header.


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


# 5ce91949 21-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* The changed settings format (display mode instead of composed fields) actually
broke Desktop::WorkspaceFrame(), which I didn't notice before; Workspaces now
shows everything in the right dimensions, even if resolutions differ.


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


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

* Added a new AS_GET_SCREEN_FRAME function, as getting the frame via
AS_SCREEN_GET_MODE won't work with multi-screen support anymore, and is also
more overhead than needed.


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


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

* Moved PrivateScreen.h header to headers/private/interface.
* Desktop is now including it as well to be able to use the new
B_CURRENT_WORKSPACE_INDEX constant.
* Include order cleanup.


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


# 0eed9183 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Rewrote screen configuration management: VirtualScreen doesn't have anything
to do with the configurations now, instead, there is a separated
ScreenConfigurations class that maintains all known screen_configurations
per workspace (and the Workspace::Private class has two of them, one for the
current modes, one for the stored modes).
* Added Desktop::{Get|Set}ScreenMode() methods, ServerApp now only calls those.
* Getting and setting of anything else than the current screen is now supported.
* This change also fixes that a temporarily set screen mode was not being
restored on workspace switch.
* Also, the Deskbar now seems to have the wrong location a lot, which is
something that should be easily fixable therefore. I will look into this next.
* Got rid of the unhandy screen_id structure server side, and in BPrivateScreen;
we now just use an int32 - the next API break should definitely replace the
screen_id with a simple typedef.
* Some cleanup.


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


# 02b6c959 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* VirtualScreen::RestoreConfiguration() now also takes care of collecting the
screens that actually changed their resolution, which simplifies the code
in Desktop considerably.
* Minor cleanup.


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


# 0d1d2de5 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Desktop::SetFocusWindow() now takes kWindowScreenFeel windows into account,
and does not give focus to any window behind that one.
* Added TODO comment to the DefaultDecorator bitmap caching mechanism (although,
it really seems to be fast enough, anyway, at least once we remove no longer
used bitmaps).


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


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

* When a window changed its look/title/... we need to make sure the dirty region
we got in _RebuildAndRedrawAfterWindowChange() does not contain hidden parts.
* This eliminates the updates as seen in the WindowInvalidation test app, as
well as it fixes bug #4257.


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


# f98bacf6 13-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved HandleDirectConnection From Window to Desktop. This should fix the
spurious off-window drawing of BDirectWindow. At least, it does here.


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


# c6906c28 31-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* In FFM mode, when a window was closed, or the workspace was changed, the
window under the mouse was given focus. This makes using FFM with the keyboard
alone very inconvenient to use, which is why now the window that previously
had focus will regain it instead; as soon as you actually move the mouse, the
focus is changed as usual.


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


# 69f9a367 29-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* The app_server no longer uses workspace counts internally, but only columns,
and rows.
* set_workspace_count() now uses the logic formerly found in
WorkspacesView::_GetGrid() to determine the layout.


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


# 390b0f94 28-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Added TODO about why the implementation of StoreConfiguratoin() is broken
if it were ever called for an inactive workspace, as our BScreen API in theory
allows you to do (not the BeOS API).


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


# 926b6fdb 21-Jun-2009 Rene Gollent <anevilyak@gmail.com>

Fix style violation.



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


# faafd00c 21-Jun-2009 Rene Gollent <anevilyak@gmail.com>

Fix broken check for ctrl+cmd+esc that would result in any of ctrl+esc, cmd+esc or ctrl+cmd+esc triggering safe video mode, and as a side effect, prevent menus from being opened via keyboard.



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


# 83a9be23 16-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Implemented switching to the fallback video mode when pressing
Command+Control+Escape.


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


# f680cfe2 02-May-2009 Axel Dörfler <axeld@pinc-software.de>

* The direct connection update in ServerWindow::{_Show()|_Hide()} is superfluous
since Korli's change in r30440.
* 80 character per line limit.


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


# 55423bfa 26-Apr-2009 Jérôme Duval <korli@users.berlios.de>

send DirectWindow events when hiding or showing a window


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


# 4fba3522 11-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed src/kits/tracker/OpenHashTable.h. The shared version in
headers/private/shared is newer, though with small interface changes.
* Removed the unnecessary Debug.h include in
headers/private/shared/ObjectList.h.
* Adjusted sources using these headers, mostly by adding missing includes.
* Lots of automatic whitespace cleanup.


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


# 84b784b4 24-Mar-2009 Axel Dörfler <axeld@pinc-software.de>

* Minor cleanup.


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


# 2f846521 28-Jan-2009 Karsten Heimrich <host.haiku@gmx.de>

* use client_window_info as suggested by Axel



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


# 320a952c 27-Jan-2009 Karsten Heimrich <host.haiku@gmx.de>

* extend Haiku specific client window info to include the tab height and border size



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


# a107d167 19-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* Made the get_token_list() function behave the same way as under BeOS. This
simplifies the code in the Switcher, but has the drawback that the window
list is not "static" anymore, ie. the items in the window list of the Deskbar
will now jump around as in BeOS.
* However, EasyMove now works under Haiku as well out of the box, if that is
something we want :)
* Maybe we should instead add another parameter to the window list to make
it sorted or not; sorting the list as it's done now is much simpler and
faster on the server.


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


# f3bd277e 15-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* Moved the screen change to a later point, as the workspace-leaving message
did arrive after the change; now it's: leave workspace, change screen,
enter workspace.


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


# ea5c7202 05-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* If a window was hidden during resize/movement, it would still be in resizing
or moving mode when it was shown again. Added a test app HideAndShow which let
you easily reproduce the faulty behaviour (with a previous version of the
app_server, that is).
* Minor cleanup.


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


# 790d3aee 02-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* When the window to be activated isn't a normal visible window (ie. floating
or modal), we need to check if our effort to make it visible (by activating
its subset window) was successful. This fixes bug #3201.


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


# 27c43a2d 08-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Implement the missing pieces to handle per workspace display mode support.
Adjust Workspace view to correctly scale each workspace based on the
resolution of that workspace. This exposes one or two anomalies in other
places in the app_server code though which I wasn't able to track down.
This fixes ticket #693.




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


# 0a3f410f 16-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a Desktop::BroadcastToAllWindows() method that sends all ServerWindows
a message.
* The DesktopSettings class is now using that to send the new
AS_SYSTEM_FONT_CHANGED message to all windows.
* The ServerWindow now propagates font changes to its decorator, causing it
to update its drawing. That means changing the bold font in the "Fonts"
preferences application will instantly change all window titles.
* Factored out a _RebuildAndRedrawAfterWindowChange() out of several Desktop
methods, simplifying some code.
* The DefaultDecorator no longer calls _DoLayout() twice (through SetLook()),
but instead calls the new _UpdateFont() method now also called by
FontsChanged(), and SetLook().
* BWindow::GetDecoratorSettings() now also includes "tab frame" BRect with the
exact footprint of the tab, allowing apps to know the size of the tab to
position itself accordingly.
* Automatic white space cleanup.


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


# 0c9593ac 14-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* Minor simplification and clarification.


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


# d0283566 14-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a method Desktop::_LastFocusSubsetWindow() which returns the last
window being the focus window that is a subset of the specified window.
* This is now used to bring the window to front belonging to a floating
or modal window (if on another workspace), ie. Desktop::ActivateWindow()
should now work with modal and floating windows.
* Fixed typo (in Window.cpp).


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


# c73be1e8 07-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* When switching to a workspace a window is on in ActivateWindow(), only
consider the workspaces in the configured count.
* If the window is not on the current workspace after the workspace check,
always move it to the current instead. This lets windows on workspaces
outside of the ones currently configured show up on the current workspace
as if they had the B_NOT_ANCHORED_ON_ACTIVATE flag set.
* This fixes bug #3003.
* Minor cleanup.


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


# 40fa49e7 03-Nov-2008 Stephan Aßmus <superstippi@gmx.de>

Oversight: When FFM is turned off, don't focus the window under the mouse
on mouse up if there was a focus-locked window.


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


# 21b40edd 03-Nov-2008 Stephan Aßmus <superstippi@gmx.de>

Implemented respecting B_LOCK_WINDOW_FOCUS that a view can set using
SetMouseEventMask() from within it's mouse hooks. Among other things,
scroll bars won't stop scrolling in FFM mode now if you accidentally
leave the window with the mouse, something which is very likely.


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


# 4932bc5e 21-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Added the BeOS feature that Command-~ (with American keymap) will switch
workspaces between this and the previous one.
* Note that this is mapped to a specific key on the keyboard (key 17), so
it will differ with the keymap, but will usually be the key below the escape
key.
* This closes ticket #2766.


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


# 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


# 64ba396f 16-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* When changing the workspace of a window, it's workspace position will now be
set to its current position if that is the only workspace it's in.
* This fixes missing windows on other workspaces in the Workspaces app after
boot, ie. before you had visited that workspace.


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


# d689f457 13-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Fixed a possible deadlock in Desktop::_ActivateApp(): since ActivateWindow()
will need to write lock the window lock, we cannot call it with the read
lock held.
* Added a TODO comment in _ActivateApp() on how we could handle minimized
windows.
* Added a WindowList::Count() method.
* Added a WindowList::ValidateWindow() that you can use to validate a window
pointer in case you had to unlock the list.
* Made FirstWindow()/LastWindow() const.


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


# ae0606be 12-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Added two more private InterfaceDefs functions: get_application_order(), and
get_window_order() will retrieve the application respectively window order
on the selected workspace.
* Moved private BeOS compatible functions (as used by the Deskbar) into the
private WindowInfo.h header.
* Whitespace cleanup.


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


# a8f4e1d0 12-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* _ActivateApp() did not lock the window list while traversing it.
* It will now first iterate through the windows on the current workspace to
choose the topmost window of this team (for this, it would be nice to have
a sorted list over all windows/workspaces).


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


# 547a7d18 03-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Since ShowWindow() could call ActivateWindow() again as well, we should
better call Window::SetMinimized() before calling it from there.
* And since ShowWindow() calls _SendFakeMouseMoved(), we also better don't
call it with the window lock held, or otherwise we would potentially cause
a deadlock.


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


# 51805689 03-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* BWindow::Activate() now also unminimizes a window if necessary.
* Removed superfluous white space.


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


# d2d52d31 01-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Made _LaunchInputServer() more robust: when launching by signature fails,
we try its well-known location directly.


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


# bd2509c5 10-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Desktop::_UpdateFloating() and Desktop::_UpdateSubsetWorkspaces() both
assumed that there was only a single window that was responsible for the
workspaces of a floating/subset window. Of course, any number of windows
can make up the workspaces of those. This fixes bug #2506.
* Added a Window::InSubsetWorkspace() method to complement SubsetWorkspaces().
* Minor cleanup.


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


# b09e2f6f 10-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

Patch by Andrej Spielmann (GSOC):
* Extend the app_server protocol by configuration options to turn
subpixel font rendering on/off and also make the glyph hinting optional
(aligning of glyph shapes to the pixel grid).
* Implement the setting in the app_server and also handle the persistency.


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


# 6aede71c 29-Apr-2008 Ryan Leavengood <leavengood@gmail.com>

Resolve a TODO and fix another ancient bug, #386. Print Screen is now handled
by BWindow, no longer by the app_server. This should stop the "screen freeze"
effect.

This adds a dependency on libpng.so and libz.so to libbe.so. The same
dependencies and the PNGDump code added here can be removed from the
app_server. I am just waiting for a code review of this before doing that.

This implementation still does not give the client a chance to handle it
differently.


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


# ace2d5ee 02-Apr-2008 Stephan Aßmus <superstippi@gmx.de>

HWInterface::Cursor() and therefor Desktop::Cursor() accessed the
current cursor without locking, and did not add a reference while
using the cursor. I have tried to solve both problems by introducing
a simple ServerCursorReference class, which makes sure that the
reference count is properly maintained. There are only two places
where this code was even used, from within ServerApp and when taking
screenshots. Axel, you mentioned in #837 that the code is unsafe, is
this what you meant? This hopefully fixes #837, but it is very hard
to reproduce in the first place, I will close the ticket, but it should
just be reopened if ever encountered again.


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


# d8ebe612 14-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

The fWorkspacesViews list now gets its own lock which solves a deadlock
problem when deleting Workspaces replicants.


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


# 092c62f0 12-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Creating a Desktop can fail, in which case the app_server should not return B_OK,
and an invalid desktop message port...
* Desktop::Init() now checks if VirtualScreen::fHWInterface is valid, and exits
if not. This can happen if you don't have a graphics driver, and turn on on-screen
debug mode in the boot loader (such that you already see the messages from the
boot loader).


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


# 437b1927 08-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Removed severly outdated DebugInfoManager.
* More "layer" cleanup.


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


# 2c184b20 08-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* The Desktop is now maintaining a list of workspaces views, and supports
more than one of them at the time.
* Changed ViewLayer::FindView() to FindViews() that collects all views
with the given flag set, not just the first one.
* Made ViewLayer::AttachedToWindow() and DetachFromWindow() virtual,
WorkspacesLayer now overloads them to register itself with the window and
the desktop.


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


# 9fb2c0f2 06-Mar-2008 François Revol <revol@free.fr>

Fix tracing.


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


# 6ec72e83 05-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* In normal mouse mode, the focus list is no longer used to find the
next window to get focus after the current one is gone. This fixes the
strange behaviour when using right-click to send the current window to
the back.
* When FFM is active, Desktop::SendWindowBehind() will now choose the
new focus window to be the one under the mouse, overriding the focus
list.
* Desktop::SendWindowBehind() will now also call _SendFakeMouseMoved()
if necessary.
* Removed Desktop::fFocusFollowsMouse; it was not used or
maintained anywhere.
* Minor cleanup.


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


# d01879e5 03-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a separate focus list that will contain all windows in the order
of the last focus.
* When choosing a new focus window, this list is now used to find the
new focus window instead of just choosing the next window in the
workspace list.
* With the normal mode mouse, this shouldn't change anything, but with
focus follows mouse turned on, this will behave much better if you
don't actually move the mouse - and it also fixes bug #1886.


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


# f9bbab88 24-Feb-2008 Axel Dörfler <axeld@pinc-software.de>

* First steps towards a more flexible workspaces view handling: the
workspaces view can now be any view in the hierarchy.
* Added private view flag kWorkspacesViewFlag that identifies such a
view - note though, that you must not remove a view before closing or
hiding its window for now (and that you still need to set the
kWorkspacesWindowFlag, too).
* Fixed Workspaces check for valid screen coordinates; after a crash, it
managed to open its window offscreen for me.
* Added a ViewLayer method FindView() that finds a view with the
specified flags set.


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


# 94fec641 19-Feb-2008 Michael Lotz <mmlr@mlotz.ch>

Implemented a small kernel debugger add-on that triggers a redraw of the
entire screen when exiting the kernel debugger. It sets up a thread that sends
a message to the (currently hardcoded) desktop message looper. The desktop then
does mark the whole screen dirty which causes a full redraw.
Since interrupts need to be enabled I went with an asynchronous thread and
releasing a request sem in the add-ons' exit hook.
Added the add-on to the image as it shouldn't hurt to have it for now.

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


# 45d0ea56 11-Jan-2008 Axel Dörfler <axeld@pinc-software.de>

Fixed two dirty region problems of the workspace switching code:
* If two intersecting windows didn't change their position but their
order, the dirty region wouldn't contain the region that would need
to be updated because of that order change. This fixes bug #827.
* When a hidden window was on the new workspace (but not on the old one),
its region would be included in the dirty region, but shouldn't have
been. This caused the app_server to update a larger region than
necessary.


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


# 737ce1c0 10-Jan-2008 Axel Dörfler <axeld@pinc-software.de>

* The keyboard target was always the first menu in the window list - no matter if that was hidden or not.
This fixes the bug described by Stefano in r23343.
* Therefore, I enabled cached menu windows again.


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


# 9a2d0cf6 03-Jan-2008 Axel Dörfler <axeld@pinc-software.de>

Applied patch by Anthony Lee: the user was attached to the font manager too
late, therefore, the DesktopSettings couldn't access user fonts. This fixes
bug #1691, thanks!


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


# 09a4122e 22-Oct-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved initialization of the system color map from AppServer to Desktop


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


# dd84f111 18-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

Fixed a few potential deadlocks:
* in r22410 the unlock/relock was removed accidently from ServerWindow::_Hide()
before calling a desktop method.
* Desktop::ActivateWindow() no longer calls SetWorkspace() with the window lock
held.
* WorkspacesLayer::MouseUp() now uses the asynchronous version of SetWorkspace().
* AFAICT AS_HIDE_WINDOW, AS_SHOW_WINDOW, and AS_MINIMIZE_WINDOW don't need the
all window lock, reverted to standard single window lock.


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


# 8a3cfa2c 01-Sep-2007 Axel Dörfler <axeld@pinc-software.de>

* Made menu windows behave differently than others: before, they were just
always put between window screens and modal all windows (before floating
all ones), so a BWindowScreen couldn't have menus at all.
Now, they behave more like floating app windows, just that they float above
all other application windows, such that all window feels (also BWindowScreen)
can now have menus.
* Reenabled keyboard redirection to the top most window in case it's a menu;
bug #1152 no longer applies due to the above change.


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


# f7e1df75 16-Aug-2007 Stephan Aßmus <superstippi@gmx.de>

* get rid of RGBColor usage where it is not needed, this simplified many things,
possibly making them a little faster too
* mess with decorator button size calculation to make the whole layout scale
more agreeable with the font size (no more fixed offsets/insets), but it
is work in progress
* DefaultDecorator no longer allocated the border color array, it is part of
the object now
* small memory footprint optimizations in ViewLayer, Decorator and WindowLayer


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


# b9c1e099 21-Jun-2007 Axel Dörfler <axeld@pinc-software.de>

The Workspaces layer will now also be updated when the window hidden/shown is not on
the current workspace - this fixes bug #1191.


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


# 189360b5 04-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Initialize all variables in the constructor


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


# ba4918e7 11-Apr-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menu windows are no longer the preferred keyboard events target (for
now, at least). This feature wasn't used yet anyway, and turning it
off cures bug #1152.


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


# cb134e25 02-Feb-2007 Axel Dörfler <axeld@pinc-software.de>

Resolved a TODO: WorkspacesLayer must take the whole workspaces frame into account, not
just the one of the first screen. This also solves a locking bug, as the HWInterface
is already read-locked when WorkspacesLayer::Draw() is called.


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


# 2d75f771 09-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Fixed minor ugliness (only visible on slow systems, such as Qemu): the mouse cursor
was drawn before the background got cleared.


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


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

* Removed the debugger() call when the input_server couldn't be started - it's not
a critical error, and definitely no reason to take the server and all GUI apps
down. You could also still log in remotely.
* Now opens and uses the syslog in some rare cases (should become the primary error
channel over time).
* Minor cleanup.


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


# 2cfe93e7 04-Dec-2006 Stephan Aßmus <superstippi@gmx.de>

* renamed HWInterface locking to LockParallelAccess() and
LockExclusiveAccess() (meaning more or less access to the
frame buffer)
* extracted the AGGTextRenderer to be a global instance used
by each Painter instance (currently, it is thread safe because
of the global font lock, so there is some work left in this
regard)
* gave every ServerWindow it's own DrawingEngine instance, this
is work in progress. So far, there doesn't seem to be a regression,
but less fighting over the exclusive access to the frame buffer, now
each ServerWindow thread can draw in parallel. There is room for
improvement, plus I think I'm leaking the DrawingEngine...
* changed the locking for the software cursor. ShowSoftwareCursor()
can only be called if HideSoftwareCursor(BRect) returned true, or
if you called the generic HideSoftwareCursor(), since it needs
to keep the cursor lock and unlocks in Show...!
* some clean up and renaming in Decorator and friends
* moved PatternHandler.h to live along with the .cpp


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


# 8e963d88 30-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

The app_server did not reset keyboard focus on B_INPUT_METHOD_EVENT messages.
This should fix bug #658.


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


# 07dc2c69 30-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

* The app_server now gives top-most menus the keyboard focus.
* BMenuWindow now makes its menu focus view, so that it can receive key events.
* Keyboard navigation doesn't work as it should though, that is bug #670 is
still valid - there should even be another recently opened bug about this,
but Trac obviously ate it :-/


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


# 122a1633 17-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

The mouse event window will already be reset in RemoveWindow() (through HideWindow());
doing it here is not only superfluous, it would also cause to lose the window when switching
to a workspace where the window is not visible and back while dragging it around.


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


# 8c68eab6 17-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed two different bugs that could cause bug #896:
* the app's Activate() method was called unsafely; the ServerApp pointer could
have become invalid in the mean time.
* when hiding a floating window (because its parent got hidden) that had focus
or even was the mouse event window (was currently dragged over the screen)
the focus was not moved to another window.


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


# a17c3a48 26-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Changed the way DesktopSettings work:
* Removed the DesktopSettings lock itself - it's not really needed at all,
and causes some trouble with a clean locking design. This may even have
fixed bug #757, at least I couldn't reproduce it anymore.
* There is now a class for read-only access that requires you to have locked
the desktop (either read or write).
* There is now another class LockedDesktopSettings that allows you to set
settings (and only that) - when you're changing the settings, you must not
have read locked the desktop (ie. hold the single window lock). The class
will obtain a write lock, but write locks can be nested.
* Moved SetWorkspacesCount() into the Desktop class.


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


# d479fa7a 23-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Floating windows no longer flicker when moving a window to another workspace
using the shortcut keys (Alt-Fn).


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


# 64747950 23-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

SetWorkspace() now also move the subset windows of the mouse event window to
the new workspace - this fixes bug #755. Unlike floating windows, they aren't
even redrawn :-)


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


# 85e25429 23-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Shouldn't try to move windows to top that aren't yet in the workspace
(a.k.a. floating windows) in SetWorkspace().
This fixes bug #211.


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


# 258d8a33 22-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

When building the update region on workspace switch, the mouse event window was
ignored even if it was not visible on the previous workspace (only normal windows
can be moved this way).
This fixes bug #765.


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


# 82584ab9 09-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented AS_DIRECT_WINDOW_SET_FULLSCREEN so that it sets kWindowScreenFeel
when enabled, and B_NORMAL_WINDOW_FEEL when disabled. IOW when enabled, no
other windows can interfere.
* Therefore, it's no longer necessary to have the screen_blanker window
use kWindowScreenFeel - it will set its window to full screen as long
as the blanker runs.
* Added a AS_APP_CRASHED notification in the app_server that will remove
all kWindowScreenFeels from the windows of the crashed app.
* This is now used by the debugger to ensure that the debugger alert will
be visible.
* Factored out a DesktopLink class out of the BRoster::_ActivateApp()
method. This class is now also used in the new BRoster::_ApplicationCrashed()
method as used in the debug_server (via BRoster::Private).


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


# fa3c08f0 29-May-2006 Axel Dörfler <axeld@pinc-software.de>

The workspaces window is now updated when a tab is moved - this fixes bug #641.


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


# b30e9021 24-May-2006 Stephan Aßmus <superstippi@gmx.de>

added a way for BWindow to store and restore arbitrary decor settings,
currently those include only the tab location


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


# 46fb2d73 24-May-2006 Stephan Aßmus <superstippi@gmx.de>

sorry, I couldn't resist...
* added a few very small changes to make the tab sliding work perfectly
* added a comment on the purpose of WindowLayer::fLastMousePosition and
how it is supposed to be used to have the mouse cursor stick to what
is being dragged
* TODO: the tab offset doesn't necessarily have to be on [0..1], as long
as we update it during window resizing to keep the relative position


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


# 382084bd 23-May-2006 François Revol <revol@free.fr>

The return of the long awaited for Sliding Tabs, that even Linux users envy!
Needs some cleanup, passed values should be inside [0:1].
Need to make sure changing the title doesn't reset the tab to left.


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


# e6b19d1f 05-May-2006 Stephan Aßmus <superstippi@gmx.de>

removed unnecessary call to ConstrainClipping(), the drawing functions that take a color are reserved for the server and ignore clipping

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


# e647873a 01-May-2006 Stephan Aßmus <superstippi@gmx.de>

implemented TODOs from Desktop::ActivateWindow():
* If the window is on another workspace, the workspace will be
activated or the window will come to the current workspace
or nothing will happen depending on the windows flags. Tested
with WonderBrush, but I just now realise that it will also
fix activating a window in the Deskbar, which is on a different
workspace.


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


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

Finally removed SERVER_{TRUE|FALSE} and lots of other unused constants from ServerProtocol.h.


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


# 6d5488e1 25-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* There is now a server_read_only_memory structure that is placed in a (surprise!)
read-only area shared between the Desktop and all applications.
* Right now, this area only contains the desktop colors, ie. B_PANEL_BACKGROUND_COLOR
etc.; ui_color() no longer needs to ask the server for these colors.
* The ui_colors are now maintained by DesktopSettings, though ColorSet is still there.
* The default colors are now hardcoded once and for everyone in InterfaceDefs.h, ie.
the app_server uses them as well.
* Desktop::Init() can now also return an error (but that is not yet accounted for).
* Cleaned up InterfaceDefs.h.
* Fixed wrong include in moreUTF8.h.


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


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

Activating a window with B_AVOID_FOCUS set no longer changes focus - this prevents
the desktop window from losing focus when a menu opens.


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


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

Desktop::SendBehindWindow() now checks if the window is on the current
workspace, and do nothing if not. This fixes bug #442.


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


# 68b599fb 14-Apr-2006 Jérôme Duval <korli@users.berlios.de>

reusing the old settings message is a good idea (thanks Axel!)
we simply remove color data before storing the workspace color


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


# 8be3635f 14-Apr-2006 Jérôme Duval <korli@users.berlios.de>

don't reuse old workspace settings, store method expects an empty message


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


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

* When changing a window's feel, it's now also moved to the front if
necessary.
* Also, newly exposed window areas are now refreshed when a change
of feel also changed the window order.


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


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

* Changed window hierarchy: menu windows are now always on top, then come modal
all windows, and after them floating all windows. This is different from BeOS
(where floating all windows are on top of modal all windows), but the way its
now seems to be more logical. This fixes bug #453 - there remains a problem
with open menus, though, but that has to be solved differently by introducing
a new feel.
* Also, modal app windows are now blocking floating app windows.
* Simplified WindowLayer::Frontmost() and Backmost() a bit, moving more stuff
into HasInSubset().


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


# 82081c70 12-Apr-2006 Jérôme Duval <korli@users.berlios.de>

improved version
though the first workspace color isn't kept between boots


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


# 190b4fa4 12-Apr-2006 Jérôme Duval <korli@users.berlios.de>

hopefully implemented makedefault in Workspace::SetColor()


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


# 39c9925f 07-Apr-2006 Stephan Aßmus <superstippi@gmx.de>

* implemented a BRegion pool per WindowLayer which is supposed
to cut down on BRegion related allocations, cannot really tell
if it speeds things up
* used the new BRegion pool in WindowLayer and ViewLayer whereever
a BRegion was used on the stack
* fixed the debugging stuff in MultiLocker - it will get you into
the debugger if you
- try to nest read locks
- try to write lock when your are a reader already
- don't match up nested locks when your a writer
-> but only if you #define DEBUG 1 in the .cpp, is off by default now
* went over WindowLayer, ServerWindow, Desktop and a few other places
and fixed the locking for use with the MultiLocker, the "a reader can
not become a writer" is especially tricky, feel free to review the
changes
* activated the MultiLocker, I tested this quite a bit, if there are
problems simply turn on DEBUG and you should drop into the debugger
right where the problem is... hope all is good


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


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

* The background is now repainted on workspace switch in case the background
color differs. This fixes bug #373.
* The workspaces window is now invalidated when the workspace color is
changed, so that it shows the correct color then.


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


# 150e5ed5 15-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* When the current focus window was closed or invisible, we used to
chose the front window as our next focus window - but this proved
to be problematic with B_AVOID_FRONT windows. Therefore, we now
simply chose the top-most window as the next focus window.
This fixes bug #281, and potentially also fixes bug #181.
* This also revealed another bug in SetFocusWindow(): when the window
to have focus already had focus, but were hidden before, the focus
did not change; if that window was subsequently removed, the app_server
would have crashed.


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


# 88962660 13-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Now moves with absolute coordinates instead of relative, which makes moving
windows to other workspaces so much easier that even I managed to get it
right...
* Moving windows on another workspace is now working as well.
* Fixed a positioning bug in Desktop::SetWorkspace() - was only visible in
case the window was in more than one workspace, but not in all.


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


# 14fe11cf 13-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented moving windows around via the Workspaces app. However, you
can't move them to another workspace, and you currently don't see a
window moving that is not in the current workspace. (this fixes bug #135)
* Desktop::SetWindowBehind() didn't update the WorkspacesLayer.
* Changed Desktop::MoveWindowBy() to be able to move window on any workspace.


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


# e2c5e775 12-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed a crashing bug Stippi's StressTest revealed: hidden (and especially,
removed and deleted) windows must not be the mouse event window (ie. while
dragging or resizing the window).


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


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

* Fixed a possible locking bug in Desktop::WindowAction().
* Cleaned up locking a bit.


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


# 87b1f40c 09-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Fixed misbehaviour of AS_SET_CURSOR: it will no longer set the mouse cursor
when it's not over a view of the application.
* The application cursor is no longer applied when the mouse cursor is over
the border (or tab) of a window.
* Gave up and imitate BeOS behaviour: the mouse cursor now always get the
shape the view below dictates, ie. it will no longer fall back to the
default cursor outside the focus window.
* The window is now set to the default in case there is no window under it
at all (ie. if Tracker isn't running).


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


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

When the last window was removed with floating windows on screen, they wouldn't
be closed.


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


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

B_AVOID_FRONT window were ignored when activating a window, and thus, menus could
steal the focus of the focus window.
This fixes bug #181.


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


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

various changes to handling custom cursors:
* all cursors owned by a team are visually different,
or (iaw) an already existing cursor is reused when
it is set by the client again
* changed various occurances of cursor data from "int8*"
to "uint8*"
* ServerCursors also remember the R5 data from which
they were created
* the reference counting and destruction of
ServerCursors changed: The cursor knows it is attached
to a CursorManager and one can simply use
ServerCursor::Acquire() and Release() and the reference
counting and everything is being taken care of
* destroying a ViewLayer will now correctly release a set
ServerCursor
* fixed a race condition when setting a cursor through
BView::SetViewCursor(): If the client code looks like this:

BCursor cursor(cursorData);
someView->SetViewCursor(&cursor, false);

there is a relatively high chance the BCursor destructor
told the ServerApp thread to destroy the cursor before
the ServerWindow thread got to "acquire" the cursor for
use by the view layer. The very same problem is likely the
reason that SetViewCursor works to unreliably on R5, even
when the "sync" flag is set to "true" (although it should
theoretically work in that case).

all these fixes make WonderBrush work fine again with the
new support of custom cursors.... coded by axeld and myself
(the joys of pair programming :-)



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


# 36e8fa61 15-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

The keyboard focus is now always updated if the message is a B_[UNMAPPED_]KEY_DOWN or a
B_MODIFIERS_CHANGED message.
This fixes bug #175 (which was probably caused by a bug in our old BMessage implementation,
see TODO item in line 141).


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


# 966fbea6 13-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

A work-around for the Tracker desktop redraw problem of the previous change.
Should probably be cleaned up a little. This fixes bug #146.


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


# 3dcbe9fc 13-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

Implemented redrawing the desktop after color changes. Right now, it only works
correctly when Tracker is not running; obviously, the background is cleared in
Tracker before it had the chance of changing the view color.
Maybe the app_server needs to detect the background view of the desktop and
change the view color manually :-/


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


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

* Implemented private functions do_minimize_team(), and do_bring_to_front_team()
used by the Deskbar (for "Hide All" and "Show All"). The latter doesn't work
correctly yet, though, it just maximizes all windows of that application.
* Added a TODO to ServerWindow AS_MINIMIZE_WINDOW on how to make it work correctly.


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


# ebae3c7d 09-Feb-2006 Stephan Aßmus <superstippi@gmx.de>

this fixes Chart leaving dirty stars in BDirectWindow mode... at least on my machine. Looks like BDirectWindow resizing is notably smoother on Haiku btw. :-)

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


# b5182fe0 08-Feb-2006 Stephan Aßmus <superstippi@gmx.de>

don't blit stuff arround on screen when moving or resizing invisible windows, this bug was most visibly triggered when navigating menus, since the menu window was reused and moved and resized when it was invisible, weird things could happen on the screen...

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


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

Stupid me - thanks to Michael Lotz for pointing that out :-)


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


# 2a472699 09-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

SetWindowFocus() could reset the focus of a window that already had focus.
This fixes bug #128.


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


# 8527f8ff 06-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

The display resolution is now saved and restored. Probably doesn't handle non-default
modes right yet.
The settings are stored in B_USER_SETTINGS_DIRECTORY/system/app_server/workspaces.
They are currently saved as a flattened BMessage - we might want to switch to the
driver_settings format, though.


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


# 195e980e 05-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* Cursors are now reference counted, so it shouldn't be possible anymore
to delete them accidently :)
* You should no longer call HWInterface::SetCursor(), but the new Desktop::SetCursor()
if you need to change the cursor.


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


# 73b3ea3c 05-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed a few more uninitialized variables.


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


# 47f1b81c 05-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* fCurrentWorkspace wasn't properly initialized.
* Removed AS_SET_SYSCURSOR_DEFAULTS handling for now.


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


# 7023b103 16-Jan-2006 Stephan Aßmus <superstippi@gmx.de>

I took the liberty to revert Stefanos patch in 15953 since you all seem busy, it is ok and even required for the Desktop window to be able to have focus

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


# 3532dd20 15-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Now the kDesktopWindowFeel means also that the window doesn't want focus.

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


# 74ae3248 11-Jan-2006 Stephan Aßmus <superstippi@gmx.de>

* when the parent ServerApp of the focus window changes,
it's Activate() method is called, if there is no
new focus app, the cursor is unhidden for safety. The
most notable difference: After having run a screen
saver, the cursor will be visible again.


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


# a342fafc 03-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Undo 15810 again; it messed up the window lists (as WindowLayer::InWorkspace() and WindowLayer::Workspaces() must be in sync).
Might reveal other problems in this area, that are worth looking into.


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


# 574af559 03-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Floating windows start with 0 workspaces - probably didn't matter, though, as
freshly added windows are hidden anyway.


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


# cd2b129d 29-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

* removed superflous LockSingleWindow() from WindowLayer::MoveBy()
and ResizeBy()
* WindowLayer::SetSizeLimits() needs to be called with the
AllWindows lock held
* I was observing weird behaviour with "unclickable" windows
that I might have fixed by explicitly excluding invisible
windows from Desktop::WindowAt(), there might be something
wrong with the "current" window list though, Axel would know
* finally found the problem with "delayed background clearing"
* enabled delayed background clearing and removed unnecessary
code. It should be more efficient, since it clears larger
areas at once, and it solves the problem of views unable to
draw into regions that are pending for another update - among
other things, updates in resizing windows are more fluent,
especially for B_FULL_UPDATE_ON_RESIZE views. "Cut off" scroll
bars should no longer appear when the view being scrolled takes
too long to redraw.


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


# 8f30140c 21-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

fixed opening windows in other workspaces than the current, keeps the window lists valid

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


# ef4635a3 20-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

added a few comments

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


# 270b7f58 19-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

removed unnecessary locks

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


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

Windows now receive B_WORKSPACE_ACTIVATED and B_WORKSPACES_CHANGED messages again.


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


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

Renamed Write[Un]lockWindows() to [Un]lockAllWindows(), and Read[Un]lockWindows() to
[Un]lockSingleWindow().


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


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

The fWindowLock is now responsible for all window activities - no need to sometimes
lock the Desktop itself, and sometimes not - that also fixes some potential deadlock
situations.


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


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

The Workspaces window is now updated again. Only mouse clicks don't work yet.


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


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

* SetFocusWindow() now makes sure no hidden window is taken as focus window...
* When switching workspaces, usually the focus switches to the front window.
This no longer happens in case a floating window had focus and is still visible
in the new workspace - in that case, focus is kept with the floating window.
* SetFocusWindow() now chooses the topmost window in case the specified window
has either a modal or there is no front window.
Desktop::RemoveWindow() now makes sure the window is hidden before removing it.


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


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

Minor cleanup.


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


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

If the focus window became invisible because of changing its feel, focus is now
reset to the front window.


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


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

* SetWindowFeel() now respects the position of the window, and changes it, if necessary.
* renamed workspaces_on_workspace() to workspace_in_workspaces() (was even wrong before).


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


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

A couple of changes related to modal and floating windows:
* Desktop::SetWindowFeel() is now working, but doesn't respect the window
position yet (ie. floating windows would have to be moved to front).
* WindowLayer::Workspaces() now always reflects exactly the lists it's in
(at least after Desktop::AddWindow() has been called). WindowList::AddWindow()
and RemoveWindow() now update this flag to be correct at all times.
* Fixed Desktop::_ChangeWindowWorkspaces() to not set the current workspace
for windows that are not on the current workspace, and vice versa.
It also would hide windows that were already hidden, and tried to show
windows that actually were hidden (did no other harm than triggering
a rebuild of the global clipping).
* Floating windows now work as expected.
* Desktop::SetFocusWindow() won't give a window focus that has a modal.
* Renamed OnWorkspace() to InWorkspace().
* ServerApp::InWorkspace() now works correctly, added ServerApp::Workspaces()
as well.
* WindowLayer::SubsetWorkspaces() returns the workspaces mask this modal or
floating window should be in.
* New window flag B_SAME_POSITION_IN_ALL_WORKSPACES should work as well.
* Floating and modal windows now have always set this flag.
* Added a WindowList::HasWindow() method.
* Desktop windows (windows with the desktop feel) can now have focus again
(I accidently broke that before).


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


# 939fb407 08-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

fix scrolling of BViews that rely on app_server painting the background, remove a forgotten debug output in ViewLayer, reimplemented setting the window title during runtime, fix Decorator redraw on pressing buttons - though I was lazy on that one... it works, but as the TODOs say, it would be better integrated directly in the Decorator class than being handled by WindowLayer

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


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

Windows currently being dragged now follow workspace switches.
Desktop::_ChangeWindowWorkspaces() and SetWorkspace() didn't lock the window list,
but should have.


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


# 799c100e 08-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

That would be a bug indeed.
* ShowWindow() and HideWindow() now also work correctly for windows not
on the current workspace.
* Reverted WindowList::RemoveWindow() - if it is used wrongly, it should
better crash the server for now, so that we can iron out the bugs.


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


# 48ccf5ab 02-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Some work to get modal/floating windows back:
* B_{FLOATING|MODAL}_ALL_WINDOW_FEEL now works as expected
* reintroduced the concepts of subsets of modal/floating windows - does only
work correctly for subset "all" window feels.
* RootLayer::_SetFront() now deals correctly with modal windows
* renamed RootLayer *WindowLayer() methods to *Window()


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


# 57be2866 01-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

* when moving/resizing windows on another workspace, the Workspaces window
has to be udpated anyway.
* some work towards being able to set a window's look/feel/flags on-the-fly.


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


# 19d801a6 01-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Moving/resizing is now routed over the desktop as well.
This also allows the workspaces layer for these actions, which is now done as well.


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


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

* the Workspace class is now hidden and put into Workspace::Private; the new
Workspace class is a simple accessor to this class that takes care about
locking (currently, it's just the desktop lock, maybe it'll stay that way).
* WorkspacesLayer now displays the window thumbs again.


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


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

Forgot to remove the Unlock(), thanks to Stephan for pointing this out.


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


# 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


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

Added a bit of documentation to the EventDispatcher.


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


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

Now sends B_SCREEN_CHANGED messages to all windows when the screen resolution changes.


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


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

* Got rid of the frightening Layer::fCurrent/RootLayer::fWinBorderIndex as well as
NextChild() and PreviousChild() - the current WinBorder list is now rebuilt on every
change; this is not perfect, and only a temporary solution (but cleaner than the
previous one).
* Introduced Layer::PreviousLayer()/NextLayer() methods that return the previous resp.
the next sibling.
* Moved {show|hide}_winBorder() into {Show|Hide}WinBorder() and got rid of the former.
* Renamed Layer::fServerWin to fWindow.
* removed some unused stuff, minor cleanup.


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


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

Next big step in the event handling:
* RootLayer's mouse event processing is now at its minimum - the
EventDispatcher handles them now. As a result, a window will now
get only one message per event.
* RootLayer adds "_view_token" to mouse moved messages that specify
the view currently under the cursor.
* There is now a mouse event layer in RootLayer that gets preferred
when it's set - this is now used for the window moving instead of
the previous mechanism.
* changed the previous DistributeMessage() to an UnpackMessage()
method following Adi's suggestion.
* caveat: some things might be functionally broken in RootLayer now
because of removing the mouse notification stuff.
* "be:transit" handling is now done completely client side by
BWindow::_SanitizeMessage(() (similar to what the input_server does).
This should also make the mechanism pretty robust, since every
B_MOUSE_MOVED message can now trigger the view transit (in case a
message is lost). B_WINDOW_ACTIVATED messages should be generated
client side as well.
* renamed AS_LAYER_GET_MOUSE_COORDS to AS_GET_MOUSE as it's not a
layer specific command, and also gets the mouse buttons.
* B_MOUSE_* messages from the up server now contain only a "screen_where"
field; "where" (in window's coordinates) and "be:view_where" are
added in BMessage::_SanitizeMessage().
* messages that don't have a valid target in the looper are now
dropped instead of being sent to the looper - this should be done
in BLooper as well, though.


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


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

The Desktop's message port now gets the same name as its looper.


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


# 6c17d025 15-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* Introduced a new handshake between input_server and app_server, and some
temporary handling code in the app_server.
* RootLayer no longer creates the input_server messaging port - this is now
the responsibility of the input_server.
* Moved AS_CREATE_[OFFSCREEN_]WINDOW from ServerApp::_MessageLooper() to
_DispatchMessage().
* The RootLayer thread is now started as soon as the input_server is there.
* removed or disabled any input_server stuff in the AppServer class.
* removed old message commmands to the app_server.
* Removed the R5_CURSOR_COMM and HAIKU_APPSERVER_COMM definitions: the
input_server is now automatically built correctly depending on the target.
* InputServer::EventLoop() plays now safe and checks for error conditions.
* InputServer::EnqueueDeviceMessage() seems to leak memory, added TODO about
this.
* InputServer event loop messaging uses ports for inner-app communication - why?
* The InputServer event loop thread is no longer killed on exit, it just quits
when its port is gone.
* Minor cleanup in input_server.


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


# 8fbbd37f 08-Nov-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added some code for notifying client BDirectWindows that the window was moved or resized. Currently commented because of other problems. Looks like the windows bounds are not changed if a MoveBy() is called before the window is shown. Removed unneeded includes. Small changes

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


# 6ed89418 04-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

renamed DisplayDriverPainter.* to DrawingEngine.*

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


# 58468dfe 04-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

first step of geting rid of abstract DisplayDriver base class for less development overhead, DisplayDriverPainter is renamed to DrawingEngine

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


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

* the FontManager is now a looper (but doesn't do anything useful yet).
* moved the system default font functionality into the DesktopSettings class.
* ServerFont::SetStyle() is now a public method.
* Improved font fallback routines: they will never end up without a font if
there is at least one font installed.
* fixed some minor bugs in the DecorManager.
* Decorator now get a DesktopSettings object passed - dunno if that's a good
idea (since we'll have to open the DesktopSettings header), but it works
for now (and something like this is probably needed anyway).
* a clean ServerFont is now set to the system default font - and not to the
(user chosen) desktop default font anymore (since the font manager doesn't
know about that one).
* Improved font directory scanning in the font manager a bit, it's now using
find_directory() instead of hard-coded paths.


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


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

Got rid of sDesktop.
Moved AS_ACTIVATE_APP over to Desktop. _CursorThread() is currently dysfunctional (but not enabled anyway).
Minor cleanup (Desktop::WindowList() is now a BObjectList).


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


# 3ddebe7e 21-Aug-2005 Michael Lotz <mmlr@mlotz.ch>

Moved the CursorManager over to the Desktop too.
Maybe the CursorManager should be used to set the cursors directly instead of using
fDesktop->GetCursorManager.FindCursor() and then fDesktop->GetHWInterface()->SetCursor()
in ServerApp.cpp.

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


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

The Desktop class now inherits from MessageLooper as well, the AppServer
class runs it, too.
No real message processing is done yet, though.


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


# 22137825 17-Jul-2005 Michael Lotz <mmlr@mlotz.ch>

All cursor related changes:

* Moved setting the default cursor from ServerScreen to Desktop
* Getting the default cursor is now done using the CursorManager
* Removed outdated setcursor from SysCursor.cpp (we have a new implementation by now)
* Renamed SysCursor.cpp to CursorSet.cpp as that's what it is
* Moved headers/private/app/SysCursor.h to headers/private/servers/app/CursorSet.h
* Removed some unneeded header includes along the way

There remains {set|get}_syscursor now in CursorSet.cpp. Serverside for these are not implemented
and they are obvious hacks. Do we need to keep them?
Also this commit _would_ break Appearance, but 1) all the related code is currently commented out
with the comment "cursor set management belongs in another app" and 2) it is already broken
because of ColorSet.

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


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

Extracted the settings stuff from the Desktop class. If you now need to access
the desktop's settings, you have to do something like this:
DesktopSettings settings(desktop);
settings.SetMouseMode(mode);
The advantage of this is that this object is fully locked, and cannot lead to
corrupted settings anymore. Also, the settings will stay the same until you
delete the object again.
Updated all accesses to use this new API.
Removed no longer used FFM messages.
Implemented AS_{GET|SET}_MENU_INFO for future use.


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


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

First baby step to a restructured app_server:
- introduced new ScreenManager and VirtualScreen classes
- removed screen handling from RootLayer
- removed multiple screen/root layer stuff from Desktop, it's
now using a VirtualScreen object instead


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


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

Stippi's commit accidently changed the initial screen size.


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


# 94fa2bd2 25-Jun-2005 Adi Oanca <adioanca@nowhere.fake>

inlined a few methods in header file, otherwise app_server would not build

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


# 3dcb3b07 23-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

Added some root layer locking in ServerWindow.cpp when accessing the layer tree. Moved HWInterface management out of DisplayDriverPainter and into Desktop. Removed all the directly hardware related functions from DisplayDriver API. They just called the same HWInterface functions. Now DisplayDriver is much cleaner and ready for being attached to a yet to be written BitmapHWInterface. Clean up of the display mode stuff in Screen and the View-/AccelerantHWInterface. Frequency is now regarded on Haiku. AccelerantHWInterface::GetModeList now works before SetMode has been called. Added MultiLocker from the sample code. HWInterface uses it now in preparation to being used from multiple instances of DisplayDriver.

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


# 54cc0f1b 16-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

reverted some unintentional changes

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


# 99b9d5ac 15-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

a new state begins life as a copy from the previous state, fixed Scale(). Note that BoundsOrigin() (and therefor Scale()) is called _a lot_ so we should cache the value! I started to work on this, but our lack of encapsulation strikes again... Layer::fLayerData is used directly all over the place.

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


# 0aa69a9c 07-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed the crashing bug when quitting the app_server.
The display driver is now owned by the Screen object.


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


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

Made some necessary enhancements to class Screen; the app_server also
has to care about refresh rates. Also changed Screen::GetMode() (formerly
Resolution()) to return all interesting values, so that hopefully no one
will call it anymore like RootLayer::SetScreens() did.
Greatly improved the horrible RootLayer::SetScreens().
The app_server is now able to deal with failing HWInterface::SetMode() calls;
in this case, it will fall back to the hardware's current mode. This now
also works correctly in combination with the vesa driver, so that you don't
have to compile the app_server with the same resolution you boot in anymore.
SetMode() now always returns if it succeeded or not.
Renamed RootLayer::fScreenXYResolution to fScreenWidth/Height respectively.
Removed the useless DisplayDriver::DisplayMode() method.
Added B_GET_DISPLAY_MODE to the required accelerant hooks.
Some minor cleanup.


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


# 55d6f1b7 25-May-2005 Stephan Aßmus <superstippi@gmx.de>

Many efficiency improvements to text rendering. Moved stuff from Painter into AGGTextRenderer which didn't belong in Painter. AGGTextRenderer now has an embedded transformation, which expresses the font rotation and (in future) shear settings. Removed direct support for BBitmaps from Painter (supposed to draw ServerBitmaps). Tested drawing of bitmaps other than B_RGB32. (only B_CMAP8 and B_GRAY8 so far, but they work). Right now, these colorspaces are supported by on the fly conversion. So every colorspace supported by BBitmap::ImportBits() should work, which are a lot more than the R5 app_server can display.

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


# 7b58474a 25-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Beautified some odd code (like "a ? a : NULL" to "a").
Applied our coding style guide.
No functional change.


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


# d53639ce 21-Apr-2005 Adi Oanca <adioanca@nowhere.fake>

Implemented support for BWindow::SetFeel()

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


# 3dea4bb6 18-Apr-2005 Stephan Aßmus <superstippi@gmx.de>

cleanup the defines, move old DisplayDriver implementations out because they are currently unused and won't build

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


# b176b6b4 12-Apr-2005 Stephan Aßmus <superstippi@gmx.de>

The DisplayDriverPainter is now also the default on Haiku. The DisplayDriverImpl stuff is left out for now.

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


# 8940f93c 01-Apr-2005 Stephan Aßmus <superstippi@gmx.de>

AccelerantHWInterface now uses a MallocBuffer as RenderingBuffer for the back buffer instead of a BitmapBuffer, which under Haiku does not work.

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


# 507c1efe 29-Mar-2005 Michael Lotz <mmlr@mlotz.ch>

I didn't want to mess with the screen resolution, sorry.

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


# 73fc6713 29-Mar-2005 Michael Lotz <mmlr@mlotz.ch>

Choose headers according to DISPLAYDRIVER, too.

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


# 9c59f2f2 29-Mar-2005 Stephan Aßmus <superstippi@gmx.de>

fixed app_server build, though I don't exactly know why that fixes it

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


# d3db964e 29-Mar-2005 Stephan Aßmus <superstippi@gmx.de>

code refactoring, moved common stuff into the base class

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


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

Made DISPLAYDRIVER a true compile time option.


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


# e0bb2421 28-Mar-2005 Stephan Aßmus <superstippi@gmx.de>

whoa - how did this even work?

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


# 5cdd7029 26-Mar-2005 Stephan Aßmus <superstippi@gmx.de>

use a DisplayDriverPainter version if config says so

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


# a850bd1d 25-Mar-2005 Stephan Aßmus <superstippi@gmx.de>

added Painter to the app_server build and fixed the Jamfile to include the drawing subfolder for header search path

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


# 96b832ac 25-Mar-2005 Michael Lotz <mmlr@mlotz.ch>

No need to endless loop here.

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


# 0653d45f 25-Mar-2005 Michael Lotz <mmlr@mlotz.ch>

Adapt to new location of display drivers

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


# fa6fca91e699c19c4240b2d1aa2b5d613681c356 21-May-2015 Axel Dörfler <axeld@pinc-software.de>

app_server: Fixed some send fake mouse event issues.

* Activating a window never send a faked mouse message. This was
noticeable when switching windows using the keyboard; if you then
scrolled with the mouse wheel you could scroll in the previous window
still.
* Also, using MouseEventWindow() in _SendFakeMouseMoved() doesn't work
when you click the window to send it to behind: it's moved on button
press, but the mouse event window is only released on button release,
ie. too late.
* This is fixed by always using the current window under the mouse as
target for the fake event.


# c895d331c9c791de2a1ba9fac405ce9dd2ee3d3b 12-May-2013 Axel Dörfler <axeld@pinc-software.de>

app_server: added an ASSERT to Desktop::_Windows().

* So that something like #9595 should not happen again.


# 9e1a0720cb3f2e15944658003beac1db18bf5c09 10-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Fix FFM focus loss on window close

kFocusList is an invalid index for _Windows(). fWorkspaces would be
accessed out of bounds.


# 486aaa49f3cf67c1a1d10a199c2101b6069edc38 07-Feb-2013 John Scipione <jscipione@gmail.com>

Check to make sure lastFocus is not NULL before using it.

This prevents an app_server crash on startup for me most likely
introduced in hrev45252. (Just a few commits ago)


# 4db1a8c61d68370bc8cccadcb8793679774a7426 07-Feb-2013 Axel Dörfler <axeld@pinc-software.de>

app_server: reworked SetFocusWindow() logic a bit.

* The normal mouse mode now only uses the window that had focus last if that
window is one that does not support to be the front window (such as the
desktop).
* This should keep the logic of r41264 without the drawbacks (see #7280 for
more information).
* Added _WindowCanHaveFocus() method.
* This should fix #7630.


# 6078d891b4d0a31a04e00095fb123021685e4029 06-Nov-2012 czeidler <haiku@clemens-zeidler.de>

Move stacked windows to a different workspace correctly.

When moving a window of a stacked window group to a different workspace all windows in the stack have to be moved. This fixes #8855.


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


# d5df7842992cca54f767bb597dcd11a0e3a228b4 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed input server start fallback

After failing to start the input server by signature, the fallback
didn't append the input server name to the servers directory returned by
find_directory().


# 323b65468e5836bb27a5e373b14027d902349437 21-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Filtered flat import of Oliver's svn package management branch

Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.


# f33cf3fd44d0877037b3cf8f82c2b40f4189bf28 13-Aug-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Activating all windows in a stack caused flickering. The reason to activate all windows was to get all windows form a stack into the upper window layers, otherwise it was possible that the top layer stack window is activated but another window in the stack is at the bottommost layer position. Sending this window to the back does not triggered sending the complete stack to the back. The send behind call is now redirected to the top most stack window to ensure the stack is send behind.



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


# cd67c205ff3aae882046fc96fc181e3b601be500 09-Aug-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Only remove a window from the S&T group when the hide event is not triggered by a minimize call.



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


# cdb351d4a49f37ad47fbf01a6e44f8541da245d4 04-Aug-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

When activating a window also bring all windows in the stack to the front layer. I used the ActivateWindow method because there is some magic involved when changing the layer position, utilising this method seems to be a safe way to do it.



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


# 55fbf11fd7ac3b4c6002b4d8ff3ec2372fa5e8c4 02-Aug-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

If a window is hidden remove it from the S&T group. This happens when MediaPlayer goes fullscreen. Maybe not optimal but at least consistent with terminal which also left the S&T group in fullscreen mode. This is because the terminal has no decorator in fullscreen mode and thus can't be stacked any more (maybe this should be solved in the future...). Fixes #7895, #7896.



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


# 2dae355ecb8879c494b3ba19f506a581ced13b28 31-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix window stack api and Desktop::WindowForClientLooperPort lock assert.



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


# 8313747b531d9f5e80cb79966056782504fd1542 26-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

As done in move, resize only the top layer window. The top layer window resizes the lower windows separately.
Use auto locker.



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


# 6a0ed7da5303f3389cf954b24eda4c179f6a0a72 26-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Move S&T back into the app server.



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


# 7c5525e83489cc80600bc31d1a8be774bccd34c0 25-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Only allow windows with a normal thick border to S&T. Fixes #6647.



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


# 898878314d25b67a9be06dd6c5a92ae77481af74 24-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix todo and only unload listener from the last add-on.



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


# f4f30311aab9b2768d3ef7e590f85598298edfe0 24-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Cleanup app server directory a bit by creating a font and a decorator sub folder.



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


# bb2e9b06acb1783543442464561b7811892ee7e2 24-Jul-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add multi tab support to the default decorator as discussed on the mailing list. Windows can be stacked on top of one another. All windows using the same decorator instance. This makes it easier to draw the stacked tabs and makes it possible to design more fancy looks for stacked windows. This also helps to fix some issues in S&T, e.g. when activating one window in a stacked group all windows have to be activated to ensure that all tabs are on top. This causes some flickering in tracker.

* Each Window has a reference counted WindowStack class which can be shared between stacked Windows. To keep the Decorator separated from Window there is another tab list in the Decorator now. The index of the stacked Window in the window stack is the same as the index of the tab in the Decorator. Properties like title or window focus are managed on a per tab basis now. This mean when you set the title in the Decorator you also have to specify the tab id which is equal to the window position in the stack.

* When drawing the decorator its important that only the top window is doing the drawing. Also the top window drawing engine should be used.
Actually that is only a problem directly after a window is stacked and the other window has still a none empty dirty region. In this case we clear the dirty region of this window and stop the drawing (the top window will draw everything).

* Track if shifting of a tab is still ongoing, i.e. mouse still down.

* The key event filter called the DesktopListener without holding the window write lock. This probably caused #7801 and #7796.

* Commented out assert's in Window::SetScreen and Window::Screen. Add TODO because I'm not sure about the screen access.

This breaks all existing decorators again, sorry guys! Haven't looked into any other then the default decorator (and the SAT decorator). Will not fix the others in the near future so go for it! Since applications should be able to rely on S&T features the other decorator must be able to handle multiple tabs as well. A simple solution would be to draw all title bars in multiple rows. That probably looks quit poorly. Think the better solution would be to draw a tab interface in the title bar, e.g. like in KDE.



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


# 0d792bb3bb4b2009a9cdb1e07de63441522f0aca 19-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed input server start fallback

After failing to start the input server by signature, the fallback
didn't append the input server name to the servers directory returned by
find_directory().


# 3dfd9cb95ce45f59160d50975210bc55e3fc0709 16-Jun-2011 Oliver Tappe <zooey@hirschkaefer.de>

Flat commit of all changes from package-management branch in svn


# c30f4641fa1e02e400442fdee69500ad11e707f2 29-Jun-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Be more clean and use a auto lock, thanks Axel.



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


# ccc37bbb77bb55ddee1d4fa48a56ff0f9c738115 24-Jun-2011 Clemens Zeidler <clemens.zeidler@googlemail.com>

Don't forget to unlock when there is no desktop listener for the message.



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


# b46615c55ad2c8fe6de54412055a0713da3d610a 19-May-2011 Stephan Aßmus <superstippi@gmx.de>

Applied patch by Joseph "looncraz" Groover from ticket #7445.
This changes how Decorators are managed and applied. The app_server
no longer scans and maintains the available ones himself, but is
simply asked to load a Decorator add-on from a provided path.
The Decorator scanning is moved into DecorInfo and DecorInfoUtil,
private classes in the InterfaceKit. The bin command 'setdecor'
uses those.
I cleaned up all the coding style violations that I could find,
removed chunks of code which didn't make sense (if you never put
a NULL pointer into a list, you don't need to check for this and
so on) and also cleaned up other passages for improved clarity
and simplicity.
I also tested the functionality and it works fine. Would even be
Ok to include in Alpha 3, IMHO. Thanks for the patch!


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


# 18ebc7918d71dee29e9796ccccf6d6e2cd7ea15b 18-Apr-2011 Axel Dörfler <axeld@pinc-software.de>

* Temporary commit to be able to test new focus behaviour, see #7280.


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


# 5c9b2476677acbc15d4b83ff11f22e93b453ab07 02-Jan-2011 Rene Gollent <anevilyak@gmail.com>

The cmd+` shortcut wasn't taking into account if the user was currently holding a
window with the mouse, and as such didn't take it along to the new workspace
as the cmd+F# shortcuts do. Fixes #7057.



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


# d65593aaa31fe782ac22ef9d11220b57ef08b638 27-Dec-2010 Michael Lotz <mmlr@mlotz.ch>

CID 1420: fTargetScreen was leaked.


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


# 673481f371ba7a67d52b68e8cf421a112ec5111d 27-Dec-2010 Michael Lotz <mmlr@mlotz.ch>

CID 2502: Check the FindMessage return which also safes a needless FindRect call
in the error case.


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


# 951366c59d800622aceee5118b032a3bc9152474 27-Dec-2010 Michael Lotz <mmlr@mlotz.ch>

CID 10231: Remove unused fInputPort member and initilize fShutdownCount, even
though it's used only in the special case of running as BApplication.


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


# 5377c49be42eb630ed3c3779c8c2e612fba1825f 23-Dec-2010 Michael Lotz <mmlr@mlotz.ch>

CID 4383 and 4384: Fix wrong checks of index values against kMaxWorkspaces that
could otherwise lead to out of bound access.


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


# 83cdf43f094acddb1d04e00b6dbc3977ae60d6fa 06-Dec-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Give the option for the desktop listener to "absorb" key events.
- Make the S&T groups navigateable by pressing the S&T key + arrow down/up. Arrow down means to send the active S&T group to the bottom. Arrow up means to rise the bottom S&T group to the front. If no S&T group is selected, in both cases the front-most S&T group is activated.



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


# 92998b409f7f71e6bd0ed1f3a56c3a8503e931bd 02-Dec-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Take the window when dragging the window and switching the workspace using the cmd + F1-12. Thanks Ingo.



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


# dc2dd40caa19cf5e504b5d8684482be5bb9c2437 02-Dec-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix #6925 and #6935.
- If the event window was set the window was moved also if the moveFocusWindow flag was not set.
- Use ProcessDirtyRegion to redraw the dirty region.



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


# 8689fe066ac0ad684ed0fba314b85e1ef47a2ce0 26-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added method SetManagementCursor() that allows to set a cursor that overrides
the normal cursor set with SetCursor(). Intended for window management
interactions.


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


# 427788e06f65f338595de54e91aa12792741e6d8 24-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* Extended the Desktop's MouseFilter to reset the mouse-down messages' "clicks"
field. It does that when the modifiers, the pressed buttons, or the click
target changes between the clicks, or when the distance between the click
points is >= four pixels.
* Adjusted the Window::MouseDown() and WindowBehavior::MouseDown() interfaces
and implementation accordingly (we now also pass and return click count and
click targets).
* Removed the no longer need multi-click handling from DefaultWindowBehaviour.

Fixes #6841 and #6867.


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


# 76107eeb117de4d4289dcb8942737ff7dc1e998f 24-Nov-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Added ModifiersChanged() hook to Window and [Default]WindowBehavior.


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


# e3feb1f8afc654158137c5aee869d8e22c892747 23-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Added a new AS_DUMP_BITMAPS command.
* Extended app_server_debug command to be able to send it, too.


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


# 9ff327dea3cf4ab84fa475ada4b073e311794654 19-Nov-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Make MessageForListener a bit more flexible, passing a fix ServerLink is sometimes not enough and a separate sender and receiver is needed.
- Add communication part to restore and save S&T groups.
- Fix call of GetDecoratorSettings listener hook.



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


# 1d219b3a253f44d73aa68cd42238d6fa451bb80e 15-Nov-2010 Axel Dörfler <axeld@pinc-software.de>

* Added AS_DUMP_ALLOCATOR command that dumps an applications memory allocator to
the syslog/serial output.
* Added app_server_debug command that currently just sends this command to the
specified teams.


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


# 4772e0b22ee19a8d7b9eda6aa4c5e758cdeec8d7 08-Nov-2010 Philippe Houdoin <philippe.houdoin@gmail.com>

Fixed a typo. No functional change.


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


# 7306ba04487ad91c70aa4511f450fab9a1fe5ce2 19-Sep-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Watch the window look and remove a window from a S&T group if the look changed to B_NO_BORDER_WINDOW_LOOK.



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


# cd4692196cc78c025a6ef453611e6d93a852b288 31-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Revert my last changes for now.



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


# d4272f888e3fde9f37b0d7ff81034301e7629d38 30-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Fix SendWindowBehind. It now sets the window layer position behind the specified window. If behindOf is NULL it is send to the bottom. Please review if it really was broken! At least it has not worked as I had expected and what I read from bebook.



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


# 52ede95cd7b0ece647027cca23b38f274473fb90 18-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

* Removed outdated USE_MULTI_LOCKER build option
* Don't acquire the read-lock in WindowForClientLooperPort,
since MultiLocker does not support nested read-locks.
Use an assert instead, however the method does not appear
to be used anywhere at the moment.


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


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

Add Notify* prefix to DesktopObservable hooks.



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


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

Lock WindowForClientLooperPort method and add comment that the window lock has to be held if accessing the a WindowList.



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


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

Add function to find a window in the app server by the client looper port id. Need this for the stacking api e.g. to stack window x on window y.



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


# c84e125085a87d34ac311f085c4eca870e2228b9 12-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Rework listener interface as suggested by Axel.



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


# 5483fa4e786707fca69c40d063cf1d0934fdec27 12-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Make RebuildAndRedrawAfterWindowChange public. This is useful when changing the window footprint from the outside. In this case RebuildAndRedrawAfterWindowChange recalculate the clipping and everything. Need this when I switch a decorator into a SAT stacking mode which is not a standard desktop operation. In this case the tab size is adjusted and also the window clipping need to be recalculated.
- First unregister listener reload decorators and then register new listener.



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


# d25313d44f06867b7559f980667e409087b0fde1 12-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add listener for the tab location.



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


# 691749c0a3ed74a009dde0b9dc8f9170cedd1325 05-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* Changed mouse down behavior for all mouse modes while dragging a window: now
a second click on the right mouse button will raise the window again.
* Desktop::SendWindowBehind() now locks a bit earlier, as some of the things
it did shouln't really be done without holding a lock (depending from where
it was called).


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


# d6734c083a96002fba135f0fe8dc0163699f7ce9 04-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Notify listener when they are registered and unregistered.
- First reload decorators and then the listeners. (my SAT listener caches the decorator when it is registered so the new one should already be loaded)
- Make the Desktop all window list accessible, help full when a listener is registered and want to iterate over the existing windows.



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


# b6ba2290fc6e584dbb45c4a2e9940b576a47be56 02-Aug-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

Introduce a new DecorAddOn class which provide the DecorManager with the needed Decorator, WindowBehaviour and DesktopListener.



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


# 0265102f8b6360c77c2b84f71e89924f9b2ad035 29-Jul-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

-Make Windows private again and lock the iteration over the windows when reloading the decorators.
- Make the used decorator persistent.



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


# bb86786a1bac06ffbb4baa03c4a9311283c835a2 28-Jul-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Make _Windows public.
- Reload all decorators when the decorator has changed in the DecorManager.
- Update copyrights.



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


# 860dfc9a77381099c8c9549e28865ed015886bf7 28-Jul-2010 Clemens Zeidler <clemens.zeidler@googlemail.com>

- Introduce a DesktopListener interface to the Desktop class (needed for SAT).
- Add a minimize method to desktop.
- Make _CurrentWindows public.



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


# 8104bd54225e61f18536dc6a41eb30fb7ae92187 02-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Always set the focus to the moved window on workspace switch.
* This fixes a part of ticket #5675.


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


# b6486ac2c04960dc21062e4c3bb20dd75f45e24f 11-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

bonefish + axeld:
* When moving a window to another workspace (using the mouse or the keyboard),
the fLastWorkspaceFocus array of the old workspace could still point to that
window.
* This could also lead to a stale pointer and might have caused crashes in
SetFocusWindow(). This should fix #5124, and its duplicates #5294, and #5688.


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


# a0b37b6e3852e63bd2746468411ca7827c900c25 11-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

Tried to fix all issues with running a DEBUG build of app_server.
* CopyRegion should not need the HWInterface to be exclusive locked.
* BitmapDrawingInterface does not need to be locked at all, since
it doesn't use a shared HWInterface instance.
* Window and Desktop should lock the HWInterface appropriately
before invoking CopyRegion() on the DrawingEngine.


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


# e59dc33e215e8ae0a90b051e88c70f8aaff296a0 07-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

* Added BCursorID enumeration in App Kit's Cursor.h and new constructor which
takes such an id.
* Reused the existing mechanism to to have hardcoded tokens for the system
cursors, i.e. removed cursor_which enumeration from ServerProtocol.h and
used BCursorID where cursor_which was previously used.
* Reworked CursorManager.h and CursorSet.h accordingly and removed some methods
that where intended to replace system cursors with client cursors, since
those would break the reference counting and forget to maintain the cursor
list.
* Replaced the cursors in CursorData.h/cpp with the new ones I just designed.
* Removed HaikuSystemCursor.h and HaikuLogo.h from the source, as those are/were
no longer used.

I hope I will not get too much beating for this one... :-) I know the new
default cursor is slightly larger, but I believe the old one was just too small.
Also I noticed that the cursor may be slightly too dark, at least the old one
seems noticeably brighter when compared side by side (the new one has a slight
gradient). That is something I may correct at least. Otherwise I hope nothing
is broken, I've tested in QEMU and so far everything works as intended.


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


# aeb689782ce5ced9d23144d982f3655425661297 15-Feb-2010 Axel Dörfler <axeld@pinc-software.de>

* Removed ServerCursorReference in favour of BReference.
* Simplified the Desktop::SetCursor() code a bit.


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


# f7d398285764fefcc26b9b9f9086c5e6e3358c30 03-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Always take the last window when choosing a new focus window in normal mouse
mode. This fixes focus issues as describen in bug #5020.


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


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

* Moved the B_NOT_MINIMIZABLE flag check into ServerWindow::NotifyMinimize()
as this fixes some more incorrect minimizations on the app_server side.


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


# 001731449e405167c6218737a986a298a020ead8 29-Nov-2009 Philippe Saint-Pierre <stpere@gmail.com>

Don't minimize windows (when hiding applications) if they have
the B_NOT_MINIMIZABLE flag. It should more properly fix #4337.



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


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

* We now store the last window having focus in a separate array, or else the
windows visible on more than one workspace destroy the FFM experience (ie.
restoring the last window that had focus on a workspace switch).


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


# 47212dddf5447c624a59a5445ceee4abfbf288b2 18-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Made the Alt-Shift-Fx behaviour consistent with Ctrl-Alt-Shift-Arrow (ie.
take the active window to the new workspace).


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


# 0296ba19bb829479d2b955b211509fb34324c84d 18-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* For dead keys, the keyboard input device now sends a B_UNMAPPED_KEY_DOWN
event.
* This allows applications to listen to keys independent to their dead key
status.
* The app_server keyboard filter now also check for B_UNMAPPED_KEY_DOWN.


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


# 842aad23f97a6f4ac6353529eaee2c57420a0a7b 18-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed focus behaviour of FFM on workspace switch - let SetFocusWindow() decide
which window to give focus, it already does the right thing.


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


# 85d512ed6583c516ce8d1e5999aabbb18e53a979 30-Oct-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Revert Stack & Tile patch (r33814) and first fixes done by axel (r33824, r33826)
The stack & tile feature developement & fixes would be done in
branches/features/stack-and-tile branch, until it's ready enough to be merge
into trunk.


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


# 23e00a25e2d8ba0c83be28d548c13e2bdfcbd5d7 29-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed millions of coding style violations introduced by the stack & tile
patch. Grmbl.


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


# ef831a1dc393b2008b35fc46c028d3466ce7634f 28-Oct-2009 Philippe Houdoin <philippe.houdoin@gmail.com>

Applied Stack & Tile patch by Hong Yul Yang, formely by Christof Lutteroth.


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


# b85716cbd9a7974483cf544f681d87ba34f7bf7f 25-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Not sure why Brecht changed the behaviour of FFM here. This should hopefully
fix most of the issues.


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


# c3d0a5e8a1fb6e79e543c9523c8c21e389904e04 25-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed the style violations introduced by r33732, nothing too bad, though.


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


# 926e63c8851f8e1d085981e69ef03f8e9cda1e65 22-Oct-2009 Brecht Machiels <brecht@mos6581.org>

* added click to focus mouse mode; right-click for bring-to-front and send-to-back
(might cause some regressions in FFM)
* made accept first click user configurable
* updated the Mouse preflet to use the layout kit
* removed the warp and instant warp modes from the Mouse preflet
* changed internal representation of mouse modes (warp modes moved)
* coding style fixes



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


# a406b1e6256df7dde6522a1834b0e9bc365056fc 21-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* When switching the workspace while moving a window around, that window got
added to the window list without considering its frontmost window. That caused
problems with all feels that were always on top, like
B_ALL_WINDOW_FLOATING_FEEL. This was causing bug #4700.
* Disabled the "previous window keep keyboard focus" heuristic - it doesn't
really work that well. There should be a central mechanism that detects active
typing that could also be used to disable touchpads.


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


# 931cd377aade563781849d3e6f91a9b635cd6753 07-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Added a new flag kAcceptKeyboardFocusFlag that allows B_AVOID_FOCUS windows
to still receive keyboard events. This is now used for menu windows (before,
the menu feel alone would trigger that behaviour).
* This also fixes bug #4691, as tool tip windows use the menu feel as well.


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


# b4a7d0bcc68d50015634e681bcc48315ed87e185 05-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Do not forward the Command-~ to the apps, like with the other workspace
switching keys.


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


# 68667bf48a9e29a2d142cb3308b606d80bee3c2d 04-Oct-2009 Michael Lotz <mmlr@mlotz.ch>

* Adding a remote desktop interface that operates on app_server drawing
primitives by providing a RemoteDrawingEngine and a RemoteHWInterface.
Not really optimized yet, still a bit WIP.
* Adding corresponding infrastructure like a blocking ring buffer and network
sender/receiver that are attached to the buffers to feed/drain them as well
as a RemoteMessage helper that provides a message based interface.
* Adding target screen concept to request an app to be run on a specific screen.
It's controlled by the TARGET_SCREEN environment variable which is added on
the app side and sent to the app_server.
* Right now only remote target screens are supported, in which case a new
RemoteHWInterface is created that tries to connect to the given host:port.
* Fix shape bounds when drawing, they need to be translated by the pen position
and converted to screen like the points as well. Wasn't visible though as the
bounds weren't used in the normal DrawingEngine.


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


# 60a981fbbea0c565df005fc6f82379f8e072c845 03-Sep-2009 Michael Lotz <mmlr@mlotz.ch>

When a focus locked window is hidden, we need to remove the focus lock.
Otherwise the focus cannot be changed to another window. In one case this could
have a severe sideeffect: When a window is quit it is hidden to remove focus and
remove it from screen. If this didn't work due to the focus lock, the fFocus
member would become a stale pointer after the window was quit and deleted. The
app_server would crash or corrupt memory on the next focus change. Easily seen
when moderately quickly clicking away a few alert windows.


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


# 2a0cda5017006d2345fb1afa6a94f38f2d4c257b 28-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Added proper locking to _ResizeToFullScreen().
* Desktop::{Move|Resize}WindowBy() could be called with zeros in which case it
doesn't have to do anything.


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


# 9fe35223cf4eb9714865152d62e8efc36b327fef 26-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* BWindowScreens had no sychronization mechanism whatsoever - since the
workspace activation message was asynchronous, whether or not the
BWindowScreen stopped drawing in time was pure luck (this also caused crashes
with the VESA driver, as that one unmaps its frame buffer during mode switch).
Introduced a new AS_DIRECT_SCREEN_LOCK protocol for this.
* In the long term, we should let BWindowScreen use the same mechanism as
BDirectWindows, though.
* Removed superfluous locking in BDirectWindow::_InitData().


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


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

* Resolved a TODO and got rid of Desktop::ActiveScreen().


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


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

* Shuffled methods around to match their location in the header.
* Made ScreenChanged() private, and renamed it to _ScreenChanged().


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


# 5e3f4c41a64d68b93b88e66bb00d6d4d5092c0e4 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* ServerApp now maintains a mask of workspaces with temporary mode settings,
and reverts the modes if the app goes away (ie. if it crashes).
* Desktop::SetScreenMode() also set the mode on the current screen, even if
it should have been set on another screen.
* Cleaned up the Desktop.h header.


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


# 5ce919497d2cc9aaa6d1f8f7dabb1007567812ad 21-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* The changed settings format (display mode instead of composed fields) actually
broke Desktop::WorkspaceFrame(), which I didn't notice before; Workspaces now
shows everything in the right dimensions, even if resolutions differ.


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


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

* Added a new AS_GET_SCREEN_FRAME function, as getting the frame via
AS_SCREEN_GET_MODE won't work with multi-screen support anymore, and is also
more overhead than needed.


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


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

* Moved PrivateScreen.h header to headers/private/interface.
* Desktop is now including it as well to be able to use the new
B_CURRENT_WORKSPACE_INDEX constant.
* Include order cleanup.


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


# 0eed9183061a7763972bc2589f9c43489cd078ab 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Rewrote screen configuration management: VirtualScreen doesn't have anything
to do with the configurations now, instead, there is a separated
ScreenConfigurations class that maintains all known screen_configurations
per workspace (and the Workspace::Private class has two of them, one for the
current modes, one for the stored modes).
* Added Desktop::{Get|Set}ScreenMode() methods, ServerApp now only calls those.
* Getting and setting of anything else than the current screen is now supported.
* This change also fixes that a temporarily set screen mode was not being
restored on workspace switch.
* Also, the Deskbar now seems to have the wrong location a lot, which is
something that should be easily fixable therefore. I will look into this next.
* Got rid of the unhandy screen_id structure server side, and in BPrivateScreen;
we now just use an int32 - the next API break should definitely replace the
screen_id with a simple typedef.
* Some cleanup.


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


# 02b6c95990a4fd1647d63898cfbe0ee79e11e008 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* VirtualScreen::RestoreConfiguration() now also takes care of collecting the
screens that actually changed their resolution, which simplifies the code
in Desktop considerably.
* Minor cleanup.


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


# 0d1d2de59bd3a650be18838adab815196ddeaaf3 20-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Desktop::SetFocusWindow() now takes kWindowScreenFeel windows into account,
and does not give focus to any window behind that one.
* Added TODO comment to the DefaultDecorator bitmap caching mechanism (although,
it really seems to be fast enough, anyway, at least once we remove no longer
used bitmaps).


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


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

* When a window changed its look/title/... we need to make sure the dirty region
we got in _RebuildAndRedrawAfterWindowChange() does not contain hidden parts.
* This eliminates the updates as seen in the WindowInvalidation test app, as
well as it fixes bug #4257.


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


# f98bacf6ca52679ea11700bf43681391c17612cf 13-Aug-2009 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved HandleDirectConnection From Window to Desktop. This should fix the
spurious off-window drawing of BDirectWindow. At least, it does here.


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


# c6906c2832dfea48b42e8443c07120468a71a1b9 31-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* In FFM mode, when a window was closed, or the workspace was changed, the
window under the mouse was given focus. This makes using FFM with the keyboard
alone very inconvenient to use, which is why now the window that previously
had focus will regain it instead; as soon as you actually move the mouse, the
focus is changed as usual.


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


# 69f9a367bc3ade44eaf73a5b1c51c079acf702cd 29-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* The app_server no longer uses workspace counts internally, but only columns,
and rows.
* set_workspace_count() now uses the logic formerly found in
WorkspacesView::_GetGrid() to determine the layout.


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


# 390b0f9486710ea54637b517b81a5ce39b81c0fc 28-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Added TODO about why the implementation of StoreConfiguratoin() is broken
if it were ever called for an inactive workspace, as our BScreen API in theory
allows you to do (not the BeOS API).


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


# 926b6fdb08db00c39090e0908c99ff524118a068 21-Jun-2009 Rene Gollent <anevilyak@gmail.com>

Fix style violation.



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


# faafd00c1a37b5ebb26e8238e31cdf4905cd1b60 21-Jun-2009 Rene Gollent <anevilyak@gmail.com>

Fix broken check for ctrl+cmd+esc that would result in any of ctrl+esc, cmd+esc or ctrl+cmd+esc triggering safe video mode, and as a side effect, prevent menus from being opened via keyboard.



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


# 83a9be236aed6086d359ccec49f2d7c40c07abc2 16-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Implemented switching to the fallback video mode when pressing
Command+Control+Escape.


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


# f680cfe2652f79b08ac178c648494b7beea2899e 02-May-2009 Axel Dörfler <axeld@pinc-software.de>

* The direct connection update in ServerWindow::{_Show()|_Hide()} is superfluous
since Korli's change in r30440.
* 80 character per line limit.


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


# 55423bfa2223dd6f345520b5dae4e8f4bd32bdae 26-Apr-2009 Jérôme Duval <korli@users.berlios.de>

send DirectWindow events when hiding or showing a window


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


# 4fba3522e02906506b6c713ef5b57d72e9458fef 11-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed src/kits/tracker/OpenHashTable.h. The shared version in
headers/private/shared is newer, though with small interface changes.
* Removed the unnecessary Debug.h include in
headers/private/shared/ObjectList.h.
* Adjusted sources using these headers, mostly by adding missing includes.
* Lots of automatic whitespace cleanup.


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


# 84b784b43d3e2b22526230347a44262b248d1a2c 24-Mar-2009 Axel Dörfler <axeld@pinc-software.de>

* Minor cleanup.


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


# 2f8465212f85f233e6cdc506a77786d9479e6f7a 28-Jan-2009 Karsten Heimrich <host.haiku@gmx.de>

* use client_window_info as suggested by Axel



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


# 320a952cdd563a6ae8237b0cc1f3e895ab6f9c9d 27-Jan-2009 Karsten Heimrich <host.haiku@gmx.de>

* extend Haiku specific client window info to include the tab height and border size



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


# a107d1676efac13cd456871cd9ae12fad273e860 19-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* Made the get_token_list() function behave the same way as under BeOS. This
simplifies the code in the Switcher, but has the drawback that the window
list is not "static" anymore, ie. the items in the window list of the Deskbar
will now jump around as in BeOS.
* However, EasyMove now works under Haiku as well out of the box, if that is
something we want :)
* Maybe we should instead add another parameter to the window list to make
it sorted or not; sorting the list as it's done now is much simpler and
faster on the server.


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


# f3bd277ed55d7d412582608716e86de968661b91 15-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* Moved the screen change to a later point, as the workspace-leaving message
did arrive after the change; now it's: leave workspace, change screen,
enter workspace.


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


# ea5c7202cb93f38844d60fa951e9a17ddb9c5e08 05-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* If a window was hidden during resize/movement, it would still be in resizing
or moving mode when it was shown again. Added a test app HideAndShow which let
you easily reproduce the faulty behaviour (with a previous version of the
app_server, that is).
* Minor cleanup.


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


# 790d3aee0a4ce8674458aab1a528082dcdeeed20 02-Jan-2009 Axel Dörfler <axeld@pinc-software.de>

* When the window to be activated isn't a normal visible window (ie. floating
or modal), we need to check if our effort to make it visible (by activating
its subset window) was successful. This fixes bug #3201.


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


# 27c43a2d8f20fd98050c6acd9abac970b1d4d7c8 08-Dec-2008 Rene Gollent <anevilyak@gmail.com>

Implement the missing pieces to handle per workspace display mode support.
Adjust Workspace view to correctly scale each workspace based on the
resolution of that workspace. This exposes one or two anomalies in other
places in the app_server code though which I wasn't able to track down.
This fixes ticket #693.




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


# 0a3f410f3040ce58777d262de98229a054e43f10 16-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a Desktop::BroadcastToAllWindows() method that sends all ServerWindows
a message.
* The DesktopSettings class is now using that to send the new
AS_SYSTEM_FONT_CHANGED message to all windows.
* The ServerWindow now propagates font changes to its decorator, causing it
to update its drawing. That means changing the bold font in the "Fonts"
preferences application will instantly change all window titles.
* Factored out a _RebuildAndRedrawAfterWindowChange() out of several Desktop
methods, simplifying some code.
* The DefaultDecorator no longer calls _DoLayout() twice (through SetLook()),
but instead calls the new _UpdateFont() method now also called by
FontsChanged(), and SetLook().
* BWindow::GetDecoratorSettings() now also includes "tab frame" BRect with the
exact footprint of the tab, allowing apps to know the size of the tab to
position itself accordingly.
* Automatic white space cleanup.


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


# 0c9593acdc880616c869aebc84be69d5403f32b0 14-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* Minor simplification and clarification.


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


# d02835660f6e033fa7e492ba5854448a16bb8945 14-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a method Desktop::_LastFocusSubsetWindow() which returns the last
window being the focus window that is a subset of the specified window.
* This is now used to bring the window to front belonging to a floating
or modal window (if on another workspace), ie. Desktop::ActivateWindow()
should now work with modal and floating windows.
* Fixed typo (in Window.cpp).


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


# c73be1e843d52d852cfae5aa94f0d2b12dfc5b93 07-Nov-2008 Axel Dörfler <axeld@pinc-software.de>

* When switching to a workspace a window is on in ActivateWindow(), only
consider the workspaces in the configured count.
* If the window is not on the current workspace after the workspace check,
always move it to the current instead. This lets windows on workspaces
outside of the ones currently configured show up on the current workspace
as if they had the B_NOT_ANCHORED_ON_ACTIVATE flag set.
* This fixes bug #3003.
* Minor cleanup.


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


# 40fa49e7b8af6dce20770bd0af873f3ad70789b8 03-Nov-2008 Stephan Aßmus <superstippi@gmx.de>

Oversight: When FFM is turned off, don't focus the window under the mouse
on mouse up if there was a focus-locked window.


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


# 21b40edd7531466fad9daa80dc440583492dec08 03-Nov-2008 Stephan Aßmus <superstippi@gmx.de>

Implemented respecting B_LOCK_WINDOW_FOCUS that a view can set using
SetMouseEventMask() from within it's mouse hooks. Among other things,
scroll bars won't stop scrolling in FFM mode now if you accidentally
leave the window with the mouse, something which is very likely.


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


# 4932bc5ea8b223dcce5214aa5d8485d703ae84df 21-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Added the BeOS feature that Command-~ (with American keymap) will switch
workspaces between this and the previous one.
* Note that this is mapped to a specific key on the keyboard (key 17), so
it will differ with the keymap, but will usually be the key below the escape
key.
* This closes ticket #2766.


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


# 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


# 64ba396fa7688395d5b0de121ff86636e9592f3b 16-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* When changing the workspace of a window, it's workspace position will now be
set to its current position if that is the only workspace it's in.
* This fixes missing windows on other workspaces in the Workspaces app after
boot, ie. before you had visited that workspace.


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


# d689f4578d9eacc7a45260e7d223e7fca53f1d7c 13-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Fixed a possible deadlock in Desktop::_ActivateApp(): since ActivateWindow()
will need to write lock the window lock, we cannot call it with the read
lock held.
* Added a TODO comment in _ActivateApp() on how we could handle minimized
windows.
* Added a WindowList::Count() method.
* Added a WindowList::ValidateWindow() that you can use to validate a window
pointer in case you had to unlock the list.
* Made FirstWindow()/LastWindow() const.


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


# ae0606be749b5b16f3ec706c24bcb488d7f5ac96 12-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Added two more private InterfaceDefs functions: get_application_order(), and
get_window_order() will retrieve the application respectively window order
on the selected workspace.
* Moved private BeOS compatible functions (as used by the Deskbar) into the
private WindowInfo.h header.
* Whitespace cleanup.


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


# a8f4e1d0fdc01577fb71a008cc41fe5f261fd380 12-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* _ActivateApp() did not lock the window list while traversing it.
* It will now first iterate through the windows on the current workspace to
choose the topmost window of this team (for this, it would be nice to have
a sorted list over all windows/workspaces).


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


# 547a7d1844566a29d3d2fc29a3fbc639ea0bc532 03-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Since ShowWindow() could call ActivateWindow() again as well, we should
better call Window::SetMinimized() before calling it from there.
* And since ShowWindow() calls _SendFakeMouseMoved(), we also better don't
call it with the window lock held, or otherwise we would potentially cause
a deadlock.


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


# 518056893e1fd490099cbf5ace9c0c2b69c698e3 03-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* BWindow::Activate() now also unminimizes a window if necessary.
* Removed superfluous white space.


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


# d2d52d31abb67ab338a4fbf102a880c55fda0fe1 01-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* Made _LaunchInputServer() more robust: when launching by signature fails,
we try its well-known location directly.


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


# bd2509c549c5aa5a456524754cddfb8eb0e4f888 10-Jul-2008 Axel Dörfler <axeld@pinc-software.de>

* Desktop::_UpdateFloating() and Desktop::_UpdateSubsetWorkspaces() both
assumed that there was only a single window that was responsible for the
workspaces of a floating/subset window. Of course, any number of windows
can make up the workspaces of those. This fixes bug #2506.
* Added a Window::InSubsetWorkspace() method to complement SubsetWorkspaces().
* Minor cleanup.


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


# b09e2f6f4bcda91da778d565b7a814841bad05a6 10-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

Patch by Andrej Spielmann (GSOC):
* Extend the app_server protocol by configuration options to turn
subpixel font rendering on/off and also make the glyph hinting optional
(aligning of glyph shapes to the pixel grid).
* Implement the setting in the app_server and also handle the persistency.


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


# 6aede71c0c98fc4bced0235ad84abbdcfa422d4f 29-Apr-2008 Ryan Leavengood <leavengood@gmail.com>

Resolve a TODO and fix another ancient bug, #386. Print Screen is now handled
by BWindow, no longer by the app_server. This should stop the "screen freeze"
effect.

This adds a dependency on libpng.so and libz.so to libbe.so. The same
dependencies and the PNGDump code added here can be removed from the
app_server. I am just waiting for a code review of this before doing that.

This implementation still does not give the client a chance to handle it
differently.


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


# ace2d5ee376ad7d772cd313781ea2f912409f299 02-Apr-2008 Stephan Aßmus <superstippi@gmx.de>

HWInterface::Cursor() and therefor Desktop::Cursor() accessed the
current cursor without locking, and did not add a reference while
using the cursor. I have tried to solve both problems by introducing
a simple ServerCursorReference class, which makes sure that the
reference count is properly maintained. There are only two places
where this code was even used, from within ServerApp and when taking
screenshots. Axel, you mentioned in #837 that the code is unsafe, is
this what you meant? This hopefully fixes #837, but it is very hard
to reproduce in the first place, I will close the ticket, but it should
just be reopened if ever encountered again.


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


# d8ebe6120343dfbf801e30be2a1ca2924b73041b 14-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

The fWorkspacesViews list now gets its own lock which solves a deadlock
problem when deleting Workspaces replicants.


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


# 092c62f0f114993910a6ba267b9670e0c56263e1 12-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Creating a Desktop can fail, in which case the app_server should not return B_OK,
and an invalid desktop message port...
* Desktop::Init() now checks if VirtualScreen::fHWInterface is valid, and exits
if not. This can happen if you don't have a graphics driver, and turn on on-screen
debug mode in the boot loader (such that you already see the messages from the
boot loader).


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


# 437b19277feacd48292ca9ec814a38da17e4eb89 08-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Removed severly outdated DebugInfoManager.
* More "layer" cleanup.


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


# 2c184b20ed06343ba39e3c84a9542c7069f9011d 08-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* The Desktop is now maintaining a list of workspaces views, and supports
more than one of them at the time.
* Changed ViewLayer::FindView() to FindViews() that collects all views
with the given flag set, not just the first one.
* Made ViewLayer::AttachedToWindow() and DetachFromWindow() virtual,
WorkspacesLayer now overloads them to register itself with the window and
the desktop.


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


# 9fb2c0f239dbcfce80b29e9e2cde0c6109aed540 06-Mar-2008 François Revol <revol@free.fr>

Fix tracing.


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


# 6ec72e838c7582268ebcf6c1b83d162d3f5f3e63 05-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* In normal mouse mode, the focus list is no longer used to find the
next window to get focus after the current one is gone. This fixes the
strange behaviour when using right-click to send the current window to
the back.
* When FFM is active, Desktop::SendWindowBehind() will now choose the
new focus window to be the one under the mouse, overriding the focus
list.
* Desktop::SendWindowBehind() will now also call _SendFakeMouseMoved()
if necessary.
* Removed Desktop::fFocusFollowsMouse; it was not used or
maintained anywhere.
* Minor cleanup.


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


# d01879e5a6b0ad0f2c77e6e0225e2576873ae07d 03-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Added a separate focus list that will contain all windows in the order
of the last focus.
* When choosing a new focus window, this list is now used to find the
new focus window instead of just choosing the next window in the
workspace list.
* With the normal mode mouse, this shouldn't change anything, but with
focus follows mouse turned on, this will behave much better if you
don't actually move the mouse - and it also fixes bug #1886.


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


# f9bbab8848383da363df67ea3e712c222d3708f0 24-Feb-2008 Axel Dörfler <axeld@pinc-software.de>

* First steps towards a more flexible workspaces view handling: the
workspaces view can now be any view in the hierarchy.
* Added private view flag kWorkspacesViewFlag that identifies such a
view - note though, that you must not remove a view before closing or
hiding its window for now (and that you still need to set the
kWorkspacesWindowFlag, too).
* Fixed Workspaces check for valid screen coordinates; after a crash, it
managed to open its window offscreen for me.
* Added a ViewLayer method FindView() that finds a view with the
specified flags set.


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


# 94fec641a7a8c3cf726d32525bd88808e53adeeb 19-Feb-2008 Michael Lotz <mmlr@mlotz.ch>

Implemented a small kernel debugger add-on that triggers a redraw of the
entire screen when exiting the kernel debugger. It sets up a thread that sends
a message to the (currently hardcoded) desktop message looper. The desktop then
does mark the whole screen dirty which causes a full redraw.
Since interrupts need to be enabled I went with an asynchronous thread and
releasing a request sem in the add-ons' exit hook.
Added the add-on to the image as it shouldn't hurt to have it for now.

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


# 45d0ea5605bd2bcf31fde62fd30b94176e2a783d 11-Jan-2008 Axel Dörfler <axeld@pinc-software.de>

Fixed two dirty region problems of the workspace switching code:
* If two intersecting windows didn't change their position but their
order, the dirty region wouldn't contain the region that would need
to be updated because of that order change. This fixes bug #827.
* When a hidden window was on the new workspace (but not on the old one),
its region would be included in the dirty region, but shouldn't have
been. This caused the app_server to update a larger region than
necessary.


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


# 737ce1c03c575393ea66268e91dfe4e5e671b5db 10-Jan-2008 Axel Dörfler <axeld@pinc-software.de>

* The keyboard target was always the first menu in the window list - no matter if that was hidden or not.
This fixes the bug described by Stefano in r23343.
* Therefore, I enabled cached menu windows again.


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


# 9a2d0cf6ff30e0ff887f5aaaf45fc80fa1723dde 03-Jan-2008 Axel Dörfler <axeld@pinc-software.de>

Applied patch by Anthony Lee: the user was attached to the font manager too
late, therefore, the DesktopSettings couldn't access user fonts. This fixes
bug #1691, thanks!


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


# 09a4122e4c67238112a8b3930a84638861d2a342 22-Oct-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Moved initialization of the system color map from AppServer to Desktop


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


# dd84f111b9cac2b7f1bae6802784a166a2e22dd9 18-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

Fixed a few potential deadlocks:
* in r22410 the unlock/relock was removed accidently from ServerWindow::_Hide()
before calling a desktop method.
* Desktop::ActivateWindow() no longer calls SetWorkspace() with the window lock
held.
* WorkspacesLayer::MouseUp() now uses the asynchronous version of SetWorkspace().
* AFAICT AS_HIDE_WINDOW, AS_SHOW_WINDOW, and AS_MINIMIZE_WINDOW don't need the
all window lock, reverted to standard single window lock.


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


# 8a3cfa2cf315cabd650bc02c61acf942d1eb68c3 01-Sep-2007 Axel Dörfler <axeld@pinc-software.de>

* Made menu windows behave differently than others: before, they were just
always put between window screens and modal all windows (before floating
all ones), so a BWindowScreen couldn't have menus at all.
Now, they behave more like floating app windows, just that they float above
all other application windows, such that all window feels (also BWindowScreen)
can now have menus.
* Reenabled keyboard redirection to the top most window in case it's a menu;
bug #1152 no longer applies due to the above change.


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


# f7e1df75609966bdfdb4ed39edf26dd145d8221f 16-Aug-2007 Stephan Aßmus <superstippi@gmx.de>

* get rid of RGBColor usage where it is not needed, this simplified many things,
possibly making them a little faster too
* mess with decorator button size calculation to make the whole layout scale
more agreeable with the font size (no more fixed offsets/insets), but it
is work in progress
* DefaultDecorator no longer allocated the border color array, it is part of
the object now
* small memory footprint optimizations in ViewLayer, Decorator and WindowLayer


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


# b9c1e099e22fbe701227bab956b49db2b73acee9 21-Jun-2007 Axel Dörfler <axeld@pinc-software.de>

The Workspaces layer will now also be updated when the window hidden/shown is not on
the current workspace - this fixes bug #1191.


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


# 189360b5d874c3c4e0f057e761426fbfac74c4f4 04-Jun-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Initialize all variables in the constructor


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


# ba4918e74c0b0d6c7e071e81b2b56cc713593c60 11-Apr-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Menu windows are no longer the preferred keyboard events target (for
now, at least). This feature wasn't used yet anyway, and turning it
off cures bug #1152.


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


# cb134e2550619a0311f0d39c0a9094d0123cb131 02-Feb-2007 Axel Dörfler <axeld@pinc-software.de>

Resolved a TODO: WorkspacesLayer must take the whole workspaces frame into account, not
just the one of the first screen. This also solves a locking bug, as the HWInterface
is already read-locked when WorkspacesLayer::Draw() is called.


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


# 2d75f771bfd5263ad365b26dcd45925263ab0889 09-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Fixed minor ugliness (only visible on slow systems, such as Qemu): the mouse cursor
was drawn before the background got cleared.


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


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

* Removed the debugger() call when the input_server couldn't be started - it's not
a critical error, and definitely no reason to take the server and all GUI apps
down. You could also still log in remotely.
* Now opens and uses the syslog in some rare cases (should become the primary error
channel over time).
* Minor cleanup.


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


# 2cfe93e7804edb2817dba26ba9b908efbfa80b06 04-Dec-2006 Stephan Aßmus <superstippi@gmx.de>

* renamed HWInterface locking to LockParallelAccess() and
LockExclusiveAccess() (meaning more or less access to the
frame buffer)
* extracted the AGGTextRenderer to be a global instance used
by each Painter instance (currently, it is thread safe because
of the global font lock, so there is some work left in this
regard)
* gave every ServerWindow it's own DrawingEngine instance, this
is work in progress. So far, there doesn't seem to be a regression,
but less fighting over the exclusive access to the frame buffer, now
each ServerWindow thread can draw in parallel. There is room for
improvement, plus I think I'm leaking the DrawingEngine...
* changed the locking for the software cursor. ShowSoftwareCursor()
can only be called if HideSoftwareCursor(BRect) returned true, or
if you called the generic HideSoftwareCursor(), since it needs
to keep the cursor lock and unlocks in Show...!
* some clean up and renaming in Decorator and friends
* moved PatternHandler.h to live along with the .cpp


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


# 8e963d88f0545935bdb5a4b0cf20c1310c79f56d 30-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

The app_server did not reset keyboard focus on B_INPUT_METHOD_EVENT messages.
This should fix bug #658.


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


# 07dc2c697239f7eae1fc184f1796b4fa705d1fd5 30-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

* The app_server now gives top-most menus the keyboard focus.
* BMenuWindow now makes its menu focus view, so that it can receive key events.
* Keyboard navigation doesn't work as it should though, that is bug #670 is
still valid - there should even be another recently opened bug about this,
but Trac obviously ate it :-/


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


# 122a163324cb99cf3a01d8cd686694e6c4105e1b 17-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

The mouse event window will already be reset in RemoveWindow() (through HideWindow());
doing it here is not only superfluous, it would also cause to lose the window when switching
to a workspace where the window is not visible and back while dragging it around.


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


# 8c68eab6943eefb176d31d7f1cef91c65ada5231 17-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed two different bugs that could cause bug #896:
* the app's Activate() method was called unsafely; the ServerApp pointer could
have become invalid in the mean time.
* when hiding a floating window (because its parent got hidden) that had focus
or even was the mouse event window (was currently dragged over the screen)
the focus was not moved to another window.


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


# a17c3a48b84013d5c1ab684fd5bf9961eee3d7d9 26-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Changed the way DesktopSettings work:
* Removed the DesktopSettings lock itself - it's not really needed at all,
and causes some trouble with a clean locking design. This may even have
fixed bug #757, at least I couldn't reproduce it anymore.
* There is now a class for read-only access that requires you to have locked
the desktop (either read or write).
* There is now another class LockedDesktopSettings that allows you to set
settings (and only that) - when you're changing the settings, you must not
have read locked the desktop (ie. hold the single window lock). The class
will obtain a write lock, but write locks can be nested.
* Moved SetWorkspacesCount() into the Desktop class.


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


# d479fa7ae4339ec8d84082500bdaede3269108b0 23-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Floating windows no longer flicker when moving a window to another workspace
using the shortcut keys (Alt-Fn).


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


# 64747950085abc2a7313c243550ac1ee7e6b70d0 23-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

SetWorkspace() now also move the subset windows of the mouse event window to
the new workspace - this fixes bug #755. Unlike floating windows, they aren't
even redrawn :-)


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


# 85e2542930052436500e0c4754b0f085ae42e5d9 23-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Shouldn't try to move windows to top that aren't yet in the workspace
(a.k.a. floating windows) in SetWorkspace().
This fixes bug #211.


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


# 258d8a3380e0d986adcef3e65c57e8f46bb548fe 22-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

When building the update region on workspace switch, the mouse event window was
ignored even if it was not visible on the previous workspace (only normal windows
can be moved this way).
This fixes bug #765.


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


# 82584ab9c2996ff4dec740d64eb78c7c0b74c900 09-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented AS_DIRECT_WINDOW_SET_FULLSCREEN so that it sets kWindowScreenFeel
when enabled, and B_NORMAL_WINDOW_FEEL when disabled. IOW when enabled, no
other windows can interfere.
* Therefore, it's no longer necessary to have the screen_blanker window
use kWindowScreenFeel - it will set its window to full screen as long
as the blanker runs.
* Added a AS_APP_CRASHED notification in the app_server that will remove
all kWindowScreenFeels from the windows of the crashed app.
* This is now used by the debugger to ensure that the debugger alert will
be visible.
* Factored out a DesktopLink class out of the BRoster::_ActivateApp()
method. This class is now also used in the new BRoster::_ApplicationCrashed()
method as used in the debug_server (via BRoster::Private).


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


# fa3c08f073f96335343a1123acb863e6175f823f 29-May-2006 Axel Dörfler <axeld@pinc-software.de>

The workspaces window is now updated when a tab is moved - this fixes bug #641.


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


# b30e90211eddde5fc96258dfaf8364f2fefd9695 24-May-2006 Stephan Aßmus <superstippi@gmx.de>

added a way for BWindow to store and restore arbitrary decor settings,
currently those include only the tab location


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


# 46fb2d73bed519b7712918568b5aeda5cd7ef54d 24-May-2006 Stephan Aßmus <superstippi@gmx.de>

sorry, I couldn't resist...
* added a few very small changes to make the tab sliding work perfectly
* added a comment on the purpose of WindowLayer::fLastMousePosition and
how it is supposed to be used to have the mouse cursor stick to what
is being dragged
* TODO: the tab offset doesn't necessarily have to be on [0..1], as long
as we update it during window resizing to keep the relative position


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


# 382084bd0a8da947a5b8f7b738b43d688cfc2345 23-May-2006 François Revol <revol@free.fr>

The return of the long awaited for Sliding Tabs, that even Linux users envy!
Needs some cleanup, passed values should be inside [0:1].
Need to make sure changing the title doesn't reset the tab to left.


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


# e6b19d1f400337bf24e8863666bfba5ccb2ff1a2 05-May-2006 Stephan Aßmus <superstippi@gmx.de>

removed unnecessary call to ConstrainClipping(), the drawing functions that take a color are reserved for the server and ignore clipping

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


# e647873a03485259cd36968def0efb2d1329219f 01-May-2006 Stephan Aßmus <superstippi@gmx.de>

implemented TODOs from Desktop::ActivateWindow():
* If the window is on another workspace, the workspace will be
activated or the window will come to the current workspace
or nothing will happen depending on the windows flags. Tested
with WonderBrush, but I just now realise that it will also
fix activating a window in the Deskbar, which is on a different
workspace.


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


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

Finally removed SERVER_{TRUE|FALSE} and lots of other unused constants from ServerProtocol.h.


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


# 6d5488e18ac47e1c47706227b9a21524ae7874e8 25-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

* There is now a server_read_only_memory structure that is placed in a (surprise!)
read-only area shared between the Desktop and all applications.
* Right now, this area only contains the desktop colors, ie. B_PANEL_BACKGROUND_COLOR
etc.; ui_color() no longer needs to ask the server for these colors.
* The ui_colors are now maintained by DesktopSettings, though ColorSet is still there.
* The default colors are now hardcoded once and for everyone in InterfaceDefs.h, ie.
the app_server uses them as well.
* Desktop::Init() can now also return an error (but that is not yet accounted for).
* Cleaned up InterfaceDefs.h.
* Fixed wrong include in moreUTF8.h.


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


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

Activating a window with B_AVOID_FOCUS set no longer changes focus - this prevents
the desktop window from losing focus when a menu opens.


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


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

Desktop::SendBehindWindow() now checks if the window is on the current
workspace, and do nothing if not. This fixes bug #442.


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


# 68b599fbccfb5353e1418f601153a299eeda9fe6 14-Apr-2006 Jérôme Duval <korli@users.berlios.de>

reusing the old settings message is a good idea (thanks Axel!)
we simply remove color data before storing the workspace color


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


# 8be3635fcf058d72fadf6649b3f268c7f703787a 14-Apr-2006 Jérôme Duval <korli@users.berlios.de>

don't reuse old workspace settings, store method expects an empty message


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


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

* When changing a window's feel, it's now also moved to the front if
necessary.
* Also, newly exposed window areas are now refreshed when a change
of feel also changed the window order.


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


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

* Changed window hierarchy: menu windows are now always on top, then come modal
all windows, and after them floating all windows. This is different from BeOS
(where floating all windows are on top of modal all windows), but the way its
now seems to be more logical. This fixes bug #453 - there remains a problem
with open menus, though, but that has to be solved differently by introducing
a new feel.
* Also, modal app windows are now blocking floating app windows.
* Simplified WindowLayer::Frontmost() and Backmost() a bit, moving more stuff
into HasInSubset().


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


# 82081c70ea570719f8ce4c5c0e92fd0eb5db9c93 12-Apr-2006 Jérôme Duval <korli@users.berlios.de>

improved version
though the first workspace color isn't kept between boots


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


# 190b4fa4efb5613077e511d692841b8d5c4873c5 12-Apr-2006 Jérôme Duval <korli@users.berlios.de>

hopefully implemented makedefault in Workspace::SetColor()


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


# 39c9925fcf718dbb8c8d5342997d6bbd40f9e7e4 07-Apr-2006 Stephan Aßmus <superstippi@gmx.de>

* implemented a BRegion pool per WindowLayer which is supposed
to cut down on BRegion related allocations, cannot really tell
if it speeds things up
* used the new BRegion pool in WindowLayer and ViewLayer whereever
a BRegion was used on the stack
* fixed the debugging stuff in MultiLocker - it will get you into
the debugger if you
- try to nest read locks
- try to write lock when your are a reader already
- don't match up nested locks when your a writer
-> but only if you #define DEBUG 1 in the .cpp, is off by default now
* went over WindowLayer, ServerWindow, Desktop and a few other places
and fixed the locking for use with the MultiLocker, the "a reader can
not become a writer" is especially tricky, feel free to review the
changes
* activated the MultiLocker, I tested this quite a bit, if there are
problems simply turn on DEBUG and you should drop into the debugger
right where the problem is... hope all is good


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


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

* The background is now repainted on workspace switch in case the background
color differs. This fixes bug #373.
* The workspaces window is now invalidated when the workspace color is
changed, so that it shows the correct color then.


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


# 150e5ed5328209914ca8e349cbe7da50d6da6667 15-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* When the current focus window was closed or invisible, we used to
chose the front window as our next focus window - but this proved
to be problematic with B_AVOID_FRONT windows. Therefore, we now
simply chose the top-most window as the next focus window.
This fixes bug #281, and potentially also fixes bug #181.
* This also revealed another bug in SetFocusWindow(): when the window
to have focus already had focus, but were hidden before, the focus
did not change; if that window was subsequently removed, the app_server
would have crashed.


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


# 8896266062e8b2cfa7ba5c02b7191e49b99888a9 13-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Now moves with absolute coordinates instead of relative, which makes moving
windows to other workspaces so much easier that even I managed to get it
right...
* Moving windows on another workspace is now working as well.
* Fixed a positioning bug in Desktop::SetWorkspace() - was only visible in
case the window was in more than one workspace, but not in all.


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


# 14fe11cfaed1dc4450ffdd8c82cab879d9f97d39 13-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Implemented moving windows around via the Workspaces app. However, you
can't move them to another workspace, and you currently don't see a
window moving that is not in the current workspace. (this fixes bug #135)
* Desktop::SetWindowBehind() didn't update the WorkspacesLayer.
* Changed Desktop::MoveWindowBy() to be able to move window on any workspace.


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


# e2c5e77531bc913dac97bf6d6d36ab203626d44d 12-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed a crashing bug Stippi's StressTest revealed: hidden (and especially,
removed and deleted) windows must not be the mouse event window (ie. while
dragging or resizing the window).


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


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

* Fixed a possible locking bug in Desktop::WindowAction().
* Cleaned up locking a bit.


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


# 87b1f40c0f241325ebc66f8734e3eb889ac386b8 09-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Fixed misbehaviour of AS_SET_CURSOR: it will no longer set the mouse cursor
when it's not over a view of the application.
* The application cursor is no longer applied when the mouse cursor is over
the border (or tab) of a window.
* Gave up and imitate BeOS behaviour: the mouse cursor now always get the
shape the view below dictates, ie. it will no longer fall back to the
default cursor outside the focus window.
* The window is now set to the default in case there is no window under it
at all (ie. if Tracker isn't running).


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


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

When the last window was removed with floating windows on screen, they wouldn't
be closed.


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


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

B_AVOID_FRONT window were ignored when activating a window, and thus, menus could
steal the focus of the focus window.
This fixes bug #181.


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


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

various changes to handling custom cursors:
* all cursors owned by a team are visually different,
or (iaw) an already existing cursor is reused when
it is set by the client again
* changed various occurances of cursor data from "int8*"
to "uint8*"
* ServerCursors also remember the R5 data from which
they were created
* the reference counting and destruction of
ServerCursors changed: The cursor knows it is attached
to a CursorManager and one can simply use
ServerCursor::Acquire() and Release() and the reference
counting and everything is being taken care of
* destroying a ViewLayer will now correctly release a set
ServerCursor
* fixed a race condition when setting a cursor through
BView::SetViewCursor(): If the client code looks like this:

BCursor cursor(cursorData);
someView->SetViewCursor(&cursor, false);

there is a relatively high chance the BCursor destructor
told the ServerApp thread to destroy the cursor before
the ServerWindow thread got to "acquire" the cursor for
use by the view layer. The very same problem is likely the
reason that SetViewCursor works to unreliably on R5, even
when the "sync" flag is set to "true" (although it should
theoretically work in that case).

all these fixes make WonderBrush work fine again with the
new support of custom cursors.... coded by axeld and myself
(the joys of pair programming :-)



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


# 36e8fa618f9ac42d40a6a8e8eba5da5701b7d972 15-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

The keyboard focus is now always updated if the message is a B_[UNMAPPED_]KEY_DOWN or a
B_MODIFIERS_CHANGED message.
This fixes bug #175 (which was probably caused by a bug in our old BMessage implementation,
see TODO item in line 141).


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


# 966fbea627da9dee220f80515e7baf8d0957a92d 13-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

A work-around for the Tracker desktop redraw problem of the previous change.
Should probably be cleaned up a little. This fixes bug #146.


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


# 3dcbe9fc8879f2f88a0cd4fc57e504649a2362cd 13-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

Implemented redrawing the desktop after color changes. Right now, it only works
correctly when Tracker is not running; obviously, the background is cleared in
Tracker before it had the chance of changing the view color.
Maybe the app_server needs to detect the background view of the desktop and
change the view color manually :-/


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


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

* Implemented private functions do_minimize_team(), and do_bring_to_front_team()
used by the Deskbar (for "Hide All" and "Show All"). The latter doesn't work
correctly yet, though, it just maximizes all windows of that application.
* Added a TODO to ServerWindow AS_MINIMIZE_WINDOW on how to make it work correctly.


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


# ebae3c7d614a29283dfdc40089e95cb1cc9ef233 09-Feb-2006 Stephan Aßmus <superstippi@gmx.de>

this fixes Chart leaving dirty stars in BDirectWindow mode... at least on my machine. Looks like BDirectWindow resizing is notably smoother on Haiku btw. :-)

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


# b5182fe099e06747375c9dec135806922d773656 08-Feb-2006 Stephan Aßmus <superstippi@gmx.de>

don't blit stuff arround on screen when moving or resizing invisible windows, this bug was most visibly triggered when navigating menus, since the menu window was reused and moved and resized when it was invisible, weird things could happen on the screen...

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


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

Stupid me - thanks to Michael Lotz for pointing that out :-)


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


# 2a472699077aad35bd6bc2651b29f1c895614101 09-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

SetWindowFocus() could reset the focus of a window that already had focus.
This fixes bug #128.


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


# 8527f8ffbeb4b72a9502099b29aa6210b7832191 06-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

The display resolution is now saved and restored. Probably doesn't handle non-default
modes right yet.
The settings are stored in B_USER_SETTINGS_DIRECTORY/system/app_server/workspaces.
They are currently saved as a flattened BMessage - we might want to switch to the
driver_settings format, though.


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


# 195e980ef10d42d13bf8f4360d81eebda3b8417e 05-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* Cursors are now reference counted, so it shouldn't be possible anymore
to delete them accidently :)
* You should no longer call HWInterface::SetCursor(), but the new Desktop::SetCursor()
if you need to change the cursor.


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


# 73b3ea3cd7596e2da7fbf8c55e43cbe09b8c127c 05-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

Fixed a few more uninitialized variables.


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


# 47f1b81ce2ba29e6b3da8847e7130f0feff87c89 05-Feb-2006 Axel Dörfler <axeld@pinc-software.de>

* fCurrentWorkspace wasn't properly initialized.
* Removed AS_SET_SYSCURSOR_DEFAULTS handling for now.


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


# 7023b103b34be0ef57d137979ce8f2521b9fa3b5 16-Jan-2006 Stephan Aßmus <superstippi@gmx.de>

I took the liberty to revert Stefanos patch in 15953 since you all seem busy, it is ok and even required for the Desktop window to be able to have focus

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


# 3532dd20d58de9ca3aa154b611fb6cf8dcb1ec46 15-Jan-2006 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Now the kDesktopWindowFeel means also that the window doesn't want focus.

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


# 74ae32484914da6442d0ce20d3a7f6f598c28e49 11-Jan-2006 Stephan Aßmus <superstippi@gmx.de>

* when the parent ServerApp of the focus window changes,
it's Activate() method is called, if there is no
new focus app, the cursor is unhidden for safety. The
most notable difference: After having run a screen
saver, the cursor will be visible again.


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


# a342fafcf43733b2305e9b31267154571806d8f2 03-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Undo 15810 again; it messed up the window lists (as WindowLayer::InWorkspace() and WindowLayer::Workspaces() must be in sync).
Might reveal other problems in this area, that are worth looking into.


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


# 574af5597c91db9cf3df641883470da4a3cb93e0 03-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Floating windows start with 0 workspaces - probably didn't matter, though, as
freshly added windows are hidden anyway.


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


# cd2b129d0777a3198229fa66f0f4c344f7027120 29-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

* removed superflous LockSingleWindow() from WindowLayer::MoveBy()
and ResizeBy()
* WindowLayer::SetSizeLimits() needs to be called with the
AllWindows lock held
* I was observing weird behaviour with "unclickable" windows
that I might have fixed by explicitly excluding invisible
windows from Desktop::WindowAt(), there might be something
wrong with the "current" window list though, Axel would know
* finally found the problem with "delayed background clearing"
* enabled delayed background clearing and removed unnecessary
code. It should be more efficient, since it clears larger
areas at once, and it solves the problem of views unable to
draw into regions that are pending for another update - among
other things, updates in resizing windows are more fluent,
especially for B_FULL_UPDATE_ON_RESIZE views. "Cut off" scroll
bars should no longer appear when the view being scrolled takes
too long to redraw.


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


# 8f30140c635ffdc1b9c90adf59c00986b8755128 21-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

fixed opening windows in other workspaces than the current, keeps the window lists valid

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


# ef4635a3f9d9cbdce2ddf3e5c125e31e72e8c929 20-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

added a few comments

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


# 270b7f58b6c6f0df7c31611f19a20751da9db2ce 19-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

removed unnecessary locks

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


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

Windows now receive B_WORKSPACE_ACTIVATED and B_WORKSPACES_CHANGED messages again.


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


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

Renamed Write[Un]lockWindows() to [Un]lockAllWindows(), and Read[Un]lockWindows() to
[Un]lockSingleWindow().


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


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

The fWindowLock is now responsible for all window activities - no need to sometimes
lock the Desktop itself, and sometimes not - that also fixes some potential deadlock
situations.


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


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

The Workspaces window is now updated again. Only mouse clicks don't work yet.


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


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

* SetFocusWindow() now makes sure no hidden window is taken as focus window...
* When switching workspaces, usually the focus switches to the front window.
This no longer happens in case a floating window had focus and is still visible
in the new workspace - in that case, focus is kept with the floating window.
* SetFocusWindow() now chooses the topmost window in case the specified window
has either a modal or there is no front window.
Desktop::RemoveWindow() now makes sure the window is hidden before removing it.


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


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

Minor cleanup.


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


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

If the focus window became invisible because of changing its feel, focus is now
reset to the front window.


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


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

* SetWindowFeel() now respects the position of the window, and changes it, if necessary.
* renamed workspaces_on_workspace() to workspace_in_workspaces() (was even wrong before).


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


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

A couple of changes related to modal and floating windows:
* Desktop::SetWindowFeel() is now working, but doesn't respect the window
position yet (ie. floating windows would have to be moved to front).
* WindowLayer::Workspaces() now always reflects exactly the lists it's in
(at least after Desktop::AddWindow() has been called). WindowList::AddWindow()
and RemoveWindow() now update this flag to be correct at all times.
* Fixed Desktop::_ChangeWindowWorkspaces() to not set the current workspace
for windows that are not on the current workspace, and vice versa.
It also would hide windows that were already hidden, and tried to show
windows that actually were hidden (did no other harm than triggering
a rebuild of the global clipping).
* Floating windows now work as expected.
* Desktop::SetFocusWindow() won't give a window focus that has a modal.
* Renamed OnWorkspace() to InWorkspace().
* ServerApp::InWorkspace() now works correctly, added ServerApp::Workspaces()
as well.
* WindowLayer::SubsetWorkspaces() returns the workspaces mask this modal or
floating window should be in.
* New window flag B_SAME_POSITION_IN_ALL_WORKSPACES should work as well.
* Floating and modal windows now have always set this flag.
* Added a WindowList::HasWindow() method.
* Desktop windows (windows with the desktop feel) can now have focus again
(I accidently broke that before).


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


# 939fb4077cfd90b688d29b738889082d3a9fa0bb 08-Dec-2005 Stephan Aßmus <superstippi@gmx.de>

fix scrolling of BViews that rely on app_server painting the background, remove a forgotten debug output in ViewLayer, reimplemented setting the window title during runtime, fix Decorator redraw on pressing buttons - though I was lazy on that one... it works, but as the TODOs say, it would be better integrated directly in the Decorator class than being handled by WindowLayer

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


# 72994381f2e4cd59054bdd908248e6f60d960fb9 08-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Windows currently being dragged now follow workspace switches.
Desktop::_ChangeWindowWorkspaces() and SetWorkspace() didn't lock the window list,
but should have.


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


# 799c100e79f8546c965fd7fabcb24b057100db77 08-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

That would be a bug indeed.
* ShowWindow() and HideWindow() now also work correctly for windows not
on the current workspace.
* Reverted WindowList::RemoveWindow() - if it is used wrongly, it should
better crash the server for now, so that we can iron out the bugs.


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


# 48ccf5abefce9ecac2b3212c662af6fc3511cfb0 02-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Some work to get modal/floating windows back:
* B_{FLOATING|MODAL}_ALL_WINDOW_FEEL now works as expected
* reintroduced the concepts of subsets of modal/floating windows - does only
work correctly for subset "all" window feels.
* RootLayer::_SetFront() now deals correctly with modal windows
* renamed RootLayer *WindowLayer() methods to *Window()


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


# 57be2866092ae0247cc70f573761d44a0419f893 01-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

* when moving/resizing windows on another workspace, the Workspaces window
has to be udpated anyway.
* some work towards being able to set a window's look/feel/flags on-the-fly.


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


# 19d801a6b6acbd725e8bb474c3be56d4fa99b66a 01-Dec-2005 Axel Dörfler <axeld@pinc-software.de>

Moving/resizing is now routed over the desktop as well.
This also allows the workspaces layer for these actions, which is now done as well.


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


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

* the Workspace class is now hidden and put into Workspace::Private; the new
Workspace class is a simple accessor to this class that takes care about
locking (currently, it's just the desktop lock, maybe it'll stay that way).
* WorkspacesLayer now displays the window thumbs again.


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


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

Forgot to remove the Unlock(), thanks to Stephan for pointing this out.


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


# 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


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

Added a bit of documentation to the EventDispatcher.


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


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

Now sends B_SCREEN_CHANGED messages to all windows when the screen resolution changes.


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


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

* Got rid of the frightening Layer::fCurrent/RootLayer::fWinBorderIndex as well as
NextChild() and PreviousChild() - the current WinBorder list is now rebuilt on every
change; this is not perfect, and only a temporary solution (but cleaner than the
previous one).
* Introduced Layer::PreviousLayer()/NextLayer() methods that return the previous resp.
the next sibling.
* Moved {show|hide}_winBorder() into {Show|Hide}WinBorder() and got rid of the former.
* Renamed Layer::fServerWin to fWindow.
* removed some unused stuff, minor cleanup.


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


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

Next big step in the event handling:
* RootLayer's mouse event processing is now at its minimum - the
EventDispatcher handles them now. As a result, a window will now
get only one message per event.
* RootLayer adds "_view_token" to mouse moved messages that specify
the view currently under the cursor.
* There is now a mouse event layer in RootLayer that gets preferred
when it's set - this is now used for the window moving instead of
the previous mechanism.
* changed the previous DistributeMessage() to an UnpackMessage()
method following Adi's suggestion.
* caveat: some things might be functionally broken in RootLayer now
because of removing the mouse notification stuff.
* "be:transit" handling is now done completely client side by
BWindow::_SanitizeMessage(() (similar to what the input_server does).
This should also make the mechanism pretty robust, since every
B_MOUSE_MOVED message can now trigger the view transit (in case a
message is lost). B_WINDOW_ACTIVATED messages should be generated
client side as well.
* renamed AS_LAYER_GET_MOUSE_COORDS to AS_GET_MOUSE as it's not a
layer specific command, and also gets the mouse buttons.
* B_MOUSE_* messages from the up server now contain only a "screen_where"
field; "where" (in window's coordinates) and "be:view_where" are
added in BMessage::_SanitizeMessage().
* messages that don't have a valid target in the looper are now
dropped instead of being sent to the looper - this should be done
in BLooper as well, though.


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


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

The Desktop's message port now gets the same name as its looper.


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


# 6c17d025516c9c1a271394f8ef618d842e68c716 15-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* Introduced a new handshake between input_server and app_server, and some
temporary handling code in the app_server.
* RootLayer no longer creates the input_server messaging port - this is now
the responsibility of the input_server.
* Moved AS_CREATE_[OFFSCREEN_]WINDOW from ServerApp::_MessageLooper() to
_DispatchMessage().
* The RootLayer thread is now started as soon as the input_server is there.
* removed or disabled any input_server stuff in the AppServer class.
* removed old message commmands to the app_server.
* Removed the R5_CURSOR_COMM and HAIKU_APPSERVER_COMM definitions: the
input_server is now automatically built correctly depending on the target.
* InputServer::EventLoop() plays now safe and checks for error conditions.
* InputServer::EnqueueDeviceMessage() seems to leak memory, added TODO about
this.
* InputServer event loop messaging uses ports for inner-app communication - why?
* The InputServer event loop thread is no longer killed on exit, it just quits
when its port is gone.
* Minor cleanup in input_server.


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


# 8fbbd37f83d51bdfd787081186c28e0e8f4fb254 08-Nov-2005 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Added some code for notifying client BDirectWindows that the window was moved or resized. Currently commented because of other problems. Looks like the windows bounds are not changed if a MoveBy() is called before the window is shown. Removed unneeded includes. Small changes

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


# 6ed894182f5f5865f2f8a2b1c4dea7bf81324063 04-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

renamed DisplayDriverPainter.* to DrawingEngine.*

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


# 58468dfed0b7013c600aecb0a714194bc98eeecc 04-Nov-2005 Stephan Aßmus <superstippi@gmx.de>

first step of geting rid of abstract DisplayDriver base class for less development overhead, DisplayDriverPainter is renamed to DrawingEngine

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


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

* the FontManager is now a looper (but doesn't do anything useful yet).
* moved the system default font functionality into the DesktopSettings class.
* ServerFont::SetStyle() is now a public method.
* Improved font fallback routines: they will never end up without a font if
there is at least one font installed.
* fixed some minor bugs in the DecorManager.
* Decorator now get a DesktopSettings object passed - dunno if that's a good
idea (since we'll have to open the DesktopSettings header), but it works
for now (and something like this is probably needed anyway).
* a clean ServerFont is now set to the system default font - and not to the
(user chosen) desktop default font anymore (since the font manager doesn't
know about that one).
* Improved font directory scanning in the font manager a bit, it's now using
find_directory() instead of hard-coded paths.


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


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

Got rid of sDesktop.
Moved AS_ACTIVATE_APP over to Desktop. _CursorThread() is currently dysfunctional (but not enabled anyway).
Minor cleanup (Desktop::WindowList() is now a BObjectList).


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


# 3ddebe7ec23737814f02aeb99e2ed3eb0fb5998e 21-Aug-2005 Michael Lotz <mmlr@mlotz.ch>

Moved the CursorManager over to the Desktop too.
Maybe the CursorManager should be used to set the cursors directly instead of using
fDesktop->GetCursorManager.FindCursor() and then fDesktop->GetHWInterface()->SetCursor()
in ServerApp.cpp.

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


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

The Desktop class now inherits from MessageLooper as well, the AppServer
class runs it, too.
No real message processing is done yet, though.


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


# 2213782534a8b17fdea5d7fc603360f4c9ac317e 17-Jul-2005 Michael Lotz <mmlr@mlotz.ch>

All cursor related changes:

* Moved setting the default cursor from ServerScreen to Desktop
* Getting the default cursor is now done using the CursorManager
* Removed outdated setcursor from SysCursor.cpp (we have a new implementation by now)
* Renamed SysCursor.cpp to CursorSet.cpp as that's what it is
* Moved headers/private/app/SysCursor.h to headers/private/servers/app/CursorSet.h
* Removed some unneeded header includes along the way

There remains {set|get}_syscursor now in CursorSet.cpp. Serverside for these are not implemented
and they are obvious hacks. Do we need to keep them?
Also this commit _would_ break Appearance, but 1) all the related code is currently commented out
with the comment "cursor set management belongs in another app" and 2) it is already broken
because of ColorSet.

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


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

Extracted the settings stuff from the Desktop class. If you now need to access
the desktop's settings, you have to do something like this:
DesktopSettings settings(desktop);
settings.SetMouseMode(mode);
The advantage of this is that this object is fully locked, and cannot lead to
corrupted settings anymore. Also, the settings will stay the same until you
delete the object again.
Updated all accesses to use this new API.
Removed no longer used FFM messages.
Implemented AS_{GET|SET}_MENU_INFO for future use.


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


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

First baby step to a restructured app_server:
- introduced new ScreenManager and VirtualScreen classes
- removed screen handling from RootLayer
- removed multiple screen/root layer stuff from Desktop, it's
now using a VirtualScreen object instead


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


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

Stippi's commit accidently changed the initial screen size.


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


# 94fa2bd2567b925ff7e2eb88cab7dfeddbffd885 25-Jun-2005 Adi Oanca <adioanca@nowhere.fake>

inlined a few methods in header file, otherwise app_server would not build

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


# 3dcb3b079ab645a90859eba6505cf2692c291138 23-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

Added some root layer locking in ServerWindow.cpp when accessing the layer tree. Moved HWInterface management out of DisplayDriverPainter and into Desktop. Removed all the directly hardware related functions from DisplayDriver API. They just called the same HWInterface functions. Now DisplayDriver is much cleaner and ready for being attached to a yet to be written BitmapHWInterface. Clean up of the display mode stuff in Screen and the View-/AccelerantHWInterface. Frequency is now regarded on Haiku. AccelerantHWInterface::GetModeList now works before SetMode has been called. Added MultiLocker from the sample code. HWInterface uses it now in preparation to being used from multiple instances of DisplayDriver.

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


# 54cc0f1b56a9419e6d900c40bb03d4fa25d58c49 16-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

reverted some unintentional changes

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


# 99b9d5ac8a6a1fa22e162b433e258f3d048bf6eb 15-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

a new state begins life as a copy from the previous state, fixed Scale(). Note that BoundsOrigin() (and therefor Scale()) is called _a lot_ so we should cache the value! I started to work on this, but our lack of encapsulation strikes again... Layer::fLayerData is used directly all over the place.

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


# 0aa69a9cd4f37a6f343d6d7dfc74aded88c25916 07-Jun-2005 Axel Dörfler <axeld@pinc-software.de>

Fixed the crashing bug when quitting the app_server.
The display driver is now owned by the Screen object.


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


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

Made some necessary enhancements to class Screen; the app_server also
has to care about refresh rates. Also changed Screen::GetMode() (formerly
Resolution()) to return all interesting values, so that hopefully no one
will call it anymore like RootLayer::SetScreens() did.
Greatly improved the horrible RootLayer::SetScreens().
The app_server is now able to deal with failing HWInterface::SetMode() calls;
in this case, it will fall back to the hardware's current mode. This now
also works correctly in combination with the vesa driver, so that you don't
have to compile the app_server with the same resolution you boot in anymore.
SetMode() now always returns if it succeeded or not.
Renamed RootLayer::fScreenXYResolution to fScreenWidth/Height respectively.
Removed the useless DisplayDriver::DisplayMode() method.
Added B_GET_DISPLAY_MODE to the required accelerant hooks.
Some minor cleanup.


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


# 55d6f1b792f86ba5529b5ec311e84a1bfd6e15ea 25-May-2005 Stephan Aßmus <superstippi@gmx.de>

Many efficiency improvements to text rendering. Moved stuff from Painter into AGGTextRenderer which didn't belong in Painter. AGGTextRenderer now has an embedded transformation, which expresses the font rotation and (in future) shear settings. Removed direct support for BBitmaps from Painter (supposed to draw ServerBitmaps). Tested drawing of bitmaps other than B_RGB32. (only B_CMAP8 and B_GRAY8 so far, but they work). Right now, these colorspaces are supported by on the fly conversion. So every colorspace supported by BBitmap::ImportBits() should work, which are a lot more than the R5 app_server can display.

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


# 7b58474a09d69a9fead2e277fe5bba18a28ad366 25-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Beautified some odd code (like "a ? a : NULL" to "a").
Applied our coding style guide.
No functional change.


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


# d53639ce2e27b02b8fd5f6b320495f6361314cce 21-Apr-2005 Adi Oanca <adioanca@nowhere.fake>

Implemented support for BWindow::SetFeel()

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


# 3dea4bb659457b495b7ed9ca66168426a162312c 18-Apr-2005 Stephan Aßmus <superstippi@gmx.de>

cleanup the defines, move old DisplayDriver implementations out because they are currently unused and won't build

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


# b176b6b4936be2f53eb29bc63c5f6ff2be44d153 12-Apr-2005 Stephan Aßmus <superstippi@gmx.de>

The DisplayDriverPainter is now also the default on Haiku. The DisplayDriverImpl stuff is left out for now.

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


# 8940f93c1d5bce994b062b866fe230c5fa8517e1 01-Apr-2005 Stephan Aßmus <superstippi@gmx.de>

AccelerantHWInterface now uses a MallocBuffer as RenderingBuffer for the back buffer instead of a BitmapBuffer, which under Haiku does not work.

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


# 507c1efe078a9fee70882b3505aae5284a8ad755 29-Mar-2005 Michael Lotz <mmlr@mlotz.ch>

I didn't want to mess with the screen resolution, sorry.

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


# 73fc67136c7333e0d875c59527deefb5dc38b5ab 29-Mar-2005 Michael Lotz <mmlr@mlotz.ch>

Choose headers according to DISPLAYDRIVER, too.

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


# 9c59f2f20706f9dd94a6a18d4f5143c8b33efca4 29-Mar-2005 Stephan Aßmus <superstippi@gmx.de>

fixed app_server build, though I don't exactly know why that fixes it

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


# d3db964ed0075963d9ecbb708dc37a7f5ce649c3 29-Mar-2005 Stephan Aßmus <superstippi@gmx.de>

code refactoring, moved common stuff into the base class

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


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

Made DISPLAYDRIVER a true compile time option.


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


# e0bb2421eaa75a723d0df3fd2d640e222c8ce0b4 28-Mar-2005 Stephan Aßmus <superstippi@gmx.de>

whoa - how did this even work?

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


# 5cdd7029018864e55c631ae797c4a95e8eb9c5ad 26-Mar-2005 Stephan Aßmus <superstippi@gmx.de>

use a DisplayDriverPainter version if config says so

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


# a850bd1d8fa6d2145da7b0d977b7c6fee956fa15 25-Mar-2005 Stephan Aßmus <superstippi@gmx.de>

added Painter to the app_server build and fixed the Jamfile to include the drawing subfolder for header search path

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


# 96b832ac575cfa1ef2e7275c113ed19c69fe63a8 25-Mar-2005 Michael Lotz <mmlr@mlotz.ch>

No need to endless loop here.

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


# 0653d45f5babaa7dff58268d03104752fc8bcd93 25-Mar-2005 Michael Lotz <mmlr@mlotz.ch>

Adapt to new location of display drivers

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