Commit graph

18148 commits

Author SHA1 Message Date
Nick Johnson ddcef0452a NotificationServer: Close connection on notification close
When the notification was closed, the connection was kept around. This
caused the core event loop to take up nearly all CPU, so instead of
checking the connection we clear it on close and add state variables
to check state.
2021-03-22 12:46:16 +01:00
Nick Johnson 9d09594e44 Notification: Remove default image
This takes up a lot of space if it is not used, and the default image
does not give value. Therefore, we hide the image widget if an invalid
image is passed.
2021-03-22 12:46:16 +01:00
Nick Johnson c7f00717c3 Notification: Use RefPtr for connection
With this RefPtr, we can initialize the connection to the
NotificationServer upon showing the notification. With this, we can
prevent double shows and updates or closes before showing.
2021-03-22 12:46:16 +01:00
Nick Johnson e17752fc91 Notification: Use on_close
on_close_request is not called at any point if close is explicitly
called, so we must instead use on_close.
2021-03-22 12:46:16 +01:00
Nick Johnson 8f6894d250 LibGUI+Notification: Add mutable notifications
This commit puts all of the remaining pieces in place. This adds a
mechanism to update the text, title, and icon of an image. If an image
is not provided, the default ladybug will be shown.
2021-03-22 12:46:16 +01:00
Nick Johnson 147a2c4ca2 Notification: Prevent showing a closed window
If a notification was closed, the connection will now be dead. To
prevent inconsistencies between when a user closes a notification and
when an application closes an applicated, check if the notification has
been closed before allowing any action.
2021-03-22 12:46:16 +01:00
Nick Johnson 0fd1e6f062 LibGUI+Notification: Add notification closing
Closing a notification will now allow it to be shown again, as
m_showing being false means it can be re-shown.
2021-03-22 12:46:16 +01:00
Nick Johnson ef4144c183 Notification: Member-ize updatable components
Changes the necessary widgets to be pointers so we can later change
their underlying data.
2021-03-22 12:46:16 +01:00
Nick Johnson f2814dd6c1 Notification: Allow getting window by ID
This is a neccessity so a connection can get the notification it is
connected to for later updates.
2021-03-22 12:46:16 +01:00
Nick Johnson a437430294 Notification: Give a unique internal ID
This will allow us to later query the notifications from a connection
and safely update it without exposing it to any other applications, as
it is session based.
2021-03-22 12:46:16 +01:00
Nick Johnson 7351c77a42 LibGUI+Notification: Use lifetime connection
In order to allow notifications to be updated, we will create a persistent connection for the lifetime of the notification.
2021-03-22 12:46:16 +01:00
Luke dddaa529b2 LibWeb: Advertise that we support the deflate content encoding 2021-03-22 12:45:34 +01:00
Luke 6cad2aba5e LibHTTP: Add support for the deflate content encoding 2021-03-22 12:45:34 +01:00
Andreas Kling 0255c8d976 Only apply auto-naming of function expressions based on syntax
The auto naming of function expressions is a purely syntactic
decision, so shouldn't be decided based on the dynamic type of
an assignment. This moves the decision making into the parser.

One icky hack is that we add a field to FunctionExpression to
indicate whether we can autoname. The real solution is to actually
generate a CompoundExpression node so that the parser can make
the correct decision, however this would have a potentially
significant run time cost.

This does not correct the behaviour for class expressions.

Patch from Anonymous.
2021-03-22 12:44:07 +01:00
Andreas Kling 7241ff3967 LibJS: *Actually* check for negative zero in JS::Value(double)
As @nico pointed out, 0.0 == -0.0 in C++, even though they are not
bitwise identical. Use the same trick as Value::is_negative_zero() to
really check for it.

This allows JS::Value(0.0) to correctly become an Int32-backed 0 value.
2021-03-22 08:06:47 +01:00
AnotherTest 9b68f91c0b Spreadsheet: Add an export wizard, and support for custom CSV exports
Fixes #4269.
2021-03-22 07:43:58 +01:00
AnotherTest bba3a7a2cb Spreadsheet: Ignore empty cells when calculating data bounds
There's no reason to use extra rows/columns to represent empty cells
when exporting.
2021-03-22 07:43:58 +01:00
AnotherTest 8bd138cbbe Spreadsheet/XSV: Make the writer respect QuoteAll
Also make the header container type generic, and name an enum.
2021-03-22 07:43:58 +01:00
AnotherTest 3c151b3de6 Spreadsheet: Add an import wizard, and add support for custom CSV files
Fixes the import half of #4269.
2021-03-22 07:43:58 +01:00
AnotherTest 3bbcde9192 Spreadsheet/XSV: Add at() accessors
These are just aliases for operator[].
Also make the headers() getter return a vector of empty strings when the
csv file has no explicit headers.
2021-03-22 07:43:58 +01:00
AnotherTest 39f3f3be94 LibGUI: Allow ItemListModel to have 2D items
This makes it possible to use it as a model for e.g. TableViews.
2021-03-22 07:43:58 +01:00
AnotherTest 6eeb8225f8 LibGUI: Add a few missing classes to the forwarding header 2021-03-22 07:43:58 +01:00
AnotherTest 714ce4741d LibGUI: Allow a wizard page to return null as its next page 2021-03-22 07:43:58 +01:00
AnotherTest b072cb725f LibGUI: Allow constructing a string Variant from StringView 2021-03-22 07:43:58 +01:00
AnotherTest c1d67d6b17 Spreadsheet: Don't assume that the 'cells' field is an object
It might be missing, or not be an object.
Fixes #4821.
2021-03-22 07:43:58 +01:00
AnotherTest 9f8d518e82 Spreadsheet: Only append new columns/rows every 50ms
Fixes #5550.
2021-03-22 07:43:58 +01:00
Brendan Coles 7191098356 UserspaceEmulator: Add support for SC_abort syscall 2021-03-22 07:43:44 +01:00
Yuval Tasher d2b7500c65 LibGUI: remove empty TODO. 2021-03-22 07:43:26 +01:00
Andreas Kling 14d598fe7f LibJS: Don't try to store negative zero as an Int32 JS::Value 2021-03-21 21:40:10 +01:00
Andreas Kling 6870349599 LibJS: Flatten Value::to_numeric()
The basic idea here is to inline to_primitive() to get rid of the
function call overhead.
2021-03-21 21:39:39 +01:00
Andreas Kling 00965e3dad LibJS: Add fast path for add() with two numeric JS::Values 2021-03-21 21:39:39 +01:00
Andreas Kling 37cd1a95fc LibJS: Only call GlobalObject::vm() once in add() 2021-03-21 21:39:39 +01:00
Andreas Kling c8382c32e9 LibJS: Split Value::Type::Number into Int32 and Double
We now store 32-bit integers as 32-bit integers directly which avoids
having to convert them from doubles when they're only used as 32-bit
integers anyway. :^)

This patch feels a bit incomplete and there's a lot of opportunities
to take advantage of this information. We'll have to find and exploit
them eventually.
2021-03-21 21:39:39 +01:00
Andreas Kling 630d83be8f LibJS: Always inline some tiny Interpreter getters 2021-03-21 21:39:39 +01:00
Andreas Kling e0abfcb27d LibJS: Don't track executing AST nodes in a Vector
Instead just link together the InterpreterNodeScopes in a linked list.
This was surprisingly hot on CanvasCycle.
2021-03-21 21:39:39 +01:00
Andreas Kling 46e61d208b LibJS: Avoid unnecessary FlyString(String) churn in Reference ctors 2021-03-21 21:39:39 +01:00
Andreas Kling 1fb50d823d LibJS: Always inline Cell::vm() and Cell::heap() 2021-03-21 21:39:39 +01:00
Andreas Kling dc8817638e LibJS: Only update anonymous function names when necessary
Previously we would generate function names for anonymous functions
on every AssignmentExpression, even if we weren't assigning a function.

We were also setting names of anonymous functions in arrays, which is
apparently a SpiderMonkey specific behavior not supported by V8, JSC
or required by ECMA262. This patch removes that behavior.

This is a huge performance improvement on the CanvasCycle demo! :^)
2021-03-21 21:39:39 +01:00
Andreas Kling f89c479358 profile: Add -a option as an alias for "-p -1" (all processes) 2021-03-21 16:02:11 +01:00
Andreas Kling 1603623772 LibJS: Move AST node stack from VM to Interpreter 2021-03-21 16:02:11 +01:00
Idan Horowitz b3b8c01ebf LibCompress: Convert GzipDecompressor from recursive to iterative
This way a gzip compressed file that contains a large amount of small
blocks wont cause a stack overflow.
2021-03-21 15:46:35 +01:00
Linus Groh 00bbe76c94 MenuApplets: Remove unused .gitignore files
These are not needed since the switch to CMake and out-of-tree builds.
2021-03-21 15:11:48 +01:00
Liav A 6440beeffe Kernel/AHCI: Shift the call to reset() for the WorkQueue 2021-03-21 13:41:09 +01:00
Liav A 2ae9de77bb Kernel/AHCI: Reorder complete_current_request
Clear the m_current_request before signalling the end of request.
2021-03-21 13:41:09 +01:00
Liav A cfc2f33dcb Kernel/AHCI: Add a boot argument to force AHCI to operate on IRQ 11
As a compromise, if the fimrware decided to set the IRQ line to be 7,
or something else we can't deal with, the user can simply force the code
to work with IRQ 11, with the boot argument "force_ahci_irq_11" being
set to "on".
2021-03-21 13:41:09 +01:00
Liav A 36a82188a8 Kernel/PCI: Allow to set the PCI IRQ line of a device
This will be used later by the AHCI code to set the IRQ line to be 11,
if hardware by mistake changed the value to be something we can't deal
with.
2021-03-21 13:41:09 +01:00
Liav A 6c03fdc1ef Kernel/AHCI: Don't set the PRDBC when accessing the device
This resulted in fatal error when trying to write to real hard drive
I tested, so we only set the counts in the scatter/gather list later.
2021-03-21 13:41:09 +01:00
Liav A 0b1fa97b30 Kernel/AHCI: Use interrupts for IO operations
Instead of polling if the device ended the operation, we can just use
interrupts for signalling about end of IO operation.
In similar way, we use interrupts during device detection.

Also, we use the new Work Queue mechanism introduced by @tomuta to allow
better performance and stability :)
2021-03-21 13:41:09 +01:00
Liav A 21bb7fd5c9 Kernel/AHCI: Add a method to get raw interrupt enable register 2021-03-21 13:41:09 +01:00
Tom 20cccda731 Kernel: Add simplistic work queues
We can't use deferred functions for anything that may require preemption,
such as copying from/to user or accessing the disk. For those purposes
we should use a work queue, which is essentially a kernel thread that
may be preempted or blocked.
2021-03-21 13:41:09 +01:00