Commit graph

43232 commits

Author SHA1 Message Date
thankyouverycool
4aa608aa71 LibGUI+Taskbar+Applets+Applications: Set various windows as Popups
Makes the Audio applet, Taskbar clock, CommandPalette, EmojiPicker,
and Assistant work as Popup windows. Popups are frameless, unmovable,
and unresizable by default, in addition to their preemptive function.
Also sets Assistant not to obey widget min size so its search result
area resizes correctly
2022-11-19 16:04:42 +01:00
thankyouverycool
24d299c9c8 LibGUI+WindowServer+Applets+Taskbar: Remove active input concepts
and the CaptureInput mode. They are a source of unneeded complexity
in WindowServer and have proven prone to regressions, so this patch
replaces them with a simple input preemption scheme using Popups.

Popup windows now have ergonomics similar to menus: When open,
a popup preempts all mouse and key events for the entire window
stack; however, they are fragile and will close after WindowServer
swallows the first event outside them. This is similar to how combo
box windows and popups work in the classic Windows DE and has the
added benefit of letting the user click anywhere to dismiss a popup
without having to worry about unwanted interactions with other
widgets.
2022-11-19 16:04:42 +01:00
thankyouverycool
35bd79701c WindowServer: Add request_close_fragile_windows() helper 2022-11-19 16:04:42 +01:00
thankyouverycool
c23adeaaf7 WindowServer: Add foremost_popup_window() helper 2022-11-19 16:04:42 +01:00
thankyouverycool
3027cf7e99 LibGUI+WindowServer: Remove InputPreemptor concept
This functionality will be superceded by WindowType:Popups
2022-11-19 16:04:42 +01:00
thankyouverycool
5d567565a4 LibGUI+WindowServer: Replace WindowInput{Enter,Leave} Events
with WindowInput{Preempted,Restored} Events and allow Widgets to save
the state of their focus preemption. As of now, only Popups will
preempt input and trigger these events.
2022-11-19 16:04:42 +01:00
thankyouverycool
901878bad9 LibGUI: Use move_cursor() API for AutocompleteProvider
Fixes failure to update focus rect when moving between items.
2022-11-19 16:04:42 +01:00
thankyouverycool
2c58902939 LibGUI: Use WindowType:Autocomplete for AutocompleteProvider
And fix its inability to focus/resize correctly.
2022-11-19 16:04:42 +01:00
thankyouverycool
1718a40ac7 LibGUI+WindowServer: Add WindowType:Autocomplete and helpers 2022-11-19 16:04:42 +01:00
Julian Offenhäuser
0bc3333740 LibPDF: Parse integer numbers with atoi() instead of strtof()
strtof() produces rounding errors for very large numbers, which we
don't want for integers, as they may have to be precise.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
c2ad29c85f LibPDF: Implement png predictor decoding for flate filter
For flate and lzw filters, the data can be transformed by this
predictor function to make it compress better. For us this means that
we have to undo this step in order to get the right result.

Although this feature is meant for images, I found at least a few
documents that use it all over the place, making this step very
important.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
4bd79338e8 LibPDF: Fix off-by-one error in Reader::remaining() 2022-11-19 15:42:08 +01:00
Julian Offenhäuser
4b1a72ff7a LibPDF: Fix loop condition in parse_xref_stream()
We previously compared two unrelated values to determine if we parsed
the xref table to completion. We now check if we added every subsection
instead, and double check to make sure we never read past the end.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
a17a23a3f0 LibPDF: Make some variable names in parse_xref_stream() more clear
I found these to be a bit misleading.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
f926dfe36b LibPDF: Implement the DCT filter
This filter basically tells us that we are dealing with a JPEG.
Note that by serializing the resulting image we assume that this filter
is the last one in the chain, everything else would be highly unlikely.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
baaf42360e LibPDF: Derive alternate ICC color space from the number of components
We currently don't support ICC color spaces and fall back to a "simple"
one instead.

If no alternative is specified however, we are allowed to pick the
closest match based on the number of color components.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
16ed407c01 LibPDF: Support cascading stream filters
You can specify multiple filters as an array, where each one is fed the
output of the one before it.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
becd648a78 LibPDF: Parse hexadecimal values in name objects correctly 2022-11-19 15:42:08 +01:00
Julian Offenhäuser
0308300b78 PDFViewer: Take the mousewheel delta into account for scrolling
We now respect the system-wide setting for scroll speed, where we would
previously use a fixed step.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
9b1331a984 PDFViewer: Simplify user-facing error messages
We now show a simple, if less helpful, message to the user and print
the verbose error message to serial instead.
2022-11-19 15:42:08 +01:00
Julian Offenhäuser
e782d03f96 PDFViewer: Invalidate document when a page fails to load
This fixes an issue where we would show an error message on every
subsequent paint event, making it impossible to close or use the
application further.

Some more architectural work is needed if we want to invalidate the
sidebar entries as well.
2022-11-19 15:42:08 +01:00
thankyouverycool
ef30073127 LibGUI: Let Delete remove selections greater than 1 in GlyphMapWidget
Updates keydown_event() to work with the new bubbling mechanism
for action shortcuts.
2022-11-19 15:41:09 +01:00
thankyouverycool
92a75ccaed FontEditor: Include file basename in error messages when available
And write messages in the [action] failed: [error] format to match
common error message formatting elsewhere in Userland.
2022-11-19 15:41:09 +01:00
thankyouverycool
9725fd162f LibGUI+Applications: Allow GlyphMapWidget's set_font() to fail
And TRY early during initialization in FontEditor to leave the app
in a valid state on error. Fixes OOM crashes when cloning the original
font for highlight modifications.
2022-11-19 15:41:09 +01:00
thankyouverycool
1be830e3c6 LibGfx: Add pure virtual fallible clone() for Fonts 2022-11-19 15:41:09 +01:00
thankyouverycool
d9fb838cf6 LibGUI+FontEditor: Allow system emoji to be toggled in GlyphMapWidget
And remove their red backgrounds when visible to not be confused with
deletion highlights.
2022-11-19 15:41:09 +01:00
thankyouverycool
c974e644ec FontEditor: Add Layout options to View menu
Like other apps, FontEditor now organizes widget visibility toggles
under a View->Layout submenu. The main toolbar and the status bar
can now be turned on and off.
2022-11-19 15:41:09 +01:00
thankyouverycool
61d93092cf FontEditor: Remove redundant set_scale() helper 2022-11-19 15:41:09 +01:00
thankyouverycool
8f7dbf363e FontEditor: Remove overzealous find-and-replace ""sv operator 2022-11-19 15:41:09 +01:00
thankyouverycool
894b41ef4d FontEditor: Consolidate GlyphEditor's flip_{horizontally,vertically} 2022-11-19 15:41:09 +01:00
thankyouverycool
d867871bda FontEditor: Standardize Gfx::RotationDirections for rotate_90() 2022-11-19 15:41:09 +01:00
Andreas Kling
fb00d3ed25 Kernel+lsirq: Track per-CPU IRQ handler call counts
Each GenericInterruptHandler now tracks the number of calls that each
CPU has serviced.

This takes care of a FIXME in the /sys/kernel/interrupts generator.

Also, the lsirq command line tool now displays per-CPU call counts.
2022-11-19 15:39:30 +01:00
Andreas Kling
94b514b981 Kernel: Add MAX_CPU_COUNT global constant
Instead of just hard-coding the x86 Processor array to size 64,
we now use a named constant that you can also reference elsewhere. :^)
2022-11-19 15:39:30 +01:00
Andreas Kling
9b3db63e14 Kernel: Rename GenericInterruptHandler "invoking count" to "call count" 2022-11-19 15:39:30 +01:00
MacDue
8a5d2be617 Everywhere: Remove unnecessary mutable attributes from lambdas
These lambdas were marked mutable as they captured a Ptr wrapper
class by value, which then only returned const-qualified references
to the value they point from the previous const pointer operators.

Nothing is actually mutating in the lambdas state here, and now
that the Ptr operators don't add extra const qualifiers these
can be removed.
2022-11-19 14:37:31 +00:00
MacDue
66a428ae03 LibJS+LibWeb: Return non-const types from Ptr class operators
Even if the pointer value is const, the value they point to is not
necessarily const, so these functions should not add the qualifier.

This also removes the redundant non-const implementations of these
operators.
2022-11-19 14:37:31 +00:00
MacDue
3483407ddc AK: Return non-const types from Ptr class operators
Even if the pointer value is const, the value they point to is not
necessarily const, so these functions should not add the qualifier.

This also removes the redundant non-const implementations of these
operators.
2022-11-19 14:37:31 +00:00
Jamie Mansfield
24caacfe28 LibJS: Add spec comments to TypedArray.prototype.entries 2022-11-19 14:23:28 +00:00
Jamie Mansfield
67ed3e1d93 LibJS: Add spec comments to TypedArray.prototype.keys 2022-11-19 14:23:28 +00:00
Jamie Mansfield
db00097700 LibJS: Match spec behaviour in TypedArray.prototype.join
This corrects 2 TRYs to MUSTs and a replaces a call to is_nullish to
is_undefined.
2022-11-19 14:23:28 +00:00
Jamie Mansfield
5341af6225 LibJS: Add spec comments to TypedArray.prototype.join 2022-11-19 14:23:28 +00:00
Jamie Mansfield
70a4e4bd67 LibJS: Add missing assert to TypedArray.prototype.indexOf 2022-11-19 14:23:28 +00:00
Jamie Mansfield
80d2d3812a LibJS: Add spec comments to TypedArray.prototype.indexOf 2022-11-19 14:23:28 +00:00
Jamie Mansfield
f1b4412005 LibJS: Add missing assert to TypedArray.prototype.includes 2022-11-19 14:23:28 +00:00
Jamie Mansfield
34f27f76ec LibJS: Add spec comments to TypedArray.prototype.includes 2022-11-19 14:23:28 +00:00
Jamie Mansfield
43456ad708 LibJS: Add spec comments to TypedArray.prototype.reduceRight 2022-11-19 14:23:28 +00:00
Jamie Mansfield
364d873e33 LibJS: Add spec comments to TypedArray.prototype.reduce 2022-11-19 14:23:28 +00:00
Jamie Mansfield
d7654aebd7 LibJS: Match spec behaviour in TypedArray.prototype.fill
This just replaces an instance where TRY was used when MUST should
have been, reflecting the difference between ? and ! in the spec.
2022-11-19 14:23:28 +00:00
Jamie Mansfield
d492887dcd LibJS: Add spec comments to TypedArray.prototype.fill 2022-11-19 14:23:28 +00:00
Andreas Kling
524baa29e8 LibC+Tests: Simplify getpwuid_r() and getpwnam_r() and add tests
These functions are now implemented in terms of getpwent_r() which
allows us to remove two FIXMEs about global variable shenanigans.

I'm also adding tests for both APIs. :^)
2022-11-19 11:11:13 +01:00