Commit graph

13191 commits

Author SHA1 Message Date
AnotherTest e7f5090808 Spreadsheet: Always keep the workbook interpreter in VM scope
Fixes #3570.
2020-09-21 00:10:19 +02:00
Tibor Nagy cba5a69f07 FontEditor: Draw the baseline in the glyph editor widget 2020-09-20 23:23:56 +02:00
Valtteri Koskivuori f0fdbb1d83 Meta: Fix build-root-filesystem.sh on macOS 2020-09-20 21:45:00 +02:00
asynts 03a27bc693 LibGUI: Remove unnecessary type cast in JsonArrayModel.
Since TCP sequence numbers are randomly choosen 32-bit numbers, it often
happend that the most significant bit was set. The cast to a 32-bit
signed integer then made the number negative.

Thus TCP sequence were shown negative in the SystemMonitor every so
often.
2020-09-20 21:10:46 +02:00
Tibor Nagy 3ce97b9c0e LibGUI: Pad row/column headers of AbstractTableView 2020-09-20 20:54:23 +02:00
Andreas Kling 876b7b4619 Meta: Add Itamar Shenhar to the contributors list :^) 2020-09-20 19:55:36 +02:00
Andreas Kling 1c43442be4 LibJS+Clients: Add JS::VM object, separate Heap from Interpreter
Taking a big step towards a world of multiple global object, this patch
adds a new JS::VM object that houses the JS::Heap.

This means that the Heap moves out of Interpreter, and the same Heap
can now be used by multiple Interpreters, and can also outlive them.

The VM keeps a stack of Interpreter pointers. We push/pop on this
stack when entering/exiting execution with a given Interpreter.
This allows us to make this change without disturbing too much of
the existing code.

There is still a 1-to-1 relationship between Interpreter and the
global object. This will change in the future.

Ultimately, the goal here is to make Interpreter a transient object
that only needs to exist while you execute some code. Getting there
will take a lot more work though. :^)

Note that in LibWeb, the global JS::VM is called main_thread_vm(),
to distinguish it from future worker VM's.
2020-09-20 19:24:44 +02:00
Andreas Kling c6ae0c41d9 LibWeb: Add Bindings::ScriptExecutionContext
This will be inherited by documents and workers, to provide a common
abstraction for script execution. (We don't have workers yet, but we
might as well make this little space for them now to simplify things
down the road.)
2020-09-20 19:22:44 +02:00
Andreas Kling 976e55e942 LibJS: Remove some unnecessary indirection in Object constructors 2020-09-20 19:18:05 +02:00
Andreas Kling 668e73df8a LibJS: Make Interpreter::in_strict_mode() work outside of scope
This one is a little weird. I don't know why it's okay for this
function to assume that there is a current scope on the scope stack
when it can be called during global object initialization etc.

For now, just make it say "we are in strict mode" when there is no
currently active scope.
2020-09-20 19:16:34 +02:00
Andreas Kling 893df28e80 LibJS: Don't allocate property table during GC marking phase
Shape was allocating property tables inside visit_children(), which
could cause garbage collection to happen. It's not very good to start
a new garbage collection while you are in the middle of one already.
2020-09-20 19:11:49 +02:00
Andreas Kling 4036ff9d91 LibJS: Remove unused argument in NativeFunction constructor 2020-09-20 19:11:11 +02:00
Itamar 32d0d00ab2 LibGUI: Fix row_rect(int) calculation in AbstractTableView
Previously, it didn't take into account the visibility of
column headers.
2020-09-20 16:34:56 +02:00
Itamar e3e5e57fde HackStudio: Move bulk of GUI logic into HackStudioWidget
Previously, the GUI logic of HackStudio was all stuffed into main(),
and it started getting a bit out of hand :)
2020-09-19 21:39:05 +02:00
Andreas Kling 606c0e1672 LibGfx: Move vertically centered text down slightly based on baseline
To make slightly more aesthetically pleasing use of the vertical space,
we now move all vertically centered text lines down by half the amount
of space below the font's baseline.

This is probably not the "correct" way to do this, but it does make
things look nicer with some of our fonts already.
2020-09-19 19:16:22 +02:00
Andreas Kling d3fcba78b0 WindowServer: Shrink menubar menu text rects slightly
We don't want the menu titles to cover the entire menubar.
2020-09-19 19:16:22 +02:00
Andreas Kling 5f8a9d348d LibGfx: Add a helper to check if a TextAlignment is vertically centered 2020-09-19 19:16:22 +02:00
Andreas Kling 95eeb321f9 LibGfx+FontEditor+Base: Add "baseline" value to all fonts
This does nothing at the moment but will soon allow us to improve the
vertical positioning of text.
2020-09-19 19:16:22 +02:00
Liav A d9863e0b6c Kernel: Remove unnecessary class member in UHCIController
The m_address member is not needed, since PCI::Device already has one.
2020-09-19 18:39:09 +02:00
Linus Groh 4e6a50f1d0 Meta: Add .clangd to .gitignore 2020-09-19 17:16:57 +02:00
Jakob-Niklas See eeb3ef405c
LibGUI: Increase slider acceleration with Ctrl (#3499)
When holding Ctrl and scrolling on a slider widget, the scrolling
acceleration gets increased.

This can make it faster to get to the knob location you want to
get to. :^)
2020-09-19 16:45:51 +02:00
Liav A 82b0171812 Kernel: Fix assertion statement in GenericInterruptHandler
We need to assert if interrupts are not disabled when changing the
interrupt number of an interrupt handler.
Before this fix, any change like this would lead to a crash,
because we are using InterruptDisabler in IRQHandler::change_irq_number.
2020-09-19 16:44:40 +02:00
Andreas Kling 2cb32f8356 Kernel: Let InodeWatcher track child inode numbers instead of names
First of all, this fixes a dumb info leak where we'd write kernel heap
addresses (StringImpl*) into userspace memory when reading a watcher.

Instead of trying to pass names to userspace, we now simply pass the
child inode index. Nothing in userspace makes use of this yet anyway,
so it's not like we're breaking anything. We'll see how this evolves.
2020-09-19 16:39:52 +02:00
Andreas Kling 55dd13ccac Kernel: Don't assert when reading too little from an InodeWatcher
If you provide a buffer that's too small, we'll still dequeue an event
and write whatever fits in the provided buffer.
2020-09-19 15:39:53 +02:00
Linus Groh c0e4353bde LibJS: Handle getter exception in JSONObject::serialize_json_property()
In the case of an exception in a property getter function we would not
return early, and a subsequent attempt to call the replacer function
would crash the interpreter due to call_internal() asserting.

Fixes #3548.
2020-09-19 14:17:22 +02:00
Andreas Kling e1965a5a8e FileManager: Prevent feedback loop between treeview and directory view
When opening something in the left-side treeview, it also opens in the
right-side directory view. That triggers the "path changed" hook in the
directory view, which causes us to fully reveal the opened directory
in the left-side treeview.

This feedback loop made the UI feel weird since it caused directories
to expand just by selecting them in the left-side treeview. So let's
break that loop.
2020-09-19 14:09:59 +02:00
Tom ba238ac62a Kernel: Simplify ProcFS callbacks by using function pointers directly 2020-09-19 01:22:30 +02:00
Nico Weber 31e7f73aae UserspaceEmulator: Support all msg_iovlens in recvmsg and sendmsg
The kernel doesn't support msg_iovlens != 1 yet and nothing passes
an amount != 1, but if anyone ever adds support for this they won't
have to worry about ue at least.
2020-09-19 00:39:05 +02:00
AnotherTest 29ef65c458 Shell: Fix Vector OOB access in `add_entry_to_cache()'
Fixes #3530.
2020-09-19 00:38:41 +02:00
AnotherTest a43d9c4fe0 Shell: Make a new session at start if there's no active session 2020-09-19 00:38:41 +02:00
AnotherTest 21f513fe0f LibJS: Do not revisit already visited values in update_function_name()
Fixes #3471, adds a test.
2020-09-19 00:33:56 +02:00
Tom e317ee7541 Meta: Add env variable SERENITY_RUN to be able to choose qemu, bochs, etc
This allows picking for example bochs: SERENITY_RUN=b ninja run
2020-09-19 00:33:02 +02:00
Linus Groh 724c5bd8d9 ResourceGraph: Fix graph line position calculation
The calculation was only taking the rect's inner height, but not its top
offset into account.

Fixes #3540.
2020-09-19 00:32:06 +02:00
Tom 03f45febe2 Kernel: Fix KResultOr move semantics
We need to track whether we actually own the storage.
2020-09-19 00:30:08 +02:00
AnotherTest 4c2f86c24f Shell: Do not strip glob base path when it was explicitly requested
Fixes #3544.
2020-09-19 00:24:16 +02:00
Andreas Kling eb24603da0 FileManager: Properly reveal newly opened directories in the treeview
Use the new TreeView::expand_all_parent_of() API to ensure that newly
opened directories are revealed and scrolled-into-view in the left-side
treeview. :^)
2020-09-18 21:29:01 +02:00
Andreas Kling 3bccd99fe9 LibGUI: Add TreeView::expand_all_parents_of(ModelIndex)
This does exactly what it sounds like. :^)
2020-09-18 21:29:01 +02:00
Andreas Kling 76ae47c6ed LibGUI: Unbreak FileSystemModel::index(path) after virtual root changes
Now that the "/" directory can have a (virtual) parent index, we need
to account for that when converting a full path to a model index.
2020-09-18 21:29:01 +02:00
Andreas Kling 56328409d9 FileManager: Update GUI when "entering" an inaccessible directory
When we enter an inaccessible directory, we still allow that directory
to become selected in the left-side treeview, so we need to update the
location box and window title to reflect the new current path.

This is not perfectly factored and there's a bit of duplication between
the model's on_error and on_complete hook callbacks in DirectoryView.
Needs more work. :^)
2020-09-18 21:29:01 +02:00
Andreas Kling e4c23b0151 iLibGUI+Base: Show inaccessible directories with special icon in views 2020-09-18 21:29:01 +02:00
Andreas Kling fad6b8f267 LibGUI: FileSystemModel should provide full paths to FileIconProvider
This will allow FileIconProvider to check additional things about
the specified path. (We previously only had access to the basename.)
2020-09-18 21:29:01 +02:00
Andreas Kling 8075db683b FileManager: Show an inline error message for inaccessible directories
Instead of popping up a message box whenever we can't read an opened
directory, show the error message inside the DirectoryView (as a label)
instead.

This fixes a visual inconsistency where an inaccessible directory would
be selected in the left-side treeview while the previous directory's
contents were still showing on the right.

This also makes keyboard navigation a bit more pleasant since you're
not suddenly interrupted by a message box.
2020-09-18 21:29:01 +02:00
Andreas Kling 9b89303767 LibGUI: StackWidget should not steal focus when switching active child
Only focus the new active child if the old one had focus previously.
2020-09-18 21:29:01 +02:00
Andreas Kling 65b246aaf4 FileManager: Remove an unused enum in DirectoryView 2020-09-18 21:29:01 +02:00
Linus Groh a9f5b0339d LibJS: Simplify toEval() implementation 2020-09-18 20:49:35 +02:00
Linus Groh 5fd87ccd16 LibJS: Add FIXMEs for parsing increment operators with function LHS/RHS
The parser considers it a syntax error at the moment, other engines
throw a ReferenceError during runtime for ++foo(), --foo(), foo()++ and
foo()--, so I assume the spec defines this.
2020-09-18 20:49:35 +02:00
Linus Groh fd32f00839 LibJS: Mark more ASTNode classes as final 2020-09-18 20:49:35 +02:00
Itamar b82a254da0 HackStudio: Only refresh Git widget on save if initialized 2020-09-18 15:20:55 +02:00
Peter Elliott e46b4e0865 Minesweeper: Fix inverted Single-Click Chording setting
This was introduced by 705cee528a,
where the '!' was copied from the previous implementation, but the
behavior was not
2020-09-18 09:42:26 +02:00
Andreas Kling 07d4b41bac FileManager: Move DirectoryView into the FileManager namespace 2020-09-17 17:23:37 +02:00