Commit graph

17463 commits

Author SHA1 Message Date
Ben Wiederhake 00131d244e Kernel: Expose sysctl 'ubsan_is_deadly' to panic the Kernel on UB
This makes it easier to find UB, for example when fuzzing the Kernel.

This can be enabled by default, thanks to @boricj's work in
32e1354b9b.
2021-03-07 17:31:25 +01:00
Linus Groh a0362d827c FileManager: Disable view change actions when directory is unreadable
Closes #3556.
2021-03-07 16:19:36 +01:00
thankyouverycool 1ccf9de6b9 Serendipity: Couple more tips and some clean-up 2021-03-07 15:41:32 +01:00
Andreas Kling 2d7d5f2b55 Serendipity: Make main window a normal window
..instead of a tool window. Tool windows are meant as accessories to
an application's main/primary windows, not to be primary windows
themselves.

Fixes #5667.
2021-03-07 14:19:20 +01:00
Andreas Kling 1375c57c4a Serendipity: Simplify GML and fix button alignment 2021-03-07 14:12:23 +01:00
Jean-Baptiste Boric 32e1354b9b Kernel: Fix unaligned read inside map_ebda() 2021-03-07 14:05:17 +01:00
supercyp a6f957a36b
Serendipity: Make main window resizable (#5675)
If it is not resizable, the "What's new" page may be hard to read.
2021-03-07 14:04:06 +01:00
Andreas Kling 7f9f916470 LibWeb: Make tiled backgrounds scroll with content
Previously the page background was always draw relative to the viewport
instead of following with the content. This should eventually become
an opt-in mode (via CSS "background-attachment") but for now let's have
the default behavior be that backgrounds scroll with content.

Also take this opportunity to move the background painting code from
the two web views to a shared location in InitialContainingBlockBox.
2021-03-07 13:49:20 +01:00
speles 6c087480cf LaunchServer: Use new FileManager flags instead of two arguments 2021-03-07 11:00:36 +01:00
speles 0071742a5a FileManager: Use ArgsParser, handle more options
This adds 2 more flags, that help with the "select on start" invocation.
-s - makes us open the parent directory of the entry, and select it.
-r - makes FileManager to skip real path resolution for cases when we
     want to select the symlink in parent directory.

Also, if the file path is passed as argument, not it will open parent
with the file selected.
2021-03-07 11:00:36 +01:00
speles 63a846a2ac LibCore: Add String variant for ArgsParser::add_positional_argument
This is basically the same version as const char *, but it's a nice
helper that allows us to handle strings without casting.
2021-03-07 11:00:36 +01:00
speles d64d2e4d09 LibGUI: Scroll selection into view when the IconView is first laid out
If we set selection before the IconView is laid out, it has no size.
So it can't correctly calculate where to scroll. Forcing scroll after
the first resize fixes that.
2021-03-07 11:00:36 +01:00
speles 6e16a5cdfa Applications: Open folder with pre-selected file where appropriate :^) 2021-03-07 11:00:36 +01:00
speles 50de653cc9 AK: Add optional fragment parameter to create_with_file_protocol()
Now that we use fragment for specifying starting selection in
FileManager we would benefit from providing it as argument instead of
setting it each time separately.
2021-03-07 11:00:36 +01:00
AnotherTest 1496b02203 Meta: Use the new Shell features to improve run-tests-and-shutdown
Fixes two TODOs in that file :^)
2021-03-07 10:59:51 +01:00
AnotherTest 13b65b632a Shell: Add support for enumerating lists in for loops
With some odd syntax to boot:
```sh
$ for index i x in $whatever {}
```
2021-03-07 10:59:51 +01:00
AnotherTest a45b2ea6fb Shell: Add support for 'immediate' expressions as variable substitutions
This commit adds a few basic variable substitution operations:
- length
    Find the length of a string or a list
- length_across
    Find the lengths of things inside a list
- remove_{suffix,prefix}
    Remove a suffix or a prefix from all the passed values
- regex_replace
    Replace all matches of a given regex with a given template
- split
    Split the given string with the given delimiter (or to its
    code points if the delimiter is empty)
- concat_lists
    concatenates any given lists into one

Closes #4316 (the ancient version of this same feature)
2021-03-07 10:59:51 +01:00
AnotherTest a303b69caa Shell: Do not parse history events in scripts
That makes no sense!
2021-03-07 10:59:51 +01:00
AnotherTest cad7865ad1 LibLine: Clear the buffer after invalidating prior written data
Otherwise this would set m_chars_touched_in_the_middle to zero, which is
exactly the wrong thing to do.
2021-03-07 10:59:51 +01:00
AnotherTest c580348ebd Shell: Add functions to the PATH cache when rebuilding the cache
Otherwise functions would be highlighted as missing.
2021-03-07 10:58:42 +01:00
AnotherTest 4f6bf2931c Shell: Make the 'not' builtin return the correct exit code for functions 2021-03-07 10:58:42 +01:00
AnotherTest fec8d7d699 Shell: Corrently indent offset newlines when formatting
Previously, formatting the following would incorrectly skip the indents:
```
{
    foo

    bar
}
```
to create:
```
{

foo

bar
}
```
2021-03-07 10:58:42 +01:00
AnotherTest e1512d5968 Shell: Skip caching PATH and history load/save when not interactive
Non-interactive shells (i.e. when running scripts) do not need this
functionality, so they are a boatload of wasted time.
This significantly reduces the script startup and shutdown times when
there are lots of executables in PATH or lots of entries in the history.
2021-03-07 10:58:42 +01:00
Andreas Kling 48347fb1c7 LibGfx: Make most of Gfx::Color constexpr 2021-03-06 19:57:35 +01:00
Luke ed139bee7f LibWeb: Add a couple child node operations to Node and add node types 2021-03-06 19:57:12 +01:00
Linus Groh a013a38e24 Meta: Make 'run.sh qgrub' work via SERENITY_RUN
It is possible to set the run.sh mode via the SERENITY_RUN environment
variable, but the SERENITY_DISK_IMAGE="grub_disk_image" override for
qgrub mode was only checking $1. This makes qgrub mode work via 'ninja
run' without explicitly setting SERENITY_DISK_IMAGE:

    SERENITY_RUN=qgrub ninja run
2021-03-06 19:55:53 +01:00
Liav A b807e725e0 Kernel: Address all 32 HPET comparators correctly
Instead of declaring a reserved area from byte 0x160 to 0x400, we
change the declaration of TimerStructure array to be 32 units.

Also, a static_assert was added, to ensure that the calculation is
right.
2021-03-06 15:58:24 +01:00
Liav A bbe1d7e239 Revert "Kernel: Fix HPET timer structure layout"
This reverts commit af22204488.

According to the HPET specification, each theoretical comparator takes
32 bytes in the MMIO space.

Although I hardly believe that any system will implement all 32
comparators, in practice if a machine happens to have more than 3
comparators, we need to address the comparators correctly if we want to
use them.
2021-03-06 15:58:24 +01:00
Brendan Coles 4ae3bfa40d WebServer: Serve X-Frame-Options and X-Content-Type-Options HTTP headers 2021-03-06 15:04:16 +01:00
Stephan Unverwerth 87d19273bc LibGfx: Fix draw_triangle() precision issues
This fixes some precision issues in Painter::draw_triangle()
that caused the Cube demo to leave pixels empty between triangles
under certain angles.

Also adds some extra comments for clarity and early returns when
parts of the triangle do not need to be drawn.
2021-03-06 15:03:44 +01:00
Jorropo 25e4a3467d Ports/git: Forcing NO_IPV6 option.
This fixes the build, how ever I don't know why the auto detection
broke in the first place.
2021-03-06 14:57:44 +01:00
Luke 89846b5b7c Ports: Add bzip2 port
Saw that it can be included with the freetype port, so I added it.
2021-03-06 14:56:51 +01:00
Mihai Parparita c2f3d3afe1 LibWeb: Make CSS background image painting respect destination origin and transparency
It was previously using draw_tiled_bitmap, which always aligns the
tiles with the global origin and does not respect the alpha of the
source. Switch to a new Painter::blit_tiled helper which uses
Painter::blit under the hood, which has more correct behavior.
2021-03-06 14:56:31 +01:00
speles e97865e982 WebContent: Set correct scroll offset for PageHost painting 2021-03-06 14:54:12 +01:00
Luke 3f969286d7 Ports: Add zlib dependency to libpng
I didn't have zlib installed when I was trying to compile libpng.
It said it was missing, so add a dependency to zlib.
2021-03-06 14:53:46 +01:00
Brendan Coles 6ac2d3e1bd Base: Add egrep and rgrep aliases to /etc/shellrc 2021-03-06 09:43:13 +01:00
Nick Wanninger c3f417aa1e LibM: optimized (branchless) copysign 2021-03-06 09:42:06 +01:00
Itamar cfa100cb65 HackStudio: Restart LanguageServer if it crashes
We now restart the language server transparently if it crashes.
If the language server crashes too frequently (current threshold is
twice within 3 seconds), we give up and will not attempt to restart it
again. HackStudio will still work fine, but features that depend on the
language server will not function.

To support this change we use a new class, 'ServerConnectionWrapper',
that holds the actual ServerConnection and is responsible for restarting
the language-server if it crashes.

Closes #5574.
2021-03-06 09:40:33 +01:00
Itamar 4223f03b2b LanguageServers: Support calling SetFileContent with not-yet open files
Also, use dbgln_if
2021-03-06 09:40:33 +01:00
Itamar 6f7ef4ec65 LanguageServers: Tweak FileDB API
- FileDB::get() now returns nullptr if the file is not in the FileDB
- Added FileDB::get_or_create_from_filesystem()
- Added FileDB::add() version that receives that file's content as a
parameter
2021-03-06 09:40:33 +01:00
Itamar 684cc5f027 HackStudio: Add ProjectFile::create_if_needed 2021-03-06 09:40:33 +01:00
Itamar ba6cbf160b HackStudio: Create Language enum from file extension or language name 2021-03-06 09:40:33 +01:00
Itamar 1edaefca3a HackStudio: Remove redundant null check when creating a new project file
Project::get_file returns a NonNullRefPtr
2021-03-06 09:40:33 +01:00
Itamar fa4d9da237 HackStudio: Make sure project files are created with an absolute path
This fixes an issue were "Find in Files" would not use the up-to-date
content of a file with unsaved changes.

The issue existed because 'FindInFilesWidget' uses
Project::for_each_text_file, which retrieves files by their absolute
path. However, when a file is opened in an Editor, it is created with
a relative path.

This caused us to store two ProjectFile objects that refer to the same
file - one with a relative path and one with an absolute path.
2021-03-06 09:40:33 +01:00
Itamar 74070ef74d HackStudio: Map connections to langauge-servers by language name
HackStudio keeps a map that stores the different ServerConnection
instances we have open.

Previously, that map was indexed by a project's root path.
This did not make much sense because we only support opening a single
project with each instance of the HackStudio program.

We now index the different ServerConnections by the language name, which
allows us to support talking to multiple language-servers in the same
project (e.g C++ and Shell).

This also fixes an issue where if you first opened a Shell file, and
then a C++ file in the same project, then C++ language-server features
would not work.
2021-03-06 09:40:33 +01:00
Itamar 289c466fef LibCpp: Don't crash on an empty '#' line
Closes #5634
2021-03-06 09:40:33 +01:00
Itamar 3f0ace6670 LanguageServers/Cpp: Allow the creation of DocumentData objects to fail
This fixes langauge-server crashes when trying to parse non-existant
header files, such as #include <new>.
Closes #5569.
2021-03-06 09:40:33 +01:00
Itamar a2ac86f5e1 LibCpp: Check if type is null in VariableDeclaration::dump 2021-03-06 09:40:33 +01:00
Andreas Kling e0e8c6f70e Ports: Add FreeType 2.10.4 2021-03-05 21:58:52 +01:00
Andreas Kling 9f8a9dba0b LibM: Add naive implementation of copysign() 2021-03-05 20:46:25 +01:00