+ has greater operator precendence than ?, so we need parentheses when
using both in expressions. Both of these look like actual bugs.
Spotted by Clang.
joystick_info contains BLists which initialize themselves upon new(),
and Clang warned (correctly) that using memset() overwites that, as well as
RTTI and other data that they contain. So instead, only memset the first
part of the struct, and then manually initialize the other members.
Fixes#14217.
- When in non-interactive mode, i.e. saving a crash report, don't
allow the image debug info loader to automatically grab missing but
available info packages. Otherwise we potentially download very large
packages with the user being entirely unaware, i.e. the 200MB debug
information package now present by default for gcc7's libgcc. This
should eventually be made a configurable preference though.
The Flatten and Unflatten method should check the size according to the
matching FlattenedSize method, not a possibly overriden version.
May also fix#14128 since we avoid use of the vtable by doing this.
the size of BAffineTransform is architecture dependent, so we transmit
its contents in a standard array instead.
Change-Id: I907110742168846a869a48bb2d116cc5292ec7d0
my.justenergy.com allows only RSA, so we can't connect there without
this. Other websites may have a similar problem.
Also improve the handling of the error, as it was giving a generic
"general system error" to the user.
Fixes#13975.
The debug build of the packagefs kernel addon failed because user_memcpy had no type.
Using the correct headers for user_memcpy and IS_USER_ADDRESS fixed the issue.
DwarfImageDebugInfo:
- In some, but not all cases, gcc5 generates type information where the DIEType
is a child of a namespace rather than of its containing compilation unit.
This needs to be taken into account when building our name lookup table, as
we'll otherwise not find the full definition of such types when attempting to
locate them for corresponding variables. Fixes an issue reported by Axel.
* At this point we want to avoid the user calling the callbacks
in the form of BMediaConnection. Instead we force to use the
BMediaInput and BMediaOutput versions.
TypeHandler:
- Add name field for presentation purposes. Adapt subclasses accordingly.
TypeHandlerRoster:
- Add methods to count and retrieve all type handlers for a given type,
and adjust CreateValueNode to allow for passing in an explicit handler.
Adjust callers accordingly.
VariablesViewState:
- Add helpers to store an explicitly chosen type handler for a node.
TypeHandlerMenuItem:
- ActionMenuItem subclass that takes care of reference management
for its contained type handler.
VariablesView:
- Add context menu for choosing type handlers if applicable. Implement
support for invoking said type handlers in a similar manner to explicit
typecasts.
- Adjust saving/restoring the view state so that hidden nodes are taken
into account as well. This is necessary since it may be the case that
the handler had to be applied to the hidden child rather than the visible
node (i.e. the BMessage handler when applied to a pointer to a BMessage).
All together, these changes allow choosing to switch between views of a type
when the Debugger has multiple handlers for it. For example, for BMessages
this allows switching between displaying the raw underlying structure vs
the decoded message content.
AttributeClasses:
- Fix typo in get_attribute_name_classes which resulted in us not
handling DW_AT_linkage_name properly.
- Fix incorrect class specification for DW_AT_default_value due
to inconsistencies in the DWARF documentation (the table of attribute
classes indicates it is only a reference, but the detailed description
indicates it also being possible to be a flag or constant, both of
which gcc outputs).
DebugInfoEntries:
- Add accessor for DIEClassBaseType's inner types.
DwarfImageDebugInfo:
- When looking up types, create a basic target interface to pass on
to the type context. Otherwise, type lookups that required DWARF
expression evaluation would crash.
- When building the type name table, we now recursively walk a class's
inner types, and add them to the list as well. This omission would
cause the debugger to lack the type description for such classes,
and consequently be unable to display their details in the variables
view.
AbstractTable/Table/TreeTable:
- Let BColumnListView take care of deleting columns. The previous
approach was resulting in the columns being leaked.
Debugger:
- Don't detach the UI reference, as TeamDebugger will acquire its own.
GraphicalUserInterface:
- Cleanup of file panel handler.
SourceView:
- Clean up marker manager.
*Roster:
- Clean up registered objects in destructors.
GlobalTypeLookup:
- Clean up hash tables.
NetworkTargetHostInterfaceInfo:
- Fix reference handling for settings.
BListValueNode:
- BList's item count member is an int32. However, when the handler was reading
said variable, it was mistakenly reading the number of bytes corresponding to
to the address size of the architecture instead.This would cause the read to
fail, and consequently BList and/or BObjectList variables to not display
their contents properly on x86-64.
- 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.
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().
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.
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
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.
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.
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).
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.)
- 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.
* 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.
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.
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.
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.
* 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.
because the bound scrolls to the current cursor to view the text (ScrollToOffset).
Follow up #12608
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
* Actually set status before testing it
* sscanf (reads from passed buffer) not scanf (reads from stdin)
* &httpStatus not httpStatus.
Found by Coverity.
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!
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.
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.
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.
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
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.
* 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.
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>
_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>
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.
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.
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
Only using the keyboard navigation colour to indicate the current day isn't that
nice in all situations. When using custom system colours, like white on blue
for selected items, it can become barely readable.
Now we
* use bold type face for 'today',
* tint 'today's background (lighten for dark, darken for bright bgColor),
* use B_LIST_SELECTED_BACKGROUND_COLOR and B_LIST_SELECTED_ITEM_TEXT_COLOR
for the selected day,
* keyboard navigation colour only for the frame and text when doing keyboard
navigation
Fixes#13714
* Use BDateFormat::GetDayName() to fetch weekday names.
* Use appropriate symbol width(Mon, Mo, M) depending on the frame width.
* Provide functionality to update day name header in case of locale
preferences change.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>