Commit Graph

730 Commits

Author SHA1 Message Date
Brian Gianforcaro
271d6f494f RequestServer: Use smart pointers for allocating protocols 2021-09-01 01:22:14 +02:00
Joe Bentley
9df79a77da WindowServer: Add message to notify clients of applet area resize
Applets and windows would like to be able to know when the applet
area has been resized. For example, this happens asynchronously after
an applet has been resized, so we cannot then rely on the applet area
position synchronously after resizing. This adds a new message
applet_area_rect_changed and associated Event AppletAreaRectChange,
and the appropriate virtual functions.
2021-08-31 16:49:22 +02:00
Andreas Kling
087bd7f767 Userland: Use Rect::centered_within() where useful 2021-08-31 01:35:08 +02:00
Andreas Kling
4c8fe01bff SQLServer: Don't stat()-then-mkdir() when mkdir() alone is enough
Closes a TOCTOU race that SonarCloud complained about.

SonarCloud: https://sonarcloud.io/project/issues?id=SerenityOS_serenity&issues=AXuVO_uKk92xXUF3qSVc&open=AXuVO_uKk92xXUF3qSVc
2021-08-30 18:35:36 +02:00
Mustafa Quraish
5f23958abd WindowServer: Always return properly cropped bitmap
Previously, when `screen_index` was not provided when calling
`ClientConnection::get_screen_bitmap`, the bitmap that was created
was always the size of the bounding rect of the screen. The actual
screen bitmap was being cropped, but the bitmap being returned was
of the original size with just black pixels everywhere else.
2021-08-28 08:18:41 +01:00
kleines Filmröllchen
9880a5c481 AudioServer: Expose the ability to get and set the sample rate
Two new IPC calls allow audio clients to get and set the sample rate.
The AudioServer calls into the new ioctl of the sound card.
2021-08-27 23:35:27 +04:30
Andreas Kling
317f55bb25 ConfigServer: Update the configuration cache on file changes
We were only notifying clients about the change, but didn't actually
update the internal cache in ConfigServer itself.

Thanks to "The Grey One" for pointing this out. :^)
2021-08-27 13:31:45 +02:00
Andreas Kling
83d3720842 ConfigServer: Monitor opened config files for changes
After opening a domain configuration and putting into our configuration
cache, we now monitor the underlying file for changes and send out
notifications to monitoring clients as needed.

This patch has three FIXME's:

- We create a new Core::FileWatcher for each domain.
- We don't yet detect removed keys.
- We don't know the type of key, so we assume everything is a string.

There are a number of ways we can solve those problems but let's not
hold up this patch while we wait for solutions. :^)
2021-08-26 23:41:38 +02:00
Andreas Kling
edf7843409 ConfigServer+LibConfig: Add way for clients to listen for config changes
This patch adds a Config::Listener abstract class that anyone can
inherit from and receive notifications when configuration values change.

We don't yet monitor file system changes, so these only work for changes
made by ConfigServer itself.

In order to receive these notifications, clients must monitor the domain
by calling monitor_domain(). Only pledged domains can be monitored.

Note that the client initiating the change does not get notified.
2021-08-26 23:41:38 +02:00
Andreas Kling
eeddaa988a ConfigServer+LibConfig: Add pledge_domains() API
This API lets applications specify which configuration domains they
will be accessing throughout their lifetime. It works similarly in
spirit to the kernel's pledge().

You cannot pledge_domains() more than once, and once you have used it,
it's no longer possible to access any other configuration domain.

This is obviously just a first cut of this mechanism, and we may need
to tweak it further as we go.
2021-08-26 00:54:28 +02:00
Andreas Kling
bdcd0abf9d Userland: Introduce ConfigServer and LibConfig
ConfigServer is an IPC service that provides access to application
configuration and settings. The idea is to replace all uses of
Core::ConfigFile with IPC requests to ConfigServer.

This first cut of the API is pretty similar to Core::ConfigFile.

The old:

    auto config = Core::ConfigFile::open_for_app("App");
    auto value = config->read_entry("Group", "Key");

The new:

    auto value = Config::read_string("App", "Group", "Key");

ConfigServer uses the ~/.config directory as its backing store
and all the files remain human-editable. :^)
2021-08-26 00:54:27 +02:00
Marco Cutecchia
0ae5de8c3c WebServer: Add 'Content-Type' header for error responses
Previously when the WebServer sent an error page the browser would
show the raw HTML since we forgot to send the 'Content-Type' header
2021-08-24 22:01:34 +02:00
Andreas Kling
fd922cf92f LibWeb+WebContent: Add a simple API for running arbitrary JavaScript
This patch adds OutOfProcessWebView::run_javascript(StringView).
This can be used by the OOPWV embedder to execute arbitrary JavaScript
in the top-level browsing context on the WebContent process side.
2021-08-24 16:56:42 +02:00
Maciej Zygmanowski
3597b6eb9d WindowServer+LibGfx: Move CursorParams to LibGfx
They will be used by MouseSettings in the next commit.
2021-08-23 01:41:53 +02:00
Maciej Zygmanowski
0363cd3d55 WindowServer: Add IPC calls for controlling cursor theme
This commit adds two new IPC calls for WindowServer: apply_cursor_theme
and get_cursor_theme.
2021-08-23 01:41:53 +02:00
Maciej Zygmanowski
040a723f1f WindowServer: Add support for cursor themes
Now you can specify a CursorTheme key in /etc/WindowServer.ini. The
cursors are loaded from /res/cursor-themes/<name> directory. This
directory contains a Config.ini file with format similar to previous
Cursor section, except it uses relative paths.

This commit adds also Default theme, which uses cursors being
previously in /res/cursors.

The WidgetGallery is updated to match the new cursor path format.
2021-08-23 01:41:53 +02:00
Andreas Kling
bcd2025311 Everywhere: Core dump => Coredump
We all know what a coredump is, and it feels more natural to refer to
it as a coredump (most code already does), so let's be consistent.
2021-08-23 00:02:09 +02:00
Robert Stefanic
e4f040147f SQLServer: Use m_client_id instead of client_id in callback
In the DatabaseConnection constructor, there's a deferred_invoke
callback that references the client_id. But depending on when the
callback occurs, the reference of the client_id can change. This created
a problem when connecting to SQLServer using the SQL utility because
depending on when the callback was invoked, the client_id could change.

m_client_id is set in the constructor and that reference will not change
depending on when the callback is invoked.
2021-08-22 15:32:09 +02:00
networkException
acde7d12b0 Everywhere: Rename get in ConfigFile::get_for_{lib,app,system} to open
This patch brings the ConfigFile helpers for opening lib, app and system
configs more inline with the regular ConfigFile::open functions.
2021-08-22 01:32:25 +02:00
networkException
938051feb8 Everywhere: Use Core::ConfigFile::AllowWriting::Yes to allow writing 2021-08-22 01:32:25 +02:00
Jan de Visser
d074a601df LibSQL+SQLServer: Bare bones INSERT and SELECT statements
This patch provides very basic, bare bones implementations of the
INSERT and SELECT statements. They are *very* limited:
- The only variant of the INSERT statement that currently works is
   SELECT INTO schema.table (column1, column2, ....) VALUES
      (value11, value21, ...), (value12, value22, ...), ...
   where the values are literals.
- The SELECT statement is even more limited, and is only provided to
  allow verification of the INSERT statement. The only form implemented
  is: SELECT * FROM schema.table

These statements required a bit of change in the Statement::execute
API. Originally execute only received a Database object as parameter.
This is not enough; we now pass an ExecutionContext object which
contains the Database, the current result set, and the last Tuple read
from the database. This object will undoubtedly evolve over time.

This API change dragged SQLServer::SQLStatement into the patch.

Another API addition is Expression::evaluate. This method is,
unsurprisingly, used to evaluate expressions, like the values in the
INSERT statement.

Finally, a new test file is added: TestSqlStatementExecution, which
tests the currently implemented statements. As the number and flavour of
implemented statements grows, this test file will probably have to be
restructured.
2021-08-21 22:03:30 +02:00
sin-ack
705e5a3d87 WindowServer: Only clear the hovered item if the item was enabled
Otherwise, we emit a menu_item_left to the WindowServer client even
though the mouse never left the menu item (as is the case when a
disabled menu item is clicked).
2021-08-19 00:11:42 +02:00
sin-ack
e11d177618 Userland+LibGUI: Add shorthand versions of the Margins constructor
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same
margin on all edges, for example. The constructors follow CSS' style of
specifying margins. The added constructors are:

- Margins(int all): Sets the same margin on all edges.
- Margins(int vertical, int horizontal): Sets the first argument to top
  and bottom margins, and the second argument to left and right margins.
- Margins(int top, int vertical, int bottom): Sets the first argument to
  the top margin, the second argument to the left and right margins,
  and the third argument to the bottom margin.
2021-08-18 10:30:50 +02:00
sin-ack
9c9a5c55cb Userland+LibGUI: Make Margins arguments match CSS ordering
Previously the argument order for Margins was (left, top, right,
bottom). To make it more familiar and closer to how CSS does it, the
argument order is now (top, right, bottom, left).
2021-08-18 10:30:50 +02:00
kleines Filmröllchen
d1b0143ba5 AudioServer: Persist audio settings with a config file
AudioServer loads its settings, currently volume and mute state, from a
user config file "Audio.ini". Additionally, the current settings are
stored every ten seconds, if necessary. This allows for persistent audio
settings in between boots.
2021-08-17 01:21:17 +02:00
Andreas Kling
459115a59c Taskbar: Add keyboard shortcuts to the fixed items in the start menu 2021-08-14 13:34:59 +02:00
Liav A
65730f459d SystemServer: Generalize chown_all_framebuffer_devices function
Instead of neatly searching for all framebuffer device nodes and
changing ownership of them, let's generalize this function so we can
apply the same pattern on tty nodes.
2021-08-12 21:10:55 +02:00
Jean-Baptiste Boric
2084289162 Userland: Fix PATH environment variable ordering 2021-08-12 18:56:30 +02:00
Liav A
16979bec15 SystemServer: Change group ownership on all framebuffer devices
WindowServer was not able to utilize any other framebuffer device in the
/dev directory due to wrong group ownership of other framebuffer
devices. Therefore we need to ensure that when SystemServer starts,
it checks all directory entries in /dev, searching for framebuffer
devices, and then apply the correct ownership for them.
2021-08-10 21:30:53 +02:00
Gunnar Beutner
f424485193 LaunchServer: Make sure launching absolute symlinks works
This was broken by 31d659d.
2021-08-10 20:17:34 +02:00
LuK1337
31d659d9a0 LaunchServer: Resolve symlinks when querying for handler application
This lets us launch proper handler application for symlinks :^)
2021-08-10 05:26:36 +04:30
Tetsui Ohkubo
1479ee3f3e LaunchServer: Do not provide file handlers for special files
With this change, LaunchServer will always return an empty list of file
handlers for special files e.g. sockets and devices. Before this change,
TextEditor was always returned as a default handler for these files.
2021-08-09 22:50:09 +02:00
Andreas Kling
2c1788e2e4 FileOperation: Don't follow symlinks
Deleting a symlink via "FileOperation Delete" should not recursively
delete whatever the symlink is pointing to. Same basic idea applies to
the Copy and Move operations.
2021-08-08 14:24:54 +02:00
Daniel Bertalan
f94532ea4e WindowServer: Fix Clang crash when compiling Compositor.cpp
Due to a bug in Clang 12, the compilation would fail with an 'unexpected
end-of-file' error when it encounters some of the nested generic lambdas
in `Compositor.cpp`.

Co-authored-by: Peter Bindels <dascandy@gmail.com>
2021-08-08 10:55:36 +02:00
Daniel Bertalan
7fb41d6250 WindowServer: Fix 'use of GNU old-style field designator'
Since C99 and C++20 have a standardized syntax for designated
initializer, we should use that instead of this GCC-specific extension.
While this currently works both in Clang and GCC, the former emits a
warning for it, while the latter has an [issue] open that plans to
deprecate it.

[issue]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88144
2021-08-08 10:55:36 +02:00
Timothy
95ee7069d5 FileSystemAccessServer: Add window title as parameter for opening file 2021-08-07 12:48:22 +02:00
Brian Gianforcaro
b5b67a1747 SystemServer: Handle missing service executable gracefully
I use the `configure-components` functionality locally during
development. There are a few services (SpiceAgent) which aren't marked
as required components, and hence aren't built in all configurations,
but we still try to launch them in all configurations.

Instead of letting the forked SystemServer process crash, lets
gracefully handle the situation of a missing binary and provide a
message to the user.
2021-08-07 12:30:50 +02:00
LuK1337
0a7041aad7 Taskbar: Pass full argv for exit action
We need to pass --now to `shutdown` command.
2021-08-07 01:37:28 +02:00
Andreas Kling
779316d468 Userland: Use Core::Process::spawn() instead of posix_spawn() in places
This replaces a bunch of very basic uses of posix_spawn() with the new
Core::Process::spawn().
2021-08-06 01:06:42 +02:00
Jelle Raaijmakers
c7e72a52a3 Taskbar: Use provided AppFile icon instead of finding it ourselves 2021-08-04 13:54:08 +01:00
Timothy
73c1b1617a Everywhere: Replace most cases of exit() with Application::quit()
Application::quit() is nicer for most cases where exit() is used. Cases
where exit() is used intentionally for early termination are left
intact.
2021-08-03 18:55:52 +02:00
Karol Kosek
49ae73022c Taskbar: Set chdir to the home directory when opening applications
Although the chdir was set up for the applications opened from
the quick launch, the regular application list hadn't do this.

This meant that you could open a Terminal or HackStudio project
in the root directory, which isn't so bad, but it's better to stick
to the user home directory.
2021-08-03 09:12:33 +02:00
sin-ack
611370e7dc LibGUI, WindowServer: Greatly simplify menubar logic
Currently, any number of menubars can be plugged in and out of a window.
This is unnecessary complexity, since we only need one menubar on a
window. This commit removes most of the logic for dynamically attaching
and detaching menubars and makes one menubar always available. The
menubar is only considered existent if it has at least a single menu in
it (in other words, an empty menubar will not be shown).

This commit additionally fixes a bug wherein menus added after a menubar
has been attached would not have their rects properly setup, and would
therefore appear glitched out on the top left corner of the menubar.
2021-08-02 00:39:15 +02:00
Brian Gianforcaro
808aa31353 Services: Remove unused header includes 2021-08-01 08:10:16 +02:00
LuK1337
5fe3cc3b85 WindowServer: Don't draw separator between pin window & close for modals
Modal windows cannot be pinned and thus we end up drawing 2 separators.
2021-07-28 18:32:06 +02:00
sin-ack
4c9c85ac01 Userland: Make TextWrapping::Wrap opt-in
This was breaking many places which didn't expect text to wrap. Now,
the only place where text currently wraps is in GUI::Label.
2021-07-27 22:05:20 +02:00
Andreas Kling
751cb094ff LibGfx: Remove Gfx::ImageDecoder::bitmap() in favor of frame(index)
To transparently support multi-frame images, all decoder plugins have
already been updated to return their only bitmap for frame(0).

This patch completes the remaining cleanup work by removing the
ImageDecoder::bitmap() API and having all clients call frame() instead.
2021-07-27 01:29:50 +02:00
Andreas Kling
d01b4327fa LibGfx: Improve ImageDecoder construction
Previously, ImageDecoder::create() would return a NonnullRefPtr and
could not "fail", although the returned decoder may be "invalid" which
you then had to check anyway.

The new interface looks like this:

    static RefPtr<Gfx::ImageDecoder> try_create(ReadonlyBytes);

This simplifies ImageDecoder since it no longer has to worry about its
validity. Client code gets slightly clearer as well.
2021-07-27 01:17:05 +02:00
sin-ack
48d4062b47 NotificationServer: Expand the notification when hovered
Now, instead of showing a tooltip, the entire notification will be
shown when the user hovers over a notification. In the future, limiting
the amount of lines shown within the notification and moving extra lines
to the tooltip again might be a good idea.
2021-07-26 21:14:39 +04:30
sin-ack
e11940fd01 Userland: Move text wrapping/elision into the new TextLayout :^)
This class now contains all the fun bits about laying out text in a
rect. It will handle line wrapping at a certain width, cutting off lines
that don't fit the given rect, and handling text elision.
Painter::draw_text now internally uses this.

Future work here would be not laying out text twice (once actually
preparing the lines to be rendered and once to get the bounding box),
and possibly adding left elision if necessary.

Additionally, this commit makes the Utf32View versions of
Painter::draw_text convert to Utf8View internally. The intention is to
completely remove those versions, but they're kept at the moment to keep
the scope of this PR small.
2021-07-26 21:14:39 +04:30
Andreas Kling
7d4e3f01dd Taskbar: Unbreak application launchers in the start menu
Application launcher actions reference their applications by an index
into the global `g_apps` table. When skipping over settings apps,
we still have to increment the current app identifier.
2021-07-26 02:57:24 +02:00
Andreas Kling
4e2c5cd19e Taskbar: Show Settings app instead of Settings app category
The Settings app is basically a viewer for the Settings app category
anyway, so let's just direct users there instead of having the various
settings apps in the start menu.
2021-07-26 01:56:33 +02:00
Andreas Kling
fb0c94ae84 WindowServer: Remove debug spam in MenuManager::refresh() 2021-07-25 18:01:24 +02:00
Andreas Kling
3f9e018d9a CrashDaemon: Remove BACKTRACE_DEBUG debugging code
This thing seems to work fine, no need to hang on to old debug code.
2021-07-22 23:34:33 +02:00
Tom
fd60815c58 WindowServer: Fix rendering overlays when there's no desktop window
We were missing to account for areas that are not covered by any
window. If any of these areas are covered by an overlay we need to
render the wallpaper into transparency and also render the overlay
over them.

This fixes not rendering overlays properly when e.g. the FileManager
(desktop) crashed as there is no longer any window underneath.
2021-07-22 21:38:52 +02:00
Andreas Kling
d79d768010 LaunchServer: Remove debug spam about incoming connections 2021-07-22 14:20:05 +02:00
Sam Atkins
9122967d5f FileOperation: Use LexicalPath::join() for all path joining 2021-07-22 12:48:44 +02:00
Sam Atkins
967314023c FileOperation: Implement 'Delete' operation 2021-07-22 12:48:44 +02:00
Sam Atkins
e99200cc23 FileOperation: Combine 'sources' and 'destination' CL arguments
The upcoming 'Delete' operation has no destination, so this was the
best solution we could come up with for now. Perhaps ArgsParser
could support sub-commands, so we would define 'Copy', 'Move' and
'Delete' each as sub-commands with their own argument definitions.
That would make things like git's variety of commands possible.
2021-07-22 12:48:44 +02:00
Sam Atkins
0a62d517fd FileManager+FileOperation: Implement (and use) 'Move' command
`FileOperation Move ...` is now used for cut-and-paste in the
FileManager.
2021-07-22 12:48:44 +02:00
Sam Atkins
a1b4ec1507 FileOperation: Extract execute_work_items() from perform_copy()
This is in preparation for a perform_move() function.
2021-07-22 12:48:44 +02:00
Sam Atkins
3267556ce4 FileOperation: Accept multiple source arguments
You can now list multiple files or directories and they will all be
copied to the destination. :^)

Note that this means you can pass the same file or directory multiple
times. It runs fine, just means that it does unnecessary work. But
figuring out if a file is already queued is probably more hassle than
it's worth, if it's even possible at all due to symlinks.
2021-07-22 12:48:44 +02:00
Sam Atkins
ca039e6ba1 FileManager+FileOperation: Switch to east const
(And some adjustments based on MaxWipfli's feedback)
2021-07-22 12:48:44 +02:00
Karol Kosek
f2c9ef3763 WindowServer: Reuse config variable from the class on theme change
When changing the theme, there were two Core::ConfigFile instances
(one class scoped -- m_config and one function scoped -- wm_config)
fighting over the file, resulting in not saving the new theme name
to the config. :^(

This makes WindowServer remember selected theme from the menu
after reboot!
2021-07-22 00:26:44 +02:00
Andreas Kling
c7d891765c LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
2021-07-21 18:02:15 +02:00
Tom
dbb9f891fb WindowServer: Re-use existing Screen instances and improve fallbacks
If a screen layout cannot be applied, instead of failing to start
WindowServer try to fall back to an auto-generated screen layout with
the devices that are detected.

Also, be a bit smarter about changing the current screen layout.
Instead of closing all framebuffers and bringing them back up, keep
what we can and only change resolution on those that we need to change
them on. To make this work we also need to move away from using an
array of structures to hold compositor related per-screen data to
attaching it to the Screen itself, which makes re-using a screen much
simpler.
2021-07-21 00:06:58 +02:00
Andreas Kling
59b6169b51 Taskbar: Update the start button width when system fonts change 2021-07-20 02:48:29 +02:00
Linus Groh
37cc110003 Taskbar: Launch apps in Terminal when RunInTerminal=true is specified
This feels a bit awkward right now, and needs code duplication - I think
adding a mechanism to the AppFile class to run the executable would be
neat, especially if we add an arguments field to app files - but this
will do for now.
2021-07-20 00:58:26 +01:00
Peter Elliott
2b37fad60b WindowServer: Add set_virtual_dekstop WindowManager message
Users can specify the row and column of the virtual desktop, and
WindowServer will animate to it.
2021-07-19 18:21:40 +02:00
Tom
18eeb3db87 WindowServer: Fix crash rendering fullscreen window
Fixes #8869
2021-07-19 10:24:58 +02:00
Tom
7ae46ae218 WindowServer: Fix menu over-drawing
We only need to re-draw the item being selected and the item being
deselected. We also don't care anymore if applets were added or
removed as we no longer have a global menu bar.
2021-07-18 23:55:13 +02:00
Tom
220886db4c WindowServer: Fix compositor overdraw issues related to transparency
We were re-rendering areas that were considered transparency areas even
though they weren't transparency areas or were occluded by opaque
areas.

In order to fix this, we need to be a bit smarter about what is above
and below any given window. Even though a window may have transparent
areas, if those are occluded by opaque window areas on top they are
not actually any areas that should be rendered at all. And the opposite
also applies, opaque window areas for windows below that are occluded
by transparent areas, do need to be rendered as transparency. This
solves the problem of unnecessary transparency areas.

The other problem is that we need to know what areas of a window's
dirty rectangles affect other windows, and where. Basically any
opaque area that is somehow below a transparent area that isn't
otherwise occluded, and any transparent area above any other window
area (transparent or opaque) needs to be marked dirty prior to
composing. This makes sure that all affected windows render these
areas in the correct order. To track these, we now have a map of
affected windows and the rectangles that are affected (because not all
of that window's transparency areas may be affected).
2021-07-18 18:39:20 +02:00
Tom
6bb1825366 WindowServer: Recompute occlusions when removing an overlay
This makes sure we don't needlessly render areas with transparency
that used to be occupied by an overlay.
2021-07-18 18:39:20 +02:00
Timothy
9e04ab936f WindowServer: Let clients mark windows as stealable by specific clients
This implements window stealing in WindowServer, which allows clients
to mark a window they own as 'stealable' by another client. Indicating
that the other client may use it for any purpose.

This also updates set_window_parent_from_id so that the client must
first mark its window as stealable before allowing other clients to
use it as a parent.
2021-07-18 17:21:28 +02:00
Timothy
f5e0475bdf FileSystemAccessServer: Add expose_window_server_client_id()
This will expose the client id of the WindowServerConnection this
instance of FileSystemAccessServer is using.
2021-07-18 17:21:28 +02:00
Timothy
38594dde79 FileSystemAccessServer+TextEditor: Implement cross-process modal prompts
This transitions from synchronous IPC calls to asynchronous IPC calls
provided through a synchronous interface in LibFileSystemAccessClient
which allows the parent Application to stay responsive.

It achieves this with Promise which is pumping the Application event
loop while waiting for the Dialog to respond with the user's action.

LibFileSystemAccessClient provides a lazy singleton which also ensures
that FileSystemAccessServer is running in the event of a crash.

This also transitions TextEditor into using LibFileSystemAccessClient.
2021-07-18 17:21:28 +02:00
Timothy
b77b631571 WindowServer: Add WindowServer::get_window_rect_from_client()
This allows a client to get the rect of a window in another client.
2021-07-18 17:21:28 +02:00
Timothy
88e6d18a61 WindowServer: Add WindowServer::async_set_window_parent_from_client()
This allows a client to set the parent for one of its local windows
where the parent window is in another client.
2021-07-18 17:21:28 +02:00
Timothy
522f6775a7 LibGUI+WindowServer: Expose WindowServer client id to the client
This allows an WindowServer client to identify itself and allow future
cross-client functionality in WindowServer.
2021-07-18 17:21:28 +02:00
Gunnar Beutner
56cbd00e94 SpiceAgent: Add Clipboard as a build dependency
SpiceAgent depends on header files built as part of the Clipboard
target.
2021-07-15 11:51:16 +02:00
Timothy Flynn
ae910e4370 LibWeb: Add OOPWV IPC for selecting all text 2021-07-14 17:16:39 +02:00
Timothy Flynn
2fda6ce159 LibWeb: Add OOPWV IPC for retrieving selected text 2021-07-14 17:16:39 +02:00
Daniel Bertalan
bb26cea291 WindowServer: Don't use GNU-style designator
Clang throws a fit when it encounters this code, since we already have
the standardized designated initializer syntax in C++20, which we should
use.
2021-07-14 13:12:25 +02:00
x-yl
c8b13bd053 SpiceAgent: Support copying and pasting images 2021-07-14 12:33:07 +02:00
x-yl
d4bb6a1a1e SpiceAgent: Add a new spice agent service :^)
A SPICE agent communicates with the host OS to provide nifty features
like clipboard sharing :^)

This patch implements only plain-text clipboard sharing.

See: github.com/freedesktop/spice-protocol/blob/master/spice/vd_agent.h
2021-07-14 12:33:07 +02:00
ForLoveOfCats
60713c5fcf KeyboardPreferenceLoader: Use correct default Num Lock config value 2021-07-13 23:25:07 +02:00
LuK1337
ac78f1e812 TaskbarWindow: Redraw start button when default font changes 2021-07-12 11:08:09 +02:00
Adam Hodgen
643ecfee73 FileSystemAccessServer: Return user_picked_value even on error
If a user picks a file which can't be opened for some reason, we should
still return the value, so client applications can report the error
along with the chosen filepath.
2021-07-11 09:46:50 +02:00
Tom
83b512789c WindowServer: Flush display buffer when flashing
If the device requires a flush and we modify the front buffer, we need
to flush those changes to the front buffer. This makes the flashing
work using the VirtIOGPU.

Also fix a minor bug where we flushed the front buffer instead of
the back buffer after flipping, which caused the VirtIOGPU to not work
as expected when using the SDL backend and disabling buffer flipping.
2021-07-10 21:24:52 +02:00
Timothy
41ce2debda FileSystemAccessServer: Add service for accessing veiled files nicely
Adds new service FileSystemAccessServer which allows programs to
request a file descriptor for any file on the file system.

The user can be prompted to choose the path with a FilePicker, or the
path can be provided by the application which will show a MessageBox
showing the pid and name of the calling process and allows the user to
approve or deny the request.
2021-07-10 15:33:46 +02:00
LuK1337
5e823d3de0 Taskbar: Scale window icon bitmap if it's not 16x16
Fixes: #5806
2021-07-10 14:04:21 +01:00
Andreas Kling
b8a204c5b9 LibThreading: Rename Lock => Mutex 2021-07-09 11:15:50 +02:00
Aziz Berkay Yesilyurt
dc833e49b0 WindowServer: Paint background when a fullscreen window is transparent
The windows in the background are ignored when the window is fullscreen.
However, we still would like to see the background if that window is
transparent.
2021-07-09 13:33:17 +04:30
Ali Mohammad Pur
0459a111b2 Revert "Userland: Add ability to screenshot rectangular region in shot (#8515)"
This reverts commit 1c06d77262.
This was squashed by mistake, the rebased version will follow.
2021-07-09 13:27:56 +04:30
Aziz Berkay Yesilyurt
1c06d77262
Userland: Add ability to screenshot rectangular region in shot (#8515)
* LibGUI: Verify m_window_id is not-zero in set_maximized

Window::set_maximized requires non-zero window id to be a valid call,
i.e. calling Window::show beforehand. A verify statement before the
server call can help developers by hinting correct usage.

* LibGUI: Paint background when the fullscreen window is transparent

The windows in the background are ignored when the window is fullscreen.
However, we still would like to see the background if that window is
transparent.

* Userland: Add ability to capture rectangular region in shot

A click and drag selectable, transparent, fullscreen window is
displayed with the command line argument -r for screenshots.
2021-07-09 13:11:24 +04:30
Andrea Martinelli
ab1caad1e9 Taskbar: Make clicks at the edges and corners work as expected
This makes it easy for the user to just throw the mouse at the corner
of the screen and obtain the desired outcome (eg. opening the start
menu), without having to precisely position the cursor over one of the
buttons.
2021-07-08 22:45:40 +02:00
networkException
dac7b25b8a WindowServer: Add missing minimize check to highlighted window callback
This patch adds a missing minimize check for highligted windows in
WindowStack::for_each_visible_window_of_type_from_front_to_back().
Minimized windows should not be treated as visible in this context.

Previously, iterating through each visible Window when recomputing
occlusions in the Compositor would cause a crash if a highlighted
Window is also minimized at the same time. As the WindowSwitcher
currently highligts Windows even when they are minimized, opening
it while any Window is minimized would cause WindowServer to crash.
2021-07-08 22:31:21 +02:00
networkException
76a18e1172 WindowServer: Remove rect behind window icon in WindowSwitcher
This patch removes the background behind window icons
in the WindowSwitcher which looked like it was being
rendered incorrectly (without alpha) previously.
2021-07-08 20:15:23 +02:00
Jan de Visser
a034774e3a LibSQL+SQLServer: Build SQLServer system service
This patch introduces the SQLServer system server. This service is
supposed to be the only process/application talking to database storage.
This makes things like locking and caching more reliable, easier to
implement, and more efficient.

In LibSQL we added a client component that does the ugly IPC nitty-
gritty for you. All that's needed is setting a number of event handler
lambdas and you can connect to databases and execute statements on them.

Applications that wish to use this SQLClient class obviously need to
link LibSQL and LibIPC.
2021-07-08 17:55:59 +04:30
Andrea Martinelli
5397845a41 WindowServer: Add a new IPC to set the cursor position 2021-07-08 14:15:07 +02:00