Commit Graph

601 Commits

Author SHA1 Message Date
Max Wipfli
6e6ff844d3 WebServer: Defer invocation of Client::remove_from_parent()
This is necessary to avoid trying to destruct the on_ready_to_read
function from inside the function. This fixes #7810.
2021-06-11 11:37:15 +02:00
Max Wipfli
5408111aff WebServer: Use east const style in Client.{cpp,h}
This also removes two unused headers.
2021-06-11 11:37:15 +02:00
Marcus Nilsson
2f7dc29ab7 LibGUI/WindowServer: Add set_maximized IPC call
Add an IPC call to enable the client to manually maximize it's own
window.
2021-06-09 22:58:10 +02:00
Max Wipfli
4efccbd030 LookupServer: Watch /etc/hosts for changes during runtime
This adds a FileWatcher to the LookupServer which watches '/etc/hosts'
for changes during runtime and reloads its contents. If the file is
deleted, m_etc_hosts will be cleared.

Since we now need to access '/etc/hosts' later during runtime, it needs
to be unveiled with read permissions.
2021-06-09 17:43:32 +04:30
Max Wipfli
7b39db3bf4 LookupServer: Check for hostname after /etc/hosts
If the hostname is not in /etc/hosts, looking it up should return
127.0.0.1.
2021-06-09 17:43:32 +04:30
Max Wipfli
12feb79cef LookupServer: Make DNSName::operator== ignore case 2021-06-09 17:43:32 +04:30
Max Wipfli
95d4d36b5c LookupServer: Modernize load_etc_hosts()
This reworks the LookupServer::load_etc_hosts() method to use the
IPv4Address APIs instead of trying to parse an IPv4 address itself.

It also adds a few error checks for invalid entries in /etc/hosts,
trims away leading and trailing whitespace from lines and tries to use
StringView over String.
2021-06-09 17:43:32 +04:30
Ali Mohammad Pur
7ac196974d Everywhere: Replace Vector<T*> with nonnull entries with Vector<T&> 2021-06-08 19:14:24 +02:00
Andreas Kling
cb295ab644 WindowServer+Magnifier: Make Magnifier buttery smooth :^)
This patch moves the magnifier rect computation over to the server side
to ensure that the mouse cursor position and the screen image never get
out of sync.
2021-06-07 10:22:25 +02:00
Andreas Kling
4c47b3951d Clipboard: Tighten pledge promises a bit earlier :^) 2021-06-06 17:56:34 +02:00
Eugene Barnett
4ef85de9dc WindowServer: Add a GetDesktopDisplayScale IPC request
Tells you which scale factor is configured in window manager.
2021-06-06 15:56:43 +02:00
Tom
2c8309c841 WindowServer: Simplify determining transparent/opaque occlusions
By moving the logic to determine what window areas (shadow, frame,
content) into WindowFrame::opaque/transparent_render_rects we can
simplify the occlusion calculation and properly handle more
arbitrary opaque/transparent areas.

This also solves the problem where we would render the entire
window frame as transparency only because the frame had a window
shadow.
2021-06-06 09:37:27 +01:00
Ali Mohammad Pur
51c2c69357 AK+Everywhere: Disallow constructing Functions from incompatible types
Previously, AK::Function would accept _any_ callable type, and try to
call it when called, first with the given set of arguments, then with
zero arguments, and if all of those failed, it would simply not call the
function and **return a value-constructed Out type**.
This lead to many, many, many hard to debug situations when someone
forgot a `const` in their lambda argument types, and many cases of
people taking zero arguments in their lambdas to ignore them.
This commit reworks the Function interface to not include any such
surprising behaviour, if your function instance is not callable with
the declared argument set of the Function, it can simply not be
assigned to that Function instance, end of story.
2021-06-06 00:27:30 +04:30
Gunnar Beutner
d840608a51 Taskbar: Make sure LibGUI/Desktop.h is usable in ports
Now that Desktop.h includes Services/Taskbar/TaskbarWindow.h we have
to install Taskbar's header files so that Desktop.h can be used in
ports or when building software in-target.
2021-06-04 19:11:13 +02:00
Gunnar Beutner
19c4e74f70 Taskbar: Allow creating menus for sub-categories
This change allows creating sub-categories in app files, e.g. with
Category=Games/Puzzles.
2021-06-04 09:38:25 +02:00
Max Wipfli
bc8d16ad28 Everywhere: Replace ctype.h to avoid narrowing conversions
This replaces ctype.h with CharacterType.h everywhere I could find
issues with narrowing conversions. While using it will probably make
sense almost everywhere in the future, the most critical places should
have been addressed.
2021-06-03 13:31:46 +02:00
Brian Gianforcaro
d0dbb014a0 WindowServer: Switch Window to IntrusiveList from InlineLinkedList
Another small step towards unifying IntrusiveList / InlineLinkedList.
2021-06-03 13:27:40 +02:00
Matthew Jones
0ff09d4f74 WindowServer: Add sanity checks to create_window IPC 2021-06-03 08:27:57 +02:00
Matthew Jones
b0682a73ee WindowServer: Position popup menu with offset of 1 pixel 2021-06-03 08:21:01 +02:00
Matthew Jones
ea4116f5bd LibGUI+LibGfx+WindowServer: Sanity check window size dimensions
Previous to this commit, if a `Window` wanted to set its width or height
greater than `INT16_MAX` (32768), both the application owning the Window
and the WindowServer would crash.

The root of this issue is that `size_would_overflow` check in `Bitmap`
has checks for `INT16_MAX`, and `Window.cpp:786` that is called by
`Gfx::Bitmap::create_with_anonymous_buffer` would get null back, then
causing a chain of events resulting in crashes.

Crashes can still occur but with `VERIFY` and `did_misbehave` the
causes of the crash can be more readily identified.
2021-06-02 23:59:57 +01:00
Gunnar Beutner
b5778675a5 WindowServer: Use RefPtr instead of raw pointers
Now that we have static initializers and destructors we can use
RefPtr here.
2021-06-02 18:08:11 +02:00
Matthew Jones
00c8b74ab4 InspectorServer: Add is_inspectable IPC 2021-06-02 11:19:04 +02:00
Gunnar Beutner
cdb070cdfb WindowServer: Don't crash when we can't allocate a bitmap
When the client specifies an absurdly large window size
render_to_cache() fails to allocate a bitmap and crashes.

Refs #7688.
2021-06-02 10:17:42 +01:00
Matthew Jones
33eb9a6ddc WindowServer: Use user-defined background color, if defined
Use the configured desktop background color, if defined, otherwise
default to the current theme's background color. If a user chooses
a background color via "desktop settings", then this new color
will always be used.

Switching themes will delete the user-defined background color, so
the background color resets to the theme's defined color.
2021-06-02 09:40:53 +02:00
Gunnar Beutner
5b86a8bad1 InspectorServer: Remove extraneous curly brackets 2021-06-01 23:36:44 +04:30
Max Wipfli
a603e69599 AK+Everywhere: Replace usages of URLParser::urlencode() and urldecode()
This replaces all occurrences of those functions with the newly
implemented functions URL::percent_encode() and URL::percent_decode().
The old functions will be removed in a further commit.
2021-06-01 09:28:05 +02:00
Edwin Hoksberg
e68780e1ad WebServer: Put dbgln's behind WEBSERVER_DEBUG
These dbgln's caused excessive load in the WebServer process,
accounting for ~67% of the processing time when serving a webpage
with a bunch of resources like serenityos.org/happy/2nd/.
2021-05-30 17:41:56 +01:00
Linus Groh
75ea1bd346 WebServer: Exit when the given port is invalid
Similar to an invalid listen address, we should not fallback to the
default port (8000) but instead exit with an error.
2021-05-30 14:11:53 +01:00
Linus Groh
7fa3033ca8 WebServer: Replace printf()/fprintf(stderr) with outln()/warnln() 2021-05-30 14:07:58 +01:00
Edwin Hoksberg
2deffeb74d WebServer: Add optional listen address argument
With this we can make the Webserver listen on
another address than the default of "0.0.0.0".
2021-05-30 13:03:59 +01:00
Andreas Kling
4190fd2199 LibWeb: Rename Web::Frame to Web::BrowsingContext
Our "frame" concept very closely matches what the web specs call a
"browsing context", so let's rename it to that. :^)

The "main frame" becomes the "top-level browsing context",
and "sub-frames" are now "nested browsing contexts".
2021-05-30 12:39:53 +02:00
Andrew Kaster
1a0eed705c DHCPClient: Avoid unaligned access when parsing options
Just casting a void* to a T* and dereferencing it is not particularly
safe. Also UBSAN was complaining. Use memcpy into a default constructed
T instead and require that the T be trivially copyable.
2021-05-27 15:18:03 +02:00
Gunnar Beutner
e17a5dc2b9 DHCPClient: Rename struct members for InterfaceDescriptor
Public members shouldn't have an "m_" prefix.
2021-05-27 15:53:49 +04:30
Gunnar Beutner
106def9de7 DHCPClient: Remove unused #includes 2021-05-27 15:53:49 +04:30
Gunnar Beutner
c73116b2e2 DHCPClient: Resend DHCP packets when we don't receive an answer
Previously we'd only only send one DHCP request for network interfaces
which were up when DHCPClient started. If that packet was lost we'd
never send another request for those interfaces.

Also, if an interface were to appear after DHCPClient started (not
that that is possible at the moment) we wouldn't send requests for
that interface either.
2021-05-27 15:53:49 +04:30
Jean-Baptiste Boric
e4394b1605 LibGfx: Use anonymous buffer instead of raw anon_fd for Gfx::Bitmap
Instead of using a low-level, proprietary API inside LibGfx, let's use
Core::AnonymousBuffer which already abstracts anon_fd and offers a
higher-level API too.
2021-05-24 13:31:01 +02:00
Jean-Baptiste Boric
8e6241b78b LookupServer: Fix missing POSIX includes 2021-05-23 18:10:29 +02:00
Jean-Baptiste Boric
5ced9a3dfb ImageDecoder: Fix narrowing cast of loop count 2021-05-23 18:10:29 +02:00
Andreas Kling
67b47d62f3 WebContent: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling
6b2f24018d RequestServer: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling
bf33b5df6e WebSocket: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling
03df8882df InspectorServer: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling
78b57fcea3 NotificationServer: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling
5424372d50 AudioServer: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling
e7fc46879e LaunchServer: Remove unnecessary greet() message 2021-05-23 09:53:55 +02:00
Andreas Kling
de07dab184 ImageDecoder: Remove unnecessary greet() message
This didn't do anything except induce an IPC stall during startup.
2021-05-23 09:53:55 +02:00
Andreas Kling
c9e849a968 LibCore: Make all processes opt out of InspectorServer by default
This functionality, while neat, isn't really something you need enabled
all the time. Let's make it opt-in instead. Pass MakeInspectable::Yes
to the Core::EventLoop constructor if you want your program to become
inspectable.
2021-05-22 23:30:40 +02:00
Andreas Kling
b5d73c834f Userland: Rename LibThread => LibThreading
Also rename the "LibThread" namespace to "Threading"
2021-05-22 18:54:22 +02:00
Andreas Kling
9c2786b872 Userland: Remove SymbolServer and the "symbol" user+group 2021-05-22 18:54:22 +02:00
Andreas Kling
636c43db6c WindowServer: Notify window-less clients about theme/font changes 2021-05-22 10:21:52 +02:00
Andreas Kling
59fd1f40ce WindowServer: Store system font queries in WindowServer.ini :^)
Changes to the system font settings are now persisted in /etc.
Note that you still need to restart the system for changes to fully
apply in all programs.
2021-05-21 20:15:51 +02:00
Andreas Kling
c778130d63 WindowServer+LibGUI: Add an IPC API to change the current system fonts
This patch adds a set_system_fonts() IPC API that takes the two main
font queries as parameters. We'll probably expand this with additional
queries when we figure out what they should be.

Note that changing the system fonts on a live system mostly takes
effect in newly launched programs. This is because GUI::Widget will
currently cache a pointer to the Gfx::FontDatabase::default_font()
when first constructed. This is something we'll have to fix somehow.

Also note that the settings are not yet persisted.
2021-05-21 20:15:51 +02:00
Andreas Kling
bb23e61fbf LibGfx+WindowServer: Have WindowServer broadcast system font settings
Instead of everybody getting their system fonts from Gfx::FontDatabase
(where it's all hardcoded), they now get it from WindowServer.

These are then plumbed into the usual Gfx::FontDatabase places so that
the old default_font() and default_fixed_width_font() APIs keep working.
2021-05-21 20:15:51 +02:00
Linus Groh
d60ebbbba6 Revert "Userland: static vs non-static constexpr variables"
This reverts commit 800ea8ea96.

Booting the system no longer worked after these changes.
2021-05-21 10:30:52 +01:00
Lenny Maiorani
800ea8ea96 Userland: static vs non-static constexpr variables
Problem:
- `static` variables consume memory and sometimes are less
  optimizable.
- `static const` variables can be `constexpr`, usually.
- `static` function-local variables require an initialization check
  every time the function is run.

Solution:
- If a global `static` variable is only used in a single function then
  move it into the function and make it non-`static` and `constexpr`.
- Make all global `static` variables `constexpr` instead of `const`.
- Change function-local `static const[expr]` variables to be just
  `constexpr`.
2021-05-21 10:07:06 +01:00
Andreas Kling
e95e64972c Clipboard+LibGUI: Remove unnecessary client/server greeting message 2021-05-20 22:12:42 +02:00
Andreas Kling
ec8363aec3 WindowServer+LibGUI: Make client/server greeting faster
Instead of doing a full IPC round-trip for the client and server to
greet each other upon connecting, the server now automatically sends
a "fast_greet" message when a client connects.

The client simply waits for that message to arrive before proceeding.
(Waiting is necessary since LibGUI relies on the palette information
included in the greeting.)
2021-05-20 22:12:42 +02:00
Andreas Kling
6a012ad79f LibGfx: Remove Gfx::FontDatabase::default_bold_font()
Instead use default_font().bold_variant() in cases where we want a bold
variant of the default font. :^)
2021-05-20 20:55:29 +02:00
Andreas Kling
93ef661914 WindowServer+DisplaySettings: Remove the weird "simple" wallpaper mode
Painting the wallpaper at 100% scale in the top left corner is a weird
mode and I don't think we need it. :^)
2021-05-20 17:52:38 +02:00
Linus Groh
36e7733dec CrashDaemon: Fix CrashReporter argument order
For compressed coredumps, CrashReporter's argv were in this order:

    CrashReporter path --unlink

Core::ArgsParser doesn't like that at all and would immediately exit
from main(), causing the crash reporter to never display.
2021-05-18 23:42:02 +01:00
DexesTTP
9f42ccd639 WebServer: Fix jailbreaking of server via .. relative paths
The recent patch to LexicalPath allowed relative paths like ../ to work
in requests to WebServer. This wasn't too dangerous because of unveil,
but let's still fix this :^)
2021-05-18 09:32:10 +02:00
Andreas Kling
5f342c41b9 WindowServer: Don't attempt to make WindowServer inspectable 2021-05-17 23:32:37 +02:00
Andreas Kling
5d0c3bd564 WindowServer: Add Menu::is_open() to improve readability
"menu.is_open()" instead of "MenuManager::the().is_open(menu)"
2021-05-17 23:28:15 +02:00
Gunnar Beutner
8c96640157 WebServer: Set no-cache header for responses
This sets the Pragma: no-cache header. Using Cache-Control would be
preferable but that's not part of the HTTP/1.0 standard.
2021-05-17 21:28:34 +02:00
Gunnar Beutner
7aca2d181a WebServer: Don't read until EOF
There's no guarantee that the client has closed the socket for
writing. Instead we should just read until the first empty line.

Fixes #7064.
2021-05-17 21:28:34 +02:00
Andreas Kling
7e799529b9 WindowServer+LibGUI: Make menubar allocation asynchronous
Same as with menu allocation, move menubar ID management to the client
side, removing more IPC stalls during application startup.
2021-05-17 13:33:41 +02:00
Andreas Kling
baab0a5bef WindowServer+LibGUI: Make menu allocation asynchronous
This was only synchronous since WindowServer managed the ID allocation.
Doing this on the client side instead allows us to make create_menu()
an asynchronous IPC call, removing a bunch of IPC stalls during
application startup.
2021-05-17 13:33:41 +02:00
Andreas Kling
2083d1a3d6 WindowServer: Ignore window base size in aspect ratio enforcement
This makes windows with an aspect ratio behave more naturally if they
also have a base size (e.g from the main widget being a GUI::Frame.)
2021-05-17 12:01:17 +02:00
Andreas Kling
00fa5dc53e Taskbar: Make shutdown dialog non-resizable and tweak button spacing 2021-05-16 21:23:31 +02:00
Andreas Kling
f34a3b9521 Taskbar: Give the shutdown dialog a UI facelift :^) 2021-05-16 20:57:45 +02:00
Liav A
20743e8aed Kernel/Graphics + SystemServer: Support text mode properly
As we removed the support of VBE modesetting that was done by GRUB early
on boot, we need to determine if we can modeset the resolution with our
drivers, and if not, we should enable text mode and ensure that
SystemServer knows about it too.

Also, SystemServer should first check if there's a framebuffer device
node, which is an indication that text mode was not even if it was
requested. Then, if it doesn't find it, it should check what boot_mode
argument the user specified (in case it's self-test). This way if we
try to use bochs-display device (which is not VGA compatible) and
request a text mode, it will not honor the request and will continue
with graphical mode.

Also try to print critical messages with mininum memory allocations
possible.

In LibVT, We make the implementation flexible for kernel-specific
methods that are implemented in ConsoleImpl class.
2021-05-16 19:58:33 +02:00
Gunnar Beutner
53d0150827 AK+Userland: Remove nullability feature for the ByteBuffer type
Nobody seems to use this particular feature, in fact there were some
bugs which were uncovered by removing operator bool.
2021-05-16 17:49:42 +02:00
Gunnar Beutner
f0fa51773a AK+Userland: Fix some compiler warnings and make variables const-ref
This fixes a few compiler warnings and makes some variables const-ref
in preparation for the next commit which changes how ByteBuffer works.
2021-05-16 17:49:42 +02:00
Jean-Baptiste Boric
e16894af5a LibC: Do not include errno.h inside unistd.h
POSIX does not mandate this, therefore let's not do it.
2021-05-14 22:24:02 +02:00
Jean-Baptiste Boric
090936e424 Userland: Replace arc4random() with get_random<u32>() 2021-05-14 22:24:02 +02:00
Jean-Baptiste Boric
5a0468c21f Userland: Migrate from arc4random_uniform() to get_random_uniform() 2021-05-14 22:24:02 +02:00
Andreas Kling
339b368308 InspectorServer: Add another missing <AK/JsonObject.h> include 2021-05-13 23:56:25 +02:00
Andreas Kling
9b765b42e4 InspectorServer: Add missing <AK/JsonObject.h> include 2021-05-13 23:44:48 +02:00
Andreas Kling
31d4bcf5bf Userland: Tighten a *lot* of pledges! :^)
Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
2021-05-13 23:28:40 +02:00
Andreas Kling
04d78adaf7 Userland: Remove no-longer-needed unveil()'s of /tmp/rpc 2021-05-13 23:28:40 +02:00
Andreas Kling
a03879f8dd SystemServer: Stop creating the /tmp/rpc directory
This is no longer needed.
2021-05-13 23:28:40 +02:00
Andreas Kling
3d3a5b431f Services: Add InspectorServer to reverse the direction of Inspector
This service daemon will act as an intermediary between the Inspector
program and the inspectable programs it wants to inspect.

Programs can make themselves available for inspection by connecting
to /tmp/portal/inspectables using the Core::EventLoop RPC protocol.
2021-05-13 23:28:40 +02:00
Andreas Kling
c784413cd9 SymbolServer: Remove two unnecessary #include statements 2021-05-13 23:28:40 +02:00
Linus Groh
9a27ef6523 WindowServer: Re-render window frame when setting unresponsive status
Otherwise "(not responding)" would not appear in the window title until
the window is moved/resized.
2021-05-12 22:51:56 +01:00
sin-ack
2159f90e00 Userland+LibCore: Update FileWatcher + its users for InodeWatcher 2.0
With the new InodeWatcher API, the old style of creating a watcher per
inode will no longer work.  Therefore the FileWatcher API has been
updated to support multiple watches, and its users have also been
refactored to the new style.  At the moment, all operations done on a
(Blocking)FileWatcher return Result objects, however, this may be
changed in the future if it becomes too obnoxious. :^)

Co-authored-by: Gunnar Beutner <gunnar@beutner.name>
2021-05-12 22:38:20 +02:00
Ali Mohammad Pur
a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
Valtteri Koskivuori
4864ef9440 WindowServer: Add Optional<Gfx::IntRect> argument to get_screen_bitmap()
This way, we can optionally specify a region of the display to capture.
Defaults to entire screen if no rectangle is given.
2021-05-11 10:18:29 +01:00
Gunnar Beutner
212cd9d8ac LookupServer: Do cache eviction when mDNS cache flush bit is set 2021-05-10 17:26:17 +02:00
Gunnar Beutner
edb21e02ea LookupServer: Track the receive timestamp for DNS answers 2021-05-10 17:26:17 +02:00
Gunnar Beutner
3304d675e1 LookupServer: Correct some flags for DNS packets
This corrects some of the flags in the DNS packets to match
what I saw on my local network.
2021-05-10 17:26:17 +02:00
Gunnar Beutner
a569381037 LookupServer: Handle DNS record types TXT, AAAA, SRV and CNAME
They're not being used elsewhere at the moment but this gets
rid of the debug message for incoming mDNS response packets.
2021-05-10 17:26:17 +02:00
Gunnar Beutner
7b3bed7910 LookupServer: Turn #defines into enum classes and add formatter 2021-05-10 17:26:17 +02:00
Gunnar Beutner
6e70888315 LookupServer: Split mDNS flags into separate field 2021-05-10 17:26:17 +02:00
Andreas Kling
29fe4a5de5 RequestServer: Make the certificate_requested IPC call asynchronous
It was already being used asynchronously inside RequestServer anyway.
2021-05-10 12:38:23 +02:00
Andreas Kling
455afd32f2 Clipboard+LibGUI: Make set_clipboard_data asynchronous
There's no need for GUI applications to block after the clipping is
already in flight.
2021-05-10 12:30:41 +02:00
Andreas Kling
bfeacb5728 WindowServer+Taskbar: Make all the IPC used by Taskbar asynchronous 2021-05-10 12:26:35 +02:00
Andreas Kling
11dc790d69 WindowServer: Make set_background_color and set_wallpaper_mode async
Both of these were already used asynchonrously by GUI::Desktop.
2021-05-10 12:21:42 +02:00
Andreas Kling
b8411d1ef6 WindowServer: Make dismiss_menu() an asynchronous IPC call
This was already being used asynchronously by LibGUI, which meant that
WindowServer would generate a response, and the client would ignore it.
2021-05-10 12:20:28 +02:00
Andreas Kling
f556bd1045 WindowServer: Make popup_menu() an asynchronous IPC call
This was already being used asynchronously by LibGUI, which meant that
WindowServer would generate a response, and the client would ignore it.

This patch simplifies the WindowServer side so it no longer generates
the unnecessary response.
2021-05-10 12:20:28 +02:00
Andreas Kling
8684fca9df WindowServer+LibGUI: Make "move window to front" asynchronous 2021-05-10 12:20:28 +02:00
Andreas Kling
fb93535419 WindowServer+LibGUI: Make menu and menubar teardown asynchronous
Clients don't need to wait for WindowServer to tear down a menu or
menubar before continuing.
2021-05-10 11:53:26 +02:00
Andreas Kling
634e652b6c WindowServer: Add "Move" action to window menus
This can be used to initiate a window move. It's only enabled while
the window is normal (not minimized, maximized or fullscreen.)
2021-05-10 09:06:37 +02:00
Andreas Kling
2bc3cc4cab WindowServer: Add separator above "Close" in window menus 2021-05-10 08:43:44 +02:00
Andreas Kling
353a831c8c WindowServer: Compute final window title before passing to WM clients
We were not substituting the window modified marker ("[*]") in the
title strings we were sending to WM clients. This caused the Taskbar
to show pre-substitution window titles for the Text Editor application.

This patch moves the window title resolution to Window::compute_title()
which is then used throughout.
2021-05-10 00:02:05 +02:00
Andreas Kling
1f24ab91f2 WindowServer: Notify WM clients when a window's modified state changes
Also update the window switcher for good measure. The window switcher
doesn't visualize this information at the moment, but we generally do
this when any window state changes.
2021-05-09 23:59:35 +02:00
Andreas Kling
a47d576e94 WindowServer: Tweak width/height of automatic window tile rects
The resulting window rects when snapping to some edges/corners were
a bit lopsided. This patch makes them symmetrical. :^)
2021-05-09 21:48:38 +02:00
Andreas Kling
5497b7a718 WindowServer: Tweak spacing above maximized windows
Nudge maximized windows 1px upwards. This prevents the outer window
border from showing up above the title bar.
2021-05-09 21:48:38 +02:00
Andreas Kling
5aa9f128fc WindowServer: Simplify the way we update items in the window menu
Instead of trying to update only the little bit that changes, let's
have a function that updates all the window menu items in one go.

It's just a couple of string and boolean assignment, and the real
cost is performing the subsequent menu redraw, which remains the same.
2021-05-09 21:48:38 +02:00
Ömer Kurttekin
d922c2f5f3
Userland: Preserve keyboard mapping preference on reboot (#6955) 2021-05-09 15:56:03 +02:00
Andreas Kling
c53e937014 WindowServer: Constrain popup menu Y position within screen rect
This fixes an issue where large popup menus would open upwards despite
there not being enough space for that.
2021-05-09 15:47:21 +02:00
Andreas Kling
4c6e3d0c59 WindowServer: Fix a handful of clang-tidy warnings in the menu code
Some avoidable signed/unsigned mismatch, String move construction,
and functions that can be static constexpr.
2021-05-09 15:47:21 +02:00
Eric Butler
5d14636b95 WindowServer: Open window menu on Alt+Space
Adds a keyboard shortcut Alt+Space that opens the window menu.
2021-05-09 15:38:32 +02:00
Eric Butler
967cd6afd2 WindowServer: Select last menu item when up key pressed if no selection
When a menu is first opened and has no selected item, pressing the "up"
key now selects the last menu item instead of the first.
2021-05-09 15:38:32 +02:00
Andreas Kling
5007d7bb38 WindowServer: Don't ignore MouseMove events for pressed window buttons
Without this change, window buttons would get stuck in the "pressed"
state as long as the left mouse button was pressed, even if you moved
the mouse cursor out of the button rect.
2021-05-09 10:34:40 +02:00
Andreas Kling
9d8aa2a57a Taskbar+LibGUI+WindowServer: Shrink taskbar by one pixel
Make the taskbar 27 pixels tall instead of 28. This makes the button
icons and applets vertically centered.

On a related note, this required touching *way* too many places..
2021-05-09 00:11:37 +02:00
Itamar
8a01167c7d AK: Add missing GenericTraits<NonnullRefPtr>
This enables us to use keys of type NonnullRefPtr in HashMaps and
HashTables.

This commit also includes fixes in various places that used
HashMap<T, NonnullRefPtr<U>>::get() and expected to get an
Optional<NonnullRefPtr<U>> and now get an Optional<U*>.
2021-05-08 18:10:56 +02:00
Andreas Kling
f0687dbbb7 Services: Convert StringBuilder::appendf() => AK::Format 2021-05-07 21:12:09 +02:00
Andreas Kling
6024617df3 LookupServer: Remove some unnecessary "rc" temporaries 2021-05-06 13:37:46 +02:00
Andreas Kling
f0629e29c9 LookupServer: Check the return value after calling unveil() 2021-05-06 13:34:36 +02:00
Andreas Kling
f3091d89aa WindowServer: Don't let clients start resize of non-resizable windows
This came up in #6886. If resizing has been disabled for a window,
we shouldn't let clients bypass this via start_window_resize().
2021-05-06 12:09:03 +02:00
Gunnar Beutner
6e101adc28 DHCPClient: Handle invalid DHCP responses more gracefully 2021-05-06 08:49:35 +02:00
Sergey Bugaev
bb06e720de LookupServer: Implement basic mDNS support :^)
The implementation is extremely basic, and is far from fully conforming
to the spec. Among other things, it does not really work in case there
are multiple network adapters.

Nevertheless, it works quite well for the simple case! You can now do
this on your host machine:

$ ping courage.local

and same on your Serenity box:

$ ping host-machine-name.local
2021-05-05 21:16:17 +02:00
Sergey Bugaev
fd76e07399 LookupServer: Implement DNSName::operator==() 2021-05-05 21:16:17 +02:00
Gunnar Beutner
a3baf06549 WindowServer: Ignore mouse clicks we're not handling
This ignores unhandled mouse clicks for the window buttons. Right now
right-clicking on the window buttons animates them as if some action
were to occur when the mouse button is released.
2021-05-04 08:40:00 +02:00
Andreas Kling
1ee31981da WindowServer: Close any open menus when starting window move/resize 2021-05-03 23:13:02 +02:00
Andreas Kling
1aa56f0129 WindowServer+LibGUI: Make much of window construction asynchronous
Most of the IPC that happens between clients and WindowServer when
creating and configuring windows can be asynchronous. This further
reduces the amount of ping-ponging played during application startup.
2021-05-03 21:56:19 +02:00
Andreas Kling
a8a899adbf WindowServer+LibGUI: Make much of menu construction asynchronous
Creating a menu/menubar needs to be synchronous because we need the
ID from the response, but adding stuff *to* menus (and adding menus
to menubars, and menubars to windows) can all be asynchronous.

This dramatically reduces the amount of IPC ping-pong played by
each GUI application during startup.

I measured how long it takes TextEditor to enter the main event loop
and it's over 10% faster here. (Down from ~86ms to ~74ms)
2021-05-03 21:56:13 +02:00
Gunnar Beutner
9e22e9ce88 Userland: Use snake case names in .ipc files
This updates all .ipc files to have snake case names for IPC methods.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
eb21aa65d1 Userland: Make IPC results with one return value available directly
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-03 21:14:40 +02:00
Gunnar Beutner
5bb79ea0a7 Userland: Update IPC calls to use proxies
This updates all existing code to use the auto-generated client
methods instead of post_message/send_sync.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
78803ce384 Userland: Split IPC endpoints into proxies and stubs
This enables support for automatically generating client methods.
With this added the user gets code completion support for all
IPC methods which are available on a connection object.
2021-05-03 21:14:06 +02:00
Gunnar Beutner
065040872f Userland: Change IPC funcs to use plain arguments instead of a struct
Instead of having a single overloaded handle method each method gets
its own unique method name now.
2021-05-03 21:14:06 +02:00
Gunnar Beutner
b613817bca Userland: Fix 64-bit portability issues 2021-05-03 08:42:39 +02:00
Matthew Olsson
88cfaf7bf0 LibGfx: Unify Rect, Point, and Size
This commit unifies methods and method/param names between the above
classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where
appropriate. It also renamed the various move_by methods to
translate_by, as that more closely matches the transformation
terminology.
2021-05-02 22:48:06 +02:00
Valtteri Koskivuori
5b6f36dfea LaunchServer: Only consider path in OpenURL
This resolves the crash in #6812 where the browser was trying to open a
file in the Download directory, but the check against allowed paths was
also trying to match the URL fragment.

Resolves #6812
2021-05-02 19:47:28 +02:00
Andreas Kling
f052a66c5d WindowServer+Base: Show alternate close button for "modified" windows
Windows that are marked as modified will now have another (themable)
close button. This gives an additional visual clue that some action
will be required by the user before the window gets closed.

The default window-close-modified icon is an "X" with "..." underneath,
building on the established use of "..." in menus to signify that
additional user input will be required before an action is completed.
2021-05-02 14:17:49 +02:00
Andreas Kling
819325892a WindowServer: Minor tweaks to Window.h 2021-05-02 13:35:46 +02:00
Andreas Kling
cc6db526a6 WindowServer+LibGUI+Taskbar: Store window progress as Optional<int>
We were previously using the magical constant -1 to signify that a
window had no progress state. Be more explicit an use an Optional. :^)
2021-05-02 10:43:39 +02:00
Andreas Kling
68a542623f LaunchServer: Actually seal the allow-list on SealAllowList
Fixes #6804.
2021-05-02 08:17:31 +02:00
Gunnar Beutner
889359b6f9 Userland: Make IPC handlers return void if they don't have any outputs 2021-05-02 08:11:38 +02:00
Gunnar Beutner
7cf2839a26 Userland: Get rid of the OwnPtr<...> boilerplate code for IPC handlers 2021-05-02 08:11:38 +02:00
Gunnar Beutner
6cf59b6ae9 Everywhere: Turn #if *_DEBUG into dbgln_if/if constexpr 2021-05-01 21:25:06 +02:00
Valtteri Koskivuori
370231c05c Kernel: Expose minor device numbers for keyboard and mouse
A fix for two FIXMEs, and paving the way for multi-keyboard/mouse
support, I guess.
2021-05-01 20:07:11 +02:00
Andreas Kling
20dd5735ce WindowServer+LibGfx: Automatic "modified" markers in window titles
You can now add the string "[*]" to a window title and it will be
replaced with " (*)" if the window is modified, and with "" otherwise.
2021-05-01 19:42:29 +02:00
Andreas Kling
492464f4c1 WindowServer: Add Window "modified" state
This will be used to track which windows contain some kind of unsaved
data that the user may want some help remembering to save. :^)
2021-05-01 19:42:29 +02:00
Andreas Kling
3d4afe7614 Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which
of these words to use. Let's just choose one and use it everywhere. :^)
2021-04-29 22:23:52 +02:00
Andreas Kling
7ae7170d61 Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
Andreas Kling
def1f1444a WindowServer: Move configuration file to /etc/WindowServer.ini
This was in the /etc/WindowServer/ directory which had nothing else in
it, so let's just get rid of the directory and move this up one step.
2021-04-29 22:16:18 +02:00
Tom
b88b19272e WindowServer: Fix alpha hit-test accessing out-of-bounds pixels
It's possible that the backing store hasn't been updated yet, so
when performing an alpha hit-test make sure the bitmap actually
contains it.

Fixes #6731
2021-04-29 21:51:41 +02:00
Linus Groh
649d2faeab Everywhere: Use "the SerenityOS developers." in copyright headers
We had some inconsistencies before:

- Sometimes "The", sometimes "the"
- Sometimes trailing ".", sometimes no trailing "."

I picked the most common one (lowecase "the", trailing ".") and applied
it to all copyright headers.

By using the exact same string everywhere we can ensure nothing gets
missed during a global search (and replace), and that these
inconsistencies are not spread any further (as copyright headers are
commonly copied to new files).
2021-04-29 00:59:26 +02:00
Tom
31c3382577 WindowServer: Use window menu actions when clicking frame buttons
This keeps the minimize/maximize/restore/close implementation
consistent with the window menu actions.
2021-04-28 09:40:34 +02:00
Tom
7345b502ab WindowServer: Don't restore active window if it is minimized
When closing a menu, don't restore the active input to a window that
is now minimized or invisible.

Fixes #6690
2021-04-28 09:40:34 +02:00
Jelle Raaijmakers
2e1320f264 WindowServer: Reevaluate hovered window on window rect change
When a new Window instance is added to the WindowManager, it does not
yet have an updated value for `m_frame->rect()` and we're not checking
if there is a new candidate for the hovered window, which we need to do
since the mouse cursor might hover above the newly opened window.

This fixes both issues: as soon as a Window frame's rect is changed,
ask the WindowManager to reevaluate its hovered window. This takes care
of newly opened windows _and_ windows that are programmatically changed
in size.

This works because when a Window becomes hovered, the WindowManager
sends out an enter event. This event in turn triggers the Window to
evaluate the cursor type under the mouse position and to update it when
necessary.

Fixes #4809.
2021-04-27 08:58:13 +02:00
DexesTTP
71d27abb97 Services: Rename ProtocolServer to RequestServer
The current ProtocolServer was really only used for requests, and with
the recent introduction of the WebSocket service, long-lasting
connections with another server are not part of it. To better reflect
this, this commit renames it to RequestServer.

This commit also changes the existing 'protocol' portal to 'request',
the existing 'protocol' user and group to 'request', and most mentions
of the 'download' aspect of the request to 'request' when relevant, to
make everything consistent across the system.

Note that LibProtocol still exists as-is, but the more generic Client
class and the more specific Download class have both been renamed to a
more accurate RequestClient and Request to match the new names.

This commit only change names, not behaviors.
2021-04-25 19:04:34 +02:00
DexesTTP
22413ef729 LibWeb: Add WebSocket bindings
The WebSocket bindings match the original specification from the
WHATWG living standard, but do not match the later update of the
standard that involves FETCH. The FETCH update will be handled later
since the changes would also affect XMLHttpRequest.
2021-04-25 19:04:34 +02:00
DexesTTP
62ed26164b Services: Add a WebSocket service
The WebSocket service isolates communication with a WebSocket to its
own isolated process. Similar to other isolating services, it has its
own user and group.
2021-04-25 19:04:34 +02:00
Andreas Kling
6c2ec4c1a4 Userland+Base: Add "ladyball" logo for the system :^)
Thanks to Katalin Kult for the artwork!
2021-04-25 18:57:10 +02:00
sin-ack
62af6cd4f9 IPCCompiler: Remove hardcoded endpoint magic, attempt deux
This patch removes the IPC endpoint numbers that needed to be specified
in the IPC files.  Since the string hash is a (hopefully) collision free
number that depends on the name of the endpoint, we now use that
instead. :^)

Additionally, endpoint magic is now treated as a u32, because endpoint
numbers were never negative anyway.

For cases where the endpoint number does have to be hardcoded (a current
case is LookupServer because the endpoint number must be known in LibC),
the syntax has been made more explicit to avoid confusing those
unfamiliar.  To hardcode the endpoint magic, the following syntax is now
used:

endpoint EndpointName [magic=1234]
2021-04-25 14:06:56 +02:00
Andreas Kling
418bc484e4 Revert "IPCCompiler: Use string hashes for IPC endpoint magic"
This reverts commit 59218007a3.
2021-04-25 11:24:12 +02:00
sin-ack
59218007a3 IPCCompiler: Use string hashes for IPC endpoint magic
This patch removes the IPC endpoint numbers that needed to be specified
in the IPC files.  Since the string hash is a (hopefully) collision free
number that depends on the name of the endpoint, we now use that
instead. :^)
2021-04-25 09:29:49 +02:00
Albert S
89a9d8f45c LaunchServer: Fix argument order to FileManager
Correct the order we pass the arguments to the FileManager so
opening file:// URLs works.

The path is a positional argument that was passed after the flags.
We need to make sure the flags are passed before positional arguments.
2021-04-24 17:55:04 +02:00
Brendan Coles
ac98dc4f7c AudioServer: Mixer: limit max volume to 200% 2021-04-24 01:30:10 +02:00
Andreas Kling
b91c49364d AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to
create a NonnullOwnPtr from the result of a naked new.)
2021-04-23 16:46:57 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
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-22 11:22:27 +02:00
Andreas Kling
e924da6c73 TelnetServer: Convert String::format() => String::formatted() 2021-04-21 23:49:02 +02:00
Andreas Kling
d342e9608c WindowServer: Add missing <AK/Debug.h> include and use dbgln_if() 2021-04-21 23:49:01 +02:00
Andreas Kling
2e6de99f1e ImageDecoder: Add missing <AK/Debug.h> include and use dbgln_if() 2021-04-21 23:49:01 +02:00
Ali Mohammad Pur
c4f682606a LookupServer: Use dbgln_if instead of #if
Also adds a missing AK::Formatter specialisation for DNSName, required
for the debug calls to actually work (!)
2021-04-21 14:29:46 +02:00
Tobias Christiansen
a8915ecd61 FileManager+FileOperation: Report Errors when doing an file operation
Report back errors from the FileOperation to the FileManager and
display them in the MessageBox
2021-04-20 12:02:01 +02:00
Conor Byrne
68d1469aea Taskbar: Show start menu when super key is pressed
This commit re-adds the functionality of the start menu appearing when
the super key is pressed
2021-04-19 20:03:25 +02:00
Conor Byrne
88ecfa164a LibGUI+WindowServer: Add WM_SuperKeyPressed event
This commit adds an event called WM_SuperKeyPressed which is sent to all
windows via WindowManagerServerConnection.
The event is fired from WindowManager when the super key is pressed,
which is the windows key on most keyboards :)
2021-04-19 20:03:25 +02:00
Maciej Zygmanowski
136f6fb7c8 WindowServer: Use VERIFY instead of assert in scale factor check 2021-04-19 17:30:07 +02:00
Linus Groh
8d490aba76 LibJS: Implement console.assert() 2021-04-18 18:28:17 +02:00
Linus Groh
e37421bddc Browser+WebContent: Fix HTML injection in console functions output 2021-04-18 18:28:17 +02:00
Andreas Kling
12546259ff Everywhere: Rename title_bar => titlebar 2021-04-18 16:35:18 +02:00
Andreas Kling
b937ebd121 WindowServer: Make MenuItemActivated IPC message pass identifier as u32
This is consistent with the actual storage type.
2021-04-17 22:26:58 +02:00
Andreas Kling
ec6debb46f WindowServer: Don't "enter" menu item when hovering over a separator
Since menu separator items don't have an associated identifier,
make sure we don't falsely report that we've enter item 0.

This fixes an issue where hovering over a separator would behave
as if we'd hovered over the first item in the menu wrt sending
MenuItemEntered.
2021-04-17 20:49:53 +02:00
Andreas Kling
ba7e1ca2fb WindowServer+LibGUI: Notify GUI clients about menu item enter/leave
We now send out MenuItemEntered and MenuItemLeft messages to the client
when the user hovers/unhovers menu items.

On the client side, these become GUI::ActionEvent, with one of two
types: ActionEnter or ActionLeave. They are sent to the Application.

This will allow GUI applications to react to these events.
2021-04-17 20:49:53 +02:00
Georgiy Komarov
f8c2beec7c
DHCPClient: Fix undefined behaviour when calling memcpy() (#6416)
Calling memcpy with null pointers results in undefined behaviour, even
if count is zero.

This in turns is exploited by GCC. For example, the following code:
    memcpy (dst, src, n);
    if (!src)
      return;
    src[0] = 0xcafe;
will be optimized as:
    memcpy (dst, src, n);
    src[0] = 0xcafe;
IOW the test for NULL is gone.
2021-04-17 20:49:22 +02:00
sin-ack
c8ef8d2db5 Taskbar: Use WM connection for window management operations
Since WM operations are moved to a separate endpoint pair, Taskbar now
uses those to perform window management related operations.
Additionally, it now explicitly declares to WindowServer that it is a
window manager.
2021-04-17 13:06:25 +02:00
sin-ack
aa56f9a1e0 LibGUI+WindowServer: Separate window manager IPC from regular IPC
With this patch the window manager related functionality is split out
onto a new endpoint pair named WindowManagerServer/Client.  This allows
window manager functionality to be potentially privilege separated in
the future.  To this end, a new client named WMConnectionClient
is used to maintain a window manager connection.  When a process
connects to the endpoint and greets the WindowServer as a window manager
(via Window::make_window_manager(int)), they're subscribed to the events
they requested via the WM event mask.

This patch also removes the hardcoding of the Taskbar WindowType to
receive WM events automatically.  However, being a window manager still
requires having an active window, at the moment.
2021-04-17 13:06:25 +02:00
Linus Groh
ba3bc6fef2 LibGUI+WindowServer: Fix some misaligned CMakeLists.txt SOURCES entries 2021-04-16 21:30:53 +02:00
Timothy Flynn
2381b19719 Browser+LibWeb+WebContent: Parse cookies in the OOP tab
To protect the main Browser process against nefarious cookies, parse the
cookies out-of-process and then send the parsed result over IPC to the
main process. This way, if the cookie parser blows up, only that tab
will be affected.
2021-04-16 19:19:31 +02:00
Nicholas-Baron
73dd293ec4 Everywhere: Add -Wdouble-promotion warning
This warning informs of float-to-double conversions. The best solution
seems to be to do math *either* in 32-bit *or* in 64-bit, and only to
cross over when absolutely necessary.
2021-04-16 19:01:54 +02:00
Linus Groh
e632186c17 WindowServer: Recalculate window rect when toggling menubar
This is important when the window is maximized or tiled (which
recalculate_rect() will both check), as we otherwise create a gap above
the window frame (when hiding the menubar) or push the frame off the
screen (when showing the menubar).
2021-04-16 17:28:05 +02:00
Linus Groh
0aebb9ec62 WindowServer: Replace window menu action magic numbers with enum
This makes it a lot easier to find where the action handling is
happening, just 1, 2, 3, 4 isn't very discoverable. :^)
2021-04-16 17:27:54 +02:00
sin-ack
5b95850e28 SystemServer+LibCore: Allow service to request multiple sockets
SystemServer only allowed a single socket to be created for a service
before this.  Now, SystemServer will allow any amount of sockets.  The
sockets can be defined like so:

[SomeService]
Socket=/tmp/portal/socket1,/tmp/portal/socket2,/tmp/portal/socket3
SocketPermissions=660,600

The last item in SocketPermissions is applied to the remainder of the
sockets in the Socket= line, so multiple sockets can have the same
permissions without having to repeat them.

Defining multiple sockets is not allowed for socket-activated services
at the moment, and wouldn't make much sense anyway.

This patch also makes socket takeovers more robust by removing the
assumption that the socket will always be passed in fd 3.  Now, the
SOCKET_TAKEOVER environment variable carries information about which
endpoint corresponds to which socket, like so:

SOCKET_TAKEOVER=/tmp/portal/socket1:3 /tmp/portal/socket2:4

and LocalServer/LocalService will parse this automatically and select
the correct one.  The old behavior of getting the default socket is
preserved so long as the service only requests a single socket in
SystemServer.ini.
2021-04-15 21:04:49 +02:00
Andreas Kling
b75d2d36e1 WindowServer: Clean up some of the code around menu item hovering
We were writing to the currently hovered menu item index in a bunch
of places, which made it very confusing to follow how it changes.

Rename Menu::set_hovered_item() to set_hovered_index() and use it
in more places instead of manipulating m_hovered_item_index.
2021-04-15 20:50:24 +02:00
Tom
d10b95622b WindowServer: Fix window shadow rendering glitch
Some small window shadows were missing a small section of the top/bottom
and/or left/right center shadow.
2021-04-15 10:22:04 +02:00
Idan Horowitz
bc9cd55da4 Browser+LibWeb: Add support for spoofing the browser user agent
This is helpful when testing certain sites like twitter.com which
display differently based on the user agent.
2021-04-14 23:06:32 +02:00
Timothy Flynn
c00760c5f9 Browser+LibWeb+WebContent: Track the source of document.cookie requests
To implement the HttpOnly attribute, the CookieJar needs to know where a
request originated from. Namely, it needs to distinguish between HTTP /
non-HTTP (i.e. JavaScript) requests. When the HttpOnly attribute is set,
requests from JavaScript are to be blocked.
2021-04-14 16:07:46 +02:00
Andreas Kling
a2baab38fd Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"
I hereby declare these to be full nouns that we don't split,
neither by space, nor by underscore:

- Breadcrumbbar
- Coolbar
- Menubar
- Progressbar
- Scrollbar
- Statusbar
- Taskbar
- Toolbar

This patch makes everything consistent by replacing every other variant
of these with the proper one. :^)
2021-04-13 16:58:15 +02:00
Andreas Kling
bf1ef6533c FileManager+FileOperation: Show byte progress of current file
What I meant for the GUI progress bars to show:

- Bytes copied of the current file
- Files copied of the total set

What it actually showed:

- Bytes copied of the total bytes
- Files copied of the total set

This patch fixes it by showing byte progress of the current file
instead of byte progress of total bytes.
2021-04-13 10:12:50 +02:00
Andreas Kling
4205038c45 FileOperation: Add a new helper program for out-of-process file ops
This is a helper program for FileManager that performs a file operation
in a separate process and reports progress on standard out.

This initial implementation only supports the "Copy" operation and does
not do any detailed error handling.
2021-04-13 10:12:50 +02:00
Valtteri Koskivuori
d5e1250061 WindowServer: Fix notification placement
No more top bar, no more extra padding. Spacing is equal on the top and
on the left, so it looks pretty tidy.
2021-04-12 18:11:43 +02:00
Andreas Kling
767bd8cc88 WindowServer: Strip Alt-shortcut marker ('&') when measuring menu texts
We were including these markers when computing the sizes of menus,
causing them to get a little too much padding.
2021-04-12 15:24:17 +02:00
Linus Groh
da177c6517 LibJS: Make Errors fully spec compliant
The previous handling of the name and message properties specifically
was breaking websites that created their own error types and relied on
the error prototype working correctly - not assuming an JS::Error this
object, that is.

The way it works now, and it is supposed to work, is:

- Error.prototype.name and Error.prototype.message just have initial
  string values and are no longer getters/setters
- When constructing an error with a message, we create a regular
  property on the newly created object, so a lookup of the message
  property will either get it from the object directly or go though the
  prototype chain
- Internal m_name/m_message properties are no longer needed and removed

This makes printing errors slightly more complicated, as we can no
longer rely on the (safe) internal properties, and cannot trust a
property lookup either - get_without_side_effects() is used to solve
this, it's not perfect but something we can revisit later.

I did some refactoring along the way, there was some really old stuff in
there - accessing vm.call_frame().arguments[0] is not something we (have
to) do anymore :^)

Fixes #6245.
2021-04-12 09:38:57 +02:00
Timothy Flynn
1ef48d50ff LibWeb+WebContent: Hook document.cookie to the backend cookie storage 2021-04-11 18:24:34 +02:00
Andreas Kling
54cd8dfc4d LibWeb+WebContent: Support image context menus in OOPWV
You can now right-click images in web content and get a context menu.
2021-04-11 16:49:25 +02:00
Gunnar Beutner
8ca5b8c065 LibC: Move S_* defines into <fcntl.h>
According to the Single UNIX Specification, Version 2 that's where
those macros should be defined. This fixes the libiconv port.

This also fixes some (but not all) build errors for the diffutils and nano ports.
2021-04-11 09:51:20 +02:00