Commit graph

13844 commits

Author SHA1 Message Date
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
Tom
1e2e3eed62 Kernel: Fix a few deadlocks with Thread::m_lock and g_scheduler_lock
g_scheduler_lock cannot safely be acquired after Thread::m_lock
because another processor may already hold g_scheduler_lock and wait
for the same Thread::m_lock.
2020-10-26 08:57:25 +01:00
Tom
8c764319ad Kernel: Various APIC timer fixes 2020-10-26 08:57:25 +01:00
Tom
b8ad4932a9 Kernel: Fix race condition waiting for IPI while other CPU requested halt
It's possible that we broadcast an IPI message right at the same time
another processor requests a halt. Rather than spinning forever waiting
for that message to be handled, check if we should halt while waiting.
2020-10-26 08:57:25 +01:00
Tom
fe615e601a Kernel: Set up and calibrate APIC timer, and enable timer on all CPUs
This enables the APIC timer on all CPUs, which means Scheduler::timer_tick
is now called on all CPUs independently. We still don't do anything on
the APs as it instantly crashes due to a number of other problems.
2020-10-25 21:18:35 +01:00
Andreas Kling
9d347352a1 LibGfx+LibGUI+Clients: Make fonts findable by their qualified name
The qualified name of a font is "<Family> <Size> <Weight>". You can
get the QN of a Font via the Font::qualified_name() API, and you can
get any system font by QN from the GUI::FontDatabase. :^)
2020-10-25 21:18:18 +01:00
Andreas Kling
260b52215c HexEditor: Use the system default fixed width font 2020-10-25 21:18:18 +01:00
Linus Groh
66e315959d LibJS: Allow all line terminators to be used for line continuations 2020-10-25 19:45:47 +01:00
asynts
1319ad476d AK: Deprecate warn(). 2020-10-25 18:52:51 +01:00
asynts
1254cbbd0b AK: Eradicate calls to warn(). 2020-10-25 18:52:51 +01:00
asynts
a5f5c3fd33 LibC+Tests: Fix broken snprintf test.
`snprintf` returns the number of characters that would have been written
had the buffer been large enough.

It's a common trick to call `snprintf(nullptr, 0, ...)` to measure how
large a buffer has to be.

Thus the return value is not zero but fourteen.
2020-10-25 18:52:51 +01:00
asynts
0ab3488b60 AK: Remove a really slow unit test. 2020-10-25 18:52:51 +01:00
Linus Groh
7eee39b850 LookupServer: Support multiple nameservers
The configuration key [DNS] Nameserver has been renamed to Nameservers
and accepts a comma-separated list of nameserver addresses, which will
be queried in the given order until a response has been received.

The new default value is still Cloudflare's 1.1.1.1 as well as their
secondary DNS server 1.0.0.1.
2020-10-25 18:52:20 +01:00
Linus Groh
2440112d53 LookupServer: Replace unused 'did_timeout' with 'did_get_response'
did_timeout is a bool& parameter of lookup() that used to be set when
the UDP connection timed out, but this behaviour was broken in e335d73.
I replaced it with a more useful 'did_get_response' parameter that is
being set after the UDP socket connected, sent its request and got a
response - it might still be bogus data but we know the communication
was successful.
2020-10-25 18:52:20 +01:00
Linus Groh
75864b5a85 LookupServer: Replace dbg()/dbgprintf() with dbgln() 2020-10-25 18:52:20 +01:00
AnotherTest
956e9aa736 Shell: Fix off-by-one in EOL mark printing
Fixes #3844.
2020-10-25 16:39:18 +01:00
Andreas Kling
7b638e2d0d LibGUI: Make the Cancel/Okay buttons in GUI::FilePicker a little taller 2020-10-25 15:36:09 +01:00
Andreas Kling
cfe1c132cb WindowServer: Raise menu item icons slightly when hovered :^)
Same effect as LibGUI toolbar buttons.
2020-10-25 15:32:19 +01:00
Andreas Kling
8b12d200ba LibGUI: Raise toolbar button icons slightly when hovered :^)
This make buttons look extra clickable when hovered by lifting up their
icons (-1,-1) and painting a little icon-shaped shadow under them.

Partially inspired by the Office XP toolbars, although we don't go all
the way with the faux-hyperlink stuff that was all the rage back then.
2020-10-25 15:32:19 +01:00
Andreas Kling
3ba6dceee3 Taskbar: Make quicklaunch buttons larger and reduce spacing
The end result is almost identical, but now it's a little easier to
hit the buttons with the cursor. :^)
2020-10-25 15:32:19 +01:00
Marcin Gasperowicz
e5ddcadd3c LibJS: Parse line continuations in string literals properly
Newlines after line continuation were inserted into the string 
literals. This patch makes the parser ignore the newlines after \ and
also makes it so that "use strict" containing a line continuation is 
not a valid "use strict".
2020-10-25 15:16:47 +01:00
Andreas Kling
e6505a95f1 HackStudio: Include missing files in the project tree
If some file is in the project but missing on disk, let's still show
it in the project tree (instead of obscuring the fact that a file
is missing.)
2020-10-25 14:38:07 +01:00
Andreas Kling
47a3d81731 HackStudio: Don't assert when project has non-existent file
If a project contains "foo.cpp" but we can't open "foo.cpp", just go
with an empty text document for now, and we'll create "foo.cpp" when
the user saves.
2020-10-25 14:38:07 +01:00
Andreas Kling
387607503c LibCore: IODevice::can_read_line() should succeed for newline-less file
If the first call to populate_read_buffer() hits EOF but something did
get buffered, we can indeed read a line.
2020-10-25 14:38:07 +01:00
Matthew L. Curry
212aa85a55 Userland/sort: Convert sort to use getline
Sort uses a statically sized buffer. This commit changes that to use getline,
so lines of any size will be handled properly.
2020-10-25 14:37:48 +01:00