Commit Graph

3650 Commits

Author SHA1 Message Date
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
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
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
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
Gunnar Beutner
17e5ba70b1 LibC: Make sure that parse_pwddb_entry doesn't write to stderr
Library functions shouldn't write to stdout/stderr as that might not
be expected by the caller.
2021-05-01 12:40:12 +02:00
Gunnar Beutner
302f9798ee LibC: Implement support for getspnam() and friends 2021-05-01 12:40:12 +02:00
Gunnar Beutner
ce77caf479 LibC: Move crypt() and crypt_r() to the right header file
According to POSIX.1 these should be in <crypt.h>.
2021-05-01 12:40:12 +02:00
Gunnar Beutner
a9f488c55b LibC: Make EWOULDBLOCK an alias for EAGAIN
According to POSIX.1 all error codes have to be distinct - with
the exception for EAGAIN and EWOULDBLOCK. Other libcs including
eglibc and newlib define EWOULDBLOCK as an alias for EAGAIN and
some software including OpenTTD expect this behavior.
2021-05-01 09:02:57 +02:00
Hendiadyoin1
f6aad70541 LibX86+UserspaceEmulator: Add MMX insns prototypes 2021-05-01 08:56:52 +02:00
Brian Gianforcaro
ca213ab374 bt: Enumerate all threads when symbolizing stacks in the bt utility.
Enumerate tid's from /proc/{pid}/stacks/ and use it to print the
backtrace for all active threads in the specified process.
2021-05-01 08:44:33 +02:00
Brian Gianforcaro
f1c98dc5ea bt: Fix generation of click-able links for source files.
When the default build location was moved from /Build to the new
architecture specific directory, /Build/i686, this code broke.
All file names are now path relative one additional level up.

So continue the hack, and introduce another dummy directory to
make the relative paths resolve correctly.
2021-05-01 08:44:33 +02:00
Tobias Christiansen
22d6fbeb12 LibWeb: Use new way of generating list-style-type: *-alpha
Removed the local conversion from number to alphabet and used the one
offered in AK/String instead.
2021-05-01 01:19:40 +02:00
Tobias Christiansen
ef8f97635e Spreadsheet: Use String::bijective_base_from for column name resolution
Updated Spreadsheet to use the new way of converting a number to a
String represenation using the alphabet.
The code responsible for this conversion now lives in AK/String, so it
gets deleted from Spreadsheet.cpp.
2021-05-01 01:19:40 +02:00
inalone
4dbf40399b Demos: Added Alt+F4 funtionality to demos that lacked it
The Fire, LibGfxDemo and LibGfxScaleDemo demos did not have Alt+F4
functionality as they lacked menubars - I just added basic menubars with
Quit entries to allow this shortcut with the demos that didn't have it.
2021-05-01 01:11:35 +02:00
Valtteri Koskivuori
8fac7a1d5d
LibGUI: Bump up common locations width from 90 to 95
The Documents directory shows up properly now when selected.
Previously the bold text would not fit horizontally, causing an
ellipsis at the end.
2021-04-30 23:27:29 +02:00
Gunnar Beutner
f48f26f52d LibC: Implement openpty(), forkpty() and login_tty()
These are used by OpenSSH.
2021-04-30 23:10:22 +02:00
Ali Mohammad Pur
6783f65d5a LibLine: Fix writing to temporary file in ^X^E handler
I have no idea how this _ever_ worked, and I also have no idea why past
me didn't use FileStream to begin with.
Fixes the issue where lots of junk data would be written to the temp
file, causing the external editor to crash.
2021-04-30 21:57:28 +02:00
Itamar
7bd796b7e3 LibELF: Perform verification of TLS data in dlopen
When loading a library at runtime with dlopen(), we now check that:
1. The library's TLS size does not overflow the size of the allocated
TLS block.
2. The Library's TLS data is all zeroed.

We check for both of these cases because we currently do not support
them correctly. When we do add support for them, we can remove these
checks.
2021-04-30 18:47:39 +02:00
Itamar
101ac45c1a LibELF: Change TLS offset calculation
This changes the TLS offset calculation logic to be based on the
symbol's size instead of the total size of the TLS.

Because of this change, we no longer need to pipe "m_tls_size" to so
many functions.

Also, After this patch, the TLS data of the main program exists at the
"end" of the TLS block (Highest addresses).

This fixes a part of #6609.
2021-04-30 18:47:39 +02:00
Itamar
6bbd2ebf83 Kernel+LibELF: Support initializing values of TLS data
Previously, TLS data was always zero-initialized.

To support initializing the values of TLS data, sys$allocate_tls now
receives a buffer with the desired initial data, and copies it to the
master TLS region of the process.

The DynamicLinker gathers the initial TLS image and passes it to
sys$allocate_tls.

We also now require the size passed to sys$allocate_tls to be
page-aligned, to make things easier. Note that this doesn't waste memory
as the TLS data has to be allocated in separate pages anyway.
2021-04-30 18:47:39 +02:00
Itamar
db76702d71 LibELF: Rename tls_size to tls_size_of_current_object 2021-04-30 18:47:39 +02:00
Itamar
1c24388d74 LibELF: Extract TLS offset calculation logic to separate function 2021-04-30 18:47:39 +02:00
Itamar
2c9541315d LibELF: Fix TLS offset calculation for libraries
This fixes a regression that was introduced in f40ee1b and caused the
tls_offset of all objects other than the main program to be 0.

After this fix map_library's is_program argument is no longer used, so
it was removed.
2021-04-30 18:47:39 +02:00
Maciej Zygmanowski
6a12420d9d Browser: Add FrogFind search engine
FrogFind is a search engine for very old computers and can be
loaded and rendered correctly by Serenity Browser :^)
2021-04-30 17:57:22 +02:00
Egor Ananyin
8f8fbf3487 LibWeb: Position absolute boxes relative to the containing block
In the absolute positioning model, a box is explicitly offset with
respect to its containing block (CSS 2.1 section 9.6).
2021-04-30 15:25:35 +02:00
Egor Ananyin
3ca6d7dd36 LibWeb: Use min-height in calculating block box height
Now we use min-height for calculating the height of block boxes.
Besides, now we check if min-height/max-height are percentage values
and don't use them if parent's height isn't explicitly set (CSS 2.1
section 10.7).
2021-04-30 15:25:35 +02:00
Egor Ananyin
5ae2774018 LibWeb: Fix floating box position calculation
Now we set margins, borders and paddings for floating boxes and include
them into calculating floating box positions by using margin_box() and
margin_box_as_relative_rect().
2021-04-30 15:25:35 +02:00
Jesse Buhagiar
60cdbc9397 Kernel/LibC: Implement setreuid 2021-04-30 11:35:17 +02:00
stelar7
55446172cb LibWeb: Add selector support to the new CSSParser
This is stolen from the old parser, but it seems to parse fine :^)
2021-04-30 08:52:36 +02:00
Gunnar Beutner
1dfa386d70 LibC: Add missing initialization for the FILE mutex 2021-04-30 08:21:08 +02:00
Gunnar Beutner
6adb0dbdba LibC: Implement fgetc_unlocked(), fread_unlocked() and getc_unlocked() 2021-04-29 23:12:05 +02:00
Gunnar Beutner
36ee8a8c25 LibC: Make rewind() ignore errors as it should
POSIX says that rewind() should ignore errors and reset the
stream's error indicator. So let's do that.
2021-04-29 23:12:05 +02:00
Gunnar Beutner
62ee003ef5 LibC: Make stdio thread-safe 2021-04-29 23:12:05 +02:00
Andreas Kling
3d4afe7614 Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which
of these words to use. Let's just choose one and use it everywhere. :^)
2021-04-29 22:23:52 +02:00
Andreas Kling
7ae7170d61 Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
Andreas Kling
def1f1444a WindowServer: Move configuration file to /etc/WindowServer.ini
This was in the /etc/WindowServer/ directory which had nothing else in
it, so let's just get rid of the directory and move this up one step.
2021-04-29 22:16:18 +02:00
Tom
b88b19272e WindowServer: Fix alpha hit-test accessing out-of-bounds pixels
It's possible that the backing store hasn't been updated yet, so
when performing an alpha hit-test make sure the bitmap actually
contains it.

Fixes #6731
2021-04-29 21:51:41 +02:00