Commit Graph

8927 Commits

Author SHA1 Message Date
Murai Takashi
12ed45b60f Media kit: Suppress -Werror=class-memaccess
* Add media_format::Clear(), media_format::Unflatten().
* Replace memset() with media_format::Clear()
* Replace memcpy() with media_format::Unflatten()

Fix #14156

Change-Id: I38ebc2de4915b954a15b6f4f6b40d016506910e5
2018-07-02 21:14:30 +00:00
Augustin Cavalier
4215eb6003 Debugger: Fix some broken comparisons.
* Missing parentheses in integer comparison inversion
 * !=, not ! at the beginning of expression

Spotted by Clang.
2018-06-21 22:05:27 -04:00
Augustin Cavalier
582afd9a7f interface & app_server: Fix missing parentheses near ternary operators.
+ has greater operator precendence than ?, so we need parentheses when
using both in expressions. Both of these look like actual bugs.

Spotted by Clang.
2018-06-21 22:04:31 -04:00
Augustin Cavalier
9b83a2a043 BJoystick: Fix fJoystickInfo initialization.
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.
2018-06-21 17:52:39 -04:00
Augustin Cavalier
9216fc0178 More class/struct mixup fixes.
Spotted by Clang.
2018-06-18 23:16:50 -04:00
Rene Gollent
211cb77acf Debugger: don't auto-download packages non-interactively.
- 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.
2018-06-14 16:51:32 -04:00
Jérôme Duval
cd6365c7ce style fixes 2018-05-17 22:23:36 +02:00
Murai Takashi
b08627f310 Fix catching polymorphic type by value
Replace catching polymorphic type std::bad_alloc 'by value'
with 'by reference'.
Pointed by gcc8
2018-05-16 13:49:46 +00:00
Jérôme Duval
356fc3bf06 BWindow: fix debug build. 2018-05-09 21:00:55 +02:00
Adrien Destugues
ad33fd78a5 BAffineTransform: de-virtualize some calls in flattening code
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.
2018-05-08 15:40:01 +00:00
Jérôme Duval
630e3f1410 View: move BAffineTransform out of ViewSetStateInfo.
the size of BAffineTransform is architecture dependent, so we transmit
its contents in a standard array instead.

Change-Id: I907110742168846a869a48bb2d116cc5292ec7d0
2018-05-07 07:02:57 +00:00
Jérôme Duval
27bba9c3fe registrar: flat_app_info size was arch dependent.
copy each member of app_info instead.

Change-Id: Ica8d0a195b2dbaaf57d28f2fe2f7efd73c37b2c4
2018-05-05 09:30:08 +00:00
Adrien Destugues
7dba237f7f BSecureSocket: re-enable RSA cipher suite
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.
2018-05-05 08:48:22 +02:00
Axel Dörfler
a77aa747ea launch_daemon: Added basic logging facility
* The daemon now stores many events in am internal log.
* You can use "launch_roster log" to retrieve it.
2018-04-25 10:10:43 +02:00
Fredrik Holmqvist
e3becd53ee Ternary operator proper precedence.
Going through PVS Studio blogs on Haiku.
2018-04-23 23:25:16 +02:00
Jérôme Duval
b1f1332ebb PackageKit: use the correct kernel headers.
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.
2018-04-05 17:51:13 +02:00
Andrew Lindesay
b45e8b1ef9 HaikuDepot : additional debugging for json-rpc invocations 2018-03-25 05:44:19 +00:00
Jérôme Duval
a25f7264b6 BString: fix Split() for multiple characters separators...
as suggested by Janus in #14045. Thanks!
* add a unit test for BString::Split().
2018-03-22 21:29:43 +01:00
hy che
7cf48d4e51 TextView: Remove redundant check in ScrollToOffset as PointAt() already does the check.
Change-Id: I2bf541fca84ef27749484ee1be05fb9debac32e2
2018-03-22 10:28:44 +00:00
Rene Gollent
364cbeb2e3 Debugger: Adjust type handling with namespaces.
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.
2018-03-17 17:00:50 -04:00
Jérôme Duval
09320f38d7 Roster: fix debug build on x86_64. 2018-03-10 16:03:13 +01:00
Humdinger
d87eeceea5 Layout changes to AboutWindow
Most icons don't look that nice when blown up to 128px:

Before: https://lut.im/KNZw0f8j5r/3lnnRzzFXJSewq9Y.png
With this change: https://lut.im/3XcXJZv6ad/LsYKadFOiIJo1Kbz.png

* Use a 64px icon
* Make the window resizable
* Make the window a bit wider

Thanks Janus for hints where to insert SetExplicitMaxSize()...
2018-03-05 17:40:53 +01:00
Barrett17
2cb3cabcb0 MediaClient: Revert debugging edits
* The -a argument ended up in my git commit inadvently,
sorry about that.
2018-03-03 16:20:34 +01:00
Barrett17
6072c6f1cb MediaConnection: Cleanup after disconnect 2018-03-03 16:15:24 +01:00
Barrett17
65a94fbbaf MediaConnection: Fix Disconnect bug 2018-03-02 04:02:16 +01:00
Barrett17
852b62956b MediaClient: Rename IsRunning to IsStarted 2018-03-02 03:58:54 +01:00
Barrett17
a6ac14c71c MediaClient: Add ClientRegistered callback 2018-03-02 03:34:25 +01:00
Barrett17
1c15261f5a MediaConnection: Add connection name handling 2018-03-02 03:18:26 +01:00
Barrett17
83bcc405f3 MediaClientDefs: Cleanup unneded methods 2018-03-02 00:52:33 +01:00
Barrett17
d717df83d3 MediaClientNode::GetLatency use base version 2018-03-01 22:56:04 +01:00
Barrett17
9391114b8e MediaClientNode: Remove unuseful Disconnect calls
* While those calls were unharmful, better to remove them.
2018-03-01 22:55:03 +01:00
Barrett17
f015d06b84 MediaClient: Remove Preroll and SyncTo 2018-03-01 17:09:24 +01:00
Barrett17
6dc7d85423 MediaConnection: Review format negotiation mechanism 2018-03-01 17:09:24 +01:00
Barrett17
182ec76b44 MediaConnection: Remove format change protocol 2018-03-01 17:09:24 +01:00
Barrett17
444d8ec0e2 MediaConnection: Hide connection callbacks
* 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.
2018-02-27 02:43:38 +01:00
Barrett17
ff56eda570 MediaConnection: Move buffer management on producer side 2018-02-27 01:50:09 +01:00
Barrett17
9cf18a39cd MediaConnection: BufferSize should be inherited
* While it's trivial for audio to calculate the buffer size,
it isn't the same for video.
2018-02-25 23:44:33 +01:00
Barrett17
befa252fbf MediaConnection: Non simple connections should be inherited
* BSimpleMediaConnections are provided for that.
* Make SetOutputEnabled private.
2018-02-24 16:13:34 +01:00
Barrett17
c61ffa962e MediaConnection: Remove latency range interface
* In preparation for the introduction of BMediaGraph.
2018-02-24 15:42:16 +01:00
Barrett17
72958d8ba8 MediaClient: Remove SetRunMode 2018-02-24 02:30:40 +01:00
Rene Gollent
770075026c Debugger: Rework type handlers to allow for custom selection.
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.
2018-02-04 14:13:01 -05:00
Jérôme Duval
43e75989a6 libnetwork: link against the arch specific libbsd and libutil. 2018-01-30 19:19:18 +01:00
Axel Dörfler
08a4536b1f BMessage: Added missing [Get|Set]Pointer()
* SetPointer() was declared, but not defined.
2018-01-29 21:43:21 +01:00
Rene Gollent
ac9e464b78 Debugger: Fix various issues in the DWARF subsystem.
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.
2018-01-12 22:23:57 -05:00
Rene Gollent
c0936b5a03 Debugger: Another set of #13800 fixes.
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.
2018-01-11 22:39:55 -05:00
Rene Gollent
ffe684b96c Debugger: Fix type issue in BList handler.
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.
2018-01-11 22:39:55 -05:00
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
Humdinger
9d30b95ab3 BCalendarView: change visuals for 'today'
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
2017-09-22 18:27:43 +02:00
Akshay Agarwal
42745b94f8 BDateFormat: Properly map day values to ICU day-of-week.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2017-09-16 17:42:54 +02:00
Augustin Cavalier
bfbb965580 Interface Kit: Remove more non-BControlLook code. 2017-09-10 14:58:35 -04:00
Akshay Agarwal
22d88eb415 BCalendarView: Adjust day name format to available space.
* 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>
2017-09-01 20:20:06 +02:00