Commit graph

13868 commits

Author SHA1 Message Date
Andreas Kling
a6b2598fba Userland: Teach "kill" to understand signal names (not just numbers)
You can now do things like "kill -STOP pid" :^)

The getsignalbyname() helper function should probably move to LibC
or somewhere where it can be used by other signal related programs.
2020-10-29 11:45:53 +01:00
Andreas Kling
d27a8e505f LibGUI: IconView was hard-coding column 0 instead of model_column()
Some of the indexes generated during cursor movement were using column
instead of model_column(), which caused inconsistent display of items
under the cursor.
2020-10-28 21:41:51 +01:00
Andreas Kling
de3dc15a6e LibGUI: Default-initialize cursor when focusing an AbstractView
If an AbstractView receives focus without a valid cursor index, we now
ask it to move its cursor to the home position. This way, the user can
actually start moving the cursor after tabbing to a view.
2020-10-28 21:40:31 +01:00
Andreas Kling
1f789a07b1 LibGUI: Don't start AbstractView type-ahead search with tab key
This was preventing views from relinquishing focus via the keyboard.

Fixes #3862.
2020-10-28 21:26:27 +01:00
Andreas Kling
80e12999c4 LibGUI: Model-less views should not swallow key events
At least pass them up to GUI::Widget so they can be handled there.
2020-10-28 21:26:27 +01:00
Linus Groh
b5bd05b717 LibJS: Don't parse numeric literal containing 8 or 9 as octal
If the value has a leading zero (allowed in non-strict mode) but
contains the digits 8 or 9 it can't be an octal number.
2020-10-28 21:11:32 +01:00
Linus Groh
b4e51249e9 LibJS: Always insert semicolon after do-while statement if missing
https://tc39.es/ecma262/#sec-additions-and-changes-that-introduce-incompatibilities-with-prior-editions

11.9.1: In ECMAScript 2015, Automatic Semicolon Insertion adds a
semicolon at the end of a do-while statement if the semicolon is
missing. This change aligns the specification with the actual behaviour
of most existing implementations.
2020-10-28 21:11:32 +01:00
Linus Groh
d278f61f4c LibJS: Restrict toEval() failures to SyntaxError
We only use expect(...).toEval() / not.toEval() for checking syntax
errors, where we obviously can't put the code in a regular function. For
runtime errors we do exactly that, so toEval() should not fail - this
allows us to use undefined identifiers in syntax tests.
2020-10-28 21:11:32 +01:00
Andreas Kling
3ec19ae4b6 LibGUI+LibGfx+WindowServer: Auto-generate disabled action icons :^)
This patch adds a simple filter that makes button and menu item icons
have that "'90s disabled" look when disabled. It's pretty awesome.
2020-10-27 21:25:40 +01:00
Andreas Kling
ea14c67e29 LibGUI: Make TreeView use the view cursor properly
TreeView was still partly sticking to the pre-cursor way of using the
first index in the selection as the implied cursor. This patch fixes
all of the TreeView code to operate on the cursor instead.

This makes trees behave much more intuitively when alternating between
mouse and keyboard interaction.
2020-10-27 21:00:12 +01:00
Andreas Kling
ce4ee1df1b WindowServer: Improve look of drag&drop items somewhat
This just adds a bit of padding around items. There's lots of room for
improvement here.
2020-10-27 20:45:38 +01:00
Andreas Kling
0391806eec LibGUI: Shrink the default selection rect of TreeView items
Instead of filling the whole row with selection color, only fill behind
the text. This gives a snugger, more focused appearance.

For embedders that want the entire row to get filled with the selection
color when selected, they can opt in to the old behavior by calling
TreeView::set_should_fill_selected_rows(). This is used by Profiler.
2020-10-27 20:33:30 +01:00
Andreas Kling
df98c9ebbe LibGUI: Run clang-format on TableView.cpp 2020-10-27 20:21:51 +01:00
Andreas Kling
f7d8174bee LibGUI: Paint a focus rect around the cursor index in ColumnsView 2020-10-27 16:20:20 +01:00
Andreas Kling
c0076681ad LibGUI: Paint a focus rect around the cursor index in TableView 2020-10-27 16:18:55 +01:00
Andreas Kling
5030f1ed4b LibGUI: Paint a focus rect around the cursor index in IconView
This makes the cursor actually visible to the user, and looks rather
neat if I may say so. :^)
2020-10-27 16:12:54 +01:00
Andreas Kling
272af7685b LibGUI: Improve and simplify IconView item name wrapping
Move the wrapping logic to get_item_rects(). This makes mouse events
able to hit the wrapped labels, and various other little things stop
glitching out as well.

Also, instead of having a per-line width when wrapping icon names,
make the text rect wide enough to fit every line.
2020-10-27 16:10:30 +01:00
Linus Groh
7112031bfb LibJS: Use message from invalid token in syntax error 2020-10-26 21:38:34 +01:00
Linus Groh
6a3389cec6 LibJS: Emit token message for invalid numeric literals 2020-10-26 21:38:34 +01:00
Linus Groh
19edcbd79c LibJS: Emit TokenType::Invalid for unterminated multi-line comments 2020-10-26 21:38:34 +01:00
Linus Groh
03c1d43f6e LibJS: Add message string to Token
This allows us to communicate details about invalid tokens to the parser
without having to invent a bunch of specific invalid tokens like
TokenType::InvalidNumericLiteral.
2020-10-26 21:38:34 +01:00
Till Mayer
2ac734b7a8 Solitaire: Play animation when starting a new game 2020-10-26 21:36:40 +01:00
Till Mayer
ef458f7b66 Solitaire: Refactor CardStack layout code 2020-10-26 21:36:40 +01:00
Andreas Kling
4bc8768737 LibGUI: Tint selected icons in {Icon,Table,Columns}View
Add a gentle tint to selected icons based on the selection color. :^)
2020-10-26 21:32:27 +01:00
Andreas Kling
d172783d33 LibGUI: Fix bogus focus rect in buttons with icon but no text 2020-10-26 21:08:01 +01:00
Andreas Kling
06b5d292d7 LibGUI: Allow activating a focused button by pressing the space key :^)
This applies to normal push buttons, checkboxes, and radio buttons.
It feels very natural. Even moreso than activating with return..
2020-10-26 21:01:45 +01:00
Andreas Kling
b7dfa83223 LibGUI+LibGfx: Improve focus rect appearance
Draw a dotted focus rect to make it stand out more. Also make it much
larger on regular text-only GUI::Buttons.
2020-10-26 21:01:45 +01:00
Andreas Kling
f6084d42d9 LibGUI: Call up to the correct base class in GUI::AbstractView 2020-10-26 21:01:45 +01:00
Andreas Kling
f57c058c5e LibGUI: Call up to the correct base class in GUI::TextEditor 2020-10-26 21:01:45 +01:00
Andreas Kling
4e1dabeb15 LibGUI: Tweak "OK" button height in GUI::AboutDialog 2020-10-26 21:01:45 +01:00
Linus Groh
9735879318 LibMarkdown: Don't parse lines starting with a space as heading
This fixes a bug where lines starting with a space would get parsed as
"level 0" headings - it would not find a "#" and therefore never
increase the level counter (starting at zero), which then would cause
the check for "space after #" pass (again, there is no "#").

Eventually we would get funny results like this:

    <h0>[n-1 spaces]oops!</h0>

Also ASSERT(level > 0) in the Heading constructor.
2020-10-26 19:13:19 +01:00
Nico Weber
63dcd59fa5 LibGfx: Make Color formattable 2020-10-26 18:55:36 +01:00
Andreas Kling
709b3ccb0a HackStudio: Reset the cursor to I-beam when switching between files 2020-10-26 16:43:28 +01:00
Andreas Kling
0bc740ab7f HackStudio: Run clang-format 2020-10-26 14:58:17 +01:00
Andreas Kling
3d50923c4d HackStudio: Allow toggling line wrapping on/off from the Edit menu :^) 2020-10-26 14:29:30 +01:00
Andreas Kling
333ab53b8d HackStudio: Add a simple "open files" view
Instead of files disappearing after you switch to something else,
we now keep track of them in a little ListView below the project tree.

You can return to any previously opened file by activating it in the
open files list. :^)
2020-10-26 14:29:26 +01:00
AnotherTest
76a2c6e44d Shell: Fix cd' history (and cdh')
Previously, `cd` would push relative paths (and possibly nonexistent
ones too) into its history, so `cdh' would fail everywhere else.
2020-10-26 14:28:38 +01:00
AnotherTest
6d7b01a3cf Shell: Use kill() in fg/bg if killpg() fails
A job might not have its own pgid if it's created through run_tail().
2020-10-26 14:28:38 +01:00
AnotherTest
5a4673d468 Shell: Ensure that jobs going through run_tail() retain should_wait
This allows putting logic in the background as well.
2020-10-26 14:28:38 +01:00
AnotherTest
9ad858bcbf Shell: Make the ENSURE_WAITID_ONCE requirements a bit less strict
waitid() *may* be called many times if a job does not exit, so only
assert this fact when the job has in fact exited.
Also allows Background nodes to contain non-execute nodes.
2020-10-26 14:28:38 +01:00
AnotherTest
8de70e8ce7 Shell: Implement AK::Formatter::format() for AST::Command
...and use that to display jobs.
2020-10-26 14:28:38 +01:00
Andreas Kling
05ff75c321 Snake: Use the system default fixed-width font
Instead of looking one up by name.
2020-10-26 11:33:27 +01:00
Linus Groh
0f5d1f4074 js: Load and save history from/to ~/.js-history
This is super useful when hacking on LibJS and in general :^)
2020-10-26 11:27:54 +01:00
Linus Groh
d412fbdcf3 Shell+LibLine: Support HISTCONTROL environment variable
This is implemented in Line::Editor meaning not only the Shell will
respect it, but also js, Debugger etc.

Possible values are "ignorespace", "ignoredups" and "ignoreboth", as
documented in Shell-vars(7), for now.

The default value for the anon user (set in .shellrc) is "ignoreboth".
2020-10-26 11:27:54 +01:00
Linus Groh
4a4b1b1131 Shell: Support HISTFILE environment variable
This allows changing the Shell's history file path.
2020-10-26 11:27:54 +01:00
Linus Groh
b2e4fe1299 Shell+LibLine: Move Shell::{load,save}_history() to Line::Editor
This allows us to easily re-use history loading and saving in other
programs using Line::Editor, as well as implementing universally
recognized HISTCONTROL.
2020-10-26 11:27:54 +01:00
AnotherTest
af05671843 LibMarkdown: Flush the pending paragraphs when encountering empty lines
Fixes #3854.
2020-10-26 09:36:12 +01:00
Luke
63a94deb43 LibTLS: Treat a close_notify before agreeing on a cipher suite as a handshake failure
Some TLS implementations (namely, AWS CloudFront) do this instead of
sending handshake_failure for some reason.
2020-10-26 08:59:57 +01:00
Tom
328e481ee9 Kernel: Halt all processors on assertion failure 2020-10-26 08:57:25 +01:00
Tom
3ffdaabe10 Kernel: Only consider scheduler Running threads if they're the current
There will be as many threads in Running state as there are CPUs.
Only consider a thread in that state if it is the current thread
already.
2020-10-26 08:57:25 +01:00