Commit Graph

64990 Commits

Author SHA1 Message Date
PulkoMandy
5f88744263 BMenuField: allow to use non-fixed size in combination with layout mode
In fixed size mode, the menu field always uses all the available width.
In non-fixed size mode, the menu field will resize itself to be as small
as possible.

With layout, usually the difference isn't noticeable, since the layout
will already try to resize the control to the smallest possible size.
But there are a few cases where it makes a difference, when the layout
is over-constrained and the menu field can't be made as small as
possible. In that case, the menu field would be forced to fill its
allocated space, where we can instead make it a little smaller.

Change-Id: I911d497218a09aab3824865968558df5d4b3cf98
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6076
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-21 10:47:46 +00:00
Pascal Abresch
40a7fe3f68 Api docs: style search
Change-Id: I11cf0ae20ff7fc34dd2facaba462f5851efea050
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6078
Reviewed-by: nephele <nep@packageloss.eu>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-21 10:47:03 +00:00
PulkoMandy
fc2f1a3247 BMenuField: remove deprecated constructors
These were introduced by mistake during the addition of the layout
system. They have been private since 2011. It seems safe to assume that
nothing uses them anymore and they can now be removed safely.

Change-Id: I98d030096f9cb06fccc25233fe4da17d0213050e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6075
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-18 17:20:27 +00:00
PulkoMandy
3cc1da2b77 BControl: fix big-endian bitmap handling for control icons
The code is endian-dependant because the alpha channel is not at the
same place. This resulted in transparent white in icons being converted
to partially transparent yellow when attempting to darken the icons, for
example.

Change-Id: I57916139ba37b8d7ae0f9e9ba9e74c1d496d7b05
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6077
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-18 17:16:14 +00:00
Augustin Cavalier
dc509bfab4 fs_shell: Use proper readv/writev functions on Haiku hosts.
Fixes #18269.
2023-02-18 11:38:48 -05:00
Pascal Abresch
9a91a72662 Api docs: dark mode
Change-Id: I46538353f38902b58937286a9e32167424fc7d0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6074
Reviewed-by: nephele <nep@packageloss.eu>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-18 16:08:12 +00:00
Autocomitter
98a5975248 Update translations from Pootle 2023-02-18 08:15:53 +00:00
Augustin Cavalier
050515f6ae BFS: Fix missing trim of last range in a corner case.
The previous logic of _AddTrim plus _TrimNext meant that if a trim
range was specified in the final call to _TrimNext (i.e. with force=true),
but the trim buffer was already full at that point, that last range
would not actually be trimmed.

Now, _AddTrim returns true when the buffer is filled and trimming
should be done, rather than delaying it and requiring a second
add after trimming.

Change-Id: I4b782948e8dc9267c63e61bce0c078fd4e834177
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6070
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-17 20:21:24 +00:00
vaibhavg20comp
ba9ce9c13b termios: Added cfsetspeed function.
BSD extension to set both the input and output speed of a termios
structure.

Fixes #18220.

Change-Id: I8c4a06b4be4aa55b8ce35cb7f62552fc47a8e8d0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6049
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-02-17 16:16:39 +00:00
Jérôme Duval
8aadf2e84a setvolume: implement some common features
unmute when increasing volume, mute at the minimum volume, don't decrease volume when muted

Change-Id: Ifd671b2a8d7d8a4da2bc15adc18f9aa7c46e66d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6017
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-16 11:40:17 +00:00
Augustin Cavalier
c97648aad1 docs/user: Use Doxygen's internal search system.
Fixes #17209.
2023-02-15 16:49:45 -05:00
Augustin Cavalier
f7b2278e28 docs/user: Update Doxyfile to Doxygen 1.9.6.
Automated conversion via "doxygen -u". No changes to settings otherwise.
2023-02-15 16:45:53 -05:00
Augustin Cavalier
06cf64e90c fstrim: Pretty-print the trimmed size in addition to showing raw byte counts.
Also do not bother printing sizes if we are exiting without success
and nothing was reported as trimmed.
2023-02-15 16:11:35 -05:00
Augustin Cavalier
1572bf59b7 nvme_disk: Use the correct length value in the total-trimmed calculation.
We want to return the total trimmed size in bytes, not blocks.
Fixes incorrect trim size reporting under NVMe devices.
2023-02-15 15:30:24 -05:00
David Karoly
1831c1c60d libroot/crypt: remove selectsmix
There's only one implementation of smix so we don't
need any selection logic.

Change-Id: Id43e4ed49ee5a96755c3c4ab975bd128024e57b0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6065
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-14 20:32:20 +00:00
Adrien Destugues
0849c914a7 xfs: Enable -Werror, fix all warnings
Define a dedicated OnDiskData structure for each on-disk structure. This
must match the on-disk layout, except for endianness, which is handled
by _SwapEndian methods. These structure are "plain old data" so we can
use offsetof on them. They are wrapped in an easier to use C++ API.

This resolves a lot of problems with the previous code: warnings caused
by the use of offsetof as well as a much simpler instanciation of the
objects from on-disk data.

Also fixed another problem with UUIDs, where the UUIDs were handled by
pointers in a lot of place where it was not necessary. Use references
instead. The V4 structures which don't have an UUID will return a "null"
(zero-filled) one.

Change-Id: Ifb2bf6ab94906ca50410dd3446d3566615392ca2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6021
Reviewed-by: Raghav Sharma <raghavself28@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-14 15:36:25 +00:00
Augustin Cavalier
66196a82f2 libroot_build: Correct read/write[v] functions.
The previous change was not tested thoroughly enough, it seems.
2023-02-14 01:59:31 -05:00
Augustin Cavalier
5e9fd9f60d libroot_build & fs_shell: Provide _kern_ functions for readv/writev...
..instead of readv_pos/writev_pos. This way, we can be sure that we
are remapping them properly even under Haiku, as well as remove some
potential confusions.

bfs_shell seems to still work fine on a regular build.
2023-02-14 00:49:52 -05:00
Augustin Cavalier
81458ef8a6 kernel/vfs: Remove read sizing hack in common_file_io_vec_pages.
All drivers using IORequest should have any problems here already caught
by it, and overruns in other drivers would overrun the buffer and cause
corruptions, so we should no longer silently be ignoring this,
presuming it is still a problem at all.

As the TODO comment indicated that this logic could also be used for
writes if this wasn't a problem, I have added a separate TODO for that.
2023-02-13 23:12:23 -05:00
Augustin Cavalier
478c8c847d Drivers.h: Rename device_{read|write}_pages back to device_{read|write}v_hook.
They are not about reading and writing pages, but just iovecs.
As the passed iovecs use void*s, it can't possibly be working with
physical pages on 32-bit systems with PAE.

It appears nothing uses or implements these functions anyway,
as there was nothing else in the tree I had to adjust after making
this change...
2023-02-13 23:05:16 -05:00
David Karoly
6b8403b44b libroot/crypt: replace crypt_des implementation with musl's
This is required to make crypt_r() really reentrant.

Change-Id: I81497be16cae21fabb5895a88e27e6c20d3e06e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6066
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-13 19:38:56 +00:00
Máximo Castañeda
46f36ae4e0 app_server FontManager: remove not owned family deletion
On adding a font, we may or not have other faces of the same family, so
we may be trying to add the new face to an already managed family. In
that case, we can't delete it when we get an error inserting the new
style.

This same code was already in place before the user fonts, but it's much
more unlikely to trigger, except maybe on purpose. A later patch
refactoring a bunch of things will join both into the base class.

Fixes #18169

Change-Id: I78053b6e941c18b952fc2bd64f393e26d3d53b0a
2023-02-13 11:49:09 +01:00
Máximo Castañeda
b5c5eec531 app_server: don't return FreeType errors
They don't code Haiku errors and they are positive.

Change-Id: Ibd9da5251117e8883262d8880bad3c88eea6c4a9
2023-02-13 11:49:09 +01:00
Alexander von Gluck IV
1a76488fc8 servers/index: Fix broken CatchUpDone logic; get vs set ptr
* warned about by gcc compiling Haiku under Haiku

Change-Id: I40cd5a2cdaf6a4a346883f6f6060a5a729bc3117
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6064
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-13 01:04:05 +00:00
Máximo Castañeda
88b5bdf748 app_server: fix dangling references in user fonts
Change-Id: I213959b407245c6c0eb1208ebea7145f699366fa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6061
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-12 08:47:36 +00:00
Máximo Castañeda
85d52d335d app_server: push FontManager knowledge to FontStyle creation
Change-Id: I98a68a894642147d398faf22591a22afef4c3ba2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6060
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-12 08:47:36 +00:00
Máximo Castañeda
cb190a7dee app_server: new font code cleanup: includes and the like
Change-Id: I4b7f882fffc34be1984060838f13971c48d4abfc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6059
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-12 08:47:36 +00:00
Pascal Abresch
229a173c6e Mail: respect system text & Link color
Change-Id: I0e37f640decb69a43ee12389af36c70c3821d548
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6062
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2023-02-11 18:53:58 +00:00
Jessica Hamilton
49df70db7a build: include zstd_devel in Development optional package.
* zstd_devel is now required for building Haiku.

Change-Id: I75f6482322b01c5e675c93ec04a9584ca21f95d7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6055
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-10 19:15:28 +00:00
Jim906
5214106737 WebPositive: draggable page icon
* Enable user to drag the WebPositive web page icon to the bookmark
  bar to create a bookmark there, or drag it to a Tracker window to
  create a bookmark in the displayed directory.
* Send a message to the drag target that can be handled by Tracker's
  generic drop routine.
* Overload _CreateBookmark with a more flexible version and a
  _CreateBookmark(BMessage*) that handles both the icon being dropped
  on the bookmark bar, and the message that Tracker sends if the icon
  is dropped on Tracker.
* Account for the fact that, when _CreateBookmark(BMessage*) is called,
  Tracker may or may not have already determined the file name to use and
  created the file, depending on whether the icon was dragged to
  Tracker or not.
* Use page-specific small and large icons for the bookmark file, if
  they are available (currently Haiku WebKit doesn't seem to provide
  them though).
* Follows CharacterMap as a model for dragging an icon and ShowImage
  for dragging to Tracker.
* Fixes #10795.

Change-Id: I7f32013cc1372dab1894b5d92335d3a4cbfb671f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6007
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-10 19:15:04 +00:00
Dale Cieslak
88f36b2dd9 FontManagerBase: remove families from BObject list when deleting them
possibly related to #18169

Change-Id: If878109e7d739494d71ff97447de6bdeaa9f905d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6056
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-10 19:13:10 +00:00
David Karoly
125b262675 libroot: introduce crypt_r
Change-Id: Ieacd1b383ac078a440227c7954f5531a36fbbd62
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5827
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-10 18:00:44 +00:00
Máximo Castañeda
c83c6cde11 tests/app_server: fix loop direction
Change-Id: Ifb9324a8cd5d9cf4c2ed2016cd597673955007e7
2023-02-10 12:53:30 +01:00
Oscar Lesta
b4567c396c acpi_lid: avoid possible memory leak
Also: removed a now unnecessary line-break.

Change-Id: I86ceda3a437d075ff8a611df1a93cceefe3ce82b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6054
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-02-09 18:17:09 +00:00
PulkoMandy
96e28a400a googlefs: De-Googlize, rename to WebSearchFS
DuckDuckGo terms of use say "don't use our name for your app", so go for
a generic "Web Search". Mention them in the README, however.

Their terms of use say "don't remove our branding", but the results from
the HTML page have pretty much no branding. There's a logo at the top of
the page, but the terms of use also say "don't use our logo". So I guess
we're fine here.

Change-Id: Ib24a95faf4e727769ae00c1cb74fab79abde0379
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5498
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-08 18:42:37 +00:00
PulkoMandy
5a369046a3 googlefs: use DuckDuckGo HTML search page
This is much easier to parse. The only downside is it is HTTPS only, so
we can't do this in the kernel. But it works well as a userlandfs
filesystem.

TODO: rename and replace the icon. Make it clear that the replies are
generated by DuckDuckGo (we can add this in the README file exposed by
the filesystem for example)

Change-Id: I7cdbe7d71d63f3ab742f21dc55fb9df7b16da7df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5495
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-08 18:42:37 +00:00
Oscar Lesta
a780ec8653 acpi_ac: update "last_status" on acpi_ac_notify_handler()
* Extracted an "acpi_ac_update_status()" function.
* Use that for both "acpi_ac_init_driver" and "acpi_ac_notify_handler".

This ensures that "acpi_ac_read()" returns the correct (current) status.

Change-Id: I4f8f35037180c10fe507b9abfda3a8a169349c13
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6048
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-08 18:01:01 +00:00
Máximo Castañeda
a34c877fd0 app_server: FontStyle lifecycle
FontFamily is babysitted by the FontManager. It doesn't own FontStyle
references, there's no place in it to release them.

FontManager owns a reference to the FontStyle, and it is in
fStyleHashTable. Putting a style there acquires a new reference, so we
can release the one from the new style. Removing a style from the map
releases the reference. We need to clear the map before shutting down
FreeType to get rid of our last references and let the styles die now
instead of afterwards to avoid double freeing the faces.

These solve the new crash from the previous patch. It didn't crash
before because even after the map was destroyed there were still
dangling references to the styles.

On removing a user font, the style will remove itself from the family
through the manager if that was the last reference, and the manager will
remove and delete the family if it has no more styles.

Change-Id: I460ff830fa8a8a5adb90dc8ea12120e1e50a5912
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6052
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-08 17:58:48 +00:00
Máximo Castañeda
6d024fde1c app_server: fix double deletion of font families
The managed families are already deleted (in a correct way) in
FontManagerBase, so it's unnecessary to do it in GlobalFontManager.

Fixes #18245, though it surfaces another problem.

Change-Id: I93f1dcd1e0c1ec8d0657f3db6b484662e50c3487
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6051
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-08 17:58:48 +00:00
Máximo Castañeda
72d2ba2f9c test_app_server: fix build
Change-Id: I4489359980f92accdb825446f697cdbc7ce8121e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6050
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-02-08 17:58:48 +00:00
Adrien Destugues
b3099de672 DeskCalc: fix live updating of button text color
When using the panel background color, always use the matching panel
text color from system preferences.

When using a custom color, compute appropriate light or dark text color
to go with it.

Change-Id: I107731efec03a8c9661b89e26255a4fe91def79b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3560
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-02-08 15:01:17 +00:00
Adrien Destugues
c8a1650c73 docs/develop: documentation about the C library and features.h
Change-Id: Id87081fbf97e8b427f7a235d969732177d697551
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6045
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-08 08:18:59 +00:00
Dale Cieslak
4f52a155e6 BFont: Minor code cleanup and autolocking for AppFontManager
* changed explicit locking to use Autolocker for gFontManager/fAppFontManager
in ServerApp, per comments in https://review.haiku-os.org/c/haiku/+/4790
* changed BFont::LoadFont (memory version) to use size_t for size and offset
* no functional changes

Change-Id: I438a4975d5bb1b2fa17bc54e9e171c31dadfeec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6003
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-02-06 09:21:12 +00:00
Oscar Lesta
d778c82da4 acpi_lid: fix build on 64 bits.
Change-Id: I1d5b374db37edfa546b1c0d4909c08c779fd392d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6044
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2023-02-05 21:06:12 +00:00
Autocomitter
e9520a1d91 Update translations from Pootle 2023-02-04 08:17:09 +00:00
Augustin Cavalier
5d41cee816 WeakReferenceable: Clear fUseCount when it is 1.
Otherwise, if there are remaining weak references, they could
potentially try to acquire the object and trigger a use-after-free.
2023-01-31 22:36:59 -05:00
Augustin Cavalier
b956691cdd WeakReferenceable: Allow reference counts of either 0 or 1 during destruction.
Same rationale as for BReferenceable.

Fixes a KDL seen on boot by at least one user following prior changes.
2023-01-31 21:43:09 -05:00
Augustin Cavalier
6f7201128c Drop "play" command.
It was used only for playing CDs via SCSI commands, which is what
CDPlayer also did; but this is not really much supported anymore,
so CDPlayer was removed years ago, and now this is too.

Its source code lives on at HaikuArchives.

Fixes #18236.
2023-01-31 17:32:51 -05:00
Augustin Cavalier
61ed147044 keyboard: Store errno right after calling open() if an error occurred.
errno is a thread-local variable, we can't read it in another thread
and have the value make any sense. Thus we need to store it.

Fortunately, as our errors are all negative already, we can just put it
directly in fFD instead of having to make a new variable altogether.

Should help with diagnosing a problem seen in some syslogs.
2023-01-31 17:20:40 -05:00
Augustin Cavalier
d891ca1119 headers/build: Drop Drivers.h and Select.h.
As far as I can tell, these are no longer needed after the previous commit;
fs_shell does not reference them, anyway.
2023-01-31 17:15:14 -05:00