Commit graph

1208 commits

Author SHA1 Message Date
Luke Wilde
a4e3fff3fb WebContent: Invalidate document style when changing the page's palette
This makes the page automatically update to reflect the system theme
when in "Color Scheme > Follow System Theme" mode without having to
manually cause a style update.
2022-07-05 18:23:22 +02:00
MacDue
3294753d6c Browser+WebContent: Fix inspecting non-visible nodes
I already fixed the crash from this in #14470, but didn't fully fix
the issue. Currently the browser just avoids sending the
inspect_dom_node() IPC call for non-visible nodes.

The main problem with this is it means the browser keeps displaying
the overlay for the previously selected node. This commit fixes
the crash in the WebContent side, so the IPC call can still be made
and the selection correctly updated.
2022-07-05 13:09:11 +02:00
Maciej
65307cf5cc NetworkServer: Enable DHCP on interfaces that are not listed in config 2022-07-04 13:20:24 +03:00
Idan Horowitz
888d8e53a3 LookupServer: Try other available DNS nameservers on network errors
We were accidentally short-circuting DNS lookup on network errors when
contacting the first DNS server, instead of trying the other available
options.
2022-07-02 23:41:06 +03:00
MacDue
5b9d7bb335 FileSystemAccessServer: Call window stealing functions sync
These functions were changed to synchronous in #13870 but
the async_ versions were still being called. This led to
frequent crashes when loading local files in Browser.
2022-06-30 11:15:24 +01:00
FrHun
19fac58e49 LibGUI: Use new layout system for basic widgets 2022-06-28 17:52:42 +01:00
FrHun
3451181fbf NotificationServer: Remove usages of deprecated implicit ui conversions 2022-06-28 17:52:42 +01:00
FrHun
8dd08d47f1 Applications: Remove usages of deprecated implicit conversions
These deprecated conversions are currently in place to make the system
compile, but they are to be removed soon. This prepares that.
2022-06-28 17:52:42 +01:00
Luke Wilde
cd9864bbf1 LibHTTP+RequestServer: Recognize more HTTP methods
Previously it would default to GET for all of these and cause the
Discord API to return Method Not Allowed errors for certain endpoints.
2022-06-27 22:53:36 +01:00
Lucas CHOLLET
662711fa26 Browser+LibWeb+WebContent: Allow Browser to load local files
To achieve this goal:
 - The Browser unveils "/tmp/portal/filesystemaccess"
 - Pass the page through LoadRequest => ResourceLoader
 - ResourceLoader requests a file to the FileSystemAccessServer via IPC
 - OutOfProcessWebView handles it and sends a file descriptor back to
 the Page.
2022-06-27 20:22:15 +01:00
Lucas CHOLLET
1ba9c821fb WindowServer: Make window stealing related functions synchronous
This allows us to make sure that those operations are performed
in the right order. Affected functions are:
 - add_window_stealing_for_client
 - set_window_parent_from_client
 - remove_window_stealing_for_client
 - remove_window_stealing
2022-06-27 20:22:15 +01:00
Lucas CHOLLET
9521952f36 FileSystemAccessServer: Manage concurrent file requests
Before this patch, when you called FileSystemAccessServer::Client::try_*
twice, the second call used the same variable to store the promise. This
"race condition" is now solved using a HashMap, to store multiple
parallel requests.
2022-06-27 20:22:15 +01:00
kleines Filmröllchen
ef1c97e3d8 AudioServer: Reduce hardware audio buffer to 512 samples 2022-06-23 23:26:33 +01:00
kleines Filmröllchen
1c23a222b2 AudioServer: Make hardware write buffer size flexible
This removes some old cruft to refactor the hardware buffer-related
datastructures into depending on a single constant, which determines the
number of samples per hardware buffer that the audio server mixes. This
is set to 1024 as before, so there are no functional changes.
2022-06-23 23:26:33 +01:00
kleines Filmröllchen
746d3c1131 AudioServer: Explicitly cast between numeric types in the mixer 2022-06-23 23:26:33 +01:00
Kenneth Myhra
1e1d59cc25 RequestServer: Do not VERIFY(request.total_size.has_value())
If the request is stopped RequestServer::did_finish_request() will crash
on the VERIFY() call since request.total_size.has_value() returns false.

Let us instead use a conditional expression to verify if it has a value
and then call async_request_finished().
2022-06-21 10:29:14 +01:00
Mike Akers
9a908748e0 WindowServer: Prevent menubar menus from appearing off screen
Adds some logic to reposition menus that would appear off the right or
bottom edge of the screen so they appear completely on screen.

Co-authored-by: Sam Atkins <atkinssj@gmail.com>
2022-06-20 16:49:31 +01:00
Karol Kosek
03cda8a013 LibWeb+LibWebView+WebContent: Get doubleclick events from LibGUI 2022-06-20 12:55:50 +01:00
networkException
ef7fbbcf70 Taskbar: Handle an override theme being active
This patch makes taskbar react to an override theme being set by not
having any theme in the menu selected.
2022-06-17 19:46:30 +01:00
networkException
976b6156d4 WindowServer: Allow temporarily overriding the system theme
This patch adds a new api to override the current system theme with an
in memory override theme.
2022-06-17 19:46:30 +01:00
networkException
695dfabc2e Taskbar: Update checked state of theme menu on global theme change
Previously we would assume that the theme would only change through the
taskbar menu. As the theme can also be changed in DisplaySettings, the
selected theme in the taskbar menu would get out of sync.

With this patch the menu will get updated every time the theme changes
and the menu is not shown.
2022-06-17 19:46:30 +01:00
MacDue
5caf307ec0 WindowServer+MouseSettings: Toggle cursor highlighting with Super+H
Rather than enabling/disabling cursor highlighting by going into mouse
settings, you can now instead toggle it any time with Super+H. Mouse
settings now is only for customising the look of the highlighting.
2022-06-10 23:02:34 +01:00
MacDue
44cd973148 WindowServer+MouseSettings: Make default cursor highlight more visible
A litte smaller, and red with a slightly higher opacity, which
is much easier to make out.
2022-06-10 23:02:34 +01:00
MacDue
d3ed490cb4 WindowServer: Fix the cursor being offset with highlighting enabled 2022-06-10 23:02:34 +01:00
FrHun
8081a8a5de LibGUI: Add layout spacer support to GML
This is a bit of a hack, but it is an easy way to finally get spacers
into GML.
This will translate well if spacers are later to become child objects of
the continer widget.
2022-06-10 21:26:06 +01:00
MacDue
c2f94b92c4 WindowServer: Fix animated cursor not starting after cursor theme switch
Simply setting m_current_cursor in current_cursor_was_reloaded() does
not setup the cursor animation, that has to be done in change_cursor().

This also fixes the cursor disappearing after switching from an animated
cursor back to a normal one (which was due to it trying to draw a cursor
frame that did not exist).
2022-06-10 20:51:55 +01:00
Lucas CHOLLET
f467ebc933 SystemServer: Detect spawning user for AcceptSocketConnections services
SystemServer now invokes services with the same uid as the process that
made the request.

This allows the superuser to have a normal GUI workflow. For example,
read and write its own files in TextEditor.
2022-06-10 14:20:07 +01:00
Lucas CHOLLET
23fa6b1f7b SystemServer: Add Service::try_create to propagate errors
This static method is used to propagate errors at the creation of the
object.
2022-06-09 22:08:04 +02:00
Lucas CHOLLET
dd3b65c762 SystemServer: Propagate more errors
New propagated errors comes from an endgrent call, and all chown+chmod
calls all over the file. For the two last functions, custom C++ wrappers
were used.
Those wrappers were discarding `ENOENT` errors and naively crashing on
other errors, this change introduced in 76e12a48 was used to prevent a
crash if a mouse wasn't detected. There are no reasons to discard and to
not propagate other errors.
2022-06-09 22:08:04 +02:00
Liav A
f62cd52d12 WindowServer: Drop support for the DisplayConnector write interface
All DisplayConnectors should support the mmap interface and it should
provide better performance now, so let's just use it and drop support
for the DisplayConnector's write interface from the WindowServer side.
2022-06-06 20:11:05 +01:00
MacDue
5fc13e1d53 WindowServer: Add IPC calls for changing the cursor highlighting 2022-06-05 22:42:35 +01:00
MacDue
29d8ec1b18 WindowServer: Implement cursor highlighting
This allows drawing a nice cursor highlight with an arbitrary color
and radius in the compositor. The highlight circle is, of course,
antialiased :^).
2022-06-05 22:42:35 +01:00
MacDue
2a49b58269 WindowServer: Factor out config sync check to sync_config_to_disk() 2022-06-05 22:42:35 +01:00
MacDue
fddff5f4f6 LibCore: Remove ConfigFile::write_color_entry()
This method is currently unused and adds an unwanted dependency on
LibGfx.

This also adds some missing `LibGfx/Color.h` includes.
2022-06-05 22:42:35 +01:00
Lorenzo Concas
a67a7229f8 WindowServer: Check that a menu is not null
If an application menu is null, WindowServer crashes
2022-06-03 12:30:32 +01:00
MacDue
5e5a055455 Services: Use Core::Process::spawn() for common process spawn pattern 2022-06-03 12:29:56 +01:00
Karol Kosek
c317275425 Taskbar: Use default buttons in ShutdownDialog 2022-06-02 22:33:00 +02:00
Olivier De Cannière
5a3321b899 Taskbar+Desktop: Add super+D keyboard shortcut
This shortcut has the same effect as pressing the "Show Desktop" button
in the taskbar. This shortcut already exists in Windows.
2022-06-01 19:31:34 +02:00
Olivier De Cannière
12682f0bcc Taskbar: Add toggle_show_desktop()
This function is added to separate the desktop toggling functionality
from the "Show Desktop" button in the taskbar and to enable calling this
behaviour via a keyboard shortcut in a later commit.
2022-06-01 19:31:34 +02:00
Olivier De Cannière
6c202ee4a9 LibGUI: Fix typo in ConnectionToWindowManagerServer 2022-06-01 19:31:34 +02:00
networkException
524f4be5af LibGUI+WindowServer: Propagate action icon changes to buttons and menus
Previously when setting an action's icon we would only change the bitmap
stored by the action. This patch adds logic to propagate that change to
toolbar buttons as well as window menus.

This fixes an issue in SoundPlayer that would cause the play button not
to reflect the play state.
2022-06-01 12:33:06 +01:00
Tim Schumacher
808855d763 DHCPClient: Don't reset the interface if its already configured
Resetting the interface just based on the fact that it already has an IP
assigned doesn't make much sense, considering that we frequently end up
here after having configured an interface via DHCP already.

Instead, just keep the part that prevents us from sending DHCP
discoveries to interfaces that shouldn't be using DHCP.

While we are at it, place some of the logging behind a debug flag, as
this function is apparently meant to be run frequently.

This partially reverts commit e14d4482a1.
2022-05-31 13:21:19 +04:30
montiagne
9e694c9d83 WindowServer: Call screen_resolution_changed after window screens clear
When the user executes chres to change to a new resolution, the
WindowManager removes for each window its intersections with the
screens (window.screens()) and recalculates its rect. Finally, a
Window::set_rect call sets the window's new rectangle. The set_rect
call also triggers a call to Compositor::invalidate_occlusions which
fills for each window the intersections with the screens again in
window.screens().
In case chres switches to an already present resolution the set_rect
call exits prematurely as it checks if the window's rect really
changed. This means that nobody calls invalidate_occlusions
resulting in a rendering issue for each window.

Moving the call to Compositor::screen_resolution_changed after the
clearing of window.screens() and recalc of the window rect for each
window resolves the rendering issue as screen_resolution_changed
calls invalidate_occlusions.
2022-05-29 00:26:20 +01:00
Rafał Babiarz
b162b7eec6 Browser+LibWeb+WebContent: Add ability to inspect session storage 2022-05-28 23:54:06 +01:00
Maciej
1ffba0b8b4 NetworkServer: Support setting default gateway
This commit adds an IPv4Gateway to Network.ini. If that option is set to
value other than 0.0.0.0, the NetworkServer adds a default route (e.g.
with address 0.0.0.0/0) with the specified destination.
2022-05-28 23:33:46 +01:00
Karol Kosek
a41dfc416f WebContent: Depend on ImageDecoder, RequestServer and WebSocket 2022-05-26 21:54:58 +01:00
Maciej
ddd4547e13 NetworkServer: Add a new NetworkServer service
This service is responsible for loading network configuration from a
/etc/Network.ini config file. It sets up static IP address + mask or
starts DHCPClient depending on configuration.
2022-05-26 21:47:27 +01:00
Maciej
e14d4482a1 DHCPClient: Don't discover interfaces other than given by default
Now, the caller needs to give interface names in command-line arguments.
The DHCPClient will perform DHCP discovery only on these adapters. The
service now immediately closes when no interfaces were given.

We don't check if interface has already IP address assigned; we just
reset it to zero so that DHCP resolution will not fail.
2022-05-26 21:47:27 +01:00
Liav A
102ac09ad7 WindowServer: Stop spurious debug spam after flushing the framebuffer
This became apparent when using the VirtIO graphics device, because the
HardwareScreenBackend object needs to allow flushing of the framebuffer
constantly, and due to incorrect if-else flow, even a non-error response
from the ioctl was leading to a debug spam.
2022-05-25 23:33:31 +01:00
MacDue
7c8541b914 Userland: Use GUI::Process::spawn_or_show_error() for spawn() from a GUI 2022-05-25 23:14:22 +01:00