Commit graph

44501 commits

Author SHA1 Message Date
Jelle Raaijmakers 99c1b634fc AK: Stop using DeprecatedString in UUID 2022-12-20 10:34:19 +01:00
EWouters f050a426f5 Ports: Add grepcidr port 2022-12-20 10:33:00 +01:00
Baitinq 75ea339ee9 LibGUI: Fix bug in the ColorPicker's spinbox not changing colors
Before this patch, when having the initial spinbox color value
(Color::White), if you changed the color value in the vertical color
picker it didn't update the spinbox's colors.

This is fixed by manually calling update() in the color picker's
onchange() handler if the new color is equal to the previous color,
which is the case in the initial spinbox's case as it will always be
white unless it is changed (and won't be affected by the vertical
color picker).

I added a NOTE in the source to explain this "opaque" update() call :))
2022-12-20 10:30:06 +01:00
Rodrigo Tobar 89061883f2 PDFViewer: Prompt password for encrypted documents
This tackles a FIXME, but also makes sense to implement only now that
the SecurityHandler logic has been fixed. When a Document is created an
automatic attempt is made to provide the empty string as the password;
even if this attempt failed the SecurityHandler still reported it had a
user password, hence we never arrived to the VERIFY_NOT_REQUIRED line
this commit is changing.
2022-12-20 10:28:58 +01:00
Rodrigo Tobar bb48a67f84 LibPDF: Reset encryption key on failed user password attempt
When an attempt is made to provide the user password to a
SecurityHandler a user gets back a boolean result indicating success or
failure on the attempt. However, the SecurityHandler is left in a state
where it thinks it has a user password, regardless of the outcome of the
attempt. This confuses the rest of the system, which continues as if the
provided password is correct, resulting in garbled content.

This commit fixes the situation by resetting the internal fields holding
the encryption key (which is used to determine whether a user password
has been successfully provided) in case of a failed attempt.
2022-12-20 10:28:58 +01:00
Rodrigo Tobar dc6a11cf6b LibPDF: Treat Encyption's Length item as optional
With the StandardSecurityHandler the Length item in the Encryption
dictionary is optional, and needs to be given only if the encryption
algorithm (V) is other than 1; otherwise we can assume a length of 40
bits for the encryption key.
2022-12-20 10:28:58 +01:00
Rodrigo Tobar b8dc05a08e PDFViewer: Fix indexing error in ErrorsView
I confused myself when implementing this, plus I tested using pages that
had errors in pages 1 and 2, so the index and the number of the page
(internally represented as 0-indexed) was always the same. When opening
files with errors on higher pages it became evident that there was an
issue with how I was reading the errors per page from the corresponding
ModelIndex object.
2022-12-20 10:28:58 +01:00
Bruno Conde 7e9019a9c3 LibGfx: Support BMP favicons with less than 32 bpp
Adapt BMPImageDecoderPlugin to support BMP images included in ICOns.
ICOImageDecoderPlugin now uses BMPImageDecoderPlugin to decode all
BMP images instead of it's own ad-hoc decoder which only supported
32 bpp BMPs.
2022-12-20 10:26:55 +01:00
thankyouverycool 91609f9327 FontEditor: Update preview window after pasting and deleting glyphs 2022-12-20 10:22:27 +01:00
thankyouverycool 96d7964913 FontEditor: Add Unicode block/glyph selection Statusbar Segment
Displays the current active Unicode block range, or, if multiple
glyphs are selected, their count. Clicking toggles the Unicode
block ListView.
2022-12-20 10:22:27 +01:00
thankyouverycool 40e94a315a LibGUI+FontEditor: Restore normalized selections on Undo/Redo
Selections are always normalized when saving undo commands.
The restore_selection() function reverses this process so
negatively sized selections (created right-to-left) continue
to resize correctly with the keyboard when restored.
2022-12-20 10:22:27 +01:00
thankyouverycool 02212f373b LibGUI: Reset GlyphMapWidget scroll value when changing active range
Fixes being teleported to the old location when scrolling on a
previously browsed range.
2022-12-20 10:22:27 +01:00
thankyouverycool d973d43b13 LibGUI: Focus the actively resizing end of GlyphMapWidget selections 2022-12-20 10:22:27 +01:00
thankyouverycool 673afffd5a LibGUI: Only reset GlyphMapWidget selection on Escape
and when using unmodified arrows.
2022-12-20 10:22:27 +01:00
thankyouverycool 4c81fbc8c4 LibGUI: Add Page{Up,Down} support for GlyphMapWidget 2022-12-20 10:22:27 +01:00
thankyouverycool a98d5c52f8 LibGUI: Improve visible glyph estimate in GlyphMapWidget
Previously the widget used a very rough estimate for visible glyphs
based on viewport and glyph areas. Now it simply figures rows times
columns with a two row overdraw to accommodate fractional glyphs
on either end of visible content. For KaticaRegular10, this ends up
reducing unnecessary glyph iterations during painting by about 30%.
2022-12-20 10:22:27 +01:00
thankyouverycool e34503800c LibGUI: Adjust GlyphMapWidget content sizing and glyph padding
Fixes a slightly oversized content rect and erroneous glyph outer
rect values. Increases glyph rect padding to guarantee at least 1px
between the focus rect and glyph.
2022-12-20 10:22:27 +01:00
thankyouverycool 0f5ce017c5 LibGUI: Implement calculated_min_size() for GlyphMapWidget 2022-12-20 10:22:27 +01:00
thankyouverycool c4ac73d073 LibGUI: Check bounds when moving GlyphMapWidget selections
Fixes crashing on invalid code points when creating selections
with the keyboard and applying actions to them.

Also adds Home/End key support for selections. Ctrl+Shift+{Home,End}
now extends the selection to the beginning or end of the active range,
respectively. Shift+{Home,End} extends the selection to the start or
end of the row. Alt+{Home,End} resets the selection and moves the
active glyph to the beginning or end of the active range.
2022-12-20 10:22:27 +01:00
thankyouverycool 12cd30f1ac LibGUI: Ensure GlyphMapWidget selection resets when requested
Previously selection reset was ignored on active glyph change if the
old glyph equaled the new one. This was an intentional behavior that
allowed selections to resize by dragging the focused glyph, but has
proved more counterintuitive than useful.

Now the widget behaves like other text selection controls: selections
can be reset by clicking anywhere in them or shift can be held to
grow the selection.
2022-12-20 10:22:27 +01:00
thankyouverycool 360e58a276 LibGUI: Disallow GlyphMapWidget selection sizes equal to zero
This is a bogus size as the map must always have at least 1 glyph
selected, and it was causing occasional desync between selection
contents and the focused glyph when manipulating selections with
the keyboard.
2022-12-20 10:22:27 +01:00
thankyouverycool 8d3f60c7ef LibGUI: Forward GlyphMapWidget Key_Tab events
Allows focus to be passed using the keyboard.
2022-12-20 10:22:27 +01:00
thankyouverycool 61d214eab1 FontEditor: Set Unicode ListView's focus proxy to its search box
Provides a visual cue that arrow key input is shared between these
widgets.
2022-12-20 10:22:27 +01:00
thankyouverycool b8969ffe97 FontEditor: Remove unused includes 2022-12-20 10:22:27 +01:00
Karol Kosek 9b3335723f TextEditor: Suggest saving new files with an extension from highlighter 2022-12-19 14:13:50 -05:00
Karol Kosek c75bfa9cda LibSyntax: Add common_language_extension() function
The main motivation for this is to prefill an extension for user when
saving a new file.
2022-12-19 14:13:50 -05:00
Karol Kosek fb61b3d41d LibSyntax: Remove default switch case in language_to_string()
This way we can get a compiler error about unhandled new language cases,
instead of a possible crash when running a program.

Also added a missing case to make it build now.
2022-12-19 14:13:50 -05:00
Karol Kosek b00865bce5 LibSyntax+TextEditor: Move Highlighter::language_string() out of class 2022-12-19 14:13:50 -05:00
Baitinq 3c2227ceed Snake: Ignore default keydown events
Before this patch, all key down events except arrow keys or WASD were
not propagated, so keyboard shortcuts in the application didn't work.

This patch fixes this :))
2022-12-19 14:11:53 -05:00
Baitinq 89c6d41e9c Snake: Add snake color chooser game menu action
This patch makes use of a new "set_snake_base_color()" function to
change the snake's base color to the picked value.
2022-12-19 14:11:53 -05:00
Baitinq 56a75ec94e Snake: Don't hardcode the snake painting logic
This patch adds a m_snake_base_color variable which dictates the color
of the head of the snake and from which the rest of the snake color's
are derived from by darkening the base color.
2022-12-19 14:11:53 -05:00
Baitinq b354e858c8 Snake: Add pause/continue game menu action
This patch adds an action in the Snake's game menu that allows for easy
pausing/unpausing of the game state.

In order to do this, the commit adds new pause()/start() functions in
the SnakeGame class ;)
2022-12-19 14:11:53 -05:00
MacDue 3de5dcf383 Browser+WebContent: Fixup some DOM inspector weirdness
This fixes a few things I noticed whilst working on the inspector
for Ladybird.

1.
The computed and resolved values were being passed swapped around
from the inspect_dom_node() IPC call. I.e. computed values were
passed as resolved values and vice versa. This was then fixed by
swapping them again in the InspectorWidget (two errors canceled out).

2.
Resolved values were called "specified values" seemingly only in the
inspect_dom_node() IPC calls. This was a little confusing so I've
renamed them to back to "resolved values" for consistency.

3.
The inspector took and stored the DOM JSON strings unnecessarily,
all the models immediately parse the JSON and don't need the strings
to hang around.
2022-12-19 11:37:56 -05:00
MacDue e3ad5731f7 Browser: Close inspectors and JS console when tab closes
Keeping these around can lead to use-after-frees and crashes.
2022-12-19 11:37:56 -05:00
MacDue 9dea61e095 Meta: Include StylePropertiesModel.cpp in lagom LibWebView 2022-12-19 11:37:56 -05:00
MacDue 88e50869f1 LibWeb: Fix crash when serializing nodes for DOM inspector
Noticed this trying to inspect GitHub, you'd get a segfault due to the
parent node being null here.
2022-12-19 11:37:56 -05:00
Andreas Kling f11e6beca8 AK: Use __has_builtin() in Checked.h
Instead of avoiding overflow-checking builtins with AK_COMPILER_CLANG,
we can use the preprocessor's __has_builtin() mechanism to check if
they are available.
2022-12-19 09:29:12 -05:00
0xxFF c4bc889346 Documentation: Adjust default TARGET to x86_64 in the documentation 2022-12-19 09:00:34 -05:00
implicitfield 39fc7359d4 FileManager: Clear the selection after deleting files 2022-12-19 08:03:24 -05:00
Keir Davis f639445456 LibWeb: Fully Implement get_an_elements_noopener
This removes two fix me in HTMLHyperlinkElementUtils
2022-12-19 07:57:44 -05:00
Jelle Raaijmakers 9feac465dc LibCore: Convert explicit timezone to local in DateTime::parse
When we encounter an explicit timezone, we shift the time to UTC.
Because we rely on `mktime`, we need to shift it to the local time
before proceeding. If no explicit timezone is provided, local timezone
is assumed.

This fixes the "timezone-offset extension" LibJS test running on
machines with a non-UTC timezone offset.

Co-authored-by: Timothy Flynn <trflynn89@pm.me>
2022-12-19 07:07:49 -05:00
Liav A 1ea10bcb73 LibGfx: Split VERIFY statements in various Bitmap class methods
This could aid debugging in many cases, and it doesn't break any
functionality, so let's ensure it's easier to understand in which way a
provided value is out of range.
2022-12-19 11:05:44 +00:00
Liav A efae6e2270 Kernel/Graphics: Propagate errors properly around in the VirtIO driver
This happens to be a sad truth for the VirtIOGPU driver - it lacked any
error propagation measures and generally relied on clunky assumptions
that most operations with the GPU device are infallible, although in
reality much of them could fail, so we do need to handle errors.

To fix this, synchronous GPU commands no longer rely on the wait queue
mechanism anymore, so instead we introduce a timeout-based mechanism,
similar to how other Kernel drivers use a polling based mechanism with
the assumption that hardware could get stuck in an error state and we
could abort gracefully.

Then, we change most of the VirtIOGraphicsAdapter methods to propagate
errors properly to the original callers, to ensure that if a synchronous
GPU command failed, either the Kernel or userspace could do something
meaningful about this situation.
2022-12-19 10:19:57 +00:00
Liav A 12d4bbbd11 Kernel/Graphics: Disable double buffering for the VirtIO driver
The performance that we achieve from this technique is visually worse
compared to turning off this feature, so let's not use this until we
figure out why it happens.
2022-12-19 10:19:57 +00:00
Liav A bb491a681d Kernel: Properly propagate errors in VirtIOGPU 3D device initialization 2022-12-19 10:19:57 +00:00
Nico Weber 1a85539741 Meta: Find mke2fs on macOS even if HOMEBREW_PREFIX is not set
...as long as `brew` is on the path and `brew --prefix e2fsprogs`
tells us where it is.

This is for people who don't have `"$(brew shellenv)"` in their .zshrc.
2022-12-18 17:49:49 -07:00
Nico Weber 15ce757f12 Meta: Disable gdbstub when running under HVF on macOS
Without this, `serenity.sh run` fails with

    gdbstub: current accelerator doesn't support guest debugging

on an intel mac.
2022-12-18 17:46:29 -07:00
Matt Purnell 0bda06c9c5 LibWeb: Don't const_cast layout_box() when calling const functions
layout_box() already has a non-const overload, so we don't need to
const_cast them anymore. This gets rid of 2 FIXMEs. :^)
2022-12-18 12:56:33 +01:00
Stephan Unverwerth 28ad49bcbd LibGL: Pass generated GPU IR to GPU side compiler when linking program 2022-12-17 22:39:09 -07:00
Stephan Unverwerth c25359df47 LibSoftGPU: Delegate shader creation to new class ShaderCompiler 2022-12-17 22:39:09 -07:00