Commit graph

25338 commits

Author SHA1 Message Date
Jamie Mansfield 506363c08d Solitaire: Clear selection when starting new game
Fixes #9218.
2021-08-05 12:52:33 +02:00
Jamie Mansfield 22aeec1218 Spider: Clear selection when starting new game
Fixes #9217.
2021-08-05 12:52:33 +02:00
Karol Kosek 64ca51265d Assistant: Quit the application after losing focus
Prior to this change, Assistant would just stay in the background,
unless one pressed an Escape key or launched some app.
2021-08-05 11:43:12 +02:00
Karol Kosek ac21c6625d LibGUI: Add on_active_window_change function object to the Window class 2021-08-05 11:43:12 +02:00
brapru a037e0ffec Utilities: Improve the arp information output
This updates the arp command to use output styles similar to other
utilities.
2021-08-05 09:30:35 +02:00
brapru 3bd6905ea8 Utilities: Add pledge and unveil protections in arp 2021-08-05 09:30:35 +02:00
Gunnar Beutner d9d2287a11 Meta: Detect nested KVM support for WSL2 and use that when available
This allows running QEMU inside WSL2 for hosts which have nested KVM
and WSLg support (e.g. Windows 11).

Running QEMU inside the WSL2 VM is slightly slower than running QEMU
on Windows, probably because of how WSLg handles screen updates.
2021-08-04 21:15:41 +02:00
Gunnar Beutner 723c89af67 Meta: Automatically enable WHPX when possible 2021-08-04 21:15:41 +02:00
Gunnar Beutner 5445155dba Meta: Auto-detect where QEMU is installed on Windows 2021-08-04 21:15:41 +02:00
Idan Horowitz ffee3d6c5d Kernel: Remove the always 1-sized super physical regions Vector
Since we only ever add 1 super physical region, theres no reason to
add the extra redirection and allocation that comes with a dynamically
sized Vector.
2021-08-04 21:02:40 +02:00
Luke cbbbc38f27 Kernel: Print panic backtrace to both the screen and serial
Previously it would only print the backtrace to serial, which would be
inaccessible if you don't have serial setup.
2021-08-04 20:14:54 +02:00
Liav A 7c617394a1 Kernel: Ensure we read valid values from the RTC CMOS registers
We try to read twice from the RTC CMOS registers, and if the values are
not the same for 5 attempts, we know there's a malfunction with the
hardware so we declare these values as bogus in the kernel log.
2021-08-04 19:53:04 +02:00
Liav A 517460d3a9 Kernel: Ensure we don't get in an endless loop while querying the CMOS
When we try to query the time from the RTC CMOS, we try to check if
the CMOS is updated. If it is updated for a long period of time (as a
result of hardware malfunction), break the loop and return Unix epoch
time.
2021-08-04 19:53:04 +02:00
Sam Atkins 74c9587798 LibWeb: Fix EOF handling in CSS Tokenizer peek_{twin,triplet}()
Previously, the loops would stop before reaching EOF, meaning that the
values that should have been set to EOF were left with their 0 initial
values. Now, we initialize to EOFs instead. The if/else inside the loops
always ran the else branch so I have removed the if branches.
2021-08-04 19:04:12 +04:30
Jelle Raaijmakers 31e3b3028b Documentation: Add ImageMagick as dependency for macOS 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers d2379dfe96 Ports: Add PHP entry to taskbar menu 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers a76c208bae Ports: Support icons for launchers with arguments 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers 1a4b1ecd04 LibDesktop: Add support for IconPath in AppFile
With `IconPath`, you can override the icon used for the application
shortcut. This currently only supports resolving the icon through
`GUI::FileIconProvider`, the implementation for pointing to actual
image files is left as an exercise for the reader.
2021-08-04 13:54:08 +01:00
Jelle Raaijmakers 0ec39aafb6 LibDesktop: Collapse if-else in AppFile 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers c7e72a52a3 Taskbar: Use provided AppFile icon instead of finding it ourselves 2021-08-04 13:54:08 +01:00
Jelle Raaijmakers 8493477cc7 Ports: Convert only first index of ico files
When installing an icon, we fall back to a resizing strategy when an
exact match on the image dimensions is missing. However, if we are
dealing with an `.ico` file with multiple indices, `convert` will
resize every separate index and will create multiple files.

This changes makes sure we only resize the first index. A future
improvement could be to select an index most closely matching the
requested dimensions.
2021-08-04 13:54:08 +01:00
Jelle Raaijmakers 546af2d9ef Ports: Notify user of missing ImageMagick binaries 2021-08-04 13:54:08 +01:00
Timothy Flynn 6f2640d031 LibUnicode: Parse UCD DerivedBinaryProperties.txt and generate property 2021-08-04 13:50:32 +01:00
Timothy Flynn 9113f892a7 LibUnicode: Parse UCD emoji-data.txt and generate Unicode property 2021-08-04 13:50:32 +01:00
Timothy Flynn 484ccfadc3 LibRegex: Support property escapes of Unicode script extensions 2021-08-04 13:50:32 +01:00
Timothy Flynn 5edd458420 LibUnicode: Parse UCD ScriptExtensions.txt and generate property 2021-08-04 13:50:32 +01:00
Timothy Flynn 6bdb19fe21 LibUnicode: Remove unused parameter from Unicode data generator 2021-08-04 13:50:32 +01:00
Timothy Flynn 06088df729 LibRegex: Support property escapes of the Unicode script property
Note that unlike binary properties and general categories, scripts must
be specified in the non-binary (Script=Value) form.
2021-08-04 13:50:32 +01:00
Timothy Flynn f5c1bbc00b LibUnicode: Parse UCD Scripts.txt and generate as a Unicode property
There are a couple of minor nuances with parsing script values, compared
to other properties. In Scripts.txt, the UCD file lists the full name of
each script; other properties, like General Category, list the shorter
name in their primary files. This means that the aliases listed in
PropertyValueAliases.txt are reversed for script values.
2021-08-04 13:50:32 +01:00
kleines Filmröllchen 619c924042 AudioWidget: Proper volume changes when scrolling on the widget
Because setting the slider's value in the mousewheel handler will cause
the volume logarithm logic and the volume setting to happen anyways, we
don't need to do it in the mousewheel handler again. By just moving the
slider up and down with the scroll wheel, we mimic normal SliderWidget
behavior that doesn't exhibit the multiple previous bugs.
2021-08-04 11:36:36 +02:00
Timothy Flynn 1bb6404a19 LibUnicode: Invoke Unicode data generator a single time
It takes a non-neglible amount of time to parse all of the UCD files and
generate the Unicode data files. To help compile times, only invoke the
generator once.
2021-08-04 11:18:24 +02:00
Timothy Flynn 9413c3a0d1 LibUnicode: Generate a map of code points to their Unicode table index
The current strategy of searching for a code point within the generated
table is slow for code points > U+0377 (the last code point whose index
is the same value as the code point itself). For larger code points, we
are doing a linear search through the table.

Instead, generate a HashMap of each code point to its entry in the table
for faster runtime lookups.

This had the added benefit of being able to remove a fair amount of code
from the generator. We no longer need to track that last contiguous code
point (U+0377) nor each code point's index in the generated table.
2021-08-04 11:18:24 +02:00
Timothy Flynn 70080feab2 AK+LibJS: Implement String.from{CharCode,CodePoint} using UTF-16 strings
Most of String.prototype and RegExp.prototype is implemented with UTF-16
so this is to prevent extra copying of the string data.
2021-08-04 11:18:24 +02:00
Timothy Flynn b6ff7f4fcc LibJS: Allow PrimitiveString to be created with a UTF-16 string
PrimitiveString may currently only be created with a UTF-8 string, and
it transcodes on the fly when a UTF-16 string is needed. Allow creating
a PrimitiveString from a UTF-16 string to avoid unnecessary transcoding
when the caller only wants UTF-16.
2021-08-04 11:18:24 +02:00
Timothy Flynn 4c2cc419f9 LibJS: Decode UTF-16 surrogate pairs during string literal construction
Rather than deferring this decoding to PrimitiveString, we can decode
surrogate pairs when parsing the string. This prevents a string copy
when constructing the PrimitiveString.
2021-08-04 11:18:24 +02:00
Timothy Flynn 27d555bab0 LibRegex: Track string position in both code units and code points
In non-Unicode mode, the existing MatchState::string_position is tracked
in code units; in Unicode mode, it is tracked in code points.

In order for some RegexStringView operations to be performant, it is
useful for the MatchState to have a field to always track the position
in code units. This will allow RegexStringView methods (e.g. operator[])
to perform lookups based on code unit offsets, rather than needing to
iterate over the entire string to find a code point offset.
2021-08-04 11:18:24 +02:00
Timothy Flynn dae7674ca9 AK: Allow configuring the BumpAllocator chunk size 2021-08-04 11:18:24 +02:00
Timothy Flynn 510bbcd8e0 AK+LibRegex: Add Utf16View::code_point_at and use it in RegexStringView
The current method of iterating through the string to access a code
point hurts performance quite badly for very large strings. The test262
test "RegExp/property-escapes/generated/Any.js" previously took 3 hours
to complete; this one change brings it down to under 10 seconds.
2021-08-04 11:18:24 +02:00
sin-ack bed51d856a AK+Kernel: Print TODO when a TODO() is executed
Previously we would just print "ASSERTION FAILED: false", which was
kinda cryptic and also didn't make it clear whether this was a TODO or
an unreachable condition. Now, we actually print "ASSERTION FAILED:
TODO", making it crystal clear.
2021-08-04 11:01:16 +02:00
Karol Kosek e500b39e47 LibAudio: Use an existing file stream when parsing a FLAC header
Before this change the file stream was generated two times:
one time in the parse_header(), and another time for the whole class
in the constructor.

The previous commit moved the m_stream initialization before
executing the parse_header function, so we can now reuse that here.
2021-08-04 11:00:27 +02:00
Karol Kosek 81261bc169 LibAudio: Initialize m_stream before parsing a FLAC header
Before this change opening the file in the system resulted in crash
caused by assertion saying:

  SoundPlayer(32:32): ASSERTION FAILED: m_ptr
  ../.././AK/OwnPtr.h:139
  [#0 SoundPlayer(32:32)]: Terminating SoundPlayer(32) due to signal 6
  [#0 FinalizerTask(4:4)]: 0xdeadc0de

The issue was that 845d403b8c started
using m_stream in the parse_header() function, but that variable wasn't
initialized if the Loader plugin was created using a file path
(which is used everywhere except for the fuzz testing),
resulting in a crash mentioned above.
2021-08-04 11:00:27 +02:00
Gunnar Beutner 07cc7eed29 Shell: Make sure TTY echo is enabled when running external commands
When running external commands via "Shell -c" LibLine turns of TTY echo
before running the command. This ensures that it is turned on.
2021-08-04 03:14:59 +04:30
Linus Groh 18f507520e Ports: Update Python to 3.10.0rc1
Released on 2021-08-02.
https://www.python.org/downloads/release/python-3100rc1/

This contains the first upstreamed change for SerenityOS, making the
webbrowser module work with Browser out of the box :^)
2021-08-03 21:01:07 +01:00
Linus Groh 5a0a426c18 Ports: Make Python version check work with suffixed versions
E.g. a1, b1, rc1. Simply don't parse anything beyond major and minor.
2021-08-03 21:01:07 +01:00
Linus Groh a613e00caa Ports: Change Python's auth_type to sha256 2021-08-03 21:01:07 +01:00
Liav A cca1498e09 Meta: Make the Q35 machine more realistic
Although it is nice to test the system without too many devices, in
reality bare metal hardware is far more complex than the default skeleon
that QEMU provides. As a preparation of supporting more devices, we
need to ensure we are capable of at least booting on complex hardware
setups without easily-observable problems. Later on, this can be the
foundations of testing new drivers :^)
2021-08-03 21:08:01 +02:00
Timothy 73c1b1617a Everywhere: Replace most cases of exit() with Application::quit()
Application::quit() is nicer for most cases where exit() is used. Cases
where exit() is used intentionally for early termination are left
intact.
2021-08-03 18:55:52 +02:00
Brian Gianforcaro 2caafacd9b Kernel: Remove OOM unsafe API KBuffer::create_with_size 2021-08-03 18:54:23 +02:00
Brian Gianforcaro 720a686a76 Kernel: Handle OOM when allocating Packet KBuffers 2021-08-03 18:54:23 +02:00
Brian Gianforcaro 8c4785bd10 Kernel: Use normal initialization for TCPPacket instead of memset 2021-08-03 18:54:23 +02:00