Commit graph

12355 commits

Author SHA1 Message Date
AnotherTest
688e54eac7 Kernel: Distinguish between new and old process groups with equal pgids
This does not add any behaviour change to the processes, but it ties a
TTY to an active process group via TIOCSPGRP, and returns the TTY to the
kernel when all processes in the process group die.
Also makes the TTY keep a link to the original controlling process' parent (for
SIGCHLD) instead of the process itself.
2020-08-19 21:21:34 +02:00
AnotherTest
cf18bff72a Shell: Do not attempt to yank the TTY from background processes
They don't own the TTY anyway!
2020-08-19 21:21:34 +02:00
AnotherTest
217eca3d3f Shell: Name the pipe ends correctly 2020-08-19 21:21:34 +02:00
AnotherTest
20d4287eaf Shell: Fix outdated debug log code 2020-08-19 21:21:34 +02:00
Andreas Kling
6d4016dd01 LibGUI: Use StringBuilder::join() in Shortcut::to_string() 2020-08-19 21:17:02 +02:00
Andreas Kling
a188e6e7d6 Base: Tweak the "new" icon to be slightly flatter
This way it fits in better with its neighbors. :^)
2020-08-19 21:17:02 +02:00
Andreas Kling
607e085823 Ext2FS: Fix inode link leak on all new inodes
The initial inode link count was wrong in Ext2FS, as the act of adding
new inodes to their new parent bumps the count.

This regressed in df66c28479.
2020-08-19 21:17:02 +02:00
Jake Wilson
0f6de0c45a Browser: add urls to browser history on load start
urls were previously added to history in the Tab::load()
function, which excluded the setter on window.location.href.
This commit adds all urls to browser history when the page loads,
as long as the load_type is not LoadType::HistoryNavigation.
Closes #3148
2020-08-19 21:11:10 +02:00
Tom
f503d3c046 WindowServer: Process dnd mouse events first
Fixes duplicate GUI::DragOperation instances being created.

Fixes #3151
2020-08-19 21:06:37 +02:00
Brian Gianforcaro
8e97de2df9 Kernel: Use Userspace<T> for the recvfrom syscall, and Socket implementation
This fixes a bunch of unchecked kernel reads and writes, seems like they
would might exploitable :). Write of sockaddr_in size to any address you
please...
2020-08-19 21:05:28 +02:00
Brian Gianforcaro
9f9b05ba0f Kernel: Use Userspace<T> for the sendto syscall, and Socket implementation
Note that the data member is of type ImmutableBufferArgument, which has
no Userspace<T> usage. I left it alone for now, to be fixed in a future
change holistically for all usages.
2020-08-19 21:05:28 +02:00
Tom
d4dae49dcd LibHTTP: Fix processing terminating chunk
After encountering the terminating chunk we need to read the
trailing headers line by line, until encountering the final
empty line.

Fixes #3197
2020-08-19 15:28:31 +02:00
Tom
4897eb8c3e Taskbar: Update and clear taskbar button rectangles
We need to update all button rectangles when the layout changed.
We also need to clear the taskbar button rectangle when we
remove a modal window button, so that WindowServer uses the
parent's taskbar button rectangle for the minimize animation.
2020-08-19 11:38:26 +02:00
Tom
2552e3be00 WindowServer: Find parent taskbar rect for minimize animation
If a modal window is being minimized, it may not have its own
taskbar rectangle. In that case, try finding a parent in the
modal window stack that does have one, and use that for the
animation.
2020-08-19 11:38:26 +02:00
Muhammad Zahalqa
e035640cd5
Kernel: Remove unneeded #include in ProcessorInfo.cpp (#3211) 2020-08-19 11:25:12 +02:00
Muhammad Zahalqa
64ea64fca5
Kernel: Remove an unimplemented function (#3210) 2020-08-19 11:24:40 +02:00
Tom
5cd2a37079 LibGfx: Small improvement for DisjointRectSet::shatter
This avoids a call to clone() which would be discarded immediately.
Also, avoid essentially cloning for each hammer rectangle unless
there is actually a need for it.
2020-08-19 11:20:27 +02:00
Muhammad Zahalqa
983f4f935c
Kernel: Do not wait before first attempt at locking SpinLock (#3212) 2020-08-19 11:10:53 +02:00
Tom
c711d34276 WindowServer: Use same modal minimize/maximize logic with shortcuts
When minimizing/maximizing windows using the keyboard shortcuts
we should use the same logic dealing with modal windows as the
window frame buttons.
2020-08-18 19:50:33 +02:00
Andreas Kling
71e8554740 Kernel: Remove the now-unused FS::DirectoryEntry
This object was cumbersome and annoying (mostly due to its manually
managed, statically sized name buffer.) And now we no longer need it!
2020-08-18 18:26:54 +02:00
Andreas Kling
6ad2d31952 Ext2FS: Stop using FS::DirectoryEntry
We were only using this as a temporary helper object while constructing
directories. Create a simpler Ext2FSDirectoryEntry instead for this.
2020-08-18 18:26:54 +02:00
Andreas Kling
108263314a TmpFS: Stop using FS::DirectoryEntry in TmpFSInode
The list of children can just be a bunch of { name, inode }.
2020-08-18 18:26:54 +02:00
Andreas Kling
c096cb9352 TmpFS: Avoid unnecessary inode lookup in TmpFSInode::lookup()
We don't have to ask the VFS to find our child inode, we have a pointer
to it right here.
2020-08-18 18:26:54 +02:00
Andreas Kling
eeaba41d13 Kernel: Add DirectoryEntryView for VFS directory traversal
Unlike DirectoryEntry (which is used when constructing directories),
DirectoryEntryView does not manage storage for file names. Names are
just StringViews.

This is much more suited to the directory traversal API and makes
it easier to implement this in file system classes since they no
longer need to create temporary name copies while traversing.
2020-08-18 18:26:54 +02:00
Abu Sakib
8abf5048b8 Calendar: Add help menuitem 2020-08-18 17:24:14 +02:00
Sergey Bugaev
4f06cda8f8 2048: Tweak default window size
As requested by @nico
2020-08-18 17:19:52 +02:00
Sergey Bugaev
1671e1ac92 WindowServer+LibVT: Convert some dbgprintf() to dbg()
These kept annoying me, because these were the only two lines in the default
boot log that went unattributed.
2020-08-18 17:19:52 +02:00
Sergey Bugaev
7861ebaad7 2048: Generate more "2" tiles
This is how the original game does it.
2020-08-18 17:19:52 +02:00
Sergey Bugaev
8dd5b0af4e 2048: Move score to a status bar
See how straightforward this was? That's because, thanks to the separation
between the model and the view, we can tweak the view without modifying the
model in any way.
2020-08-18 17:19:52 +02:00
Sergey Bugaev
05ea144961 2048: Separate game logic from the view :^)
Look Ali, it's simple:

* The *model* (in many cases, an instance of GUI::Model, but it doesn't have to
  be) should implement the "business logic" (in this case, game logic) and
  should not concern itself with how the data/state is displayed to the user.

* The *view*, conversely, should interact with the user (display data/state,
  accept input) and should not concern itself with the logic. As an example, a
  GUI::Button can display some text and accept clicks -- it doesn't know or care
  what that text *means*, or how that click affects the app state. All it does
  is it gets its text from *somebody* and notifies *somebody* of clicks.

* The *controller* connects the model to the view, and acts as "glue" between
  them.

You could connect *several different* views to one model (see FileManager), or
use identical views with different models (e.g. a table view can display pretty
much anything, depending on what model you connect to it).

In this case, the model is the Game class, which maintains a board and
implements the rules of 2048, including tracking the score. It does not display
anything, and it does not concern itself with undo management. The view is the
BoardView class, which displays a board and accepts keyboard input, but doesn't
know how exactly the tiles move or merge -- all it gets is a board state, ready
to be displayed. The controller is our main(), which connects the two classes
and bridges between their APIs. It also implements undo management, by basically
making straight-up copies of the game.

Isn't this lovely?
2020-08-18 17:19:52 +02:00
Sergey Bugaev
99efc01b2e 2048: Automatically pick an appropriate font size 2020-08-18 17:19:52 +02:00
Sergey Bugaev
50d81f1e14 2048: Use the original colors 2020-08-18 17:19:52 +02:00
Sergey Bugaev
70356429ae 2048: Tweak cell metrics
This makes the game look closer to the original.

It also fixes a weird thing where cells were displayed in a wrong order (as if
mirrored or something), and to accommodate for that keyboard actions were also
mixed up. Now it's all working as intended.
2020-08-18 17:19:52 +02:00
Nico Weber
2460980d2c LibWeb: Implement Element.innerText
Reading the property has a few warts (see FIXMEs in the included
tests), but with this the timestamps on http://45.33.8.238/
get localized :^)

Since the Date() constructor currently ignores all arguments,
they don't get localized correctly but are all set to the current
time, but hey, it's still progress from a certain point of view.
2020-08-18 16:58:46 +02:00
Nico Weber
2f85af2a20 LibWeb: Simplify Node::text_content() 2020-08-18 16:58:46 +02:00
AnotherTest
68189f80cc Shell: Document the use of environment/local variables 2020-08-18 16:58:17 +02:00
AnotherTest
32bfb48577 Shell: Update manpage about for loop behaviour around signals 2020-08-18 16:58:17 +02:00
AnotherTest
4ee4c94d60 Shell: Respect the 'PROMPT_EOL_MARK' environment variable
This allows the users to customise what is shown when a command ends
without a newline.
2020-08-18 16:58:17 +02:00
AnotherTest
ae9211037e LibLine: Make actual_rendered_string_metrics() static
This function didn't depend on the editor itself.
2020-08-18 16:58:17 +02:00
Muhammad Zahalqa
ff577e22a3 Kernel: ProcessorInfo.cpp remove unused headers 2020-08-18 13:41:08 +02:00
AnotherTest
bda1d7fd7b LibLine: Setup the keybindings after initialisation
This makes the keybindings that depend on `m_termios` (^W, ^U, etc) work.
2020-08-18 13:40:44 +02:00
Tom
a698a58d3c WindowServer: Fix flickering
Rather than blitting and rendering each window every time, only
render what actually changed. And while doing so, only render
the portions that are visible on the screen. This avoids flickering
because flipping framebuffers isn't always perfectly in sync with
the code, so it's possible that the flip happens slightly delayed
and we can briefly see the next iteration having partially completed.

Also, avoid touching the mouse cursor unless it is in an area that
needs updating. This reduces flickering unless it is over an area
that is updated often. And because we no longer render the entire
screen, we'll save the contents below the cursor so that we can
hide it before touching that area.

Fixes #2981
2020-08-18 12:12:27 +02:00
Tom
f8903acea2 LibGfx: Add convenience helpers for Rect 2020-08-18 12:12:27 +02:00
Tom
a43ba348e1 LibGfx: Add convenience method Point::constrained 2020-08-18 12:12:27 +02:00
Tom
790eacfbd1 LibGfx: Add a few convenience methods to DisjointRectSet 2020-08-18 12:12:27 +02:00
AnotherTest
5b9d563b4b LibLine: Allow the user to override (or add) keybinds in the config file 2020-08-18 12:07:32 +02:00
AnotherTest
32839d40e3 LibLine: Make (almost) all key actions configurable
This moves all internal functions to a new file, and defines the old
keybinds with register_key_input_callback().
2020-08-18 12:07:32 +02:00
AnotherTest
d0aab41628 LibLine: Read configuration from a config file 2020-08-18 12:07:32 +02:00
AnotherTest
afbeb8f977 LibCore: Add ConfigFile::get_for_lib() 2020-08-18 12:07:32 +02:00
Ben Wiederhake
1176865276 Meta: Explain how to build with ninja
Inspired by #3047, and my struggles to understand how cmake is supposed to work ^^

Thanks to @bgianfo, who made me realize that ninja can be used just like make.
No idea why I didn't notice that earlier.
2020-08-17 23:05:55 +02:00