Commit Graph

601 Commits

Author SHA1 Message Date
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
Daniel Bertalan
6f6b1b3ea1 ChessEngine: Don't call non-constexpr sqrt in a constexpr intiializer
GCC likely has a builtin intrinsic that evaluates the operation at
compile-time, even if the `LibM` is not declared as constexpr. Clang,
however, does not like it, and it failed to compile this code.
2021-07-08 10:11:00 +02:00
Daniel Bertalan
2db4709c0c Everywhere: Add braces to aggregate initializers
This fixes a couple of warnings emitted by Clang.
2021-07-08 10:11:00 +02:00
Daniel Bertalan
98a9a1d7f9 Everywhere: Add break after the last case label before default
We already do this in most places, so the style should be consistent.
Also, Clang does not like it, as this could cause an unexpected compile
error if some statements are added to the default label or a new label
is added above it.
2021-07-08 10:11:00 +02:00
Daniel Bertalan
b0208ce433 Everywhere: Forward declare structs as structs
While structs being forward declared as classes is not strictly an
issue, Clang complains as this is not portable code, since some ABIs
treat classes declared as `class` and `struct` differently.

It's easier to fix these than to reason about explicitly disabling
another warning.
2021-07-08 10:11:00 +02:00
Daniel Bertalan
b76ad3db90 IPCCompiler+WindowServer: Fix deleted function warning
It might be the case that we are passing non-movable/non-copyable things
through IPC. In this case, Clang will emit a warning as it can't
generate the requested default move/copy ctor for the IPC message.

To fix this, we use a `#pragma` to make the compiler silently ignore our
request.

The same was the case with the three-way comparison in `Screen`. Since
we don't use the three-way comparison operator anywhere else in our
codebase, we simply use the `==` operator instead.
2021-07-08 10:11:00 +02:00
Daniel Bertalan
a2e0291172 WindowServer: Don't use old GNU-style designator
Since we use C++20, we can move to the new standardized designated
initializer syntax.
2021-07-08 10:11:00 +02:00
Daniel Bertalan
ca06fd658d Everywhere: Remove unused local variables and lambda captures 2021-07-08 10:11:00 +02:00
Andrew January
5598f63d0f WindowServer: Make descending into submenu make the submenu current
This fixes a bug with menu keyboard navigation. If you pressed the right
arrow to enter a submenu, then the left arrow to exit the submenu, then
right and left again it would leave no menu item selected.

Because descending into the submenu wasn't making it the current menu,
when you press the left arrow it couldn't find the "current menu" in the
stack, so didn't know what menu to pop back to.

It was an accident that it worked the first time you navigated into the
menu. Selecting the parent item also opened the submenu, and opening
an already open menu sets it as the current menu. After closing the
submenu with the left arrow, it is no longer already open, so it wasn't
getting set as the current menu.
2021-07-08 09:13:24 +02:00
Andreas Kling
f48e581eac WindowServer: When "flash flush" enabled, flash transparent rects green 2021-07-08 01:22:21 +02:00
Andreas Kling
432ab47053 WindowServer: Allow partial repaints in window frame & menubars
Before this change, invalidating any rect in a WindowFrame would cause
the entire window (including frame & drop shadow) to get invalidated,
leading to copious amounts of overdraw when mousing over menubars,
titlebars, and window buttons.

We now simply allow the partial frame invalidations through to the
window's dirty rects collection and the compositor takes care of it.
2021-07-08 01:17:06 +02:00
Andrew January
cad62230f6 WindowServer: Close submenus when hovering over separators
ec6debb changed item_index_at to return -1 when hovering over a
separator. The intent was to not send the separator to clients for
MenuItemEntered.

However, this had the unintented consequence of not closing the submenu
when you hover over a separator. Submenus ignore when the item index is
-1 in order to leave the menu open when you move the mouse outside. This
ends up leaving the submenu open without the highlight to show what menu
item the submenu belongs to.

A slightly less severe consequence is that pressing the up or down arrow
key in such a situation would now go the top or bottom of the menu
rather than the item above or below the separator.

We now push the special casing of separators into set_hovered_index so
that the rest of the code behaves as it did before ec6debb.
2021-07-08 01:17:02 +02:00
Andreas Kling
b027466f41 WindowServer+wsctl: Add a simple utility for toggling "flash flush"
You can now put the WindowServer into "flash flush" mode by doing:

$ wsctl -f 1

To disable it, somewhat obviously:

$ wsctl -f 0
2021-07-07 22:56:46 +02:00
Andreas Kling
6032b2cb2b WindowServer: When "flash flush" is enabled, stretch flash to 10 ms
Previously, this mode would flash flush/repaint rects in yellow for
however it long it took for the compositor to replace the yellow with
the final image instead.

Now we usleep() for 10 ms when flashing, so you get a chance to see
the yellow. This immediately makes "flash flush" mode super useful. :^)
2021-07-07 22:56:46 +02:00
Andreas Kling
092e5b75ba WindowServer: Add WindowFrame::invalidate_menubar() and use it
Clean up a FIXME about overly aggressive invalidation.
2021-07-07 21:06:15 +02:00
Andreas Kling
86d0145260 LibGfx+LibGUI+WindowServer: Use move() on Core::AnonymousBuffer more 2021-07-07 18:02:43 +02:00
Andres Crucitti
f6f14777ac WindowServer: Allow windows to be pinnable (always on top)
This patch adds the concept of a window being "Pinnable" (always drawn
on top of other windows). This can be toggled through a new checkable
action in the top left corner's window menu.
2021-07-07 15:38:59 +02:00
Edwin Hoksberg
99328e1038 Kernel+KeyboardSettings: Remove numlock syscall and implement ioctl 2021-07-07 10:44:20 +02:00
Tom
96155009dd WindowServer: Fix crash removing modal windows
Calling Window::is_modal requires the window to be on a window stack,
so we need to check this before removing it from the window stack.
2021-07-05 19:31:48 +02:00
ForLoveOfCats
ce6658acc1 KeyboardSettings+Kernel: Setting to enable Num Lock on login 2021-07-05 06:19:59 +02:00
Tom
fdf701ed96 WindowServer: Improve screen invalidation on window state changes
Because window states and various flags can affect the windows'
rendered areas it's safer to use the last computed occlusion rectangles
to invalidate areas on the screen that may have to be re-rendered due
to e.g. a window size change.

Fixes #6723
2021-07-05 00:03:13 +02:00
Tom
6e792553f2 WindowServer: Query driver for framebuffer offset
Depending on the driver, the second buffer may not be located right
after the first, e.g. it may be page aligned. This removes this
assumption and queries the driver for the appropriate offset.
2021-07-04 23:59:17 +02:00
Tom
fdae117600 WindowServer: Implement support for combined buffer flipping + flushing
Some devices may require DMA transfers to flush the updated buffer
areas prior to flipping. For those devices we track the areas that
require flushing prior to the next flip. For devices that do not
support flipping, but require flushing, we'll simply flush after
updating the front buffer.

This also adds a small optimization that skips these steps entirely for
a screen that doesn't have any updates that need to be rendered.
2021-07-04 23:59:17 +02:00
Andreas Kling
c2dfa9d54c WindowServer+LibGUI: Add a way to force a window to have a drop shadow 2021-07-04 23:15:17 +02:00
Andreas Kling
782a5c88ce WindowServer: Make most remaining WindowServer IPC calls async
The only remaining sync call from client to server is now the call
that switches a window's backing store. That one actually relies on
the synchronization to hand over ownership of the backing stores,
so it has to stay synchronous for now.
2021-07-04 23:15:16 +02:00
Andreas Kling
24e122590c Taskbar: Simplify quick launch widget layout
Use shrink-to-fit instead of manually calculating the widget size.
2021-07-04 22:03:47 +02:00
Andreas Kling
48982a08f1 Taskbar: Give the "Show/Hide Desktop" button an icon :^) 2021-07-04 21:54:50 +02:00
Tom
814195b060 WindowServer: Only run window animation for windows on current desktop
We should only run the minimize and launch animations for windows that
are actually rendered on the currently visible virtual desktop.
2021-07-04 20:23:56 +02:00
Tom
812ee194b7 WindowServer: Toggling desktop should only toggle current desktop
We should only show/hide the windows on the current virtual desktop.
2021-07-04 20:23:56 +02:00
ForLoveOfCats
cefa2e3dd2 Taskbar: Add show desktop button to toggle showing of the desktop 2021-07-04 13:58:56 +02:00