Commit graph

29566 commits

Author SHA1 Message Date
Sam Atkins
e58db5592e ThemeEditor: Update value edit boxes when loading a theme file
Previously, these would continue to show the previously entered values,
until you interacted with the ComboBoxes.
2021-10-28 11:23:44 +02:00
Sam Atkins
684f8a6b15 ThemeEditor: Add MetricRole editing
The editing UI at the bottom is now split into two groups, one for
colors and one for metrics.
2021-10-28 11:23:44 +02:00
Sam Atkins
859975f6bd LibGUI: Add MetricRole and PathRole to GUI::Variant
This is needed for making them editable in the ThemeEditor, like
ColorRole is.
2021-10-28 11:23:44 +02:00
Sam Atkins
31ce4d04b6 LibGfx: Add to_string() functions for MetricRole and PathRole 2021-10-28 11:23:44 +02:00
Sam Atkins
c885722a94 ThemeEditor: Convert layout to GML 2021-10-28 11:23:44 +02:00
Sam Atkins
daaf5890a6 ThemeEditor: Display window shadows in preview :^) 2021-10-28 11:23:44 +02:00
Sam Atkins
885ca2f968 LibGfx+WindowServer: Move shadow-painting code to StylePainter
Specifically, this is to make it accessible to ThemeEditor, but there's
nothing about it that is especially window-specific.
2021-10-28 11:23:44 +02:00
Sam Atkins
cf188df86c LibGfx: Make style painters use east const and virtual specifiers 2021-10-28 11:23:44 +02:00
Sam Atkins
ab1ce13eea ThemeEditor: Give both preview windows a background color
The inactive window previously didn't have a background fill, so it
looked odd.
2021-10-28 11:23:44 +02:00
Jelle Raaijmakers
770c1935d4 MouseSettings: Reset the double-click timer after every second click
The old behavior of restarting the timer after every second click could
result in double-click-chains (or triple+ clicks), which does not feel
like the right behavior.

By resetting the double-clicking timer, you need to perform a new full
double-click to make the arrows change color again.
2021-10-28 11:21:18 +02:00
Jelle Raaijmakers
7c939c58b8 LibCore: Add ElapsedTimer::reset() 2021-10-28 11:21:18 +02:00
Jelle Raaijmakers
ae405ed2eb Ports: Disable MAME FMOPL emulation in ScummVM
It crashes with an unrecoverable page fault. The DOSBox emulation works
fine however, so let ScummVM default to that engine for now.
2021-10-28 00:23:30 +02:00
Jelle Raaijmakers
5f5fe16d4b Ports: Disable SVG in ScummVM themes
The ScummVM modern remastered theme contains SVG images that are
rendered through NanoSVG. Somehow, the ScummVM logo gets all messed up,
but all other SVGs render nicely.

It takes a lot of time to debug NanoSVG, so disable loading SVGs in
themes for now so BMPs are used instead.
2021-10-28 00:23:30 +02:00
Jelle Raaijmakers
3941e4fe24 Ports: Prevent exporting symbols for ScummVM
Both LibGUI and ScummVM have a GUI::Widget class. This interferes with
normal operation of LibGUI, since the wrong GUI::Widget::~Widget() is
invoked when SerenitySDLWidget (from the SDL2 port) is destructed.

By adding `-fvisibility=hidden` to the compiler flags, we set the
symbol visibility to hidden by default and the correct destructor is
invoked again.
2021-10-28 00:23:30 +02:00
Jelle Raaijmakers
59b2bac3a5 Ports: Update ScummVM to 2.5.0 2021-10-28 00:23:30 +02:00
Filiph Sandström
c6247fe414 Everywhere: Rename back-click to backward-click
This matches the current forward-click terminology.
2021-10-27 22:05:58 +03:00
Filiph Sandström
d6a0726302 Everywhere: Rename left/right-click to primary/secondary
This resolves #10641.
2021-10-27 22:05:58 +03:00
Ben Wiederhake
a6ccf6659a Meta: Reimplement license checker in python
On my machine, this script took about 3.4 seconds, and was responsible
for essentially all of the time taken by the precommit hook.

The script is a faithful 1:1 reimplementation, even the regexes are
identical. And yet, it takes about 0.02 seconds, making the pre-commit
hook lightning fast again. Apparently python is just faster in this
case.

Fun fact:
- Just reading all ~4000 files took bash about 1.2 seconds
- Checking the license took another 1.8 seconds in total
- Checking for math.h took another 0.4 seconds in total
- Checking for '#pragma once' took another 0.4 seconds in total

The timing is highly load-dependent, so they don't exactly add up to 3.4
seconds. However, it's good enough to determine that bash is no longer
fit for the purpose of this script.
2021-10-27 11:35:47 -07:00
Ben Wiederhake
074ce35b37 Piano: Fix typo in Copyright header
This was introduced in 74f1f2b5e2.
I have no idea why the checker script didn't pick it up. Bash bug maybe?
2021-10-27 11:35:47 -07:00
Andreas Kling
f6573f5f9d LibWeb: Don't create anonymous table boxes around whitespace
This was confusing table layout by adding empty whitspace table boxes
that wound up stealing a bunch of horizontal space.
2021-10-27 18:22:00 +02:00
Andreas Kling
ca154723f7 LibWeb: Remove Layout::Box::width_of_logical_containing_block()
This was a hack to percentages within tables relative to the nearest
table-row ancestor instead of the nearest table container.

That didn't actually make sense, so this patch simply removes the hack
in favor of containing_block()->width().
2021-10-27 18:00:51 +02:00
Andreas Kling
4333d0d639 LibWeb: Add fast_is<T>() for HTML::HTMLHtmlElement
Another one spotted in a scroll-up-and-down profile.
2021-10-27 17:58:57 +02:00
Andreas Kling
c908fa83e3 LibWeb: Add fast_is<T>() for Layout::Label
Spotted this in a profile while wheel scrolling up & down.
2021-10-27 17:58:19 +02:00
Liav A
8554952690 Kernel + WindowServer: Re-define the interface to framebuffer devices
We create a base class called GenericFramebufferDevice, which defines
all the virtual functions that must be implemented by a
FramebufferDevice. Then, we make the VirtIO FramebufferDevice and other
FramebufferDevice implementations inherit from it.
The most important consequence of rearranging the classes is that we now
have one IOCTL method, so all drivers should be committed to not
override the IOCTL method or make their own IOCTLs of FramebufferDevice.
All graphical IOCTLs are known to all FramebufferDevices, and it's up to
the specific implementation whether to support them or discard them (so
we require extensive usage of KResult and KResultOr, together with
virtual characteristic functions).
As a result, the interface is much cleaner and understandable to read.
2021-10-27 07:57:44 +03:00
Liav A
78e724a899 Kernel/Graphics: Rename GraphicsDevice => GenericGraphicsAdapter
We already use the term adapter for instances of this class, so let's
better represent this class by changing its name to what it really is.
2021-10-27 07:57:44 +03:00
Liav A
c7eb761b7f Kernel/Graphics: Re-order parameters in VirtIO GraphicsAdapter methods
As suggested by @ccapitalK, it makes the interface more neat and clean.
The proper order is to get ScanoutID first, then ResourceID and after it
everything else that is needed to complete the operation successfully.
2021-10-27 07:57:44 +03:00
Liav A
f476b49fd8 Kernel/Graphics: Merge VirtIO GraphicsAdapter and VirtIO GPU code
A VirtIO graphics adapter is really the VirtIO GPU, so the virtualized
hardware has no distinction between both components so there's no
need to put such distinction in software.

We might need to split things in the future, but when we do so, we must
take proper care to ensure that the interface between the components
is correct and use the usual codebase patterns.
2021-10-27 07:57:44 +03:00
Liav A
a9538b5879 Kernel/Graphics: Convert type method => bool vga compatible method
We never used that type method except in initialization in
GraphicsManagement, and we used it there to query whether the device is
VGA compatible or not.
2021-10-27 07:57:44 +03:00
Liav A
fb0ed2ae46 Kernel/Graphics: Force VirtIO Framebuffer to inherit FramebufferDevice
The distinction is not justified because a VirtIO Framebuffer device
acts much more like a regular FramebufferDevice than a pure BlockDevice.
2021-10-27 07:57:44 +03:00
Liav A
4815282a5f Kernel/Graphics: Rename VirtIO FrameBufferDevice => FramebufferDevice 2021-10-27 07:57:44 +03:00
Luke Wilde
fb321bad35 LibWeb: Implement URLSearchParams.getAll 2021-10-26 23:11:57 +02:00
Linus Groh
09d1db5afd LibJS: Clarify mathematical types in Temporal AOs and functions
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/e480d40
2021-10-26 23:10:11 +02:00
Felix Rauch
30c39e0e41 LibWeb: Fix inline blocks swallowing trailing whitespace
In #10434 an issue with leading whitespace in new lines after
a <br> element was fixed by checking whether the last fragment
of LineBox is empty.

However, this introduced a regression by which whitespace following
inline elements was swallowed, so `<b>Test</b> 123` would appear
like `Test123`.

By asking specifically if we are handling a forced linebreak
instead of implicity asking for a property that may be shared by
other Node types, we can maintain the correct behavior in regards
to leading whitespace on new lines, as well as trailing whitespace
of inline elements.
2021-10-26 17:27:04 +02:00
Sam Atkins
7426feacf7 Base: Map numpad '.' key to '.' instead of ',' in en-GB keymap 2021-10-26 16:51:42 +02:00
Idan Horowitz
4f1d45705f Demos: Remap mouse button events to physical buttons in MouseDemo
This ensures we paint the left button as clicked when the left mouse
button is pressed (and vice-versa with the right one) when the right
mouse button is set as the primary one in the mouse settings.
2021-10-26 16:51:29 +02:00
Idan Horowitz
14223a9c20 Demos: Change MouseDemo's window title to "Mouse demo"
The previous title ("Mouse button demo") didn't fit in the window's
titlebar, which looked pretty bad.
2021-10-26 16:51:29 +02:00
Andreas Kling
e0f0b6379a Kernel: Make WorkQueue::WorkItem slab allocated 2021-10-26 10:50:44 +02:00
Andreas Kling
44b273f3ac Kernel: Use SpinlockProtected<T> in WorkQueue 2021-10-26 10:44:10 +02:00
Andreas Kling
b443e9e1a9 Kernel: Use a larger kmalloc chunk size on 64-bit platforms
This reduces test-js runtime by over 40% on my machine.

(And once again we find another way to defer writing a better kernel
heap allocator..)
2021-10-26 10:38:35 +02:00
Andreas Kling
25250590d0 Kernel: Take VMObject lock once in Region::remap_vmobject_page()
We were taking and releasing the lock repeatedly instead of holding it
across the entire remap operation.
2021-10-26 09:03:41 +02:00
Andreas Kling
821c80848f LibC: Remove debug spam from openpty() 2021-10-26 08:47:06 +02:00
Andreas Kling
fac6d220c3 WindowServer: Don't re-open screen device immediately after opening it
The Screen constructor already calls open_device(), so there's no need
to call it again right after creating a new Screen in apply_layout().

This makes the first screen compose happen ~50ms earlier on my machine.
2021-10-26 01:00:54 +02:00
Andreas Kling
693423bbe8 WindowServer: Remove Screen::init()
This function only did one thing: call Screen::set_resolution().
We always call that function when opening the underlying device anyway,
so this was completely redundant.

This makes the first screen compose happen ~60ms earlier on my machine.
2021-10-26 01:00:54 +02:00
Andreas Kling
47c140610d AK: Prefix debug log messages with current-time-since-boot
This is very helpful when trying to better understand how long certain
things take. :^)
2021-10-26 01:00:54 +02:00
Andreas Kling
0592f80186 Kernel: Add TimeManagement::is_initialized()
This allows clients to check whether TimeManagement is available before
trying to ask it about time related things.
2021-10-26 01:00:54 +02:00
Ben Wiederhake
bf88adbcb6 Kernel: Avoid allocation when checking for vmmouse 2021-10-25 23:38:28 +02:00
Ben Wiederhake
3d855a801b SystemServer: Rename 'BootModes' config option to 'SystemModes' 2021-10-25 23:38:28 +02:00
Ben Wiederhake
8d13f6ddce Kernel+SystemServer: Change bootmode to system_mode
'bootmode' now only controls which set of services are started by
SystemServer, so it is more appropriate to rename it to system_mode, and
no longer validate it in the Kernel.
2021-10-25 23:38:28 +02:00
Ben Wiederhake
09432a8241 Kernel: Separate panic behavior from bootmode
Bootmode used to control panic behavior and SystemServer.
This patch factors panic behavior control into a separate flag.
2021-10-25 23:38:28 +02:00
Ben Wiederhake
542a88a7be Kernel: Separate framebuffers from bootmode
Bootmode used to control framebuffers, panic behavior, and SystemServer.
This patch factors framebuffer control into a separate flag.
Note that the combination 'bootmode=self-test fbdev=on' leads to
unexpected behavior, which can only be fixed in a later commit.
2021-10-25 23:38:28 +02:00