summaryrefslogtreecommitdiff
path: root/Services
AgeCommit message (Collapse)Author
2021-01-12Services: Move to Userland/Services/Andreas Kling
2021-01-12AK: Simplify constructors and conversions from nullptr_tLenny Maiorani
Problem: - Many constructors are defined as `{}` rather than using the ` = default` compiler-provided constructor. - Some types provide an implicit conversion operator from `nullptr_t` instead of requiring the caller to default construct. This violates the C++ Core Guidelines suggestion to declare single-argument constructors explicit (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit). Solution: - Change default constructors to use the compiler-provided default constructor. - Remove implicit conversion operators from `nullptr_t` and change usage to enforce type consistency without conversion.
2021-01-11Everywhere: Fix incorrect uses of String::format and StringBuilder::appendfSahan Fernando
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-11Vector: Implement `find`, `find_if`, `find_first_matching` in terms of ↵Lenny Maiorani
`AK::find*` Problem: - The implementation of `find` is coupled to the implementation of `Vector`. - `Vector::find` takes the predicate by value which might be expensive. Solution: - Decouple the implementation of `find` from `Vector` by using a generic `find` algorithm. - Change the name of `find` with a predicate to `find_if` so that a binding reference can be used and the predicate can be forwarded to avoid copies. - Change all the `find(pred)` call sites to use `find_if`.
2021-01-11CrashDaemon: Use pledgeAndreas Kling
2021-01-11Kernel+Profiler: Make profiling per-process and without core dumpsAndreas Kling
This patch merges the profiling functionality in the kernel with the performance events mechanism. A profiler sample is now just another perf event, rather than a dedicated thing. Since perf events were already per-process, this now makes profiling per-process as well. Processes with perf events would already write out a perfcore.PID file to the current directory on death, but since we may want to profile a process and then let it continue running, recorded perf events can now be accessed at any time via /proc/PID/perf_events. This patch also adds information about process memory regions to the perfcore JSON format. This removes the need to supply a core dump to the Profiler app for symbolication, and so the "profiler coredump" mechanism is removed entirely. There's still a hard limit of 4MB worth of perf events per process, so this is by no means a perfect final design, but it's a nice step forward for both simplicity and stability. Fixes #4848 Fixes #4849
2021-01-10SystemServer: Allow /dev/fb0 to not exist, for text mode support.Andrew Kaster
2021-01-10AK: Make MappedFile heap-allocated and ref-countedAndreas Kling
Let's adapt this class a bit better to how it's actually being used. Instead of having valid/invalid states and storing an error in case it's invalid, a MappedFile is now always valid, and the factory function that creates it will return an OSError if mapping fails.
2021-01-10Kernel+SystemServer+CrashDaemon: Better control where we put core dumpsAndreas Kling
SystemServer now creates the /tmp/coredump and /tmp/profiler_coredumps directories at startup, ensuring that they are owned by root, and with basic 0755 permissions. The kernel will also now refuse to put core dumps in a directory that doesn't fulfill the following criteria: - Owned by 0:0 - Directory with sticky bit not set - 0755 permissions Fixes #4435 Fixes #4850
2021-01-10SystemServer+LibCore: Move /tmp/rpc/ directory creation to SystemServerAndreas Kling
This doesn't solve half of the problems with /tmp/rpc, but this way we can at least make it sticky instead of having it fully world-writable and owned by whoever was the first to bind an RPC socket.
2021-01-10Everywhere: Convert a bunch of dbgprintf() to dbgln()Andreas Kling
2021-01-09Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.Everything: The modifications in this commit were automatically made using the following command: find . -name '*.cpp' -exec sed -i -E 's/dbg\(\) << ("[^"{]*");/dbgln\(\1\);/' {} \;
2021-01-09LibC: Move bzero() and bcopy() per Dr. POSIXAndreas Kling
2021-01-09WindowServer: Don't enter invalid state when using resize corner.Mart G
2021-01-09Everywhere: Colour => ColorAndreas Kling
The system language is US English. :^)
2021-01-09WindowServer+LibGUI: Pass the set of mime types being dragged to clientAndreas Kling
Previously the client would only learn the mime type of what was being dropped on it once the drop occurred. To enable more sophisticated filtering of drag & drop, we now pass along the list of mime types being dragged to the client with each MouseMove event. (Note that MouseMove is translated to the various Drag* events in LibGUI on the client side.)
2021-01-09WindowServer+LibGUI: Notify hovered window when drag&drop is cancelledAndreas Kling
The hovered window may want to react to a drag being cancelled, even if the drag originated in some other window.
2021-01-08WindowServer: is_blocked_by_modal_window() => blocking_modal_window()Andreas Kling
The name of this function was weird, since it returned the blocking modal window itself, and not just a bool answering the question.
2021-01-08WindowServer: Start blocked modal animation when clicking on frameTom
Fixes #4835
2021-01-04SystemMenu: Tweak text "About..." => "About SerenityOS"Andreas Kling
2021-01-03ProtocolServer: Add some debug log output for failed downloadsAndreas Kling
To make it easier to work out what went wrong.
2021-01-03LaunchServer+LibDesktop: Add ability to allow URL without handlerAndreas Kling
This lets clients say they want to be able to open a specific URL without specifying which handler to use.
2021-01-03LaunchServer+LibDesktop: Add unveil-like mechanism for LaunchServerAndreas Kling
Clients of LaunchServer can now provide a list of allowed handlers, optionally with a specific set of URLs. The list can be sealed to prevent future additions to it. If LaunchServer receives a request to open something not on the allowed handlers list, it will disconnect the client immediately. The main idea here is to allow otherwise restricted programs to launch specific things, e.g "Help" to open their manual, or "Browser" to load the SerenityOS home page. :^)
2021-01-02LibGUI: Remove Widget's unused m_{foreground,background}_colorLinus Groh
...as well as the few remaining references to set_foreground_color(). These properties are not being used for rendering anymore, presumably because they completely mess up theming - assigning random white and gray backgrounds just doesn't work with dark themes. I've chosen to not replace most of the few remaining uses of this broken functionality with custom palette colors (the closest replacement is background_role) for now (except for Minesweeper where squares with mines are painted red again now), as no one has actually complained about them being broken, so it must look somewhat decent (some just look right anyway). :^) Examples of this are the taskbar buttons, which apparently had a DarkGray foreground color for minimized windows once - this has since been replaced with bold/regular font. Another one is the Profiler's ProfileTimelineWidget, which is supposed to have a white background - which it didn't have for quite some time, it's grey now (with the default theme, that is). Doesn't look bad either.
2021-01-02NotificationServer: Reposition notifications on screen resolution changeLaria Carolin Chabowski
Previously notifications were (partially) drawn outside the screen rect if they were created before changing the screen resolution to smaller dimensions. This prevented the user from dismissing the notification as the close button was no longer clickable.
2021-01-01ProtocolServer: Use an empty Optional<IPC::File> to pass along "no fd"AnotherTest
Passing `-1` wouldn't work, as these are passed to `sendfd()'. Fixes #4706.
2021-01-01WindowServer: Flash modal window when clicking on window blocked by itAndreas Kling
This makes window modality a bit more discoverable by indicating to the user that the modal window must be closed before mouse interaction is possible in the clicked window.
2020-12-31LibThread: Hide Thread's constructor, as it is a Core::ObjectAndrew Kaster
Just constructing one of these guys on the stack willy nilly will leak the first reference to them. There might be other C_OBJECTs that have public constructors, seems like a good place for some static analysis checks :). Force users to call the construct() method for it.
2020-12-31Everywhere: Re-format with clang-format-11Linus Groh
Compared to version 10 this fixes a bunch of formatting issues, mostly around structs/classes with attributes like [[gnu::packed]], and incorrect insertion of spaces in parameter types ("T &"/"T &&"). I also removed a bunch of // clang-format off/on and FIXME comments that are no longer relevant - on the other hand it tried to destroy a couple of neatly formatted comments, so I had to add some as well.
2020-12-31ProtocolServer: Avoid blocking all downloads when client stops readingAnotherTest
Fixes #4668.
2020-12-31WindowServer: Send WindowDeactivated event to windows blocked by modalLinus Groh
When a new modal window is created, we still want to forward the WindowDeactivated event to its parent window, despite it being blocked by the newly created modal (which causes WindowServer's Window::event() to ignore all incoming events from WindowManager for that window). This fixes the "terminal doesn't stop blinking when blocked by modal window" bug.
2020-12-30LibGFX: Move default_xxx_font() methods from Font to FontDatabaseStephan Unverwerth
When we have an abstract font class it makes no sense to keep these methods in the Font class.
2020-12-30AK+ProtocolServer: Properly close download stream fd'sAnotherTest
This makes the issue of running out of openable pipes in the ProtocolServer process much less likely (but still possible).
2020-12-30WebContent: Pledge "recvfd" :^)Andreas Kling
This is needed so we can receive file descriptors from ProtocolServer. Fixes #4660.
2020-12-30ProtocolServer: Stream the downloaded data if possibleAnotherTest
This patchset makes ProtocolServer stream the downloads to its client (LibProtocol), and as such changes the download API; a possible download lifecycle could be as such: notation = client->server:'>', server->client:'<', pipe activity:'*' ``` > StartDownload(GET, url, headers, {}) < Response(0, fd 8) * {data, 1024b} < HeadersBecameAvailable(0, response_headers, 200) < DownloadProgress(0, 4K, 1024) * {data, 1024b} * {data, 1024b} < DownloadProgress(0, 4K, 2048) * {data, 1024b} < DownloadProgress(0, 4K, 1024) < DownloadFinished(0, true, 4K) ``` Since managing the received file descriptor is a pain, LibProtocol implements `Download::stream_into(OutputStream)`, which can be used to stream the download into any given output stream (be it a file, or memory, or writing stuff with a delay, etc.). Also, as some of the users of this API require all the downloaded data upfront, LibProtocol also implements `set_should_buffer_all_input()`, which causes the download instance to buffer all the data until the download is complete, and to call the `on_buffered_download_finish` hook.
2020-12-30WindowServer: Added IPC requests for getting and setting mouse settingsIdan Horowitz
These include the mouse acceleration factor and the scroll length step size.
2020-12-30WindowServer: Added configurable mouse acceleration and scroll lengthIdan Horowitz
The settings are also saved to the config file to survive reboots.
2020-12-30CrashDaemon: Move from Applications to ServicesAndreas Kling
2020-12-30LibGUI: Rewrite layout system in terms of min and max sizesAndreas Kling
This patch removes size policies and preferred sizes, and replaces them with min-size and max-size for each widget. Box layout now works in 3 passes: 1) Set all items (widgets/spacers) to their min-size 2) Distribute remaining space evenly, respecting max-size 3) Place widgets one after the other, adding spacing in between I've also added convenience helpers for setting a fixed size (which is the same as setting min-size and max-size to the same value.) This significantly reduces the verbosity of widget layout and makes GML a bit more pleasant to write, too. :^)
2020-12-30Taskbar: Set min/max size for taskbar buttonsAndreas Kling
This makes them shrink when the taskbar fills with too many buttons. It doesn't scale to infinity open windows, but it's better than them escaping off screen after 6 open windows. :^)
2020-12-28WindowServer: Add a GetGlobalCursorPosition IPC requestAndreas Kling
This tells you where the mouse cursor is in screen coordinates.
2020-12-28WindowServer: Remove unnecessary clang-format disabler commentAndreas Kling
2020-12-28WindowServer: Don't lookup configuration values in compose()Andreas Kling
The compose() function is supposed to be fast since it can execute 60 times per second. Let's not do obviously avoidable things like configuration value lookups in there. :^)
2020-12-28LibGUI: Make GUI::FileIconProvider::icon_for_executable() a public APIAndreas Kling
This way we can use it instead of icon_for_path() in a bunch of places and avoid loading the full FileIconProvider configuration.
2020-12-28Base: Rename maximize/minimize icons to a more generic nameIdan Horowitz
This reduces naming confusion when the icons are used for other use cases that require a triangle shape
2020-12-28WindowServer: Spruce up the move/resize geometry label a little bitAndreas Kling
Draw it in a threed style with a little shadow under it.
2020-12-28Everywhere: Move AppFile from LibGUI to LibDesktopLinus Groh
This was mentioned in #4574, and the more I think about it the more it feels just right - let's move it there! :^) Having to link LaunchServer against LibGUI explicitly should've been telling enough...
2020-12-28Services: Fix typosBrendan Coles
2020-12-27Kernel: Introduce the DevFSLiav A
The DevFS along with DevPtsFS give a complete solution for populating device nodes in /dev. The main purpose of DevFS is to eliminate the need of device nodes generation when building the system. Later on, DevFS will assist with exposing disk partition nodes.
2020-12-27AK: Use direct-list-initialization for Vector::empend() (#4564)Nathan Lanza
clang trunk with -std=c++20 doesn't seem to properly look for an aggregate initializer here when the type being constructed is a simple aggregate (e.g. `struct Thing { int a; int b; };`). This template fails to compile in a usage added 12/16/2020 in `AK/Trie.h`. Both forms of initialization are supposed to call the aggregate-initializers but direct-list-initialization delegating to aggregate initializers is a new addition in c++20 that might not be implemented yet.