Commit Graph

8831 Commits

Author SHA1 Message Date
Rene Gollent
3995592cdf Debugger: Fix #13939, more work on #13800.
- Fix various cases where OpenHashTables weren't being cleared properly.
- Fix various reference counting errors.
- Simplify FileManager reference handling.
- Fix bug in LocatableDirectory where the directory named '/' would have its
  name returned as empty. This would lead to failed lookups for entries already
  in the table, and ultimately corrupted the hash table when deleting unused
  entries, leading to #13939. This was previously never noticed due to the
  entries not being freed properly.
- AbbreviationTable wasn't clearing its entries.
2018-01-10 19:29:36 -05:00
Jérôme Duval
8c44fc0f65 PackageKit: tweak classes used by packagefs to write to user buffers.
when compiled in kernel mode, BMemoryIO::WriteAt() and BBufferDataReader::ReadData()
now check the buffer to write to, and eventually call user_memcpy() instead of memcpy().
2018-01-09 20:40:12 +01:00
Rene Gollent
b1ab02c434 Debugger: More memory management fixes.
DwarfImageDebugInfo:
- Type name/info entries weren't being freed properly.

BaseUnit:
- The array of entries itself was being destroyed, but not the actual
  objects. Consequently none of the DIE objects were ever being freed.

CfaRuleSet:
- The register rules array wasn't being freed.

FileManager:
- References to entries weren't being released. Some more work remains to be
  done here though, as a subset of these objects still have a non-zero ref
  count in the end.
2017-12-31 17:52:59 -05:00
Augustin Cavalier
8a9e1e0d4a Removal of non-Haiku target platform logic from build system (part 1.)
Following recent changes to use libroot_build on Haiku also, it is now
actually impossible to build Haiku components on non-Haiku platforms
(BeOS R5, Dan0, BONE, Zeta), so we can remove any logic related to this.

This is only the first part; still to be removed are:
 * SetSubDirSupportedPlatformsBeOSCompatible
 * HOST_PLATFORM_BEOS_COMPATIBLE
 * TARGET_PLATFORM_BEOS_COMPATIBLE
2017-12-31 16:14:22 -05:00
Rene Gollent
3d9b569384 Debugger: Further work on memory leak hunting.
TeamWindow:
- Properly delete stack frame selection entries in destructor.

TeamDebugger:
- The reference to TeamDebugInfo wasn't correctly initialized to own,
  leading to TeamDebugInfo never being destroyed.

FunctionInstance:
- Also clear source code reference in destructor.

ImageDebugInfo:
- Release references to specific infos in destructor. These are acquired
  on our behalf when loading the image info, but were never released,
  leading to the latter never being freed.

DwarfManager:
- Release references to files in destructor.

FileManager:
- Release entries in various destructors.

Somewhat improves the situation in #13800, but is still far from complete,
as a thorough review of this nature hasn't ever really been done.
2017-12-28 23:22:13 -05:00
Rene Gollent
8bb774fc37 Debugger: Fix a memory leak.
TeamDebugger:
- In several cases, BReferences on thread handlers after a call to
  _GetThreadHandler() weren't correctly initialized to account for
  that function implicitly acquiring a reference on our behalf, leading
  to the reference count to spiral out of control, and consequently the
  handler would never be freed. Found while attempting to address
  #13800, likely more to come.
2017-12-27 23:52:13 -05:00
Augustin Cavalier
3305611025 Mail Kit: Delete now-unused DES implementation. 2017-12-26 13:59:25 -05:00
Adrien Destugues
197c659920 libnetwork: re-introduce gethostbyname_r and gethostbyaddr_r
These are needed by existing openjdk package. Let's keep them until we
get the OpenJDK build working again and can remove the requirement.
2017-12-19 21:22:14 +01:00
Adrien Destugues
a9020afcb6 BHttpHeaders: fix gcc5 build. 2017-12-07 22:45:44 +01:00
Adrien Destugues
ed8f28a480 Move HeadersReceived hook after parsing of cookies
I still don't get what's happening, but doing the cookie parsing at the
same time as the main thread is handling HeadersReceived seems to
trigger a memory corruption, and it will escape all my attempts to debug
it (adding printfs or any other slight change to the code will make it
go away). So just chage the order we do things and hope that's enough to
always avoid it.

As a side effect, HeadersReceived can now rely on the cookies being
already stored in the cookie jar, which I think makes more sense.

I still plan to rewrite the HTTP request code as a proper state machine,
instead of one long Run() function. This would allow to run it in
smaller steps, and thus group multiple requests in a single thread
(triggering them from poll, select, or similar).
2017-12-07 22:45:44 +01:00
Augustin Cavalier
f3114cade7 Tracker: Add shortcut_catcher to UseHeaders.
Tracker uses KeyInfos.h from it. Previously this wasn't needed
due to the SEARCH_SOURCE added in the Shortcuts preferences,
but as that is now just a UseHeaders, we need it here (if only
for the DoCatalogs.)
2017-12-05 20:14:21 -05:00
Augustin Cavalier
47bedf1601 PackageDataInlineReader: Do not use fData before it has been set.
Spotted by Clang.
2017-12-02 22:24:55 -05:00
Rene Gollent
737de463dd Debugger: Fix #13797.
- When reading the areas note, there was no check in place to ensure that a
  matching segment for the address was actually found. This would later lead
  to a crash when attempting to read memory from the corresponding (missing)
  piece of memory in the core.
2017-12-02 15:58:28 -05:00
Axel Dörfler
e96835a9a4 Added simple test_launch_daemon.
* Expects its config files in /boot/home/test_launch.
* Uses standard I/O, and is always in user mode.
* Also added test_launch_roster command that is able to talk to the test
  server like it does to the real thing.
2017-11-29 17:19:46 +01:00
John Scipione
4824497d01 BDeskbar: Set auto hide default value to false
Didn't notice this before so had to do a quick fix. Catch it before
Coverity can.
2017-11-27 11:50:15 -08:00
John Scipione
fd236f33cd BWindow: Update Zoom() with Deskbar window flags
Call newly created BDeskbar methods to adjust default Zoom().

if auto-hide is turned on don't consider Deskbar's frame.

In vertical mode allow windows to zoom on top of Deskbar if
auto-raise or always on top is turned on.

Deskbar can take up a significant area so you can reclaim that
space by turning on auto-raise or always on top.

In horizontal mode ignore auto-raise and always on top settings,
don't allow windows to zoom on top of Deskbar even if these
settings are turned on.

Deskbar doesn't take up very much space and you don't want your
window to get cut-off at the bottom.
2017-11-27 11:13:50 -08:00
John Scipione
fc23c09758 BDeskbar & Deskbar: export window bool settings to BDeskbar
Add methods to get and set "Always on top", "Auto raise", and "auto hide"
which are all booleans which control aspects of the Deskbar window to
BDeskbar.

Set the bool to the default value initially. Check if sending the
message succeeds, if so check the reply which also fills out the bool.
Don't check to see if reply succeeded because the bool will only be
overwritten if it did.

Follow the BDeskbar convention Is...() for getter, Set...() for setter
e.g IsAlwaysOnTop() is the getter, SetAlwaysOnTop() is the setter.

Define new message constants to call the newly created methods.
Follow BDeskbar convention: 'gtla' is used for getter, 'stla' for setter.
g/s for getter/setter, tla is an all-lowercase code unique to each
getter/setter pair.

Copy/paste these message constants into BarApp.h unchanged. Replace four
letter codes with imported message constants in BarApp.cpp and
BarWindow.cpp. Much nicer than using bare codes.

The new BDeskbar methods are all handled by TBarApp. The getters send
back a reply message containing the bool while the setters fall through
to existing setter cases.
2017-11-27 11:05:22 -08:00
John Scipione
f8811591e1 BDeskbar: Style fixes
Update Copyright in cpp, add myself, alphabetize, standardize
Pointer style in cpp
Update some comments
Some 80 char stuff
pragma section headers
whitespace
2017-11-26 20:40:00 -08:00
John Scipione
b1b84675f0 BWindow: Update default Zoom() to respect Deskbar
Zoom() takes up all Desktop area excluding the area
occupied by Deskbar. This is calculated using information
from the BDeskbar class.

Window zooms just as you'd expect -- it takes up fullscreen
minus area taken up by Deskbar. In vertical mode the zoom
area depends on the width of Deskbar, consequently Zoom()
is more space efficient in horizontal mode than vertical
mode because the window doesn't use the area below Deskbar.

If the zoom limits are smaller than the Desktop area, the
zoom area shrinks towards the center of the Desktop not
covered by Deskbar. This is slightly different behavior,
the window insets off-center following Deskbar.

In some scenarios zooming to the non-Deskbar area was too
restrictive. I made an exception that if there is enough
room above or below Deskbar i.e. a short window, then Zoom()
instead insets from the screen edge ignoring Deskbar. Apps
which meet this criteria include DriveSetup and Expander.
2017-11-26 20:04:43 -08:00
Jérôme Duval
6ac3a280f4 Add ZstdCompressionAlgorithm.
* kernel lib is decompress only (like zlib).
* expand compression_test for zstd.
2017-11-24 21:35:49 +01:00
Julian Harnath
2a493ea0e0 BView: set initial frame rect invalid when using layouting
* When a view is used with the layout system, its initial frame rect
  was set to (0, 0, 0, 0), which is a BRect covering 1 pixel in the
  top left corner of the window.
  Since this a valid rect, it can cause "badly behaved" views to
  trigger redraws of themselves and other views during the layout
  process, which is ultimately the reason for the HaikuDepot UI
  freezing while populating with packages.

  The misbehaving view in this case is BTextView. When in read-only
  mode, since commit e27a53b2, its GetHeightForWidth() implementation
  causes the view to resize (really resizing, not just simulating a
  resize) and thus it invalidates itself. This is broken behaviour,
  and needs to be fixed in BTextView. Since GetHeightForWidth() is
  called during the layout process, all the not-yet-layouted views
  have a frame of (0, 0, 0, 0). The invalidation of just the one
  BTextView in the layout then hits *all* new views that are being
  layouted (because they all occupy the same one pixel in the
  corner), and they all get redrawn.
  Many view Draw() implementations ignore the update rect, so work
  is being done. And even if not, this can cause a lot of traffic
  on the app_server link. In a test case with HaikuDepot's
  FeaturedPackagesView, adding 300 rows (each containing a BTextView,
  among other views) in quick succession caused over 6 million
  commands to travel over the app_server link, completely freezing
  the UI for a long time.

* The actual problem here is in BTextView::GetHeightForWidth() and
  must be fixed there.
  However we also put in an extra-fix here because it never makes
  sense anyway to try and draw a view that has not yet been layouted.
  So we set the initial BView frame to an invalid rect
  (0, 0, -1, -1), which will suppress any actual updating, even
  when the view actively invalidates itself, as long it doesn't
  have a size yet. (The dirty region will always end up empty
  then).

* Fixes HaikuDepot UI freezing during package population (caused by
  above described behaviour from BTextViews in FeaturedPackagesView).
  Might improve performance in other applications using BTextView
  with layouting as well.
2017-11-24 18:22:14 +01:00
hyche
484f64f315 TextInput: Align the text when typing or removing.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Closes #13796.
2017-11-23 20:12:24 +01:00
hyche
1641a0516d Fix aligning when text growing more than the right bound..
because the bound scrolls to the current cursor to view the text (ScrollToOffset).
Follow up #12608

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-11-23 20:10:11 +01:00
Augustin Cavalier
a20f4f8a85 MidiSettings: Don't leak settings in failure case.
CID 1422944.
2017-11-23 19:40:03 +01:00
Augustin Cavalier
d692d22c9d debugger/elf: Don't leak memory in failure case.
CID 1423098.
2017-11-23 19:40:02 +01:00
Augustin Cavalier
7131246873 BNetworkAddress: Close socket in ResolveForDestination.
It was closed on all the failure cases but not on the success one.
Found by Coverity.
2017-11-23 19:40:02 +01:00
Augustin Cavalier
75fa008e23 BProxySecureSocket: Fix obviously untested code.
* Actually set status before testing it
 * sscanf (reads from passed buffer) not scanf (reads from stdin)
 * &httpStatus not httpStatus.

Found by Coverity.
2017-11-23 19:40:01 +01:00
hyche
11dee0444f TextInput: Fix text width
Thanks PulkoMandy for teaching me how to use Debugger and part of the interface kit..
Fixes #12608

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

Thanks for investigating and finding the problem!
2017-11-23 11:06:25 +01:00
Augustin Cavalier
8742c1d044 Tracker: Remove now-unused bool displayingSymlink argument from InfoWindowRect. 2017-11-22 11:36:36 +01:00
John Scipione
a75fc8a7ab Keymap: simplification
Call already existing Offset() method instead of reproducing it.

Set fCharsSize in BKeymap::SetToCurrent()
2017-11-21 14:48:54 -08:00
Adrien Destugues
b140a1c340 NetworkAddressResolver: cache needs to be locked
It is not a good idea to have a thread get an address from the request
cache, while another thread is deleting said address as the cache has
grown too large. Add a lock around the cache access to make it safe.
2017-11-21 22:15:32 +01:00
Adrien Destugues
3a2b67b5ae Support for configuring screen backlight
Accelerant interface:
Introduce new hooks B_SET_BRIGHTNESS and B_GET_BRIGHTNESS. Brightness is
a float in the 0..1 range.

App_server:
Forward brightness things between BScreen and the accelerant.

intel_extreme:
Implement the hooks. Note that this only works for laptop panels, but
the driver will pretend to support it in other cases as well.

Screen preferences:
If the accelerant supports the B_GET_BRIGHTNESS hook, allow to set
brightness with a slider. Otherwise, the slidere is hidden and these
changes aren't visible.
2017-11-21 09:12:18 +01:00
François Revol
7c7390c719 work around "cast specifies signature type" from gcc2
...when build by gcc6 or 7 on my Debian Sid.
2017-11-20 17:18:08 +01:00
Adrien Destugues
d1805b9a36 BSecureSocket: use opt-out to select ciphersuites.
We just want to disable known broken ones, rather than opt-in for
working ones. This keeps the list of authentications shorter and is more
future proof.
2017-11-20 09:44:50 +01:00
John Scipione
5c6208cc0c Tracker: Line TitleView up with scroll bar arrow
Make TitleView a few pixels shorter at the default font size so that
it lines up with the scroll bar arrow to its immediate right.

Note the font size used in the title view before and still is 9px
(12px * 3/4)

Make this the minimum TitleView height even for smaller font sizes
so that the title view never is shorter than the height of a
scrollbar button.  Make the minimum font size for TitleView 8px
because 6px (8px * 3/4) was just too small to read.

As font size is made larger it will increase the height of the
titlebar to accomodate the increased font size and consequently no
longer line up with the scrollbar arrow.

The code to scale the bar height via the font height was taken from
BColumnListView. The code to position the title in the middle of the
title bar was also taken from BColumnListView.

Some included style fixes:
* Rename height to fontHeight
* Rename loc to titleLocation
* 80 column limit
2017-11-18 16:25:01 -08:00
John Scipione
aa19dd0236 BSpinner: Draw spinner buttons activated if mouse down
Fixes #13469
2017-11-16 14:11:01 -08:00
John Scipione
6a634757e6 BSpinner: Draw spinner plus sign better
The plus was a bit too tall making it look odd.
2017-11-16 11:59:16 -08:00
Humdinger
16af9b4c61 Style, no functional changes
Make termination consistant with that last commit hrev51521.
As wished and proof-read by waddlesplash. Hope all's well...
2017-11-16 19:47:59 +01:00
Owen
a4d1e64920 Make Alt-Up and Alt-W keys work for file panels.
Fixes #11979

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
2017-11-13 16:56:47 +01:00
Humdinger
346d149694 Properly terminate property_info lists
BListView's property_info list lacked termination, resulting in
garbage output at the and of 'hey getsuites'.

Use { 0 } everywhere for sake of consistency.

Thanks to waddlesplash for spotting the bug an providing the easy fix.
2017-11-05 18:43:21 +01:00
Julian Harnath
615417e5ba BFilePanel: reset to home dir if volume unmounted
* Fix bug reported by humdinger: when the volume which is
  currently shown in the file panel is unmounted, the file
  panel's window was closed and even deleted. This is not only
  inconvenient but also a use-after-free bug waiting to happen:
  an application which keeps the BFilePanel around to show it
  again later (as recommended in the BeBook) cannot know that
  it has become invalid while it was hidden (the destruction of
  the window happens even when it's not shown).

* When receiving an unmount event for the currently shown volume,
  we now reset the view to the home directory.
2017-10-30 15:19:55 +01:00
Jérôme Duval
e1ca67697e libbnetapi: style fixes only. 2017-10-26 19:30:33 +02:00
Sean Healy
7e42e5b5a4 Do not force the keyboard focus if there wasn't one
Removing tabs tries to preserve the keyboard focus, but it should also
preserve the absence of it.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-10-18 23:07:47 +02:00
Sean Healy
d566b4d9dd Fix BWindow::_FindView when the window is hidden
_FindView finds a view that contains a specific BPoint (usually used to
dispatch a mouse event to it). It should ignore hidden views, but not if
they are hidden because of their parent.

In particular, if the whole window is hidden (for example, it is used to
draw onto a BBitmap), this should not be taken into account here.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-10-18 22:36:16 +02:00
Adrien Destugues
01ef811165 BChannelSlider: use native tooltips
BChannelSlider (used in media preferences) used to implement its own
tooltip, which didn't really work (as it could draw only inside the
view), and had hardcoded colors.

Use the native BToolTip which was added to Haiku since then.
2017-10-08 21:41:15 +02:00
Adrien Destugues
a00bd28a9b Package Kit: map some curl errors to Be error codes
Trying to get something more useful than "aborted: no error" in case of
network errors in pkgman.
2017-10-07 22:09:42 +02:00
Augustin Cavalier
6aff37d1c7 Move SHA256 class to libroot instead of linking libshared into libroot.
Discussed with PulkoMandy and on the haiku-commits mailing list.

Thanks to @jessicah for compile-testing and fixing 2 small issues I missed.
2017-10-03 20:18:26 -04:00
Augustin Cavalier
db68ff23c6 Interface Kit: Make BControlLook a proper pure-virtual base class.
All of its prior functionality has been moved into HaikuControlLook.
This paves the way for customizeable control looks, which I intend to implement
in the future as part of decorators.

This is being pushed now because libbe ABI was already broken due to the
Notifications changes, so this is riding that so we only have to do a mass
rebuild once.
2017-09-30 21:12:33 -04:00
Brian Hill
8856b51897 BNotification ABI padding
Add reserved functions and data to avoid future ABI breakage
2017-09-28 22:19:05 -04:00
Brian Hill
6aa0587222 Notifications preflet and notification_server
Notifications preflet:
-Use sliders instead of text fields for width and timeout
-Remove icon size choice (mini icon looks horrible)
-Consolidate both "Enable" checkboxes into one
-Fix Revert button, remove Apply button, add Defaults button
-All changes to settings saved immediately
-Live example notification message shown when settings changes are made
-Add setting for individual apps to specify whether their notifications
	should be muted
-Remove history list (to be implemented later)

BNotification class:
-BNotification records the signature and name of application that
	created it
-New functions to get source application signature and name

Notification Server:
-Notification pop up view layout fixes and bold font size fix
-Remove notifications history from AppUsage class (will be saved in
	cache instead)
-Remove vector of NotificationView objects which isn't needed
-Get source application info from notification object, not the received
	message which is not reliable
2017-09-23 11:41:33 -04:00