Commit graph

5822 commits

Author SHA1 Message Date
AnotherTest
d3f51ee5c3 LibLine: It's okay to be interrupted while reading the DSR response
Fixes #4855.
2021-01-10 00:03:52 +01:00
AnotherTest
7059ca9b15 LibLine: Don't clear the displayed buffer when interrupted
Since we always restart on a new line, there's no reason to clear the
previous lines.
2021-01-10 00:03:52 +01:00
AnotherTest
9b126a2250 LibLine: Unregister signal handlers on destruction
This fixes an issue that shows up as a nice crash when "^R<enter>^C",
which is actually the event loop trying to call into a deleted object
(the search editor).
2021-01-10 00:03:52 +01:00
Tom
21e6f5176c LibCore: Harden signal handling code to be called in global destrcutors
Move some more complex globals into a Singleton, which allows it being
used from global destructors. It solves problems where some global
variables, such as HashMaps may already be deleted, triggering crashes
trying to use them.
2021-01-09 21:12:31 +01:00
Tom
8548ec357c LibCore: Allow adding/removing signal handlers while handling signals
This allows adding and removing of asynchronous signal handlers while
executing signal handlers, even if it is for the same signal that is
being handled right now.
2021-01-09 21:12:31 +01:00
asynts
938e5c7719 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.Everything:

The modifications in this commit were automatically made using the
following command:

    find . -name '*.cpp' -exec sed -i -E 's/dbg\(\) << ("[^"{]*");/dbgln\(\1\);/' {} \;
2021-01-09 21:11:09 +01:00
asynts
7235ddfd98 LibGUI: Add formatter for Widget. 2021-01-09 21:11:09 +01:00
asynts
1160817a9e AK: Add Formatter<FormatString> as helper class. 2021-01-09 21:11:09 +01:00
Andreas Kling
9a842ec419 LibC: Add explicit_bzero()
This is a variant of bzero() that is guaranteed to not get optimized
away by the compiler. Useful for clearing out sensitive data.
2021-01-09 20:04:18 +01:00
Andreas Kling
b4918bbe2f LibC: Move bzero() and bcopy() per Dr. POSIX 2021-01-09 19:56:59 +01:00
Andreas Kling
9a688af4b1 LibCore+passwd+su+Base: Add /etc/shadow to hide hashes from users :^)
This patch moves the user account password hashes from /etc/passwd,
where they were world-readable, to /etc/shadow, where only root can
access them.

The Core::Account class is extended to support both authentication
against, and modification of /etc/shadow.

The default password for "anon" as of this commit is "foo" :^)
2021-01-09 19:41:12 +01:00
Linus Groh
7b2fdd08ce LibJS: Add tests for bitwise NOT operator 2021-01-09 19:09:02 +01:00
Linus Groh
9fca86109b LibJS: Make bitwise NOT work correctly with NaN and Infinity
This was missing a "toInt32()" which returns 0 for NaN and Infinity.
From the spec:

    6.1.6.1.2 Number::bitwiseNOT ( x )

    The abstract operation Number::bitwiseNOT takes argument x (a Number).
    It performs the following steps when called:

        Let oldValue be ! ToInt32(x).
        Return the result of applying bitwise complement to oldValue.
        The mathematical value of the result is exactly representable as
        a 32-bit two's complement bit string.

Fixes #4868.
2021-01-09 19:09:02 +01:00
Linus Groh
c55cb7843a LibJS: Use INVALID some more in abstract operations 2021-01-09 19:09:02 +01:00
Andreas Kling
e08e1a89d9 LibWeb: No need to report that we encountered <svg> or <math>
These things happen, and it's not particularly noteworthy.
2021-01-09 15:22:23 +01:00
Andreas Kling
1d75e82101 LibWeb: Coalesce layouts that happen in response to style changes
Instead of doing a forced layout synchronously whenever an element's
style is changed, use a zero-timer to do the forced relayout on next
event loop iteration.

This effectively coalesces a lot of layouts and makes many pages such
as GitHub spend way less time doing redundant layout work.
2021-01-09 15:22:23 +01:00
Andreas Kling
d56f4f635a LibDebug: Convert a bunch of dbg() to dbgln() 2021-01-09 15:22:23 +01:00
Andreas Kling
0a3b834346 LibWeb: Convert a bunch of dbg() to dbgln() 2021-01-09 14:03:06 +01:00
Andreas Kling
6a19542715 LibVT+Terminal: Resize terminal when font changes
When the font is changed in the Terminal application, we now resize the
terminal window to accomodate the new font.
2021-01-09 14:03:06 +01:00
Andreas Kling
9d6198b683 Everywhere: Colour => Color
The system language is US English. :^)
2021-01-09 14:03:06 +01:00
TheMorc
d0adaf4465 LibGUI: Add set_tab_index method
This method sets the current tab index to the value specified.
2021-01-09 13:27:23 +01:00
Andreas Kling
5f364f5dc1 LibGUI: Clear the application's drag-hovered widget on drop event
When we drop something on any window, there's no longer an ongoing drag
so let's forget the drag-hovered widget.
2021-01-09 12:02:07 +01:00
Andreas Kling
9e60fc5006 LibGUI: Add visual indicators for accepted drags to view classes
All the view classes used in FileManager now indicate when they are
ready to accept a drop by showing a rounded rectangle around the item.
2021-01-09 12:02:07 +01:00
Andreas Kling
607c01fad1 LibGUI: Add visual indicator for accepted drags to BreadcrumbBar
BreadcrumbBar segments will now indicate drag acceptance with a rounded
rectangle around the accepting segment.
2021-01-09 12:02:07 +01:00
Andreas Kling
b08ed1b560 LibGUI: Make AbstractView accept drags (and delegate to model) 2021-01-09 12:02:07 +01:00
Andreas Kling
7baaa34490 LibGUI: Make SortingProxyModel proxy accepts_drag() 2021-01-09 12:02:07 +01:00
Andreas Kling
12d0d12a78 FileManager+LibGUI: Make the breadcrumb bar accept text/uri-list drags 2021-01-09 12:02:07 +01:00
Andreas Kling
67b91d51a7 WindowServer+LibGUI: Pass the set of mime types being dragged to client
Previously the client would only learn the mime type of what was being
dropped on it once the drop occurred. To enable more sophisticated
filtering of drag & drop, we now pass along the list of mime types being
dragged to the client with each MouseMove event.

(Note that MouseMove is translated to the various Drag* events in LibGUI
on the client side.)
2021-01-09 12:02:07 +01:00
Andreas Kling
3b94af2c07 LibGUI: Have widgets signal willingness to accept drops
If a widget accept()'s a "drag enter" event, that widget now becomes
the application-wide "pending drop" widget. That state is cleared if
the drag moves over another widget (or leaves the window entirely.)
2021-01-09 12:02:07 +01:00
Andreas Kling
dbd090fd95 LibCore: Don't auto-accept events that hit bubbling limit
We were using the "accept" flag on the event to break out of the
bubbling loop, but this had lasting consequences since all events that
bubbled too far came out looking as if someone had accepted them.

If an event is ignored by everyone, it should appear ignored.
2021-01-09 12:02:07 +01:00
Andreas Kling
094b47971b LibGUI: Make Widget::HitTestResult::widget a WeakPtr 2021-01-09 12:02:07 +01:00
Andreas Kling
c17fa67f51 WindowServer+LibGUI: Notify hovered window when drag&drop is cancelled
The hovered window may want to react to a drag being cancelled, even
if the drag originated in some other window.
2021-01-09 12:02:07 +01:00
Andreas Kling
9acb72e804 LibGUI: Add "drag enter" and "drag leave" events
These events allow widgets to react when a drag enters/leaves their
rectangle. The enter event carries position + mime type, while the
leave event has no information.
2021-01-09 12:02:07 +01:00
Itamar
65ffd8de69 LibCoreDump: Add 'library_containing' API to CoreDump::Reader
This API returns info about the library whose range in memory contains
a given address (similar to 'region_containing', but for libraries).
2021-01-09 10:56:04 +01:00
Itamar
399091dec3 LibELF: Fix cached sorted symbols in ELF::Image
Previously, we didn't set the 'symbol' field of SortedSymbol objects in
some code paths that populate the sorted symbol cache.
2021-01-09 10:56:04 +01:00
Itamar
a4b74cba0b Loader.so+LibELF: Do not read environment variables if AT_SECURE is set
AT_SECURE is set in the auxiliary vector when we execute setuid/setgid
programs.
In those cases, we do not want to read environment variables that
influence the logic of the dynamic loader, as they can be controlled
by the user.
2021-01-09 10:55:46 +01:00
Itamar
20974b0772 LibDebug: Keep going when parent's location info could not be computed
Previously, when trying to parse the location info of a member
variable, we asserted that the location info of its parent is of type
'Address'.

However, there are cases where we cannot compute the location info of
the parent (for example - because we do not yet support the type of
debug info generated for it).
In those cases, it is better to just leave the location info of the
member variable empty instead of crashing.
2021-01-09 10:55:46 +01:00
Itamar
4b91e7c821 LibDebug: Support shared libraries
DebugSession now makes the loader stop after loading the libraries,
and parses the loaded libraries of the program before continuing its
execution.

DebugSession now also supports inserting a breakpoint at a given symbol
or source position.
Additionally, DebugInfo now takes the base address of its object into
consideration.
2021-01-09 10:55:46 +01:00
Itamar
ca9d6d21b5 Loader.so+LibELF: Introduce "_LOADER_BREAKPOINT" environment variable
If set, the dynamic loader will perform a software breakpoint after
loading all libraries, and just before jumping to the main entry point.

This allows a debugger to inspect the loaded libraries before the
program starts executing.
2021-01-09 10:55:46 +01:00
Itamar
bb90d961b8 LibELF: Add Symbol::is_undefined() 2021-01-09 10:55:46 +01:00
Itamar
f95f15e0bd CMake: Install sources of LibELF 2021-01-09 10:55:46 +01:00
Andreas Kling
6159630fa0 LibGUI: Make BreadcrumbBar report drop events
Dropping something on a breadcrumb segment button will now fire the
BreadcrumbBar::on_drop hook.

Fixes #4792.
2021-01-08 19:51:44 +01:00
Tyler Lanphear
c762a0c4d6 LibC: Implement tgoto(). 2021-01-08 17:09:40 +01:00
Tyler Lanphear
0f988424cf LibVT: Implement ICH sequence. 2021-01-08 17:09:40 +01:00
Andreas Kling
56c2cc4162 LibWeb: Implement most of the CSS table fixup algorithm
This patch implements the "remove irrelevant boxes" and "generate
missing child wrappers" parts of table fixup.

"Generate missing parents" is left as a task for our future selves.
2021-01-07 18:00:51 +01:00
Andreas Kling
0fd577084f LibWeb: Specialize is<DOM::Element>() and is<Layout::Box>()
These two show up in profiles, so let's add specializations for them.
2021-01-07 17:33:29 +01:00
Andreas Kling
d3046a2649 LibWeb: Allow anonymous table, table-row and table-cell layout nodes 2021-01-07 17:33:29 +01:00
Andreas Kling
75829c1b81 LibWeb: Move remove_all_children() from Node to TreeNode<T>
This is useful in all tree types.
2021-01-07 17:33:29 +01:00
Andreas Kling
fe9de4b55c LibWeb: Add the computed "display" values to CSS::ComputedValues 2021-01-07 17:33:29 +01:00
Andreas Kling
f655a60773 LibWeb: Add some more CSS "display" values 2021-01-07 17:33:29 +01:00