Commit graph

14939 commits

Author SHA1 Message Date
Andreas Kling
d893498e57 Kernel: Use fallible KBuffer API in PerformanceEventBuffer 2020-12-19 10:23:12 +01:00
Sahan Fernando
fb9a71bd6a AK: Add hash implementations for i16 and i64 2020-12-19 10:20:15 +01:00
Andreas Kling
3d02597316 Kernel: Avoid a heap allocation for every outgoing TCP packet 2020-12-18 19:22:26 +01:00
Andreas Kling
befabe31c9 Kernel/Net: Avoid a heap allocation for every outgoing UDP packet
We can use a stack buffer to build the UDP packet instead.
2020-12-18 19:22:26 +01:00
Andreas Kling
8cc81c2953 Kernel/Net: Make IPv4Socket::protocol_receive() take a ReadonlyBytes
The overrides of this function don't need to know how the original
packet was stored, so let's just give them a ReadonlyBytes view of
the raw packet data.
2020-12-18 19:22:26 +01:00
Andreas Kling
8e79bde2b7 Kernel: Move KBufferBuilder to the fallible KBuffer API
KBufferBuilder::build() now returns an OwnPtr<KBuffer> and can fail.
Clients of the API have been updated to handle that situation.
2020-12-18 19:22:26 +01:00
Andreas Kling
d936d86332 Kernel: Add KBuffer::try_create_with_bytes()
Here's another fallible KBuffer construction API that creates a KBuffer
and populates it with a range of bytes.
2020-12-18 19:22:26 +01:00
Andreas Kling
bcd2844439 TmpFS: Use fallible KBuffer API
If allocation fails, some TmpFS operations can now fail with ENOMEM.
2020-12-18 19:22:26 +01:00
Andreas Kling
47da86d136 Ext2FS: Fail the mount if BGD table cache allocation fails
Instead of asserting if we can't allocate enough memory for a BGD table
cache, just fail the mount instead.
2020-12-18 19:22:26 +01:00
Andreas Kling
8cde8ba511 Kernel: Add KBuffer::try_create_with_size()
We need to stop assuming that KBuffer allocation always succeeds.
This patch adds the following API:

- static OwnPtr<KBuffer> KBuffer::create_with_size(size_t);

All KBuffer clients should move towards using this (and handling any
failures with grace.)
2020-12-18 19:22:26 +01:00
AnotherTest
5d1425718e LibLine: Treat leftover data in buffer as a read event
Fixes #4328.
2020-12-18 19:20:37 +01:00
AnotherTest
5e6b9cbc91 LibLine: Be less lazy when moving prompt origin row
Fixes the issue where adding multiple lines in one refresh cycle would
break cursor positioning.
2020-12-18 19:20:37 +01:00
Brendan Coles
27a5c51f3f LibCore: UDPServer::bind: Replace bind failure assert() with perror() 2020-12-18 19:20:30 +01:00
Linus Groh
fe88f46bc9 LibGUI: Don't assume main widget exists in Window::handle_resize_event()
Just like the other event handler functions, handle_resize_event()
shouldn't assume that the window has a main widget (which is being
resized in this case).

Fixes #4450.
2020-12-18 19:20:15 +01:00
Nico Weber
573d5b7ff2 LibGfx: Give Size and Rect * and *= operators 2020-12-18 17:35:30 +01:00
Nico Weber
b67eed5b80 LibGfx: Fix type of scale factor in Point scale operators 2020-12-18 17:35:30 +01:00
Brendan Coles
098f06f042 ClipboardHistory: Add window icon 2020-12-18 17:25:24 +01:00
Sahan Fernando
354a1a7891 HackStudio: Remove duplicate auto-indentation in HackStudio Language Server 2020-12-18 16:25:42 +01:00
Sahan Fernando
8dc0d9b7b7 LibGUI: Make autoformatting performed on InsertTextCommand visible to on_edit_action 2020-12-18 16:25:42 +01:00
Andreas Kling
4232874270 Kernel: Don't dump core when OOM-killing a process
Trying to generate a core dump under low memory conditions is not the
best idea.

Fixes #4428.
2020-12-18 11:22:21 +01:00
Andreas Kling
18f1f4e1a2 LibWeb: Only preserve full whitspace for white-space: pre{,-wrap} 2020-12-18 11:04:29 +01:00
Andreas Kling
b322452ef4 LibWeb: Silence BFC spam about not knowing how to place boxes
This gets way too noisy on some pages, and isn't even interesting.
2020-12-18 10:25:50 +01:00
Liav A
5a146187cf Kernel: Workaround QEMU bug and initialize i8042 controller
ACPI 2 declared the third revision of FADT, that should have
IAPC_BOOT_ARCH flags in it, also to indicate if i8042 is present.
Q35 machine reports that it has FADT with revision 3, but the code
in QEMU simply ignores these flags and put zero on them no matter
the revision of FADT.
2020-12-18 10:02:14 +01:00
Linus Groh
176fe1795d Base: Add app-libgfx-demo.png 32x32 icon
The 16x16 icon already looks great, so this is a larger version of it,
with the same shapes and colors.
2020-12-18 10:01:18 +01:00
Linus Groh
9dc4f8bc06 Base: Add app-fire.png 32x32 icon
This is an upscaled (no interpolation) version of the 16x16 icon, which
looks pretty neat given the pixelated appearance of the "Fire" demo
application. :^)
2020-12-18 10:01:18 +01:00
Linus Groh
13697ae108 Base: Add app-cube.png 32x32 icon 2020-12-18 10:01:18 +01:00
Linus Groh
b9e3dbfbd1 Base: Tweak app-cube.png 16x16 icon 2020-12-18 10:01:18 +01:00
Brendan Coles
219d039639 Screensaver: Add app-screensaver.png 32x32 icon 2020-12-18 10:01:09 +01:00
Andreas Kling
6d7892cfc4 LibWeb: Whitespace that causes a line to wrap should be hidden
We were only pruning trailing whitespace on lines. This patch makes it
so we also don't add whitespace as the leading line box fragment on new
lines.

This logic is pretty crufty and I think we can do better, but for now
I've just made it handle this extra case so we can stop having lines
that start with a space character. :^)
2020-12-17 21:10:57 +01:00
Brendan Coles
172707a945 Chess: Prevent board changes when waiting for ChessEngine to move 2020-12-17 19:45:05 +01:00
Tom
07badd9530 WindowServer: Add the ability to animate cursors
This adds the ability to specify cursor attributes as part of their
file names, which allows us to remove hard coded values like the hot
spot from the code. The attributes can be specified between the last
two dots of the file name. Each attribute begins with a character,
followed by one or more digits that specify a uint value.

Supported attributes:
x: The x-coordinate of the cursor hotspot
y: The y-coordinate of the cursor hotspot
f: The number of animated frames horizontally in the image
t: The number of milliseconds per frame

For example, the filename wait.f14t100.png specifies that the image
contains 14 frames that should be cycled through at a rate of 100ms.
The hotspot is not specified, so it defaults to the center.
2020-12-17 19:40:05 +01:00
Brendan Coles
853664bd3c LibC: stdlib: Add clearenv() function 2020-12-17 19:39:56 +01:00
Linus Groh
3436317c08 LibWeb: Escape text nodes in innerHTML getter 2020-12-17 19:39:48 +01:00
Linus Groh
4833f0066e LibWeb: Include element attributes in innerHTML getter 2020-12-17 19:39:48 +01:00
Liav A
f36feb42bd Kernel: Return a correct name string of async write request 2020-12-17 19:36:56 +01:00
Andreas Kling
4c8dbc908c LibWeb: Notify the PageClient when the children of <title> change 2020-12-17 02:02:00 +01:00
Andreas Kling
2a5877b02c LibWeb: Fix shrink-to-fit layout for position:absolute
We were following the spec incorrectly. The comment was right, but the
code was wrong.
2020-12-17 01:47:42 +01:00
Andreas Kling
a5422a210f LibWeb: Use the correct containing block for position:absolute width 2020-12-17 01:46:51 +01:00
Andreas Kling
f0a4a6bb11 LibWeb: Always break around inline-blocks in AllPossibleLineBreaks mode 2020-12-17 01:42:03 +01:00
Andreas Kling
f35f605a24 LibWeb: Make sure the ICB is at least as tall as the viewport
This is a hack until we implement a proper overflow mechanism. For now,
this allows us to right-click below the lowest content on the page.
2020-12-17 00:58:23 +01:00
Andreas Kling
598efa60a3 LibGUI: Table views with SelectRows should scroll entire rows into view 2020-12-17 00:54:58 +01:00
Andreas Kling
f0138fcb25 LibGUI: Move selection behavior from TableView up to AbstractView
Let's make SelectionBehavior a view concept where views can either
select individual items (row, index) or whole rows. Maybe some day
we'll do whole columns, but I don't think we need that now.
2020-12-17 00:54:58 +01:00
Brendan Coles
c8fb00fe4d UserspaceEmulator: Implement geteuid, getegid, ptsname syscalls 2020-12-17 00:02:03 +01:00
Tom
c4176b0da1 Kernel: Fix Lock race causing infinite spinning between two threads
We need to account for how many shared lock instances the current
thread owns, so that we can properly release such references when
yielding execution.

We also need to release the process lock when donating.
2020-12-16 23:38:17 +01:00
Andreas Kling
56701f91f9 ln: Make the 'path' argument optional
If 'path' is omitted, we create a link with the basename of whatever
the target is. This matches what other systems do.
2020-12-16 23:26:35 +01:00
Linus Groh
3d7b8de64f Shell: Don't run commands with failing redirections
Fixes #3423.
2020-12-16 23:26:19 +01:00
Andreas Kling
5eacf62ba3 FileManager: Fix assertion when drag&dropping a file to the desktop 2020-12-16 19:40:24 +01:00
Andreas Kling
226ac8a47b LibGUI: Don't fill IconView item text background unless actually wanted
We were always filling the rect behind item texts, even when the widget
had fill_with_background_color() == false.
2020-12-16 19:39:26 +01:00
Andreas Kling
4236127fb9 LibGUI: Make the IconView cursor rect show up on the desktop
It was getting lost in some bogus coordinate conversion math while
trying to constrain unusually long item texts.
2020-12-16 19:39:26 +01:00
Andreas Kling
50aab509ce LibGUI: Add ScrollableWidget helpers for rect conversion
to_content_rect() and to_widget_rect() help you convert rects from one
coordinate space to the other.
2020-12-16 19:39:26 +01:00