Commit graph

29117 commits

Author SHA1 Message Date
Linus Groh
9143d37907 LibJS: Convert Temporal.ZonedDateTime functions to ThrowCompletionOr 2021-10-21 22:31:31 +01:00
Linus Groh
7085458a23 LibJS: Convert Temporal.TimeZone functions to ThrowCompletionOr 2021-10-21 22:31:31 +01:00
Linus Groh
15f52c5f8e LibJS: Convert Temporal.PlainYearMonth functions to ThrowCompletionOr 2021-10-21 22:31:31 +01:00
Linus Groh
e4e04528af LibJS: Convert Temporal.PlainTime functions to ThrowCompletionOr 2021-10-21 22:31:31 +01:00
Linus Groh
c8e359c25e LibJS: Convert Temporal.PlainMonthDay functions to ThrowCompletionOr 2021-10-21 22:31:31 +01:00
Linus Groh
c043b818ad LibJS: Convert Temporal.PlainDateTime functions to ThrowCompletionOr 2021-10-21 22:31:31 +01:00
Linus Groh
2093128b24 LibJS: Convert Temporal.PlainDate functions to ThrowCompletionOr 2021-10-21 22:31:31 +01:00
Linus Groh
df67f4978e LibJS: Convert Temporal.Now functions to ThrowCompletionOr 2021-10-21 22:31:09 +01:00
Linus Groh
149231d47d LibJS: Convert Temporal.Instant functions to ThrowCompletionOr 2021-10-21 22:31:09 +01:00
Linus Groh
5e9e3f9dc8 LibJS: Convert Temporal.Duration functions to ThrowCompletionOr 2021-10-21 22:31:09 +01:00
Linus Groh
2d2ba4eec6 LibJS: Convert Temporal.Calendar functions to ThrowCompletionOr 2021-10-21 22:31:09 +01:00
Andreas Kling
649cb67f28 LibGUI: Don't paint TextEditor selection in non-focused widgets
Showing the selection in non-focused text editors was not really useful,
since refocusing the widget would clear or change the selection
immediately anyway.

Note that TextEditors in inactive windows can still be the focused
widget within that window, and will still be painted with an "inactive"
looking selection.
2021-10-21 23:23:25 +02:00
Andreas Kling
c1576aca11 LibGUI: Use the new GUI::Tray widget in GUI::FilePicker
This removes all the extra entries from the keyboard focus chain and
makes FilePicker actually pleasant to navigate with the keyboard.
2021-10-21 23:23:24 +02:00
Andreas Kling
ae2579d8b5 LibGUI: Add a GUI::Tray widget for the FilePicker common locations
The FilePicker has implemented its common locations tray as a composite
widget built from a GUI::Frame with a bunch of GUI::Button inside it.
The problem with that is that it creates a long and annoying chain of
keyboard-focusable widgets.

This patch adds GUI::Tray, which is a dedicated single widget that
implements the same UI element, but without child widgets.
2021-10-21 23:23:24 +02:00
Andreas Kling
25475f7003 LibGUI: Make toolbar buttons non-focusable by default
Toolbar buttons are meant for quick mouse access to common actions,
while quick keyboard access is normally achieved via keyboard shortcuts
and underlined menu items.

This makes interfaces with many toolbar buttons (e.g GUI::FilePicker)
a lot nicer to navigate via keyboard.
2021-10-21 23:23:24 +02:00
Andreas Kling
fe98cb2c4b Kernel: Make Ext2FS::free_inode() return KResult, and use TRY() more
While there's no clear propagation path for errors that happen in an
inode destructor, using TRY() still makes the code a lot nicer.
2021-10-21 23:23:23 +02:00
Andreas Kling
98b865fe10 Kernel: Make Ext2FS::write_ext2_inode() return KResult
This allows us to use TRY() in more places.
2021-10-21 23:23:23 +02:00
Andreas Kling
6f69d5204f Kernel: Make Inode::flush_metadata() return a KResult
Even if this goes nowhere yet, we have to start building an error
propagation path somewhere.
2021-10-21 23:23:23 +02:00
Karol Kosek
6337d742bb logout: Add this utility to REQUIRED_TARGETS
The Shutdown Dialog needs it.

Related: a36d13e36c
2021-10-21 23:10:25 +02:00
Daniel Bertalan
17b66eaa3c Kernel: Call try_set_coredump_property with StringView arguments
Storing assigning a string literal to a String object just to pass it to
a function expecting a StringView is wasteful. Let's just not do that.

For consistency's sake, this commit changes all of the other invocations
to use StringView literals, too.
2021-10-21 22:19:50 +02:00
Daniel Bertalan
bbb4eb0aa1 Kernel: Convert Formatter<Process> to use Formatter<FormatString>
This lets us avoid allocating memory on the heap most of the time, as
Formatter<FormatString> writes into a quite large stack buffer instead.
2021-10-21 22:19:50 +02:00
Daniel Bertalan
39a74676bd AK: Avoid temporary String allocation in Formatter<FormatString>
Creating a String object from the formatted data is unnecessary, as it
immediately gets turned into a StringView anyways.

With this change, we will no longer allocate on the heap when printing
`VirtualAddress`, `VirtualRange` and `InodeIdentifier` objects, which is
a step towards stronger OOM hardening.
2021-10-21 22:19:50 +02:00
Daniel Bertalan
018c4e0e7e AK+Kernel: Format DistinctNumeric using the underlying type's formatter
Forcing the formatting to go through `Formatter<FormatString>` is
completely unnecessary, increases code size, performs a String
allocation and prevents us from using the formatting options available
on that type.

This commit also removes explicit formatters from
`BlockBasedFileSystem::BlockIndex` and `Kernel::InodeIndex`, as those
are already covered by the blanket implementation for all
`DistinctNumeric` types.
2021-10-21 22:19:50 +02:00
Ben Wiederhake
9bf6d51aec LibGUI: Make links only clickable where the text is 2021-10-21 20:23:04 +01:00
Nico Weber
ef1d247d79 Documentation: Tweak RunningOnRaspberryPi a bit 2021-10-21 20:01:34 +01:00
Timothy Flynn
1e1cd07549 CI: Add a cache for the CLDR on the test262 runner 2021-10-21 17:41:13 +01:00
Timothy Flynn
cff39734f1 CI: Use correct CLDR cache path on GitHub Actions 2021-10-21 17:41:13 +01:00
xSlendiX
bf80dea39c LoginServer: Capitalize username and password fields
This commit changes the TextBox's placeholders for the username and
password fields to be capitalized.
2021-10-21 16:08:13 +01:00
Andreas Kling
d621534511 LibGUI: Move GUI::FocusPolicy to its own header & add explainer comment 2021-10-21 16:48:24 +02:00
Andreas Kling
c1ba9c66b5 LibWeb: Use is_single_line() and add spec comments to FFC step 8 2021-10-21 16:48:24 +02:00
Andreas Kling
e2dbaa6ceb LibWeb: Include flex-direction in layout tree dumps 2021-10-21 16:48:24 +02:00
Ben Wiederhake
3371a27018 adjtime: Drop unnecessary privileges unconditionally
Furthermore, this simplifies the control flow.
2021-10-21 15:41:22 +01:00
Timothy Flynn
4e4db65e26 LibJS: Remove now-redundant TemporaryClearException from Promise methods
IteratorClose now handles exceptions itself before invoking VM::call(),
so outside callers doubling that work isn't helpful.
2021-10-21 14:57:43 +01:00
Jelle Raaijmakers
28e0aa59a8 Ports: Register all dependencies of ports
Previously, only `manual` installs would register dependencies of an
installed port package. Since in the future we might want to check all
dependents, not only those for manually installed packages, we should
take care to register dependencies for `auto` installs as well.

Additionally, this surpresses some unnecessary verbose output from the
package management and fixes warnings when the package DB directory did
not yet exist.
2021-10-21 14:48:21 +01:00
Jelle Raaijmakers
7ff99cb516 Ports: Return early in parse_arguments() in .port_include.sh 2021-10-21 14:48:21 +01:00
Timothy Flynn
f8e46ec296 LibJS: Convert all four PerformPromise* AOs to ThrowCompletionOr 2021-10-21 14:46:14 +01:00
Timothy Flynn
4fb948d8e7 LibJS: Convert IfAbruptRejectPromise AO to a GNU statement expression
GNU statement expressions fit the definition of IfAbruptRejectPromise
rather nicely, where we need to reject the failed promise (and return
the failed promise itself) on failure, and otherwise store a value on
success.
2021-10-21 14:46:14 +01:00
Timothy Flynn
9064491a47 LibJS: Convert GetPromiseResolve AO to ThrowCompletionOr
This is a bit ugly because, rather than simply wrapping the invocation
to GetPromiseResolve with TRY(), we have to invoke the promise's reject
method with any error. But this will be a bit cleaner in a subsequent
commit to change how IfAbruptRejectPromise is invoked.
2021-10-21 14:46:14 +01:00
Timothy Flynn
6d6cd87b7b LoginServer: Mark the login window as non-closeable and non-minimizable
Previously, you could close the window and be permanently logged out.
2021-10-21 14:45:30 +01:00
Timothy Flynn
176155c695 LibGUI+WindowServer: Add option to hide a widow's close button
This allows windows to be closed only programatically, and not from e.g.
the user clicking the X button on the window frame.
2021-10-21 14:45:30 +01:00
Timothy Flynn
8a57885494 Meta: Enable ccache for Lagom by default 2021-10-21 04:35:10 -07:00
Linus Groh
5832de62fe LibJS: Convert NativeFunction::{call,construct}() to ThrowCompletionOr
Both at the same time because many of them call construct() in call()
and I'm not keen on adding a bunch of temporary plumbing to turn
exceptions into throw completions.
Also changes the return value of construct() to Object* instead of Value
as it always needs to return an object; allowing an arbitrary Value is a
massive foot gun.
2021-10-21 09:02:23 +01:00
Linus Groh
0881f8160f LibJS: Use implicit ThrowCompletionOr<T> constructor where possible
Luckily this is not very widespread yet as most of it would happen in
the various JS functions instead of AOs.
2021-10-21 09:02:23 +01:00
Linus Groh
894834b5d5 LibJS: Allow construction of ThrowCompletionOr<Value> from non-Value
TL;DR: Instead of this:

    return { TRY(my_object()) };

we can now do:

    return TRY(my_object());

just like we mostly did for Value return types before ThrowCompletionOr.
2021-10-21 09:02:23 +01:00
Linus Groh
805f8496be AK: Add IsPOD<T> template to StdLibExtras 2021-10-21 09:02:23 +01:00
Timothy Flynn
03b251a704 LibJS: Convert IterableToList AO to ThrowCompletionOr 2021-10-21 00:26:45 +01:00
Timothy Flynn
ec54a7b5b0 LibJS: Implement IteratorClose with Completions and align to the spec 2021-10-21 00:26:45 +01:00
Timothy Flynn
04b4307b3d LibJS: Convert get_iterator_values helper to ThrowCompletionOr
This one is a bit unusual, so to clarify:

Previously, callers of get_iterator_values() would supply a callback
that would return an IterationDecision, and an enum to indicate whether
iterator_close() should be invoked upon IterationDecision::Break.

Now, use of both those enums is removed, and callers must return an
Optional<Completion>. If a Completion is provided, the iterator will be
closed, and that completion will be returned from get_iterator_values.
Otherwise, once the iterator is exhausted, a default-initialized
Completion will be returned.
2021-10-21 00:26:45 +01:00
Timothy Flynn
7b4814f74c LibJS: Convert IteratorValue AO to ThrowCompletionOr 2021-10-21 00:26:45 +01:00
Timothy Flynn
a64752cd34 LibJS: Convert IteratorComplete AO to ThrowCompletionOr 2021-10-21 00:26:45 +01:00