Commit Graph

2661 Commits

Author SHA1 Message Date
Stephan Aßmus
e98ee1410a * big cleanup of the tracing support, output useful information
for most messages, use debug_printf(), cleanup line breaks
* check return code of last link method in a lot more places
* changed some printf() and fprintf() into debug_printf()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28537 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-06 19:16:56 +00:00
Axel Dörfler
33309cb5fc * BWindowScreen::_InitClone() was broken, it called the "get clone info" method
on uninitialized accelerant, but that's what AS_GET_DRIVER_PATH is for.
* This should fix #2847.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28534 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-06 12:44:26 +00:00
Jérôme Duval
bda802b259 now uses DIRECT_BUFFER_INFO_AREA_SIZE as the direct_buffer_info area size
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-05 23:44:14 +00:00
Stephan Aßmus
ca89b8ff59 * The app_server implementation of BView::GetClippingRegion() was using the
wrong check to see if the view was currently visible. This fixes the problem
  that tool tips would popup for windows that are located on other workspaces.
* Removed commented out code that is no longer needed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28498 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-04 15:27:56 +00:00
Stephan Aßmus
40fa49e7b8 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
2008-11-03 19:57:05 +00:00
Stephan Aßmus
21b40edd75 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
2008-11-03 19:34:13 +00:00
Stephan Aßmus
6198dc0e17 To allow testing the ViewHWInterface (used in the test environment) with
both double buffering and single buffering, Invalidate() needs to be
virtual and ViewHWInterface needs to decide where to invalidate it's host
window.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28480 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-03 19:31:26 +00:00
François Revol
48ccb49ab0 Added TODO on SetTitle... the rect gets invalidated even when nothing is visible... flickers apps on top with TitleSpectrumAnalyzer in SoundPlay for ex...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28388 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-30 23:04:40 +00:00
Stephan Aßmus
393f282c79 * Mark InputDeviceListItems only as running if calling Start() for the
device returned B_OK.
* In the InputServer destructor, don't check the fAddOnManager pointer,
  but check the success of calling Lock() on it instead, which should
  be much safer.
* In StartStopDevices(), really start or stop all published devices for
  the given BInputServerDevice, not only the first one found. Simplify
  the check whether anything needs to be done.
* Change a bit the return codes of StartStopDevices(). Especially the
  version that's supposed to start or stop all devices will still try
  to do it for the rest of them.
* Removed no longer needed _FindInputDeviceListItem().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28351 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-27 22:19:55 +00:00
Stephan Aßmus
dae439fe60 Init the ref_count with 1, since the first AddPath() would leave it
at 0. A single AddPath()+RemovePath() would therefore leave a not
anymore needed path_entry(), while a AddPath()+AddPath()+RemovePath()
would remove/delete the path_entry while it was actually still used.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28349 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-27 16:44:58 +00:00
Stephan Aßmus
0d2fb32f12 As pointed out by Axel, this TODO is invalid.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28341 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-27 10:55:41 +00:00
Michael Lotz
a0d69d7dac Also add the border overlap on both sides to the available space of the initial
tab width. This fixes the initially wrong tab width for windows where the title
does not fit and previously there would be 10 pixels waste on the right.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28331 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-26 10:53:13 +00:00
Stephan Aßmus
740d899004 * InputDeviceListItem::fDevice was not maintaining it's own memory for the
device path, but instead pointing to memory owned by some device addon
  instance.
* Added TODO in the AddOnManager init code about a possible race condition
  which I have not varified yet.
* Check the return code of BList::RemoveItem() before deleting the item...
  pure defensive programming.
* For the time being, print a warning into the syslog when a device name is
  registered twice.
* When failing to Unflatten() an event, don't continue in the code after
  deleting it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28319 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-24 21:33:46 +00:00
Stephan Aßmus
1a1a4f955c * Updated the license header.
* Use new(nothrow) to allocate the MethodReplicant.
* fSignature needs to be free()d, not deleted.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28318 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-24 21:29:35 +00:00
Stephan Aßmus
944bc06060 * The way subdirectories for the input_server add-ons were defined was a bit
weird.
* Set fHandler to NULL in _UnregisterAddOns(), just in case it is called
  twice (which it probably never is... but be defensive).
* If a B_NODE_MONITOR message does not contain all the necessary fields,
  drop into the debugger when compiling in DEBUG mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28317 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-24 21:28:21 +00:00
Axel Dörfler
85dbe55d9b * r28281 accidently added the B_NORMAL_WINDOW_FEEL (0) to the list of special
feels. This caused floating/modal app and subset windows to not work anymore.
* This fixes bug #2914.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28309 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-24 10:02:12 +00:00
Stephan Aßmus
2d265d2a5b * Removed some no longer used testing code.
* Fixed unloading the add-on image twice in error case of failing to
  add the add-on info to the list.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28307 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-24 09:20:00 +00:00
Jérôme Duval
bdb1d3ac7c * BMediaRoster::GetAudio*() should return B_NAME_NOT_FOUND when nothing is set
* In this case, SoundRecorder shows a different error message, more informative, confer bug #134


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28303 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-23 21:30:19 +00:00
Stephan Aßmus
2469a6f427 * Rewrote the UpdateQueue class. It actually works now and would perform screen
updates during the vertical refresh, but it causes flickering again since
  there is no guarantee that screen regions will stay clean from the time that
  they were scheduled with the UpdateQueue until the UpdateQueue thread
  transfers them. Therefor it is still disabled.
* Refactored a bit the distinction between Invalidate() and CopyToFront().
  Invalidate() used to be virtual, but now CopyToFront() is. This was mainly
  needed for the app_server test environment, because the host window needs
  to call Invalidate() when the front buffer bitmap is clean. When the
  UpdateQueue is used, this needs to be CopyToFront(). Now the separation is
  cleaner in combination with the UpdateQueue.
* Fixed a problem in HWInterface::CopyToFront(): When separating the region
  outside the cursor and the region with the cursor during a transfer, it
  needs to hold the fFloatingOverlay lock to make sure the cursor is not
  moved in the meantime. This fixes graphics glitches with remnants of the
  cursor staying on screen. These could very rarely be observed, but much more
  often with the accelerated double-buffer mode.
* Enabled the accelerated double buffered mode, since it works now very well.
  I was able to test it with the nVidea driver on an nVideo 7300. It works by
  allocating a frame buffer twice the height of the configured screen mode.
  Then all drawing goes into the offscreen portion, including accelerated
  driver functions. AccelerantHWInterface::_CopyToFront() then uses acceleration
  to blit the clean regions in the offscreen portion of the frame buffer into
  the visible part. Please tell me if there are problems, for example when
  if there is too few video memory, or if a driver does not handle it correctly.
  To disable it, see src/servers/app/drawing/AccelerantHWInterface.cpp line 511.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28301 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-23 17:15:39 +00:00
Stephan Aßmus
8b8e062daa * DrawingEngine::CopyBits() was invalidating the wrong region (without offset)
when the HWInterface was using acceleration and at the same time double
  buffering.
* _CopyToFront() should always be used, since it calls a protected virtual that
  derived classes of HWInterface depend on. This fixes some graphics glitches
  in certain situations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28300 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-23 17:02:46 +00:00
Axel Dörfler
4932bc5ea8 * 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
2008-10-22 12:02:49 +00:00
Axel Dörfler
89b1afd16c * Added a new window feel kPasswordWindowFeel that is above all other feels.
* Changed the password window to use this feel.
* Later, the screen saver itself should use this feel whenever the password
  mode is enabled. The password window should then use a modal-app feel, but
  this doesn't work yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28281 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-22 11:51:23 +00:00
Axel Dörfler
ab869c3c27 * The ref_count member should definitely be initialized - thanks Stefano!
* This might fix bug #2894.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28277 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-22 09:04:41 +00:00
Axel Dörfler
23debb05d0 * Rewrote InputServerDevice.h header.
* Renamed _BDeviceAddOn_ to DeviceAddOn, and put it into the BPrivate namespace.
* Moved the DeviceManager functionality into the AddOnManager - this also
  solves a locking issue, as BInputServerDevice::Control() was called in the
  context of the DeviceManager before.
* The AddOnManager now uses the BPathMonitor to monitor the devices that
  BInputServerDevices ask for - this greatly simplifies the code.
* Got rid of TList.h, and use ObjectList.h instead.
* Added PathList class that has a list of paths with reference count, used by
  DeviceAddOn and the AddOnManager.
* DeviceAddOn got an actual implementation that lives in InputServerDevice.cpp.
* Added an experimental BInputServerDevice::AddDevices() that could be used
  instead of recursing over devices manually. It replaces the functionality
  that was found in the DeviceManager before (this was done implicitely for
  all monitored devices).
* Greatly cleaned up and simplified the AddOnManager.
* Also fixed lots of potential errors/leaks when things go wrong.
* Removed the extra locker in AddOnManager - its BLooper lock is now used
  instead.
* Replaced PRINT()/PRINTERR() macros in the AddOnManager with TRACE(), and
  ERROR(), both now use debug_printf().
* Hopefully this fixes the problem that I don't have keyboard under VirtualBox
  from time to time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28241 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-19 15:48:34 +00:00
Axel Dörfler
8f2be9ef82 * Cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28229 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-18 13:53:03 +00:00
Axel Dörfler
0f32f7ddeb * Added an ASSERT() and a check to make sure the workspace that Backmost() and
Frontmost() are using is valid.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28228 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-18 11:59:02 +00:00
Axel Dörfler
955307393f * 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
2008-10-17 21:37:10 +00:00
Axel Dörfler
c2a8fd9b70 * AS_ACTIVATE_WINDOW must not hold a window lock when calling
Desktop::ActivateWindow(), or Desktop::SendWindowBehind().
* This fixes a potential deadlock.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28217 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 15:48:29 +00:00
Rene Gollent
4a4355bd7d app_server was not storing its settings when the workspace count was changed.
As a consequence this setting was lost unless another setting was also altered
that affected the workspace configuration in some way.
Fixes #2849.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28206 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 01:56:44 +00:00
Axel Dörfler
64ba396fa7 * 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
2008-10-17 01:31:44 +00:00
Axel Dörfler
4e59d9c7b4 * Use a good default "yellow" in case there is no decorator (otherwise yellow
isn't initialized, but also not really used currently).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28203 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-17 01:30:06 +00:00
Stephan Aßmus
bf3a206445 Fixed r28168, which introduced an app_server deadlock. Functions
which call into Desktop methods which in turn grab the window
write lock are never supposed to hold this write lock themselves
already, since the Desktop code takes care to not hold the lock
when for example calling EventDispatcher methods, which would
cause a deadlock (as in this example).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28175 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 18:01:55 +00:00
Axel Dörfler
96c6ee9507 * _Show() and _Hide() must now be called with having all windows locked
(it would do that internally anyway).
* AS_MINIMIZE no longer calls _Show() when being unminimized, but
  Desktop::ActivateWindow(), as this will also bring the window on the screen
  if it's on another workspace (according to its flags).
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28168 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-16 12:15:02 +00:00
Stephan Aßmus
431dc47dde Patch by Artur Wyszynski with some changes by myself:
* Resolved TODO: The type of the gradient is no longer encoded twice in the
  app_server link protocoll.
* Moved instantiation of the BGradient into the LinkReceiver::ReadGradient()
  method.
* Check success for (at least) ReadGradient() in ServerWindow.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28150 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-15 19:47:00 +00:00
Stephan Aßmus
991547ef6c 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
2008-10-14 21:27:42 +00:00
Stephan Aßmus
73be167630 * Removed dead code.
* Fixed line lengths.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28102 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 19:48:35 +00:00
Stephan Aßmus
f6bffd4e5b Whitespace cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28101 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 19:47:00 +00:00
Stephan Aßmus
eeb00d5abc Small indentation improvement...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28084 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 13:21:43 +00:00
Stephan Aßmus
e385b2434f * Added clarifying comment.
* When the consumer does not want to consume a glyph, make
  sure the advance values are being reset before breaking out of the
  loop. These are used one more time after the loop.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28083 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 13:20:29 +00:00
Stephan Aßmus
47ddcdba73 Removed superfluous parenthesis.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28082 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-14 13:19:15 +00:00
Stephan Aßmus
350b87c7d2 zooey + axeld + stippi:
Fixed a problem with dispatching B_MOUSE_MOVED messages to views which need
the transit event:
* If the app_server decided to send a B_MOUSE_MOVED to the previous mouse
  containing window, it forgot to add the _feed_focus flag, which was a problem
  if the message actually happened to contain tokens (views that registered
  for events.) On the client side, only those views would receive the message,
  while the regular last mouse moved view would not be notified at all.
* On the client side, never change fLastMouseMovedView if the message is not
  targeted at the preferred handler. In the above situation, any "registered
  for events views" would receive the message first, but viewUnderMouse would
  be NULL and then when the regular last mouse moved view received it, it
  resulted in the wrong transit (B_OUTSIDE_VIEW instead of B_EXITED_VIEW).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28059 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 23:16:30 +00:00
Stephan Aßmus
18510f899b Added input_server icon by zuMi. Thanks!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28041 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-13 15:52:05 +00:00
Axel Dörfler
36bde12db2 * DHCP now actually uses the new SO_BINDTODEVICE socket option to make sure
the request is sent only on the device it should.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28017 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 23:34:08 +00:00
Jérôme Duval
efc97b9894 made several inherited methods virtual
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27993 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-12 13:07:01 +00:00
Axel Dörfler
3add2e79b7 * If you click on a window in the Workspaces view, it won't move until you
move the mouse a bit more. This should help with "fast" workspace switches
  when you click on a workspace and accidently move the mouse a bit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27977 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 20:06:04 +00:00
Stephan Aßmus
f7d800884d Polished the rendering of the miniature windows in Workspaces.
* The window names are now drawn.
* The window scaling is improved to avoid wobbly placement
  when windows move slightly.
* The tab rect is scaled to size, not a single line.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27976 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-11 18:25:36 +00:00
Stephan Aßmus
877f6beaec zuMi was at it again and created a cool icon for the mail_daemon. Almost a pity
to use this gem for a background application. :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27958 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-10 19:14:20 +00:00
Axel Dörfler
54f92239a2 * The ServerWindow now memorizes the original BDirectWindow feel when switching
to full screen. Since BDirectWindows can have any feel, this does now
  correctly restore it instead of always reverting to B_NORMAL_WINDOW_FEEL.
* This fixes part of bug #2808.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27920 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-08 07:46:27 +00:00
Stephan Aßmus
dc2da019f9 zuMi created a pretty awesome icon for the debug server. It could be improved
(for better silhouettes), but I think it's pretty cool as is! Thanks a lot!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27915 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-07 21:48:37 +00:00
Stefano Ceccherini
36bc11a79f I'm getting old. Without this change, bug #2350 was still with us. Sorry for forgetting to commit this
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27903 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-10-07 13:06:16 +00:00