Commit graph

703 commits

Author SHA1 Message Date
Liav A
50429d3b22 LibC+Kernel: Move GPU-related API methods to a LibC header file
The Kernel/API directory in general shouldn't include userspace code,
but structure definitions that both are shared between the Kernel and
userspace.

All users of the ioctl API obviously use LibC so LibC is the most common
and shared library for the affected programs.
2023-09-15 11:05:25 -06:00
Andreas Kling
545d8336b8 LibGfx: Convert Font APIs to return String instead of DeprecatedString 2023-09-06 11:29:03 -04:00
Andreas Kling
34344120f2 AK: Make "foo"_string infallible
Stop worrying about tiny OOMs.

Work towards #20405.
2023-08-07 16:03:27 +02:00
Andreas Kling
ddbe6bd7b4 Userland: Rename Core::Object to Core::EventReceiver
This is a more precise description of what this class actually does.
2023-08-06 20:39:51 +02:00
Andreas Kling
26647f2b10 LibCore: Remove the Core::Objects::all_objects() list
Nobody actually used the list of all Core::Objects anyway.
2023-08-06 18:09:25 +02:00
Torstennator
d8320d0a14 WindowServer: Fix menu height when invisible items are involved
This patch checks for visible items to determine the menu height. Now
the last visible item is used to determine the height of the menu.
Before this patch that menu height could be wrong e.g. if the last item
was not visible.
2023-08-04 12:11:13 +02:00
Shannon Booth
2b46e6f664 Everywhere: Update copyrights with my new serenityos.org e-mail :^) 2023-07-15 16:21:29 +02:00
Timothy Flynn
c911781c21 Everywhere: Remove needless trailing semi-colons after functions
This is a new option in clang-format-16.
2023-07-08 10:32:56 +01:00
Valtteri Koskivuori
c3f5b514c8 WindowServer: Yank out window frame opacity
This facility was added in 15a1d9a, but isn't being used for anything.
It wasn't even hooked up to LibGUI for applications to use.
Relevant use-cases, such as the most prominent one in `AnalogClock`, use
`GUI::Window::set_frameless()` instead.
2023-06-24 23:45:27 +02:00
Valtteri Koskivuori
6931a5a0a8 WindowServer+LibGUI: Yank out window-global opacity
From what I can tell, this facility was added to WSWindow/GWindow in
2019 in 9b71307. I only found a single place in the codebase still using
this facility: `WindowServer::Menu::start_activation_animation()`. A
subtle fade-out animation that happens when a menu item is selected, and
the menu disappears.
I think our compositing facilities have improved enough to make this
facility redundant. The remaining use mentioned above was ported to just
directly blit the fade-out animation instead of requesting it from
WindowServer.
2023-06-24 23:45:27 +02:00
Ben Wiederhake
d3a6512643 WindowServer: Properly handle OOM on drag-and-drop metadata copy 2023-06-15 08:07:17 +02:00
Ben Wiederhake
522809032a WindowServer: Don't crash when trying to set invalid effects 2023-06-01 21:17:29 +02:00
Jelle Raaijmakers
f391ccfe53 LibGfx+Everywhere: Change Gfx::Rect to be endpoint exclusive
Previously, calling `.right()` on a `Gfx::Rect` would return the last
column's coordinate still inside the rectangle, or `left + width - 1`.
This is called 'endpoint inclusive' and does not make a lot of sense for
`Gfx::Rect<float>` where a rectangle of width 5 at position (0, 0) would
return 4 as its right side. This same problem exists for `.bottom()`.

This changes `Gfx::Rect` to be endpoint exclusive, which gives us the
nice property that `width = right - left` and `height = bottom - top`.
It enables us to treat `Gfx::Rect<int>` and `Gfx::Rect<float>` exactly
the same.

All users of `Gfx::Rect` have been updated accordingly.
2023-05-23 12:35:42 +02:00
Ben Wiederhake
5b318dd160 WindowServer: Prefer File::read_until_eof over DeprecatedFile::read_all 2023-05-19 21:36:37 +02:00
thankyouverycool
44049f5ad5 WindowServer: Catch more Window stealing misbehavior
Previously it was possible for a window to register as a parentless
blocking modal then add itself to a stealable parent's modal chain,
bypassing a mode misbehavior check in create_window()

Also relaxes reciprocity for blockers with the same parent. This
scenario is usually created by simultaneous MessageBoxes. It's not
an ideal UX to cascade these, but there's no need to crash over it.
2023-05-15 12:15:39 +02:00
Ben Wiederhake
4b7639c3b5 LibGfx+WindowServer: Ensure constrain-to-rect ends up inside the rect 2023-05-06 22:04:46 +02:00
Patryk Pilipczuk
90ab011127 WindowServer: Fix window content scaling when switching from fullscreen
Resolves #18624

Switching to and from fullscreen produces a behaviour where window
content too big in relation to window size.

This patch fixes sent resize event to contain current
window size.
2023-05-06 12:24:53 +01:00
thankyouverycool
f7e034d4b2 LibGfx+Userland: Merge FrameShape and FrameShadow into FrameStyle
Previously, Frames could set both these properties along with a
thickness to confusing effect: Most shapes of the same shadowing only
differentiated at a thickness >= 2, and some not at all. This led
to a lot of creative but ultimately superfluous choices in the code.

Instead let's streamline our options, automate thickness, and get
the right look without so much guesswork.

Plain shadowing has been consolidated into a single Plain style,
and 0 thickness can be had by setting style to NoFrame.
2023-04-30 05:49:46 +02:00
Jelle Raaijmakers
7b10c8048c WindowServer: Draw stretched wallpapers with bilinear blending
This improves the quality of stretched photos and artwork considerably,
and I'd argue that this is what users will expect by default.
2023-04-25 22:37:57 +02:00
Andreas Kling
411d36719e LibCore: Simplify Core::Notifier by only allowing one event type
Not a single client of this API actually used the event mask feature to
listen for readability AND writability.

Let's simplify the API and have only one hook: on_activation.
2023-04-25 14:48:40 +02:00
Karol Kosek
7e33857afa WindowServer+LibGUI: Port WindowServer's Menu name to new String 2023-04-19 07:59:54 +02:00
thankyouverycool
b7cac829ae WindowServer: Show complete title when Window is not resizable
Saves Dialogs the trouble of accounting for variable width titles and
makes all unresizable windows more responsive to font changes.
2023-04-18 10:05:21 +02:00
Julian Offenhäuser
e32ab161ae WindowServer: Fix alt shortcut navigation for non-default keymaps
Some keymaps will bind key presses with the alt modifier to characters
other than the unmodified one, in which case you couldn't activate the
alt shortcuts in the menu bar before.

We now ask the current keymap for the code point that is mapped to the
pressed (unmodified) key instead.
2023-04-14 12:38:40 +01:00
Tom
7795b7bc17 WindowServer: Refactor window geometry overlay rect calculation logic
This moves the ideal overlay rect calculation into its own function.
2023-04-13 20:18:49 +02:00
Tom
e1077ebbad WindowServer: Prevent some overdraw by the window geometry overlay
While the window geometry overlay is centered inside the tile overlay
neither the text nor the location change, so there is no need to
re-render and update it every time the window moves.
2023-04-13 20:18:49 +02:00
Tom
5a73691fe9 WindowServer: Move window geometry label into the tile overlay area
This moves the window geometry overlay into the center of the
tile window overlay when it's visible or when it moves.
2023-04-13 20:18:49 +02:00
Tom
fe54a0ca27 WindowServer: Implement tile window overlay
This adds a tiling mode that will show a tile window overlay rather
than immediately tiling a window, triggering window resizes.
2023-04-13 20:18:49 +02:00
Tom
9ff1fa1cf3 WindowServer: Fix some gliches when overlays are moved or removed
Keep track of areas that overlays were rendered to when we recompute
occlusions. This allows us to then easily figure out areas where
overlays were moved from or removed from.
2023-04-13 20:18:49 +02:00
Tom
426d1b7410 WindowServer: Only register animations when they're running
This allows us to keep Animation objects around, and the compositor
will only use them when the animation is actually running.
2023-04-13 20:18:49 +02:00
Tom
fa7f9b0f35 WindowServer: Fix calculating tile rect on secondary screens
The screen rectangle's origin is only {0, 0} on the main screen, so
we need to move the tile rectangle relative to its location.
2023-04-13 20:18:49 +02:00
Tom
6f9c5b71fd WindowServer: Use enum class for Effects and ShowGeometry 2023-04-13 20:18:49 +02:00
Ben Wiederhake
560133a0c6 Everywhere: Remove unused DeprecatedString includes 2023-04-09 22:00:54 +02:00
MacDue
cf730403ea WindowServer: Allow updating the name of a menu 2023-03-26 21:55:21 +01:00
MacDue
952f6bbb2a WindowServer: Rename menu_title to name in IPC API
This is referred to as the name everywhere else, so we should be
consistent here.
2023-03-26 21:55:21 +01:00
Cameron Youell
1d24f394c6 Everywhere: Use LibFileSystem where trivial 2023-03-21 19:03:21 +00:00
implicitfield
e9e4baee77 Everywhere: Support overriding the system color scheme 2023-03-10 22:03:49 +01:00
Andreas Kling
21db2b7b90 Everywhere: Remove NonnullOwnPtr.h includes 2023-03-06 23:46:35 +01:00
Andreas Kling
359d6e7b0b Everywhere: Stop using NonnullOwnPtrVector
Same as NonnullRefPtrVector: weird semantics, questionable benefits.
2023-03-06 23:46:35 +01:00
Andreas Kling
689ca370d4 Everywhere: Remove NonnullRefPtr.h includes 2023-03-06 23:46:35 +01:00
Andreas Kling
8a48246ed1 Everywhere: Stop using NonnullRefPtrVector
This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.

This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-03-06 23:46:35 +01:00
Andreas Kling
b71c7a6e44 Userland: Use Font::pixel_size_rounded_up() instead of glyph_height()
The only remaining clients of this API are specific to bitmap fonts and
editing thereof.
2023-03-04 00:29:38 +01:00
Andreas Kling
025bdcf34c WindowServer: Fix various const-correctness issues 2023-02-21 00:54:04 +01:00
Tom
328a64fbdc WindowServer: Fix drawing wallpaper on additional screens
We need to translate the source rectangle relative to the screen
location when blitting from the wallpaper bitmap.
2023-02-19 01:15:26 +01:00
Tom
15d4903efb WindowServer: Fix caching stretched wallpaper for multiple screens
This creates a cached bitmap for each unique screen resolution, which
allows us to share it between displays with the same resolution. If
the resolution is the same as the wallpaper, we can just use the
wallpaper as-is.
2023-02-19 01:15:26 +01:00
John Bundgaard
7dc874104b WindowServer: Redraw Taskbar on window highlight during switching 2023-02-17 16:18:14 +00:00
John Bundgaard
091dbec295 WindowServer: Show window switcher even if fullscreen window is active 2023-02-17 16:18:14 +00:00
Tim Schumacher
a96339b72b LibCore: Move Stream-based sockets into the Core namespace 2023-02-13 00:50:07 +00:00
Tim Schumacher
d43a7eae54 LibCore: Rename File to DeprecatedFile
As usual, this removes many unused includes and moves used includes
further down the chain.
2023-02-13 00:50:07 +00:00
Karol Kosek
421b1eee49 WindowServer: Restore cursor animation
This regressed in 6edc0cf5ab.
2023-02-11 14:34:56 +00:00
MacDue
63b11030f0 Everywhere: Use ReadonlySpan<T> instead of Span<T const> 2023-02-08 19:15:45 +00:00