Commit Graph

65610 Commits

Author SHA1 Message Date
PulkoMandy
111528d18d HaikuDepot TextView: fix merging of spans
When adding two successive spans with identical styles, they should be
merged into a single span. However, all prevous spans in the view were
accidentally removed.

Change-Id: I4b2d21331ba97cf54a0db83e7638e23bd2303a63
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7128
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-11-25 10:49:21 +00:00
Autocomitter
fd76762183 Update translations from Pootle 2023-11-25 08:21:04 +00:00
Augustin Cavalier
2926dfaa3f network/stack: Fix handling of MSG_TRUNC in socket_receive.
This is a Linux extension (which at least FreeBSD has also
adopted.) It's used in the Haiku port of libpcap (where it's
a necessity) and wpa_supplicant (where it wasn't, and I
removed it.) It seems that we've had it for quite some time.

Fixes tcpdump following addition of flag checks.
2023-11-24 23:07:18 -05:00
John Scipione
e91af56d9f BMenu: Turn on keyboard tracking on up arrow too
Set MENU_STATE_KEY_TO_SUBMENU on up arrow as well as down. This
causes the menu to check if there is a selected item even if you
aren't hovering over the menu. Previously we were doing this for
the down arrow but not the up arrow which caused a subtle bug that
humdinger stumbled upon in Deskbar where if you push the Menu key,
up, then Enter, the menu item is not activated, but if you push
Menu key, down, then Enter the menu item is activated.

Fixes #18686

Change-Id: I8dce6112603e12fb47afebb48a33b3ec6fa60230
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7140
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-24 23:04:09 +00:00
John Scipione
ac83e7f073 Tracker: Fix CanEditName() crash (from hrev57402)
Although I can't reproduce this crash, from the looks of the crash
report something in the CanEditName() method is throwing a
segmentation fault.

If selection count is not 1, don't even try to get the selection,
Edit name is not allowed unless you have a single item selected.
Double check that selected item is not NULL before using it.

I refuse to believe that fSelectionList being NULL is the problem
here, more likely fSelectionList->FirstItem() is NULL and is the
cause of the crash. Bailing out after checking that selection
count is 1 should ensure that FirstItem() is not NULL.

Hopefully fixes #18684

Change-Id: Ib99192178fa6f6d31b389afb47e72c5513e6e1c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7139
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-24 18:52:13 +00:00
John Scipione
f5029bd569 Tracker: Disallow Restore from Trash if no selection
TargetVolumeIsReadOnly() doesn't make sense here because we
know the trash's volume is not read-only, we need to check
that you have a selection to enable Restore. Currently
(since hrev56978) Restore option is always enabled but it
shouldn't be if you have nothing selected.

It would be nice to also check if the restored location is
not read-only because you put something in the Trash then
remounted the volume read-only, but that's too much work.

Fixes yet another regression from hrev56978.

Also missed a delete convenience method call in hrev57402.

Call CanMoveToTrashOrDuplicate() to check if delete is allowed.
This method does a bit more work, it checks if the selection
includes the Desktop, the root volume, or the trash itself
which you are not allowed to delete.

Otherwise the same, this shouldn't make a big difference.

Change-Id: Ie188f25bd969a5aaeec9ff397fa5750872ccf97f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7138
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-24 18:52:13 +00:00
Augustin Cavalier
ceeea27b72 freebsd_wlan: Fix compilation of ieee80211_ioctl.h under GCC2 in C mode.
GCC2 tolerates [] FLAs in C++ mode but not in C mode, as discovered
when trying to build wpa_supplicant against R1/beta4. A workaround
was added there for now, but this is the more general solution.
2023-11-24 12:57:07 -05:00
John Scipione
32d1cd8e82 Tracker: Fix regression Copy To writable volumes
Regression was introduced in hrev56978 (Tracker read-only patch)
after R1B4.

This check is bad on Copy To/Move To operations because destWindow
is same as source window in these cases. This check only worked on
right-click drag Copy here/Move here since there is a separate
destWindow in this case.

Checking destFolder's volume read-only fixes the regression
because destFolder, unlike destWindow, should always be valid.

Fixes #18657

Change-Id: I4721bae34840d916e47f2a395d553e7254acaec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7137
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-24 16:34:37 +00:00
Andrew Lindesay
45f8be4190 HaikuDepot : New Model Generation Script
Without functionally changing the generated
code, create a new mechanic for generation
in order that improvements can be later made.

Change-Id: If5b755ebd257658ab0e0a0045dd21a464b429c09
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7135
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-11-24 16:34:08 +00:00
Augustin Cavalier
459fa41f17 network/stack: Get rid of socket_readv and socket_writev.
These have not been used in years (maybe since the redesign of the
network stack?). Only socket_writev had an implementation, which was
mostly just an incomplete version of socket_send.

Scatter/gather I/O is already supported via msghdr's msg_iov/len fields,
so this is redundant anyway.

Change-Id: If41c4f4ee021856f6db49c7cb95422a9c1aa7700
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7127
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-11-24 16:28:38 +00:00
Adrien Destugues
9d972e321d ext2: do not use "extfs" as a short name.
The original Linux extfs was short lived (less than a year) and is long
forgotten. Still, to avoid any confusion, it's better to refer to our
filesystem as ext4 (even if it is backwards compatible with versions 2
and 3).

Mention all 3 versions in the "pretty name" to be even clearer about
this.

Previously this was called "ext2" but people then assume that it does
not handle the later upgrades in versions 3 and 4 (which makes sense).
2023-11-24 13:41:31 +01:00
Augustin Cavalier
5188904bfa loopback: Actually update device statistics.
ifconfig shows numbers other than 0 for the loopback interface now.
2023-11-23 15:03:21 -05:00
Augustin Cavalier
75874bab1a ethernet: Device statistics must be updated using atomic operations.
Both send and receive can be called concurrently, and there aren't
any locks protecting these fields, so they must be updated with atomics.
2023-11-23 15:02:45 -05:00
Augustin Cavalier
6461885e2e TUN: Remove redundant comments.
They only described things that the function names and parameters
already indicated. As per the Coding Guidelines, such excessive
commenting is to be removed.

Also fix some other (minor) code style issues while at it.
2023-11-23 14:27:40 -05:00
Augustin Cavalier
c1f1032016 network/stack: Enumerate TUN after loopback. 2023-11-23 14:24:35 -05:00
Augustin Cavalier
a1d837369f lgtm.yml: Delete.
"LGTM" code scanning was bought out and merged into GitHub Actions.
The code scanning setup there has a different mechanism for configuration,
and so this file is not useful anymore.
2023-11-23 13:46:19 -05:00
Augustin Cavalier
e1480b40af ext2: Adjust short and pretty names to just be "ext" and not "ext2".
The filesystem name returned by read_fs_info will be correct (i.e.
returning "ext3" or "ext4" as appropriate), but some things just list
the filesystem driver's name, which can cause confusion.

Change-Id: Ic4acf497fc5db5c167131aeb323b45eeb78594d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7126
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-11-23 18:20:04 +00:00
John Scipione
cf83394d00 Tracker: Put duplicate checks into convenience methods
... and a few minor feature updates.

Create a CanEditName method on PoseView because we were using
subtly different checks in different places to see if allowed
to edit the name or not.

Tint background color of the Edit name text box on read-only
to indicate that the file name cannot be edited (only copied).

Create ReadOnlyTint() method in Utilities and use it here and
in PoseView to set the background color. Eliminate BackTint()
method from PoseView which served a similar purpose.

Add CanMoveToTrashOrDuplicate() convenience method.
Move To Trash, Delete and Duplicate options use same check.

Context menu of selection in file panel gets Duplicate option,
window context menu never did so don't try to enable it there.

Change-Id: I7a82d00ea10f22a7885c2e898a809e1abe9a6b30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7122
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-23 18:15:48 +00:00
John Scipione
501aa0f311 Tracker: Check selection parent is read-only on query
If 0 items are selected, check the window's volume instead.

If 1 item is selected, check if the parent's volume is read-only.

If multiple items are selected, consider the entire selection to
be read-only if any item's parent directory in the selection is
on a read-only volume.

You aren't allowed to for example Cut a selection that has an
item on a read-only volume as the Cut operation would not be able
to succeed. However, if all items in the selection are not on a
read-only volume then you may Cut.

For non-query windows assume all selected item's are on the same
volume and only check the first item when multiple are selected.

Fixes #18661

Change-Id: Ib898e54b62558c66aad65d33afd080480e312565
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7120
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
2023-11-23 18:15:48 +00:00
David Karoly
8497e56650 Debugger: implement DWARF5 indirect string and address forms
Change-Id: Ie3ee6f4eb14606ee2d412d8e7122d59472619f81
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7059
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-11-23 18:06:20 +00:00
Augustin Cavalier
973f6d3320 network: Migrate SIGPIPE generation into the socket module.
This removes the burden of determining whether to and then
actually sending SIGPIPE from the protocol modules, meaning
the MSG_NOSIGNAL flag can now be implemented entirely in
the socket module and not even passed further down the chain.

Change-Id: I9ba976c4aff60d533cb4b390bbba1560c0de423f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7124
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-23 06:51:39 +00:00
Augustin Cavalier
da2f2c65b7 network/stack: Mask off MSG_NOSIGNAL at the top of socket_receive.
Fixes WebKitGTK spinning endlessly and spawning lots of
short-lived worker processes following the addition of
flag checks and EOPNOTSUPP to the various socket modules.

Change-Id: I6d944b4d0235eea9e8a9333645fcb531805f340f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7123
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-23 06:23:12 +00:00
David Karoly
85a7824e2a Debugger: introduce ReadUInt
Change-Id: Iaa32db71b3a015d5496d60a96fb30763b924c89f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7103
Reviewed-by: Rene Gollent <rene@gollent.com>
2023-11-22 19:22:58 +00:00
Augustin Cavalier
e7371da8b5 network/stack: Add back a #pragma mark. 2023-11-22 12:04:38 -05:00
Augustin Cavalier
407d3f1046 network/stack: De-templatize base_fifo methods.
Following the removal of the "Fifo" class, they
do not need to be templated anymore.
2023-11-22 12:00:02 -05:00
Augustin Cavalier
0b829b1151 network/stack: Remove unused "Fifo" class.
Its declarations were moved from another header to this file
in 2008, with a comment in the commit message and a TODO here
questioning whether it was needed for anything. In the 15 years
since then, nothing has used it.
2023-11-22 11:47:52 -05:00
Augustin Cavalier
4100480724 network/stack: Return EOPNOTSUPP when unhandled flags are specified.
This method is invoked directly in some protocols, e.g. L2cap (Bluetooth.)
2023-11-22 11:41:18 -05:00
Augustin Cavalier
73eb03214e net/ProtocolUtilities: Return EOPNOTSUPP when unhandled flags are specified.
Same as has already been done for UNIX domain sockets and TCP
(this is used in the implementation of UDP.)
2023-11-22 11:40:02 -05:00
Augustin Cavalier
42e4cb759a net/ProtocolUtilities: Correct implementation of MSG_DONTWAIT.
We don't want to restore the timeout from a restarted syscall
if MSG_DONTWAIT has been specified.
2023-11-22 11:39:29 -05:00
John Scipione
f9693a1300 Deskbar: Set tooltip on truncated window items
Fixes #18678

Change-Id: I91eeb19a77e400cf798fe23cc6d50565926063d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7121
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-22 16:07:14 +00:00
Augustin Cavalier
fca1b0ec50 protocols/tcp: Return EOPNOTSUPP when unhandled flags are specified.
Same as was done for UNIX domain sockets in 74a44f5aed.
2023-11-21 23:36:07 -05:00
Augustin Cavalier
93a6528df8 protocols/tcp: Correct implementation of MSG_DONTWAIT.
Waiting for state changes correctly checked MSG_DONTWAIT,
but the overall data timeout only did in ReadData, not
SendData. This corrects that and makes the implementation
more consistent overall.
2023-11-21 23:34:59 -05:00
Augustin Cavalier
f860cfc76c protocols/tcp: Correct implementation of MSG_NOSIGNAL.
The other send_signal invocation correctly checked NOSIGNAL already.
2023-11-21 23:34:33 -05:00
Humdinger
2b50f7759d ShowImage: fix off-by-1 image placement
The image was placed 1 pixel to the right, resulting in a grey
vertical line appearing to the left of the image.

Fixes #18679

Change-Id: I02b1cb6bc898c48ff73ae114b2cda368ea636de7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7118
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-22 04:06:56 +00:00
Humdinger
7d85c2beb1 Add .genio of the Genio IDE to .gitignore
Change-Id: I9397bef0ab05b1a12d234e5c52da8e88e54571ff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7119
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-11-21 16:29:53 +00:00
Humdinger
2de4cba264 OverlayImage: Apply coding style
Change-Id: Id35e8eeaf0735210cbe14d618c59d5ef8dc90a09
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7114
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-11-20 23:19:22 +00:00
Humdinger
2283561d60 OverlayImage: Use BAboutWindow
Fixes #18677

Change-Id: Ia1469527ce9dd4e7c217182e3751357aa5305f18
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7113
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-11-20 23:19:22 +00:00
Andrew Lindesay
916c6d9492 Shared : Larger buffer increments
This change will reduce the quantity of small requests
to increment the character assembly buffer when parsing
JSON.

Change-Id: I0998f6fb403bf6dc4736585bb69a103f3976a448
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7115
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-11-20 08:34:54 +00:00
François Revol
a143f249c2 Readme.Compiling.md: Mention the need for zstd and python3
Change-Id: I9d787e3e79a6da419e6d08496463df493026e720
2023-11-18 14:58:01 +01:00
François Revol
768aa9d339 safemode: Add usage help option
Change-Id: I25c96070327f43ea12df7df9bf0d8e9b994a80af
2023-11-18 14:24:20 +01:00
Autocomitter
9a3791f0f0 Update translations from Pootle 2023-11-18 08:16:31 +00:00
Swangeon
cbb44d0ab6 Add TUN/TAP interface and driver to build definitions
Change-Id: I19f37ef75250526d7a7f9e254fd0bf3693582c92
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6898
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-11-17 16:58:45 +00:00
Swangeon
47f43bccee network/tun: rewritting tun driver and tun module for modern code base
Change-Id: Idf7ab6d2aa2b4f8cb4893053b531d2eae7418427
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6608
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-11-17 16:58:45 +00:00
Andrew Lindesay
35c4600e21 Shared: JSON Parse Perf
Improve the mechanics for JSON parsing by reusing
text buffers during the parse.

Change-Id: I7fb2cae31e6558a5a0c63fd02e1fc6fec4f9e4b3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7106
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-11-16 20:38:21 +00:00
PulkoMandy
8a00ea4af6 ps2_dev: shorter timeout for mouse reset
The keyboard is initialized after the mouse. When there is no mouse,
this timeout delays keyboard initialization noticeably (especially if
there is a mouse port multiplexer with several ports).

Change-Id: Icd4a7c28f6afca062d829df88bd15e88225d4bc0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7112
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-11-16 17:11:46 +00:00
Augustin Cavalier
3bae07fc29 protocols/unix: Implement MSG_NOSIGNAL.
Same logic as in the TCP protocol module.

This fixes a regression from hrev57383: curl now works
again. (Perhaps it shouldn't be called a "regression",
though, but instead an uncovered bug / missing feature.)

Fixes #18666.
2023-11-16 12:08:47 -05:00
Augustin Cavalier
74a44f5aed protocols/unix: Return EOPNOTSUPP when unhandled flags are specified.
Fixes the "bug" part of #18653 (however the flags still need to
actually be implemented.)

Change-Id: Icd296af8b409416317ba3d02735504729949fd08
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7109
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-15 16:33:38 +00:00
Jérôme Duval
1b8870852e ffmpeg: fix leak when decoding audio frames
removing the memset in _DecodeSomeAudioFramesIntoEmptyDecodedDataBuffer fixes #18654
also free correctly resources in AVCodecDecoder destructor.

Change-Id: I2d6de6b50ba6767f669eb765dad96d28d43100fb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7108
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-11-14 23:13:51 +00:00
Jérôme Duval
c7360f4b02 kernel/x86_64: on context switch, load defaults in fpu control and mxcsr
after a0131eaae2884fdced27158c3d34732d1656aca9 mxcsr was possibly also incorrect.
fpu control and mxcsr will be restored with fxrstor/xrstor.
no need to clear pending exceptions on #MF
fix #18656 (and #18624 after reverting).

Change-Id: I7dd5e2e4610747c5b82abd6c67e302d264b4be92
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7104
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-14 21:31:01 +00:00
Humdinger
345265c3d6 ShowImage: fix saving
As investigated and suggested by jackburton in ticket #14693:
outTranslator wasn't initialized correctly (due to type mismatch
on 64 bit platform).

Also set the image's file name as default in the save dialog.

Fixes #14693

Change-Id: I741e3616b935315a707ea3949a330d41d577fd91
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7102
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-13 22:10:25 +00:00