summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibDesktop
AgeCommit message (Collapse)Author
2022-10-17LibDesktop+Taskbar: Add 'WorkingDirectory' property to app filescflip
2022-10-14LibDesktop: Add support for RequiresRoot option to AppFilene0ndrag0n
2022-10-03SystemServer+LoginServer+Userland: Switch to sid-based socketsPeter Elliott
This commit does three things atomically: - switch over Core::Account+SystemServer+LoginServer to sid based socket names. - change socket names with %uid to %sid. - add/update necessary pledges and unveils. Userland: Switch over servers to sid based sockets Userland: Properly pledge and unveil for sid based sockets
2022-08-14LibCore+LibIPC: Recognise %uid in pathLucas CHOLLET
This patch allows to insert "%uid" in `IPC_CLIENT_CONNECTION` declaration and in SystemServer's ini files. This pattern is replaced then replaced by the UID of the owner of the service. It opens a path for seamlessly managed, per-user portal.
2022-08-14LibCore+LaunchServer: Move portal directory to `/tmp/user/%uid`Lucas CHOLLET
The `/tmp/user` directory is owned by root, this solution prevents malicious users to interfere with other users' portals. This commit also moves `launch`'s portal in the user directory.
2022-07-27LaunchServer+LibDesktop: Open from mime typedemostanis
Before, LaunchServer would only open files based on their extension. This wouldn't work if the file had the wrong one.
2022-07-19LaunchServer+SystemServer: Move the portal to a user-specific directoryLucas CHOLLET
Various changes are needed to support this: - The directory is created by Core::Account on login (and located in /tmp). - Service's sockets are now deleted on exit (to allow re-creation) - SystemServer needs to handle SIGTERM to correctly destroy services.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-07-12Everywhere: Split Error::from_string_literal and Error::from_string_viewsin-ack
Error::from_string_literal now takes direct char const*s, while Error::from_string_view does what Error::from_string_literal used to do: taking StringViews. This change will remove the need to insert `sv` after error strings when returning string literal errors once StringView(char const*) is removed. No functional changes.
2022-05-25LibCore: Return ErrorOr<pid_t> and support arguments in Process::spawnMacDue
This makes the wrapper more like the rest in LibCore, and also removes the annoying limitation of not supporting arguments. There are three overloads one for String, char const *, and StringView argument lists. As long as there are <= 10 arguments the argv list will be allocated inline, otherwise on the heap.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-10Libraries: Use default constructors/destructors in LibDesktopLenny 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-10Libraries: Use default constructors/destructors in LibCppLenny 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-02-25LibDesktop: Rename LaunchServerConnection=>ConnectionToLaunchServerItamar
This was done with CLion's automatic rename feature.
2022-02-25Userland: Rename IPC::ServerConnection=>IPC::ConnectionToServerItamar
This was done with CLion's automatic rename feature.
2022-02-16LibCore+Everywhere: Return ErrorOr from ConfigFile factory methodsSam Atkins
I've attempted to handle the errors gracefully where it was clear how to do so, and simple, but a lot of this was just adding `release_value_but_fixme_should_propagate_errors()` in places.
2022-01-21LibDesktop: Add Launcher::ensure_connection()Maciej
This can be use force connection at startup and not to leave 'unix' pledge all the time.
2022-01-15LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServersin-ack
This change unfortunately cannot be atomically made without a single commit changing everything. Most of the important changes are in LibIPC/Connection.cpp, LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp. The notable changes are: - IPCCompiler now generates the decode and decode_message functions such that they take a Core::Stream::LocalSocket instead of the socket fd. - IPC::Decoder now uses the receive_fd method of LocalSocket instead of doing system calls directly on the fd. - IPC::ConnectionBase and related classes now use the Stream API functions. - IPC::ServerConnection no longer constructs the socket itself; instead, a convenience macro, IPC_CLIENT_CONNECTION, is used in place of C_OBJECT and will generate a static try_create factory function for the ServerConnection subclass. The subclass is now responsible for passing the socket constructed in this function to its ServerConnection base; the socket is passed as the first argument to the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before any other arguments. - The functionality regarding taking over sockets from SystemServer has been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket implementation of this functionality hasn't been deleted due to my intention of removing this class in the near future and to reduce noise on this (already quite noisy) PR.
2021-11-24LibDesktop: Make allowlist APIs return ErrorOr<void>Andreas Kling
This makes it very smooth to use TRY() when setting up these lists, as you can see in the rest of this commit. :^)
2021-11-17AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional)Andreas Kling
Also add slightly richer parse errors now that we can include a string literal with returned errors. This will allow us to use TRY() when working with JSON data.
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-08-06Userland: Use Core::Process::spawn() instead of posix_spawn() in placesAndreas Kling
This replaces a bunch of very basic uses of posix_spawn() with the new Core::Process::spawn().
2021-08-04LibDesktop: Add support for IconPath in AppFileJelle Raaijmakers
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-04LibDesktop: Collapse if-else in AppFileJelle Raaijmakers
2021-07-26LibDesktop: Add an optional "Description" field to .af filesAndreas Kling
2021-07-20LibDesktop: Add a RunInTerminal boolean field to app filesLinus Groh
This is common enough to warrant its own setting by now - but it's also partially a workaround. Since app files currently only support a single executable path with no arguments, we resort to generating wrapper scripts for port launchers with arguments - and then the executable is that shell script. We also moved from manually specifying icon files to embedding them in executables. As shell scripts can't have icons embedded in them, a different solution is needed - this one solves the common case of running a CLI program in a terminal, and still allows embedding of icons in the executable itself as no shell script is needed, meaning it will be shown in the taskbar and system menu. The second use case of actually passing arguments to the executable itself (and not just "Terminal -e ...") is not covered by this and still requires an external script (meaning no icon for now), but I think that can easily be solved by adding something like an "Arguments" field to app files. :^)
2021-06-28LibDesktop: Add spawn() to AppFilesSpencer Dixon
This adds a convenience utility to AppFiles for quickly launching the apps backed by the AppFile.
2021-06-28Userland: Add new app called AssistantSpencer Dixon
'Assistant' is similar to macOS spotlight where you can quickly open a text input, start typing, and hit 'enter' to launch apps or open directories.
2021-06-24Userland: Remove dummy IPC methodsGunnar Beutner
They're not used anywhere and are unnecessary boilerplate code. So let's remove them and update IPCCompiler to allow for empty endpoint declarations.
2021-05-23Userland: Mark subclasses of IPC::{Client,Server}Connection finalAndreas Kling
2021-05-23LibIPC: Remove unnecessary IPC::ServerConnection::handshake()Andreas Kling
This is no longer used by any of our IPC pairs.
2021-05-23LaunchServer: Remove unnecessary greet() messageAndreas Kling
2021-05-03Userland: Add try_* IPC handlersGunnar Beutner
This enables calling auto-generated IPC methods in a way that doesn't crash the client if the peer disconnects.
2021-05-03Userland: Use snake case names in .ipc filesGunnar Beutner
This updates all .ipc files to have snake case names for IPC methods.
2021-05-03Userland: Make IPC results with one return value available directlyGunnar Beutner
This changes client methods so that they return the IPC response's return value directly - instead of the response struct - for IPC methods which only have a single return value.
2021-05-03Userland: Update IPC calls to use proxiesGunnar Beutner
This updates all existing code to use the auto-generated client methods instead of post_message/send_sync.
2021-05-03Userland: Change IPC funcs to use plain arguments instead of a structGunnar Beutner
Instead of having a single overloaded handle method each method gets its own unique method name now.
2021-04-29Everywhere: "file name" => "filename"Andreas Kling
2021-04-23AK: Rename adopt() to adopt_ref()Andreas Kling
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
2021-04-22Everywhere: Use linusg@serenityos.org for my copyright headersLinus Groh
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-20LibDesktop: Fail gracefully on allowlist failures instead of assertingIdan Horowitz
IPC::Connection::send_sync asserts that a response was received, so the current gracefull fail check was useless, as LibIPC would always assert before reaching it.
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-02-01LibIPC: Stop sending client ID to clientsAndreas Kling
The client ID is not useful to normal clients anymore, so stop telling everyone what their ID is.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling