Commit Graph

62167 Commits

Author SHA1 Message Date
Adrien Destugues
a11a58d4d0 ffmpeg: avoid assert in ffmpeg
The input colorspace must be set.
2020-08-05 23:06:31 +02:00
Adrien Destugues
4fb9b30056 PowerStatus: exit early if no battery is detected.
Fixes #7472
2020-08-05 19:47:38 +02:00
Adrien Destugues
ca6302dded BTextView: remove useless and heavy computation
There is no point in computing line breaks for a 10px wide text view and
it takes a long time because it needs a lot of linebreaks. The view
eventually gets laid out properly.

This may cause regressions, the TODO here is very old and I don't know
to which "other parts of the code" it refers. Possibly they were
rewritten, possibly not. In any case, there is no point in keeping this
nonsense initial text rect computation, it's better to fix the actual
problems.

Fixes #5582 (which was not locale-related, after all)
2020-08-05 18:39:28 +02:00
Adrien Destugues
0d1f89e1a3 TranslatorRoster: avoid a deadlock when launching BeLive
If be_app is not running yet, trying to lock it may easily end up in a
deadlock.

Fixes #2105

However, as a result of this, when this situation happens, the
translator roster will not be node monitoring added/removed translators.
This was already the case if BTranslatorRoster::Default was called
before BApplication constructor, now it's also the case if called inside
the BApplication constructor or from another thread before it finished
running.

Maybe BTranslatorRoster should try to register itself later on if it
detects this. But it's acceptable to have the app not monitor
translators, because adding and removing translators isn't a very common
occurence and restarting the app to get it to notice them is probably
ok.
2020-08-05 15:39:19 +02:00
Adrien Destugues
9027ca04e2 Tracker: fix infowindow resizing
Fixes #16053
2020-08-05 14:40:06 +02:00
Adrien Destugues
2c09e0dc7f Installer: separate writing bootsector from other install finishing code
Remove the InstallerInitScript (it does nothing) and the
InstallerFinishScript (it does too many things). Instead implement the
finishing directly in Installer. Separate writing the bootsector, so
that the "write bootsector" menu writes only the bootsector.

Fixes #16303
2020-08-05 12:52:04 +02:00
Adrien Destugues
d077ef8a1a better error message when xsave context is too small 2020-08-05 12:31:10 +02:00
Adrien Destugues
daf10ef340 install-wifi-firlwares: stop using haiku-files.org
- Move the firmwares to github
- Move broadcom fwcutter to a package

Fixes #11841
2020-08-04 10:52:19 +02:00
Adrien Destugues
b4b9e2089f libicon: reorder gradient stops when loading from BMessage
Some files have gradients stops stored in an incorrect order.

Fixes #14210
2020-08-02 17:42:44 +02:00
Adrien Destugues
e4c945bd5a Icon-O-Matic: fix filename length limitation
The code was using B_OS_NAME_LENGTH instead of B_FILE_NAME_LENGTH.
Use of BString allows to put the different sizes in a loop.
2020-08-02 17:27:49 +02:00
Adrien Destugues
1bad1ff34a Prepare for ICU update
- libicule and libiculx do not exist anymore in newer ICU versions
  (harfbuzz replaces them), but we didn't actually use them, so remove
  them from the build feature and from the package dependencies
- Add namespace usage marcos since the newer ICU packages put ICU things
  in a namespace, making it easier to have multiple versions of ICU used
  side by side.

No functional change intended, but this makes it possible to build the
code with either ICU 57 (for gcc2) or 66 (for other architectures).
2020-08-02 11:58:14 +02:00
Michael Lotz
b3aed2adb5 VMUserAddressSpace: Don't print unset reserved area name in KDL.
Reserved areas don't have the name field initialized, so explicitly
print "reserved" instead.

Change-Id: I26bcfcb8facb8b5df11a58074506e96a41943e31
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2847
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 19:23:27 +00:00
Michael Lotz
7d432fc911 VMKernelAddressSpace: Let Dump() print all ranges.
This makes the output of the aspace KDL command more useful as it shows
reserved and free ranges in addition to areas.

Change-Id: Id6353820b7c040fce6bfc3297c1b34adb1c9bb99
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2846
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 19:23:27 +00:00
Michael Lotz
2555f33549 Cleanup: Various comment and whitespace fixes.
Change-Id: I37c3e3346813efc595df651421b7e8ff4fbf3339
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2845
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 19:23:27 +00:00
Michael Lotz
b3bd66961a libroot/kernel: Implement MADV_FREE madvise() extension.
It allows an application to signal that it no longer needs the data in
the given address range and the underlying pages can be discarded and
reused elsewhere. This is finer grained than working with full areas
or mappings at a time and enables unmapping sections of partially used
mappings without giving up its address space.

Compared with punching holes into a mapping by "mapping over" with
PROT_NONE and MAP_NORESERVE, this has the obvious advantage of not
producing a lot of unused extra areas and saves the corresponding
resources. It is also a lot "lighter" of an operation than cutting
existing areas.

This introduces madvise() alongside the existing posix_madvise() to
allow for OS specific extensions. The constants for both functions are
aliased, the POSIX_MADV_* being a subset of the MADV_* ones without the
non-POSIX extensions. Internally posix_madvise() simply calls madvise().

MADV_FREE is commonly supported in other OSes with various subtle
semantic differences as to when pages are actually freed/cleared and how
or whether the pages are counted against the memory use of a process.
In the variant implemented here, pages are always immediately discarded
and memory counting is not altered. This behaviour should be considered
an implementation detail and may be altered later. The actual unmap and
discard could for example be delayed until pages are needed elsewhere to
reduce overhead in case of repeated discarding and remapping.

Note that MADV_FREE doesn't really align with the rest of the madvise()
API as it works like a command (i.e. discard these pages) and does not
add an attribute to the pages in the given range (i.e. mark these pages
for quick access from now on). As such, an MADV_FREE does not need to be
undone by setting a different advice later on, unlike how the other
flags work. This discrepancy may be the reason why it is not part of
POSIX.

Change-Id: Icc093379125a43e465dc4409d8f5ae0f64e107e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2844
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 19:23:27 +00:00
Michael Lotz
8e74e30784 kernel/vm: Add discard_address_range that discards pages.
Pages in the given range are unmapped and freed without getting written
back anywhere. It can be used whenever a caller does not care about the
data in the given range anymore and wants to reduce page pressure.

Change-Id: I8bcce68fab278efef710d3714677e1d463504a56
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2843
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 19:23:27 +00:00
Adrien Destugues
4bfc0072e3 limits.h: ncrease ARG_MAX
The limit was set when creating limits.h back in hrev88. It seems to be
used only in glob(). The limit is quite low by today standards and
prevents building icu 67.

I guess the liit was put at 32K because that's what BeOS did, but I see
no reason to keep it that way.

Change-Id: I74f95d9b56891dd90c79b7ced35ca8d1ec81d6ab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3117
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 17:37:01 +00:00
Alexander von Gluck IV
c17fa27430 efi: Switch to direct EFI loader creation
* efi-app-x86_64 is a undocumented legacy compatibility
  target from the early days of EFI.
* This opens the door to native arm,arm64 loaders without
  the gnu-efi 'fake pe' stubs in the future.
* This change also clairifies what's happening within the
  undocumented efi-app-x86_64
* Future as in binutils fixing these:
  https://sourceware.org/bugzilla/show_bug.cgi?id=26206
  https://sourceware.org/bugzilla/show_bug.cgi?id=26218

Change-Id: I60b4a4f5ceb36059033debbe6bf5b01928d6b223
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3016
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2020-08-01 16:16:23 +00:00
Autocomitter
7e8f3368fa Update translations from Pootle 2020-08-01 08:07:47 +00:00
Michael Lotz
de6a5cb90c Cortex: Fix buffer overflows in label truncation.
The label to be truncated was copied into a fixed width buffer without
taking the null byte into account which would make
BFont::GetTruncatedStrings() read out of bounds when the name got long
enough. The output strings were also not allocated with the required
extra space for the ellipsis which would possibly have caused the
output to overflow.

Since the goal is to truncate a single string, remove the entire
temporary extra allocations and simplify to use BFont::TruncateString()
directly, which avoids both problems by being BString based.

Change-Id: Ib57430faf6f706c705497191000ee9686441857e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3116
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 02:04:43 +00:00
Michael Lotz
6199db56e1 STXTTranslator: Fix use-after-free of encoding name.
The name retrieved from GetName() on BTextEncoding is owned by that
instance which goes out of scope when identify_text() returns. A const
char pointer to it can therefore not be used as an output variable. Use
a BString instead which ensures an appropriate reference is acquired.

Change-Id: Ib87fc9879d29e927bb41d1a9165ca7599b74a3bf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3115
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-08-01 02:04:43 +00:00
Michael Lotz
75b8b6863a kernel: Return after panic when freeing invalid interrupt range.
The panic is continuable, but moving on with the free will overrun the
array and corrupt memory.

Change-Id: I9a5849a40158042150a25740ca57d711aee872bf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3114
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-31 23:36:55 +00:00
Michael Lotz
4b6a48f4ae kernel: Check interrupt vector isn't assigned to a CPU on free.
If the vector is assigned to a CPU it means that the assignment
structure is still referenced from the CPU side and must not be reset.

This can happen when an interrupt vector is freed that still has a
handler installed, i.e. when the order of removing the handler and
freeing the vector is reversed.

Change-Id: Ib2dc5fa8f95a28b36e8f150dc8f16236ca4b2275
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3113
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-31 23:36:55 +00:00
Michael Lotz
d9ff5e5637 hda: Remove interrupt hanlder before freeing interrupt vector.
Freeing an interrupt vector that still has handlers is not allowed.

Change-Id: If2f256e5288c7a61b7e23bdb202f259f5b67b7ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3112
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-31 23:36:55 +00:00
Michael Lotz
c7c0cf726e multi_audio: Replace old buffer infos with old cycle numbers.
The old buffer info was not initialized so would possibly contain bogus
initial content.

Since the introduction of the TimeComputer, the old buffer info was not
used to update the timesource data and the only remaining use was for
keeping track of the previous cycle number.

Replace the old buffer info by just the old cycle number and initialize
that.

Change-Id: I8be5a17f086a9f81f9b8fd0629e10460518f3d8c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3111
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-31 23:36:55 +00:00
Emir SARI
24cc0d5a4a [Mail] Add ALT+, settings keyboard shortcut
Change-Id: I9af6ddf32dbaad5cf451ced5380ac63cf0eca3e6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3095
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-31 09:01:12 +00:00
Alexander von Gluck IV
312ace5631 bootloader/efi: Support 32-bit kernels
Change-Id: I82465c3002cbf58fad79b9621074cafd8fbd16e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3106
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2020-07-30 12:37:19 +00:00
Andrew Lindesay
fa5c8097c9 HaikuDepot: Languages List
Abstacts the list of supported languages into
the LanguageModel class preventing use of
List.  Also; fix a few cases where newer
logging techniques may have caused incorrect
logic flow.

Relates To #15534

Change-Id: I144fe4788abdaf0d93e53eeabc97b3f7aa2ec710
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3085
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-30 07:09:55 +00:00
Alexander von Gluck IV
861cf377b4 arm/efi: Add missing init_array to linker script.
* Nice catch mmu_man!
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46770

Change-Id: I8512b32687a292427295bbaa3ebf60396eac300f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3105
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-30 02:01:30 +00:00
Adrien Destugues
b78a83eb29 app_server: Style fix 2020-07-29 20:13:58 +02:00
Adrien Destugues
fd3f9c4126 Allow setting a "full and half fixed" font as the system fixed font.
Fixes #14424.
2020-07-29 20:13:58 +02:00
Augustin Cavalier
d548fb2b3e Tracker: Rework BFilePanel compatibility code.
Instead of adding "dummy views", leave the original views intact
and just add a resizing hack to take care of any movements that
apps have inflicted.

Fixes #16411, a crash in WonderBrush, and compatibility issues
in some other applications.
2020-07-28 21:53:19 -04:00
Augustin Cavalier
494bd14713 HaikuDepot: Let BScrollView handle resizing the scrollbar bounds.
This way, it will also resize the views properly when the scrollbars
are larger.

Fixes part of #16408.
2020-07-28 21:06:03 -04:00
Augustin Cavalier
a06b52bee8 BScrollView: Revert to earlier document-window adjust behavior.
We need a different constant or mechanism to get the document
window border size, it appears, or a static method to get
a scroll bar's preferred size.

Should fix #16422.
2020-07-28 21:04:24 -04:00
Augustin Cavalier
64ba528788 libroot/glibc: Remove two unneeded headers.
The system nl_types.h suffices for this.
2020-07-28 20:39:22 -04:00
Alexander von Gluck IV
6f92b552f3 libroot: Add fake libc static library
* It's specified in POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html
* wine hardcodes a -lc in its winegcc compiler

Change-Id: I592b62085787d8f1a1ead2df32e978a91ab03ea9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3086
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-28 17:01:13 +00:00
Panagiotis Vasilopoulos
6a40fd892c Cleaned up InstallerApp
- Removed outdated, unused EULA text
- Removed unused BAboutWindow instance
- Changed instance name from 'theApp' to 'installer'

Change-Id: I6b8e078dc6e469df4cd2f254ccab719c061561d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3066
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-28 17:01:11 +00:00
Emir SARI
60a6f1d5d7 Set Noto Sans Mono as monospace default font
Should help improve [1].

[1]: https://github.com/haikuports/haikuports/issues/3116

Change-Id: I29dd94e3380c3a5935d47d97e2a2ac1c5fb7e774
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3070
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-28 16:42:18 +00:00
Adrien Destugues
e10762d1ce Set a version for Noto font dependency 2020-07-28 18:27:18 +02:00
Adrien Destugues
affb3a4a62 Expander: don't allow selecting text while listing files
Selecting moves the cursor and results in file listing being inserted
at the wrong place.
2020-07-27 21:14:59 +02:00
Adrien Destugues
d0e9e3ca27 Printer test page: fix typo
No functional change intended.
2020-07-27 19:47:14 +02:00
X512
6aee9d6424 Tracker: fix count view border problem
Fixes #16439.

Change-Id: If936517a0ecfaba994f5d48fcc2fd159cb8ea11f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3093
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-26 03:07:11 +00:00
Michael Lotz
cf238ffce1 multi_audio: Fix use of uninitialized entry to calculate drift.
Two indices into the fEntries ring buffer are used in TimeComputer,
fLastEntry which points to the most recent sample and fFirstEntry which
points to the oldest one. The drift calculation then uses the oldest
values pointed at by fFirstEntry to produce smoother values.

Both indices are initialized to 0, then fLastEntry is incremented prior
to writing the first sample, resulting in the first sample to be written
to fEntries[1]. When drift is calculated on subsequent samples, they
were using the uninitialized data from fEntries[0] due to fFirstEntry
still pointing there, until enough samples had been added for
fFirstEntry to be moved forward. The resulting incorrect drift values
would depend on the entry content and ratio between real and performance
time and generally end up being much too small.

The drift values are published on the time source and used to correct
the conversion between performance and real time in
BTimeSource::RealTimeFor(). Given the incorrectly small drift values,
this conversion produced real time values far in the future, causing
increased delays in processes that wait for such computed real times.

One likely victim was the startup of the AudioMixer, as it generally
starts soon after the driver and its MultiAudioNode. If it started right
in the time window where the drift was broken, it would end up delaying
its initial buffer processing by a factor generally depending on the
difference between real and performance time start points, so usually
the difference of the start of the boot process to the start of the
audio driver.

The symptom was then noticable by initial silence after boot, as the
mixer was not producing any buffers until the wrongly calculated real
time had been reached. After that, lots of queued up events were
processed at once, resulting in a CPU spike and glitchy audio for a
couple of seconds after which audio finally normalized. As the problem
was in the MultiAudioNode all mutli audio drivers were affected, HDA
being the most prominent.

As the erroneous delay depended on the initial entry content and the
boot time, it was highly variable. Whether or not the mixer was affected
at all also depended on it starting reasonably early after the driver,
which made the symptom of the bug appear and disappear depending on
slight timing changes, making unrelated code changes look like they were
affecting the bug.

The fFirstEntry index is now updated to fLastEntry after the initial
entry is added, so that the drift calculation always uses valid data.

Fixes #16222, may also affect #15472 and possibly other "no audio"
tickets in case they are really "delayed" audio tickets.

Change-Id: I61f4a67e8b8bf14d2f311cb41b24a1c385aebc19
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3092
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-26 00:42:59 +00:00
Leorize
b4024938bd BUrlProtocolListener: Update DownloadProgress() docs
Updated to reflect the consistency changes done to
BUrlProtocolListener::DownloadProgress().

Change-Id: I05cfac647507a3fff294900a107293b85eff60fb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3079
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-25 18:13:20 +00:00
Leorize
7bac04e684 HttpRequest: Don't wait for socket to be readable
The socket is a blocking one, which means Read() will block unless data
is available, thus WaitForReadable() is useless in this context.

Testing also shows a 2x performance increase from removing this call due
to poll() performance being botched when KDEBUG_LEVEL >= 2.

Change-Id: I3170f865e961112b420c1548726bb6fd38e94cb2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3078
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-25 18:13:20 +00:00
Leorize
846c12f5df HttpRequest: Use an ArrayDeleter to manage the temporary buffer
This make sure that the temporary buffer will always be deleted should
any premature return happens.

Change-Id: I448ec7c3f3eeca1ef2b6473b49323f34bcb7bf86
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3077
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-25 18:13:20 +00:00
Leorize
0d0f613f17 GopherRequest: Don't wait for socket to be readable
Instead we can trigger a Read() immediately, as our socket is blocking
and won't return until some data has been made available. This avoids a
potentially costly syscall in the loop body.

Change-Id: I899f55ede41af7cb7e9311aa04006b33c40d3ee4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3076
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-25 18:13:20 +00:00
Leorize
d64d305cf6 GopherRequest: Accurate progress reports and listener bugfixes
This commit brings the following changes:
- DownloadProgress() should now be reported for every DataReceived()
calls, similar to other BUrlRequest classes.
- Properly verify whether a listener has been set before invoking them.

Change-Id: I4ded82e318ba580b8869c3d1751da4e36882c39f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3075
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-25 18:13:20 +00:00
Leorize
2056d60ff1 DataRequest: Use ArrayDeleter to manage the temporary buffer
This simplify the clean up code path and make sure that the temporary
buffer will always be freed on exit.

Change-Id: I70c1a25bfa66c4f4a96dd3d0af3765a67e305fb2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3074
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-25 18:13:20 +00:00
Leorize
e1de8e8c21 DataRequest: More consistent progress report
Trigger DownloadProgress after DataReceived, similar to how other BUrlRequest
classes behave.

Change-Id: I4858c3736b1b1ebec55af9903dbfd4b976a77df3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3073
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-25 18:13:20 +00:00