summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2022-04-26LibGUI: Split InsertTextCommand undo/redo based on whitespaceForLoveOfCats
2022-04-26LibGUI: Use ctrl+shift+z for redo action shortcutForLoveOfCats
2022-04-26LibC: Don't handle pending exceptions when reading FPU statusTim Schumacher
2022-04-26LibMarkdown: Treat whitespace-only lines as blank in paragraphsPeter Elliott
2022-04-26LibMarkdown: Don't put a newline in empty code blocksPeter Elliott
This doesn't actually matter, but I'm trying to match the commonmark test cases where possible.
2022-04-26LibMarkdown: Better support for code fencesPeter Elliott
- Support tildes. - Support different lengths of fence. - Begrudgingly keep support for serenities one markdown extension.
2022-04-26LibMarkdown: Support up to 3 spaces before an ATX headerPeter Elliott
2022-04-26LibMarkdown: Limit headings to 6 levelsPeter Elliott
2022-04-26LibMarkdown: Make thematic break parsing more correctPeter Elliott
also fix a conflict with lists and thematic breaks
2022-04-26LibMarkdown: Ignore backslash on non-punctuation charactersPeter Elliott
2022-04-26LibMarkdown: Add support for indented code blocksPeter Elliott
2022-04-26Kernel: Add FIOCLEX and FIONCLEX ioctlsAndreas Kling
These allow you to turn the close-on-exec flag on/off via ioctl().
2022-04-25LibGUI: Respect TitleButtonsIconOnly in AbstractThemePreviewMacDue
2022-04-25LibGfx+WindowServer: Add theme flag TitleButtonsIconOnlyMacDue
With this flag set to true only the icon of the title button is painted. This is useful for themes with a more non-serenity look such as Coffee and Cupertino (that currently try to hide the button).
2022-04-25LibGUI: Display line number next to the first visual lineLucas CHOLLET
The number was previously vertically centered, but it prevents from quickly seeing a line change.
2022-04-24LibGUI: Fix text wrap artifact when selecting textLucas CHOLLET
The issue was caused by the usage of the selection_end_column_within_line variable as if it was the visual line. This is fixed by taking the minimum between this value and the length of a visual line.
2022-04-23LibGUI: Remove unused functions in EditingEngine classMoustafa Raafat
2022-04-23LibC: Use correct inttypes.h format strings on Aarch64Daniel Bertalan
Similarly to x86_64, Aarch64 is LP64, so its `uint64_t` type is `unsigned long`. Fixes a bunch of compiler warnings when compiling the LLVM runtime libraries for the aarch64-pc-serenity target.
2022-04-23LibC: Unconditionally include bits/posix1_lim.h from limits.hDaniel Bertalan
No other system seems to put this behind a _USE_POSIX ifdef.
2022-04-23LibWeb+AudioServer: Remove unused spaceship operatorsAndrew Kaster
We aren't actually using these for anything, and the spaceship operator requires ``<compare>`` from the STL, which we'd rather not include.
2022-04-23Kernel+LibC+LibCore: Implement the unlinkat(2) syscallsin-ack
2022-04-23LibWeb: Move XHR::open() towards more spec complianceKenneth Myhra
Following FIXMEs have been addressed: - 1. Let settingsObject be this’s relevant settings object. - 2. If settingsObject has a responsible document and it is not fully active, then throw an "InvalidStateError" DOMException. - 6. Let parsedURL be the result of parsing url with settingsObject's API base URL and settingsObject’s API URL character encoding. - 8. If the async argument is omitted, set async to true, and set username and password to null.
2022-04-23LibWeb: XHR set_request_header() validate header name and valueKenneth Myhra
2022-04-23LibWeb: Trim leading and trailing HTTP whitespace bytesKenneth Myhra
The XMLHttpRequest specification specifices that header values should be normalized by trimming leading and trailing HTTP whitespace bytes.
2022-04-23LibWeb: Use a more restrictive regex for method token productionKenneth Myhra
This changes the regular expression for is_method() to a more restrictive pattern.
2022-04-23LibWeb: Combine headers in XMLHttpRequest::set_request_headerKenneth Myhra
This patch adds support for combining header values, in addtion it adds spec comments for readability.
2022-04-22LibWasm: Simplify the return instruction execution code a bitAli Mohammad Pur
2022-04-22LibWasm: Push call results back in reverse order to preserve stack orderAli Mohammad Pur
2022-04-22LibWasm: Make memory_grow validation push back the old memory sizeAli Mohammad Pur
2022-04-22LibWasm: Make local_tee validation keep the value on the stackAli Mohammad Pur
2022-04-22LibRegex: Check inverse_matched after every op, not just at the endAli Mohammad Pur
Fixes #13755. Co-Authored-By: Damien Firmenich <fir.damien@gmail.com>
2022-04-21LibGUI+Applications: Add --open-tab option to FooSettings applicationsSam Atkins
Similar to SystemMonitor's option of the same name, this allows you to launch the given application with the specific tab open.
2022-04-21LibGUI+Applications: Give SettingsWindow tabs a string IDSam Atkins
This gives us a convenient way to refer to them, which will be used in the following commit.
2022-04-21LibCore: Output invalid DateTime::to_string() specifiers as literalsSam Atkins
While working on #13764 I noticed that DateTime::to_string() would just return an empty String if the format included an invalid specifier (eg `%Q`). This seems to be a mistake. POSIX date(1), which I believe we are basing our implementation on, only replaces valid specifiers, and any invalid ones get included as literals in the output. For example, on Linux `date "+%Quiz"` returns "%Quiz", but we were returning "".
2022-04-21LibAudio+Userland: Use new audio queue in client-server communicationkleines Filmröllchen
Previously, we were sending Buffers to the server whenever we had new audio data for it. This meant that for every audio enqueue action, we needed to create a new shared memory anonymous buffer, send that buffer's file descriptor over IPC (+recfd on the other side) and then map the buffer into the audio server's memory to be able to play it. This was fine for sending large chunks of audio data, like when playing existing audio files. However, in the future we want to move to real-time audio in some applications like Piano. This means that the size of buffers that are sent need to be very small, as just the size of a buffer itself is part of the audio latency. If we were to try real-time audio with the existing system, we would run into problems really quickly. Dealing with a continuous stream of new anonymous files like the current audio system is rather expensive, as we need Kernel help in multiple places. Additionally, every enqueue incurs an IPC call, which are not optimized for >1000 calls/second (which would be needed for real-time audio with buffer sizes of ~40 samples). So a fundamental change in how we handle audio sending in userspace is necessary. This commit moves the audio sending system onto a shared single producer circular queue (SSPCQ) (introduced with one of the previous commits). This queue is intended to live in shared memory and be accessed by multiple processes at the same time. It was specifically written to support the audio sending case, so e.g. it only supports a single producer (the audio client). Now, audio sending follows these general steps: - The audio client connects to the audio server. - The audio client creates a SSPCQ in shared memory. - The audio client sends the SSPCQ's file descriptor to the audio server with the set_buffer() IPC call. - The audio server receives the SSPCQ and maps it. - The audio client signals start of playback with start_playback(). - At the same time: - The audio client writes its audio data into the shared-memory queue. - The audio server reads audio data from the shared-memory queue(s). Both sides have additional before-queue/after-queue buffers, depending on the exact application. - Pausing playback is just an IPC call, nothing happens to the buffer except that the server stops reading from it until playback is resumed. - Muting has nothing to do with whether audio data is read or not. - When the connection closes, the queues are unmapped on both sides. This should already improve audio playback performance in a bunch of places. Implementation & commit notes: - Audio loaders don't create LegacyBuffers anymore. LegacyBuffer is kept for WavLoader, see previous commit message. - Most intra-process audio data passing is done with FixedArray<Sample> or Vector<Sample>. - Improvements to most audio-enqueuing applications. (If necessary I can try to extract some of the aplay improvements.) - New APIs on LibAudio/ClientConnection which allows non-realtime applications to enqueue audio in big chunks like before. - Removal of status APIs from the audio server connection for information that can be directly obtained from the shared queue. - Split the pause playback API into two APIs with more intuitive names. I know this is a large commit, and you can kinda tell from the commit message. It's basically impossible to break this up without hacks, so please forgive me. These are some of the best changes to the audio subsystem and I hope that that makes up for this :yaktangle: commit. :yakring:
2022-04-21LibAudio+Everywhere: Rename Audio::Buffer -> Audio::LegacyBufferkleines Filmröllchen
With the following change in how we send audio, the old Buffer type is not really needed anymore. However, moving WavLoader to the new system is a bit more involved and out of the scope of this PR. Therefore, we need to keep Buffer around, but to make it clear that it's the old buffer type which will be removed soon, we rename it to LegacyBuffer. Most of the users will be gone after the next commit anyways.
2022-04-21LibIPC: Allow transporting a SharedCircularQueue over IPCkleines Filmröllchen
2022-04-21LibCore: Introduce SharedSingleProducerCircularQueuekleines Filmröllchen
This new class with an admittedly long OOP-y name provides a circular queue in shared memory. The queue is a lock-free synchronous queue implemented with atomics, and its implementation is significantly simplified by only accounting for one producer (and multiple consumers). It is intended to be used as a producer-consumer communication datastructure across processes. The original motivation behind this class is efficient short-period transfer of audio data in userspace. This class includes formal proofs of several correctness properties of the main queue operations `enqueue` and `dequeue`. These proofs are not 100% complete in their existing form as the invariants they depend on are "handwaved". This seems fine to me right now, as any proof is better than no proof :^). Anyways, the proofs should build confidence that the implemented algorithms, which are only roughly based on existing work, operate correctly in even the worst-case concurrency scenarios.
2022-04-21LibC: Stub out posix_memalign()Andreas Kling
2022-04-21LibC: Make nameinfo (NI_*) constants bitfield-friendlyAndreas Kling
These are supposed to be used as flags in a bitfield, so let's make them powers of two.
2022-04-21LibC: Implement errno via a __errno_location() functionAndreas Kling
This matches how some other systems implement errno, and makes 3rd party software that expect us to have __errno_location() work.
2022-04-20LibWeb: Fix various spec comment inconsistenciesLinus Groh
- Don't add multiple numbers to nested steps, just the innermost one (as rendered in the HTML document) - "Otherwise" comments go before the else, not after it - "FIXME:" goes before step number, not between it and the comment text - Always add a period between number and comment text The majority of these were introduced in #13756, but some unrelated ones have been updated as well.
2022-04-20LibGUI: Remove Tile.date_time member from CalendarMichael Manganiello
Currently, navigating through different years in the Year view of the Calendar app or the taskbar is very slow. Profiling results show that almost all the time is spent in `Calendar::update_tiles`, and specifically, in `DateTime::create` and `DateTime::set_time`. Performance can improve substantially if the `TZ` environment variable is set [0], but we can improve the current code to perform better nevertheless :^) This diff focuses on removing the need of the `Tile` struct to require the instantiation of a `DateTime` object, which avoids _at least_ 365 object instantiations in the Year view, on each `update_tiles` call. Instead, as the `date_time` isn't used often, we can instantiate it on demand when a particular date is selected. [0] https://blog.packagecloud.io/set-environment-variable-save-thousands-of-system-calls/
2022-04-20LibGUI: Use fuzzy matching in CommandPalettefaxe1008
This patch changes the previously used contains method for matching the user search term with all available commands to use the fuzzy match algorithm, which makes it more typo tolerant.
2022-04-20LibGUI: Close CommandPalette on active window changefaxe1008
This patch makes CommandPalette be closed whenever the focus shifts from the dialog. It is closer to other non-serenity implementations of the CommandPalette and other modal dialogs in the system.
2022-04-20LibGfx: Avoid signed comparison in find_largest_imageLeonardo Duarte
I believe the issue was caused by the product of two u16s being promoted to (signed) int, which can cause unwanted overflow behaviour when comparing to size_t. Casting each term to size_t before the multiplication makes the comparison unsigned.
2022-04-20LibGL: Set W-coordinate to 1 in `glRect*`Jelle Raaijmakers
According to the spec, these calls should be identical to an invocation of `glVertex2*`, which sets the W-coordinate to 1 by default. This fixes the credits sequence rendering of Tux Racer.
2022-04-20LibSoftGPU: Check for bottom edge in top-left rule in `Device`Jelle Raaijmakers
If a triangle edge is completely horizontal and moving in a positive X direction, we were erroneously treating it as a top edge. This adds a better check that accounts for those edges. :^)
2022-04-20LibSoftGPU: Simplify `Clipper` interpolationJelle Raaijmakers
By setting the clip plane normals' W coordinate to 1, we can skip two coordinate retrievals and three additions. This works because the Vector `.dot()` operation multiplies the W coordinates of both vectors.
2022-04-20LibSoftGPU: Reuse edge function for front/back cullingJelle Raaijmakers
We sat on a throne of lies: our `edge_function()` returned positive values for _clockwise_ vertex rotation instead of _counter-clockwise_, which was hidden by the fact that we were forcing everything into CW rotation by an erroneous area comparison (`> 0` instead of `< 0`). This simplifies our culling code significantly.