Commit graph

19580 commits

Author SHA1 Message Date
Idan Horowitz 028dad6e87 Meta: Add a post-commit commit message linter hook
This should help with getting commit messages tidy before they pass
through CI's commit linter :^)

For this hook to work pre-commit has to be explicitly installed via:
`pre-commit install --hook-type commit-msg`
2021-05-02 16:28:01 +02:00
Hendiadyoin1 effdd76bb2 Kernel: Remove outdated UBSan comments
The triple-fault issue has long been fixed
2021-05-02 16:18:44 +02:00
Andreas Kling 68a0e4f8d5 LibGUI+HackStudio: Remove editing specific hacks from GUI::Command
Use is<T> to check for specific types of command in HackStudio instead
of cluttering up GUI::Command with specialized getters.
2021-05-02 14:49:46 +02:00
Andreas Kling f052a66c5d WindowServer+Base: Show alternate close button for "modified" windows
Windows that are marked as modified will now have another (themable)
close button. This gives an additional visual clue that some action
will be required by the user before the window gets closed.

The default window-close-modified icon is an "X" with "..." underneath,
building on the established use of "..." in menus to signify that
additional user input will be required before an action is completed.
2021-05-02 14:17:49 +02:00
Andreas Kling 819325892a WindowServer: Minor tweaks to Window.h 2021-05-02 13:35:46 +02:00
Brian Gianforcaro 331ab52318 LibC: Implement scandir(...) to enumerate directories.
I ran into a need for this when running  stress-ng against the system.
This change implements the full functionality of scandir, where it
accepts a selection callback, as well as a comparison callback.
These can be used to trim and sort the entries from the directory
that we are being asked to enumerate. A test was also included to
validate the new functionality.
2021-05-02 13:33:41 +02:00
Brian Gianforcaro d4d988532a LibC: Fix bugs in the population of dirent members.
While adding new functionality which used the d_reclen member
to copy a dirent, I realized that the value being populated
was incorrect. sys_ent::total_size() function calculates the
size of the sys_ent structure, but dirent is larger than sys_ent.
This causes the malloc to be too small and you end up missing
the end of the copy, which can miss the null terminator
resulting in corrupt dirent names.

Since we don't actually use the variable length member nature
of dirent on other platforms we can just use the full size of
the struct ad the d_reclen value.

Also replace the custom strcpy with the standard version.
2021-05-02 13:33:41 +02:00
Brian Gianforcaro 234c6ae32d Kernel: Change Inode::{read/write}_bytes interface to KResultOr<ssize_t>
The error handling in all these cases was still using the old style
negative values to indicate errors. We have a nicer solution for this
now with KResultOr<T>. This change switches the interface and then all
implementers to use the new style.
2021-05-02 13:27:37 +02:00
Gunnar Beutner de9b454f89 LibIPC: Make sure FDs survive when passed into a MessageBuffer 2021-05-02 13:26:07 +02:00
Andreas Kling cc6db526a6 WindowServer+LibGUI+Taskbar: Store window progress as Optional<int>
We were previously using the magical constant -1 to signify that a
window had no progress state. Be more explicit an use an Optional. :^)
2021-05-02 10:43:39 +02:00
ry755 8af7cda17a TextEditor: Specify the starting line and column number using colons
This allows the user to specify a specific line and column number to
start at when opening a file in TextEditor through the terminal, by
adding a colon after the file name.

For example, `TextEditor ReadMe.md:10:5` will open ReadMe.md and put
the cursor on line 10 at column 5.

To ensure that the user isn't trying to open a file that actually has
colons in its name, it checks if the file exists before parsing.

Replaces the feature added in b474f49164
Closes #5589
2021-05-02 10:25:51 +02:00
Andreas Kling 68a542623f LaunchServer: Actually seal the allow-list on SealAllowList
Fixes #6804.
2021-05-02 08:17:31 +02:00
Gunnar Beutner 889359b6f9 Userland: Make IPC handlers return void if they don't have any outputs 2021-05-02 08:11:38 +02:00
Gunnar Beutner 7cf2839a26 Userland: Get rid of the OwnPtr<...> boilerplate code for IPC handlers 2021-05-02 08:11:38 +02:00
Valtteri Koskivuori 1a015dc379 HackStudio: Use common copy functions in ProjectTemplate.cpp
This removes the duplicated copy logic and uses the ones from Core::File
instead.
2021-05-02 00:22:33 +02:00
Linus Groh 013b2c1627 Ports: Fix hatari install step
Fixes #6798.
2021-05-01 23:22:27 +02:00
Gunnar Beutner 0a94b4233f Kernel: Don't use ref_count() in MasterPTY::close()
With the recent fixes to how close() gets called this is not
necessary anymore.
2021-05-01 23:04:40 +02:00
Gunnar Beutner 9b2dd0f3b4 Ports: Fix building libpuffy 2021-05-01 22:52:15 +02:00
Gunnar Beutner 6cf59b6ae9 Everywhere: Turn #if *_DEBUG into dbgln_if/if constexpr 2021-05-01 21:25:06 +02:00
Valtteri Koskivuori 4e6f03a860 PixelPaint: Add fill mode for the ellipse tool
Functionality was already there, just had to hook it up!
2021-05-01 21:11:33 +02:00
Idan Horowitz 8293b22361 Kernel: Handle both shift keys being pressed and then released
Our current implementation does not work in the special case in which
both shift keys are pressed, and then only one of the keys is released,
as this would result in writing lower case letters, instead of the
expected upper case letters.

This commit fixes that by keeping track of the amount of shift keys
that are pressed (instead of if any are at all), and only switching to
the unshifted keymap once all of them are released.
2021-05-01 21:08:23 +02:00
Gunnar Beutner 63ff271125 Userland: Improve how traceroute reports timing data for packets
Previously we'd include the time required to do DNS resolution in the
time we'd report for traceroute packets. This would skew the times
reported.
2021-05-01 20:52:35 +02:00
Linus Groh f81e581d50 Meta: Remove trailing whitespace from ro.json
This fixes the CI linting step.
2021-05-01 20:15:24 +02:00
Sahan Fernando bd563f0b3c Kernel: Make processes start with a 16-byte-aligned stack 2021-05-01 20:08:35 +02:00
Gunnar Beutner cf7df418ed Kernel: Make sure we read all packets
The previous patch already helped with this, however my idea of only
reading a few packets didn't work and we'd still sometimes end up not
receiving any more packets from the E1000 interface.

With this patch applied my NIC seems to receive packets just fine, at
least for now.
2021-05-01 20:08:08 +02:00
xSlendiX 1dec93f45c Keymap: Added Romanian layout 2021-05-01 20:07:27 +02:00
Valtteri Koskivuori 370231c05c Kernel: Expose minor device numbers for keyboard and mouse
A fix for two FIXMEs, and paving the way for multi-keyboard/mouse
support, I guess.
2021-05-01 20:07:11 +02:00
Andreas Kling 6536a979d8 LibGUI: Improve a FIXME comment in TextDocument 2021-05-01 19:42:29 +02:00
Andreas Kling a7fb50567b TextEditor: Make sure to mark the Window as unmodified after saving
This comes with a FIXME, as it would be nicer if this information
would propagate from TextDocument all the way out somehow.
2021-05-01 19:42:29 +02:00
Andreas Kling f0cc712246 TextEditor: Use an automatic "modified" marker in the window title
This simplifies the application somewhat as we no longer need to
manually update the window title whenever the text document changes.
2021-05-01 19:42:29 +02:00
Andreas Kling 20dd5735ce WindowServer+LibGfx: Automatic "modified" markers in window titles
You can now add the string "[*]" to a window title and it will be
replaced with " (*)" if the window is modified, and with "" otherwise.
2021-05-01 19:42:29 +02:00
Andreas Kling e9c40b0243 TextEditor: Plumb modified state from GUI::TextDocument to GUI::Window
Instead of tracking this stuff ourselves at the application level,
we now just act as an intermediary and pass along the information to
the windowing system.
2021-05-01 19:42:29 +02:00
Andreas Kling 5b68a76c77 LibGUI: Track modified state in GUI::TextDocument
Until now, this has been hackishly tracked by the TextEditor app's
main widget. Let's do it in GUI::TextDocument instead, so that anyone
who uses this class can know whether it's modified or not.
2021-05-01 19:42:29 +02:00
Andreas Kling 443775754f TextEditor: Add some missing curly braces around a nested if statement 2021-05-01 19:42:29 +02:00
Andreas Kling e5ceabfbbb TextEditor: Remove some unnecessary #include statements 2021-05-01 19:42:29 +02:00
Andreas Kling b424e6c86f TextEditor: Rename TextEditorWidget => TextEditor::MainWidget 2021-05-01 19:42:29 +02:00
Andreas Kling 2fa765bbd5 LibGUI: Add getter/setter for GUI::Window modified state
This state lives in WindowServer and has no local copy in the client
process for now. This may turn out to be a performance issue, and if
it does we can easily cache it.
2021-05-01 19:42:29 +02:00
Andreas Kling 492464f4c1 WindowServer: Add Window "modified" state
This will be used to track which windows contain some kind of unsaved
data that the user may want some help remembering to save. :^)
2021-05-01 19:42:29 +02:00
Idan Horowitz 5c385d06e8 Lagom/Fuzzers: Add fuzzers for Windows-1251 and Windows-1255 decoders 2021-05-01 17:59:08 +02:00
Idan Horowitz 87cabda80d LibTextCodec: Implement a Windows-1251 decoder
This encoding (a superset of ascii that adds in the cyrillic alphabet)
is currently the third most used encoding on the web, and because
cyrillic glyphs were added by Dmitrii Trifonov recently, we can now
support it as well :^)
2021-05-01 17:59:08 +02:00
Andreas Kling 4b0098e52f Everywhere: Rename app_menu to file_menu or game_menu 2021-05-01 17:40:54 +02:00
Gal Horowitz b119fa5a0a Base: Add bold Hebrew character glyphs to the Katica Bold 10 font
The glyph for the letter `Shin` (U+05E9) looks a bit wonky because the
width of the font is too small. Unfortunately it doesn't look like the
FontEditor is capable of changing the width of an existing font, so if
that option will be added in the future this glyph can be fixed.
2021-05-01 17:25:43 +02:00
Ali Mohammad Pur 70728b49e2 Shell: Move the heredocs vector to a local value before processing it
Otherwise we would end up trying to parse the same heredoc entry, if it
contained a sequence terminated by a newline.
e.g. `<<-x\n$({` would attempt to read a heredoc entry after `x`, and
then after `{` while inside the first heredoc entry.
To make this work, we can simply empty the instance vector and keep the
state on the stack.
Issue found through oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33852
2021-05-01 15:58:31 +02:00
Ali Mohammad Pur 323a408d8c Shell: Make set_is_syntax_error() also copy the error location 2021-05-01 15:58:31 +02:00
Ali Mohammad Pur f1d49d391e Shell: Disallow non-bareword nodes as part of a heredoc key
Found by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33854
2021-05-01 15:58:31 +02:00
Gunnar Beutner f18895c0d6 LibCore: Fix building the library on macOS 2021-05-01 15:56:16 +02:00
Mango0x45 1635942951 Man: Add a manpage for rev(1) 2021-05-01 14:15:30 +02:00
Mango0x45 10fc9231d5 Userland: Add the rev(1) utility to reverse lines 2021-05-01 14:15:30 +02:00
Mango0x45 ec0abec9ee Userland: Remove an unused function declaration from tac.
The function declaration seems to have come from an earlier commit. The
function is no longer here so there is no reason to keep this around.
2021-05-01 14:15:23 +02:00
Olivier De Cannière 56fc949646 HackStudio: Detection of externally deleted files
HackStudio can now detect that files that have been opened in it were
deleted. When this occurs, it will update the list of open files and
reasign a file to the editors that showed the deleted file before the
deletion. The new file is either another file that was opened or the
default editor is no other open file is available

Closes SerenityOS#6632
2021-05-01 13:39:43 +02:00