Commit graph

38001 commits

Author SHA1 Message Date
DexesTTP
b37379d489 Meta: Move LibWeb's CMake generation script to its own file
This patch has no functional changes, but prepares the CMake script to
be able to handle LibWeb on Lagom.
2022-05-13 09:59:02 +02:00
kleines Filmröllchen
9035d9e845 LibDSP+Piano: Convert DSP APIs to accept entire sample ranges
This has mainly performance benefits, so that we only need to call into
all processors once for every audio buffer segment. It requires
adjusting quite some logic in most processors and in Track, as we have
to consider a larger collection of notes and samples at each step.

There's some cautionary TODOs in the currently unused LibDSP tracks
because they don't do things properly yet.
2022-05-13 00:47:26 +02:00
kleines Filmröllchen
4d65607649 LibDSP: Remove Transport's time counter reference API
This is what the old Transport in Piano had, but as everyone just
references Transport directly, there's no need for it anymore.
2022-05-13 00:47:26 +02:00
kleines Filmröllchen
f23aea0c4b LibDSP: Make the note frequencies an AK::Array instead of a C array
This was a leftover from the early days of Piano, and there's no reason
to leave it that way especially if we want to use more complex
collection APIs in the future.
2022-05-13 00:47:26 +02:00
kleines Filmröllchen
bcb331b862 LibDSP: Improve const correctness 2022-05-13 00:47:26 +02:00
kleines Filmröllchen
4a6ebb8beb LibDSP: Refactor OOP non-functionally
* Don't inherit from Core::Object everywhere, that's overkill. Use
  RefCounted instead.
* Change some constructor visibilites to facilitate the above.
* default-implement all virtual destructors if possible.
* Drive-by include hygiene.
2022-05-13 00:47:26 +02:00
MacDue
3cfa9b63b5 LibWeb: Stop inactive requestAnimationFrame() callbacks from running
Previously requestAnimationFrame() callbacks were registered with a
static global RequestAnimationFrameDriver shared between all windows.
This led to callbacks still running after navigating away from a page
(This could be seen with the WASM GoL demo).

This commit moves the RequestAnimationFrameDriver (now
AnimationFrameCallbackDriver) to be a member of the HTML::Window
object, then uses the 'active document' parameter of
run_animation_frame_callbacks() to run only the active callbacks.
2022-05-13 00:47:16 +02:00
Timon Kruiper
18cad73b01 Kernel: Put code in the aarch64 init.cpp file into the Kernel namespace 2022-05-12 23:14:05 +02:00
Timon Kruiper
9282e0db16 Kernel: Move __assertion_failed to aarch64/Panic.cpp
This is for an upcoming change to add the Kernel namespace to the
init.cpp file.
2022-05-12 23:14:05 +02:00
Timon Kruiper
d451bdec6f Kernel: Remove PREKERNEL_SOURCES from aarch64 CMakeLists.txt 2022-05-12 23:14:05 +02:00
Timon Kruiper
4db44c09a4 Kernel: Use the Kernel UBSanitizer implementation in the aarch64 Kernel
Now we actually print useful information when an UBSAN fault is
detected. :^)
2022-05-12 23:14:05 +02:00
Timon Kruiper
1f3977b303 Kernel: Remove Prekernel namespace in the aarch64 Kernel
Now that we merged all the Prekernel files into the Kernel files, we can
get rid of the Prekernel namespace as well.
2022-05-12 23:14:05 +02:00
Timon Kruiper
c96a3f0c48 Kernel: Move the aarch64 boot.S out of the Prekernel directory 2022-05-12 23:14:05 +02:00
Timon Kruiper
e88cd338f1 Kernel: Move Prekernel{CPU, Exceptions}.cpp out of Prekernel directory
This lets us delete the Prekernel.h file, and gets us closer to deleting
the Prekernel from the aarch64 Kernel.
2022-05-12 23:14:05 +02:00
Timon Kruiper
e7c5fd978b Kernel: Move Prekernel assembly utils to aarch64/ASM_wrapper.h
By moving these functions to the ASM_wrapper.h file, we can get rid of
another Prekernel file.
2022-05-12 23:14:05 +02:00
Timon Kruiper
e80d8d697c Kernel: Replace Prekernel::halt with Processor::halt in aarch64 build
This allows us to get rid of one more Prekernel file.
2022-05-12 23:14:05 +02:00
Tim Schumacher
acc9be9f7d LibArchive: Use named members for ZIP general purpose flags
This fixes the faulty bit check that misclassified ZIPs as having
data descriptors.
2022-05-12 22:58:14 +02:00
Luke Wilde
1f94c8c622 Ports: Update curl to 7.83.1 2022-05-12 22:51:10 +02:00
stelar7
7d6b26e613 LibCrypto: Add Ed25519 2022-05-12 23:47:13 +04:30
stelar7
9aaeaf8a22 LibCrypto: Move Curve25519 related code into separate file 2022-05-12 23:47:13 +04:30
Michał Lach
6a7d3006d7 LibC: Add herror() and hstrerror() 2022-05-12 15:01:32 +02:00
Michał Lach
bc18fa75ec LibC: Make h_errno thread-local 2022-05-12 15:01:32 +02:00
Daniel Bertalan
0aee2abda7 Ports/gcc: Update to version 12.1.0 2022-05-12 13:12:37 +02:00
Daniel Bertalan
6cf260c7af Toolchain: Upgrade to GCC 12.1.0
This release brings support for various C++23 constructs like `if
consteval` and multidimensional subscript operators. Vectorization is
now enabled for O2 too, and `-ftrivial-auto-var-init` has been added
which can help us find and prevent security issues coming from
uninitialized variables.

Toolchain/Patches/gcc.patch is now significanly smaller as some unused,
autoconf-generated code has been removed.
2022-05-12 13:12:37 +02:00
Daniel Bertalan
fd3e3d5e28 LibC+Kernel: Prevent string functions from calling themselves
Most of the string.h and wchar.h functions are implemented quite naively
at the moment, and GCC's pattern recognition pass might realize what we
are trying to do, and transform them into libcalls. This is usually a
useful optimization, but not when we're implementing the functions
themselves :^)

Relevant discussion from the GCC Bugzilla:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

This prevents the infamous recursive `strlen`.

A more proper fix would be writing these functions in assembly. That
would likely give a small performance boost as well ;)
2022-05-12 13:12:37 +02:00
Daniel Bertalan
f157ad8a35 Kernel: Do not implement VERIFY_NOT_REACHED() as VERIFY(false)
If a switch case ends in VERIFY_NOT_REACHED(), gcc 12 thinks it might
fall through.
2022-05-12 13:12:37 +02:00
Daniel Bertalan
014b9fd709 AK+DHCPClient: Fix false positive gcc 12 warnings
The compiler would complain about `__builtin_memcpy` in ByteBuffer::copy
writing out of bounds, as it isn't able to deduce the invariant that the
inline buffer is only used when the requested size is smaller than the
inline capacity.

The other change is more bizarre. If the destructor's declaration
exists, gcc complains about a `delete` operation causing an
out-of-bounds array access.

error: array subscript 'DHCPv4Client::__as_base [0]' is partly outside
array bounds of 'unsigned char [8]' [-Werror=array-bounds]
   14 |   ~DHCPv4Client() = default;
      |   ^

This looks like a compiler bug, and I'll report it if I find a suitable
reduced reproducer.
2022-05-12 13:12:37 +02:00
Daniel Bertalan
f40b6fbd07 PixelPaint: Fix incorrect use of RefCounted CRTP
I'm not even sure why this worked. How would the compiler know which
type to destruct the FilterInfo object as?

Fixes this janky error from gcc 12:

AK/RefCounted.h:70:13: error: array subscript 0 is outside array bounds
of 'void [56]' [-Werror=array-bounds]
   70 |             delete static_cast<const T*>(this);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-05-12 13:12:37 +02:00
Daniel Bertalan
699bd9afc6 Tests: Fix new GCC 12 warnings 2022-05-12 13:12:37 +02:00
Daniel Bertalan
cccc001ded Ports: Add $STRIP and $HOST_STRIP variables
This fixes stripping the debug information from the gcc port when
building on macOS hosts.
2022-05-12 13:12:37 +02:00
Daniel Bertalan
2c0c1dca04 Ports/gcc: Install dependencies as ports
This lets us remove a couple manual config.sub patches.
2022-05-12 13:12:37 +02:00
Daniel Bertalan
f123fd7af6 Ports: Enable ccache for SERENITY_TOOLCHAIN=Clang 2022-05-12 13:12:37 +02:00
Daniel Bertalan
9b34ffd964 Ports: Add Integer Set Library (isl)
This is a dependency of gcc.
2022-05-12 13:12:37 +02:00
Sam Atkins
d7190be3a3 DisplaySettings: Set window modified state 2022-05-12 13:10:49 +02:00
Sam Atkins
af01c6be0c TerminalSettings: Set window modified state 2022-05-12 13:10:49 +02:00
Sam Atkins
17b41f0d61 MouseSettings: Set window modified state 2022-05-12 13:10:49 +02:00
Sam Atkins
7d6f5f19fd LibGUI: Add AllowCallback parameter to ComboBox::set_text() 2022-05-12 13:10:49 +02:00
Sam Atkins
e74e320750 MouseSettings: Update the cursor theme preview when restoring defaults
Previously, if you opened MouseSettings, set the cursor theme to Dark,
and then click "Defaults", the cursors list would not update.
ComboBox::set_text() does not call the on_change callback, so we have
to run the steps manually.

I've also made `m_theme_name` into a local variable, since it can be.
2022-05-12 13:10:49 +02:00
Sam Atkins
6ba03dec35 WindowServer: Save config file when mouse cursor theme is changed
When user code requests the current cursor theme name with
`GUI::ConnectionToWindowServer::the().get_cursor_theme()`, that reads
the name from the config file. If we don't write that out when it's
changed, then users get given an outdated cursor theme instead of the
current one.

In particular, changing the theme in MouseSettings, saving and closing
it, then reopening MouseSettings, would show the wrong theme selected.
So, that's fixed now. :^)
2022-05-12 13:10:49 +02:00
Sam Atkins
c7d038cc26 MailSettings: Set window modified state 2022-05-12 13:10:49 +02:00
Sam Atkins
ab2bbaabc7 KeyboardSettings: Set window modified state 2022-05-12 13:10:49 +02:00
Sam Atkins
57bac17b9f ClockSettings: Set window modified state 2022-05-12 13:10:49 +02:00
Sam Atkins
f27985a021 BrowserSettings: Set window modified state 2022-05-12 13:10:49 +02:00
Sam Atkins
4f9f948b6d LibGUI: Support "modified" window state in SettingsWindow
SettingsWindow now notices if the window is marked as modified, and
shows a confirmation pop-up to check if the user wants to apply or
discard their changes. It automatically marks the window as unmodified
after restoring defaults or applying the changes, but each Tab subclass
needs to call `set_modified(true)` when the user modifies things.

The "Apply" button is automatically disabled when there are no unsaved
changes to be applied.
2022-05-12 13:10:49 +02:00
Sam Atkins
ebbbca98fa LibGUI: Run TextEditor::on_change callback immediately
This is the only Widget that ran its callback in deferred_invoke(). It
seems to be a holdover from when syntax-highlighting ran whenever the
text changed, but that has not been true since
bec2b3086c. Running the callback
immediately has no obvious downsides, but does make it a lot easier to
reason about. (I might have spent an hour confused as to why things
were happening in the wrong order...)
2022-05-12 13:10:49 +02:00
RKBethke
0836912a6d LibGL+LibGPU+LibSoftGPU: Implement and expose glClipPlane
This commit implements glClipPlane and its supporting calls, backed
by new support for user-defined clip planes in the software GPU clipper.

This fixes some visual bugs seen in the Quake III port, in which mirrors
would only reflect correctly from close distances.
2022-05-11 23:09:47 +02:00
kleines Filmröllchen
bc2f738a84 WindowServer: Make window frame flashing use the highlight color
Now, when windows flash, the "active" color of the window title frame's
flash is the highlight color instead of the standard window color. The
"inactive" color of the flash is still the disabled color as before.

Reasoning behind this change in aesthetics: There are four [1] window
title frame colors with specific UI purposes:
1. "Active" for the normal active window, obvious purpose.
2. "Moving" for the window that is being dragged or resized by the user.
   Responsible for acting as a visual click feedback as a kind of
   subdued button.
3. "Inactive" for any inactive windows, obvious purpose.
4. "Highlight".

The purpose of "Highlight" is in the name, though it's non-obvious what
that exactly entails. Before, only alt-tab selecting windows would use
the highlight color for showing the current target window. In my opinion
this points to the purpose of "highlight" being to move the user's focus
to another window when the simple active state is not enough. Then it
makes sense to have the window flashing use the highlight color. The
entire purpose of window flashing is to shift the user's focus to a
dialog window that might not be close to the window they just clicked.
Using the highlight color enables an even stronger emphasis than before.
It enables a cleaner separation between the purpose of the two frame
colors, as well as making the "Highlight" frame more common.

[1] Technically there are eight, as the title frame has a gradient by
default. We can count the gradient as one color for this purpose.
2022-05-11 21:00:39 +02:00
Jelle Raaijmakers
5861f1821e LibSoftGPU: Clamp polygon depth values to 0.f - 1.f
According to the OpenGL spec, we're expected to clamp the fragment
depth values to the range `0.f - 1.f` for all polygons.

This fixes Z-fighting issues with the sky in Quake 3.
2022-05-11 20:25:17 +02:00
Karol Kosek
f505f1ab5e LibGUI: Try use layout's preferred size for the content size
Previously this was only done if the widget had shrink_to_fit property
enabled.
2022-05-11 20:24:57 +02:00
Karol Kosek
9156614de3 LibGUI: Always use widget's minimum size in ScrollableContainerWidget
I don't know if it makes much sense to use min_size and shrink_to_fit
at the same time, but it will make the code a bit cleaner later.
2022-05-11 20:24:57 +02:00