Commit Graph

12183 Commits

Author SHA1 Message Date
Peter Elliott
e05372cee2 Chess: Add legal move checking 2020-08-15 20:54:02 +02:00
Peter Elliott
7333916252 Chess: Add basic ChessWidget and ugly piece set 2020-08-15 20:54:02 +02:00
Ben Wiederhake
8d680dd1ad Meta: Lint for duplicate endpoint IDs
We currently have 16 endpoints. The IDs are typed by a human at creation time.
This check will detect with we ever use an endpoint ID twice.

Since the large irrelevant directories are ignored, this should be quick enough.
2020-08-15 20:48:52 +02:00
Ben Wiederhake
7a8c72d136 Meta: Document QtCreator auto-format and compiler kits 2020-08-15 20:48:52 +02:00
AnotherTest
154ffa3f5f Shell: Add some tests for builtin redirection 2020-08-15 20:48:17 +02:00
AnotherTest
c589625418 Shell: Allow redirections and pipes on builtins
Fixes #3072.
2020-08-15 20:48:17 +02:00
Matus Ferech
0dac7af6c5 HackStudio: Silence make output when checking if make is present 2020-08-15 20:11:46 +02:00
Matus Ferech
e451ce816c HackStudio: Use Core::ArgsParser for path to workspace 2020-08-15 20:11:46 +02:00
Nico Weber
19ee853cd0 LibGUI: Make ProcessChooser accept double clicks on rows as "Ok" click 2020-08-15 19:07:47 +02:00
Nico Weber
cd7b4e813f LibGUI: Remove reference captures of stack variables in ProcessChooser
Since all reference-captured variables where pointers to non-stack
objects whose owners outlive the lambdas, things were fine in practice,
but it's a bit brittle and it makes a change I want to make in this code
more difficult.
2020-08-15 19:07:47 +02:00
Linus Groh
2e5c434e22 Misc: Use automatic window positioning in more applications
This is a follow up to #2936 / d3e3b4ae56aa79d9bde12ca1f143dcf116f89a4c.

Affected programs:
- Applications: Browser (Download, View source, Inspect DOM tree, JS
  console), Terminal (Settings)
- Demos: Cube, Eyes, Fire, HelloWorld, LibGfxDemo, WebView,
  WidgetGallery
- DevTools: HackStudio, Inspector, Profiler
- Games: 2048, Minesweeper, Snake, Solitaire
- Userland: test-web

A few have been left out where manual positioning is done on purpose,
e.g. ClipboardManager (to be close to the menu bar) or VisualBuilder (to
preserve alignment of the multiple application windows).
2020-08-15 17:38:19 +02:00
Linus Groh
0cab3bca2f LibGUI: Add and use Window::center_on_screen()
Various applications were using the same slightly verbose code to center
themselves on the screen/desktop:

Gfx::IntRect window_rect { 0, 0, width, height };
window_rect.center_within(GUI::Desktop::the().rect());
window->set_rect(window_rect);

Which now becomes:

window->resize(width, height);
window->center_on_screen();
2020-08-15 17:38:19 +02:00
Ben Wiederhake
5f724b6ca1 Travis: Toolchain only depends on headers, not impls
When libstdc++ was added in 4977fd22b8, just calling
'make install' was the easiest way to install the headers. And the headers are all
that is needed for libstdc++ to determine the ABI. Since then, BuildIt.sh was
rewritten again and again, and somehow everyone just silently assumed that
libstdc++ also depends on libc.a and libm.a, because surely it does?

Turns out, it doesn't! This massively reduces the dependencies of libstdc++,
hopefully meaning that the Toolchain doesn't need to be rebuilt so often on Travis.

Furthermore, the old method of trying to determine the dependency tree with
bash/grep/etc. has finally broken anyways:

    https://travis-ci.com/github/SerenityOS/serenity/builds/179805569#L567

In summary, this should eliminate most of the Toolchain rebuilds on Travis,
and therefore make Travis build blazingly fast! :^)
2020-08-15 16:49:55 +02:00
Ben Wiederhake
0df9ddf604 Travis: Don't use Python 2, clarify reason of reinstall
This removes the dependency on the dead language python2.

Also, when we upgrade the base linux image (in 2020 or maybe 2021?),
this entire thing can hopefully be removed.
2020-08-15 16:49:09 +02:00
Itamar
dca6a77669 LibDebug: Fix DebugSession teardown
Previously, we were trying to remove the breakpoints we set on the
debugee even if it has already exited, which caused PT_POKE to fail.
2020-08-15 15:06:35 +02:00
Itamar
627f258c97 HackStudio: Use CodeDocument instead of TextDocument
This commit adds a new GUI widget type, called CodeDocument, which
is a TextDocument that can additionaly store data related to the
debugger.

This fixes various bugs and crashes that occured when we switched
between files in debug mode, because we previously held stale breakpoint
data for the previous file in the Editor object.
We now keep this data at the "document" level rather than the Editor
level, which fixes things.
2020-08-15 15:06:35 +02:00
Itamar
e793cc3d13 Base: Modify "little" project 2020-08-15 15:06:35 +02:00
Itamar
7eac9fe10e HackStudio: Support debugging library code
We can now step into library code in the debugger.

Since we now need the whole source code of our libraries
(and not just the headers), we clone the whole serenity git repo into
/usr/share/serenity.
2020-08-15 15:06:35 +02:00
Itamar
310063fed8 Meta: Install source files at /usr/src/serenity 2020-08-15 15:06:35 +02:00
Itamar
311a355505 HackStudio: Change singlestepping logic in the debugger
Previously, we did source-level singlestepping by inserting a
breakpoint at every source line and continued execution until we hit
a breakpoint. We did this because we used to not generate source
locations debug info for library code, and it allowed us to not single
step through lots of library code to get to the next source line
(which is super slow).

Since we now do generate source locations debug info for libraries
(-g1), we can improve the way we implement source level stepping by
stepping at the assembly level until we reach a different source code
location.
2020-08-15 15:06:35 +02:00
Itamar
b5f6a1a9e8 LibDebug: Assert that we can read the executable of the debugee 2020-08-15 15:06:35 +02:00
Itamar
3b422564f3 Kernel: Fix behaviour of PT_TRACEME in ptrace
The behaviour of the PT_TRACEME feature has been broken for some time,
this change fixes it.

When this ptrace flag is used, the traced process should be paused
before exiting execve.
We previously were sending the SIGSTOP signal at a stage where
interrupts are disabled, and the traced process continued executing
normally, without pausing and waiting for the tracer.
This change fixes it.
2020-08-15 15:06:35 +02:00
Linus Groh
47d7faa998 LibGUI: Update active tooltip when source widget changes the label
Application::show_tooltip() now keeps track of the application's active
tooltip source widget so it can be updated while being shown when the
same widget updates its tooltip label.
Application::hide_tooltip() will unset the tooltip source widget,
respectively.

This is pretty useful for the ResourceGraph applet's tooltips!

Also re-use the Application::TooltipWindow's rect position in its
set_tooltip() method to avoid flickering from the window temporarily
being moved to 100, 100 and the position adjusted moments later.
2020-08-15 13:45:08 +02:00
Ben Wiederhake
f19b88c965 Meta: Don't require setting SERENITY_ROOT for refresh script
The need for SERENITY_ROOT was basically eliminated in
73c953b674. The existing guess
'git rev-parse --show-toplevel' should be correct in all conceivable cases.
Most code just assumes the layout in git, or depends on SERENITY_ROOT as
set in the CMakeLists.txt. *Requiring* the user to set it doesn't make
sense anymore.

While I was in there anyway, I added exit code propagation. Also, 'find' should
be a tad faster now, because it doesn't enumerate files in the large ignored
directories Build/ and Toolchain/ anymore.
2020-08-15 13:38:24 +02:00
Ben Wiederhake
cebf8ae3b7 SystemMonitor: ProcessStack is now ThreadStack
This is a follow-up to #3095. In particular:
    https://github.com/SerenityOS/serenity/pull/3095#discussion_r469113354
2020-08-15 13:38:24 +02:00
Andreas Kling
46e53417c9 SystemServer: Adjust assertion+comment for new dup2() behavior
dup2(fd, fd) will no longer clear CLOEXEC on the descriptor.
2020-08-15 11:14:09 +02:00
Andreas Kling
65f2270232 Kernel+LibC+UserspaceEmulator: Bring back sys$dup2()
This is racy in userspace and non-racy in kernelspace so let's keep
it in kernelspace.

The behavior change where CLOEXEC is preserved when dup2() is called
with (old_fd == new_fd) was good though, let's keep that.
2020-08-15 11:11:34 +02:00
Andreas Kling
bf247fb45f Kernel+LibC+UserspaceEmulator: Remove sys$dup() and sys$dup2()
We can just implement these in userspace, so yay two less syscalls!
2020-08-15 01:30:22 +02:00
Tom
5f3d384454 WindowServer: Minimize the modal stack when minimizing from frame
Rather than only minimizing the modal window, minimize the entire
modal window stack just like when minimizing it from the task bar.
2020-08-15 01:28:18 +02:00
Uma Sankar
d5a77de906 LibGUI: Add a timer in ProcessChooser to get processes for every 1000ms 2020-08-15 00:20:34 +02:00
Muhammad Zahalqa
cdae3f53f1
LibC: bsearch fix for large arrays (#3138)
Implement unsigned arithmetic to compute middle without causing overflow.
And without mixed signed/unsigned operations.
2020-08-15 00:18:52 +02:00
Luke
bba2da66e7 Toolchain: Update README to point to the current build instructions
This README contains *really* outdated build instructions.
Let's put a pointer to the latest build instructions there instead.
2020-08-15 00:15:20 +02:00
Tom
72960fedc6 Kernel: Briefly resume stopped threads when being killed
We need to briefly put Stopped threads back into Running state
so that the kernel stacks can get cleaned up when they're being
killed.

Fixes #3130
2020-08-15 00:15:00 +02:00
Andreas Kling
2614ef550c LibWeb: Only paint focus outline when browser window has focus
This is communicated through the PaintContext::has_focus() flag.
2020-08-15 00:05:45 +02:00
Andreas Kling
c1e0047b48 LibGUI: When focusing a TextEditor via keyboard, select all contents
This feels very natural and allows you to start typing immediately
knowing it will replace whatever was in the text box before.
2020-08-15 00:05:45 +02:00
Andreas Kling
75b8f4e4e6 LibGUI: Make focus events more aware of why focus is changing
This patch adds GUI::FocusEvent which has a GUI::FocusSource.
The focus source is one of three things:

- Programmatic
- Mouse
- Keyboard

This allows receivers of focus events to implement different behaviors
depending on how they receive/lose focus.
2020-08-15 00:05:45 +02:00
Andreas Kling
110b3d89d3 LibGUI: Export GUI_FOCUS_DEBUG to visualize the focused widget
Using a command-line argument for this clashed with ArgsParser so let's
use an environment variable instead. I feel like Sergey told me to do
this at some point anyway. :^)
2020-08-15 00:05:45 +02:00
Andreas Kling
01022eb5d6 LibWeb: Allow focusing individual (focusable) elements with Tab key
You can now cycle through focusable elements (currently only hyperlinks
are focusable) with the Tab key.

The focus outline is rendered in a new FocusOutline paint phase.
2020-08-15 00:05:45 +02:00
Andreas Kling
5939af14d4 LibWeb: Pass non-accepted keydown events to PageView's base class
This will allow LibGUI's normal mechanisms to take over if the web
engine is not interested in the event right now.
2020-08-15 00:05:45 +02:00
Andreas Kling
7698feb8ce LibWeb: Add NonDocumentTypeChildNode::next_element_in_pre_order()
This is handy for traversing only the elements in a document.
2020-08-15 00:05:45 +02:00
Andreas Kling
a37331e236 Lagom: Add LibHTTP to Lagom (it builds fine without changes) 2020-08-15 00:05:45 +02:00
Muhammad Zahalqa
33cb41edcb LibThread: Lockable - add forwarding constructor 2020-08-14 18:15:10 +02:00
Muhammad Zahalqa
746f6ea36d Kernel: mark kmalloc with attributes 2020-08-14 18:14:23 +02:00
Andreas Kling
bbe2d4a2d9 LibJS+LibWeb: Clear exceptions after call'ing JavaScript functions
Decorated Interpreter::call() with [[nodiscard]] to provoke thinking
about the returned value at each call site. This is definitely not
perfect and we should really start thinking about slimming down the
public-facing LibJS interpreter API.

Fixes #3136.
2020-08-14 17:31:07 +02:00
Andreas Kling
c5127389ca LibJS: Assert that there's no exception on entry in Interpreter::call() 2020-08-14 17:30:34 +02:00
Nico Weber
19b329ee96 ifconfig: Fix capitalization of "kiB" 2020-08-14 16:09:58 +02:00
Nico Weber
d5b2233f2e ResourceGraph: add tooltips to cpu and memory graphs
The tooltip doesn't update while it's visible.
2020-08-14 16:09:58 +02:00
Andreas Kling
6b8807be6e AK: Fix obvious bad vector access in IPv4Address::from_string()
Fixes #3137.
2020-08-14 15:10:58 +02:00
AnotherTest
2336c62901 2048: Move out the 'undo' action to the app menu/action 2020-08-14 15:10:31 +02:00
AnotherTest
d97025567a 2048: Make the scoring system less 'lame' 2020-08-14 15:10:31 +02:00