summaryrefslogtreecommitdiff
path: root/Userland/Services
AgeCommit message (Collapse)Author
2022-04-29Kernel+WindowServer: Move setting tty graphical mode to UserspacePeter Elliott
This will allow using the console tty and WindowServer regardless of your kernel command line. Also this fixes a bug where, when booting in text mode, the console was in graphical mode, and would not accept input.
2022-04-26LoginServer: Change login fail message to avoid enumeration attacksPeter Elliott
The current message distinguishes between a user that doesn't exist, and an invalid password. This is considered to be bad practice, because an attack can first check if a user exists before guessing that users password. Also it's just tradition or something.
2022-04-26LibConfig+ConfigServer: Write config values synchronouslyMoustafa Raafat
This patch fixes the issue of pressing the ok button of a settings menu without saving the changes, or not reverting the changes when pressing the cancel button because the app has died before the new values make it to the other end.
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-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-21AudioServer: Auto-pause new clientskleines Filmröllchen
This fixes a bunch of audio clients that don't actually play audio.
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-21SystemServer: Boot into graphical mode even if there's no video hardwarekleines Filmröllchen
SystemServer had safety fallbacks to boot into text mode if the user errorneously specified graphical mode but no video hardware was present. As it's now possible to do exactly this intentionally, we should allow it. This would of course make WindowServer fall over and die if configured improperly, but if you're messing with the kernel command line in strange ways, you should be able to fix that.
2022-04-21WindowServer: Create the VirtualScreenBackendkleines Filmröllchen
This screen backend is just memory-backed and doesn't connect to any screen hardware. That way, we can boot Serenity without video hardware but in full graphical mode :^) To create a virtual screen, put something like this in your WindowServer.ini. There's no way yet to do this through Display Settings, though an existing virtual screen's settings can be changed there. ```ini [Screen0] Mode=Virtual Left=1024 Top=0 Width=1920 Height=1080 ScaleFactor=1 ```
2022-04-21WindowServer: Add the screen mode property in the screen configurationkleines Filmröllchen
This will allow us to change between a couple of properties, for now it's only Device and Virtual. (How about Remote :^) ) These get handled by a different screen backend in the Screen.
2022-04-21WindowServer: Make Screen use ScreenBackendkleines Filmröllchen
This will allow us to use other screen backends in the future instead.
2022-04-21WindowServer: Introduce the ScreenBackend conceptkleines Filmröllchen
The ScreenBackend is a thin wrapper around the actual screen hardware connection. It contains all the variables specific to that hardware and abstracts away operations that deal with controlling the hardware. The standard ScreenBackend implementor is HardwareScreenBackend, which contains all the existing frame buffer & ioctl handling code of Screen. I took this opportunity to introduce ErrorOr wherever sensible.
2022-04-21WindowServer: Rename fb_data and friends to flush_rect etckleines Filmröllchen
This was very badly named. All that the "FBData" struct contains is the currently to-be-flushed rectangles plus a fullness flag, so it should better be called FlushRectData. This rename is similarly applied to all variable names.
2022-04-18Userland: Always construct Application with try_create()Sam Atkins
2022-04-17DHCPClient: Send ParameterRequestList option with DHCPRequest packetThitat Auareesuksakul
We'll need SubnetMask and Router options to be returned with the ACK packet. So, it's a good idea to request them explicitly in this packet.
2022-04-17DHCPClient: Send ServerIdentifier option with DHCPRequest packetThitat Auareesuksakul
Some DHCP servers (including Mikrotik ones) will NAK the request if the ServerIdentifier option is not sent with the DHCPRequest packet.
2022-04-16LibCore+Everywhere: Make Core::Stream read_until() return BytesSam Atkins
This affects BufferedSeekable::read_until() and ::read_until_any_of(). For the reasoning, see the previous commit about Core::Stream::read().
2022-04-16LibCore+Everywhere: Make Core::Stream::read() return BytesSam Atkins
A mistake I've repeatedly made is along these lines: ```c++ auto nread = TRY(source_file->read(buffer)); TRY(destination_file->write(buffer)); ``` It's a little clunky to have to create a Bytes or StringView from the buffer's data pointer and the nread, and easy to forget and just use the buffer. So, this patch changes the read() function to return a Bytes of the data that were just read. The other read_foo() methods will be modified in the same way in subsequent commits. Fixes #13687
2022-04-15LibDNS: Remove the 'DNS' prefix from the various type and class namesTom
Since all types and class names live in the DNS namespace, we don't need to spell it out twice each time.
2022-04-15LookupServer: Move DNS related code into new LibDNS libraryTom
This allows other code to use the DNSPacket class, e.g. when sent over IPC.
2022-04-14TelnetServer: Ignore null and \n when parsingAatos Majava
This fixes issues with carriage return sequences. Before, using <CR><NUL> as the return sequence wouldn't work at all, and when using <CR><LF> there was an extra newline after every newline. After this patch, the behaviour should be closer to the Telnet RFC.
2022-04-11DHCPClient: Close outgoing sockets after useTim Schumacher
2022-04-11LibCore+Userland: Remove File::ensure_parent_directorieskleines Filmröllchen
We have a much safer and more powerful alternative now, so let's move the few users over.
2022-04-11LibCore: Automatically create config directories if necessarykleines Filmröllchen
If the .config directory (or its children, like lib) was deleted, ConfigFile would crash because it would try to open or create a file in a directory that didn't exist. Therefore, for user and library configs (but not system configs), ensure that the parent directories exist. This allows the user to delete the entire .config folder and all apps still work. (Except those which can't handle missing config. That's a separate issue though.) Fixes #13555 Note: Some changes to pledges and unveils are necessary for this to work. The only one who can recreate .config at the moment is ConfigServer, as others probably don't pledge the user home directory.
2022-04-09LibGfx: Move other font-related files to LibGfx/Font/Simon Wanner
2022-04-09Browser+LibWeb+WebContent: Implement per-URL-pattern proxiesAli Mohammad Pur
...at least for SOCKS5.
2022-04-09RequestServer+LibProtocol: Allow users to specify a per-request proxyAli Mohammad Pur
2022-04-09LibCore+RequestServer: Add support for SOCKS5 proxiesAli Mohammad Pur
2022-04-09WebServer: Add utf-8 charset to Content-Type header for text/plainLady Gegga
2022-04-06LibWeb: Remove the InProcessWebView widgetAndreas Kling
Let's simplify our offering by only having the OutOfProcessWebView.
2022-04-06InspectorServer: Defer removal of InspectableProcess from tablesin-ack
This prevents a crash when the inspected process closes the socket (i.e. when the app is exited). This crash was caused by the InspectableProcess removing itself from the global process table within a callback Function that is stored as part of the InspectableProcess.
2022-04-05Revert "WebContent: Use ConsoleGlobalObject for the console's global object :^)"Andreas Kling
This reverts commit 8296dd995562a0233dcc75d4f59621f60dd0c77d.
2022-04-05WindowServer+LibGUI: Notify windows when their maximized state changesAndreas Kling
Previously, GUI::Window::is_maximized() had to make a synchronous IPC request to WindowServer in order to find out if the window was indeed maximized. This patch removes the need for synchronous IPC by instead pushing the maximization state to clients when it changes. The motivation for this change was that GUI::Statusbar was checking if the containing window was maximized in its resize_event(), causing all windows with a statusbar to block on sync IPC *during* resize. Browser would typically block for ~15 milliseconds here every time on my machine, continuously during live resize.
2022-04-05WebContent: Cancel pending paint requests when removing a backing storeAndreas Kling
If there are pending paint requests waiting to be processed when the client asks us to remove a backing store, we now prune them from the request queue. This avoids doing completely wasted painting work while resizing the browser window. :^)
2022-04-05WebContent: Use ConsoleGlobalObject for the console's global object :^)Sam Atkins
Seems like this got missed when ESOs were implemented. Now we can use `$0` again!
2022-04-04ClockSettings+Taskbar: Add settings for taskbar clock formatcflip
2022-04-03Services: Use default execpromises parameter to `pledge(..)`Brian Gianforcaro
2022-04-03Browser+LibWeb+WebContent: Add ability to inspect local storageValtteri Koskivuori
The storage inspector now has a new tab for local storage. The next step would be to persist local storage and receive real-time notifications for changes to update the table view.
2022-04-03DisplaySettings+WindowServer: Allow updating theme without backgroundBen Maxwell
With this change you can now set the theme and background color at the same time in the Display Settings. Before if both were changed before hitting 'apply' the theme background color would overwrite the custom background.
2022-04-02LibGfx: Add list_installed_system_themes() to SystemThemeBen Maxwell
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-31Browser+WebContent: Add a Debug menu action to disable scripting :^)Linus Groh
2022-03-31WebContent: Add plumbing for 'is scripting enabled' settingLinus Groh
2022-03-27LookupServer: Fix confusing copy/paste error in debug messageLinus Groh
2022-03-27LookupServer: Use case-insensitive comparison for domain namesTimur Sultanov
Some ISPs may MITM DNS requests coming from clients, changing the case of domain name in response. LookupServer will refuse responses from any DNS server in that case. This commit changes the behaviour to perform a case-insensitive equality check.
2022-03-27WindowServer+LibGUI: Expose raw scroll wheel values to applicationscircl
This is useful, for instance, in games in which you can switch held items using the scroll wheel. In order to implement this, they previously would have to either add a hard-coded division by 4, or look up your mouse settings to adjust correctly. This commit adds an MouseEvent.wheel_raw_delta_x() and MouseEvent.wheel_raw_delta_y().
2022-03-25LibWeb: Show correct element margin values in Inspector "Box Model" viewAndreas Kling
We were showing the margin-top value for all 4 margin values.
2022-03-24Services: Use default constructors/destructorsLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-03-24WebContent: Remove accidentally committed unveil() callAndreas Kling