Commit Graph

2555 Commits

Author SHA1 Message Date
Andreas Kling
21c56477b0 LibGUI: Add a GAbstractButton base class for button widgets.
This patch moves GButton and GRadioButton to inherit from it. This allows
them to share code for mouse event handling, etc.
2019-05-24 16:32:20 +02:00
Andreas Kling
abbcdba72e WindowServer: Add 2560x1440 resolution option.
Also expand the QEMU VGA memory size to 64 MB, since otherwise we won't
have enough memory for double-buffering the screen.
2019-05-24 14:02:17 +02:00
Christopher Dumas
9823354754 LibGUI: Don't crash when updating menu item that's not in the window server (#83)
Don't crash when updating menu item that's not in the window server. Menu Items begin with an invalid ID of -1, and only get a valid ID if the menu they are attached to is added to the window server. They don't send updates to the server unless they have a valid ID.

Fixes #82
2019-05-24 04:31:00 +02:00
Andreas Kling
ebf645d72a Kernel: Tidy up IDEDiskDevice a bit.
The main cleanup here is putting the I/O address base in a member variable.
2019-05-24 04:17:15 +02:00
Andreas Kling
36d8b9e89b LibGUI: Add a GRadioButton widget.
Radio buttons are automagically exclusive with other radio button children
of the same parent. :^)
2019-05-24 02:29:16 +02:00
Christopher Dumas
00075b1c8a Added functionality to make back and forward buttons work in FileManager. Also
fixed it so that directories don't get double-opened (first when they are
opened, and second when the selection changes to match in the file tree view)
2019-05-24 00:24:28 +02:00
Andreas Kling
fba57d6ba3 Always run QEMU with -debugcon stdio.
If someone wants to run without this, they can disable it manually :^)
2019-05-23 20:57:32 +02:00
Andreas Kling
9806a23f83 Kernel: Return ENOSYS if an invalid syscall number is requested. 2019-05-23 17:04:26 +02:00
Robin Burchell
6917c42140 Kernel/AK: Move ELF loader to AK
This is in preparation for eventually using it in userspace.
LinearAddress.h has not been moved for the time being (as it seems to be
only used by a very small part of the code).
2019-05-23 16:57:34 +02:00
Robin Burchell
5b3c4afff2 LibC: Stub out dlfcn 2019-05-23 16:57:34 +02:00
Andreas Kling
14a202f011 Kernel: getpeername() should fail with ENOTCONN for non-connected sockets. 2019-05-23 15:39:52 +02:00
Andreas Kling
709893364d LibC: The "install" target should depend on the "startfiles" target.
This ensures that crt0.o is built during the Toolchain bootstrap.
2019-05-23 14:10:37 +02:00
Robin Burchell
a04a58b7eb LibC: Port setjmp syntax to avoid nasm dependency 2019-05-23 13:06:59 +02:00
Andreas Kling
7afc0fb9c8 Kernel: Forked children should inherit their RangeAllocator by copy.
Otherwise we'll start handing out addresses that are very likely already in
use by existing ranges.
2019-05-22 13:24:28 +02:00
Andreas Kling
8098d2e337 Kernel: If a signal is ignored, make sure we unset BlockedSignal state. 2019-05-22 13:23:41 +02:00
Andreas Kling
c048ded470 Kernel: Dump backtrace on illegal opcode exception. 2019-05-22 13:22:27 +02:00
Andreas Kling
e388808479 LibC: Some compat fixes for GNU make. 2019-05-22 13:21:49 +02:00
Andreas Kling
f490ce0fb5 LibC: Implement wait() as a wrapper around waitpid(). 2019-05-22 13:21:17 +02:00
Andreas Kling
4aef87a9a4 LibC: First pass of compat work / stubs while trying to build OpenSSL. 2019-05-21 21:36:08 +02:00
Andreas Kling
08228f34b9 GWindow: Only flip the window backing stores once per paint event. 2019-05-21 21:05:10 +02:00
Robin Burchell
9aa9454c6b WindowServer: Don't eat a MouseUp when producing a MouseDoubleClick
Otherwise, double clicking a button will leave it in pressed state.
2019-05-21 16:43:56 +02:00
Andreas Kling
c9a9ca0dfe Kernel: Bump kernel stacks to 64 KB.
This makes the ELF symbolication crash go away while I work out a smart fix.
2019-05-21 16:15:52 +02:00
Andreas Kling
a8313ae0a3 AK: Always inline convert_between_host_and_network<T>. 2019-05-21 16:14:02 +02:00
Andreas Kling
e383bc6fd8 LibC: Oops, forgot to commit sigsuspend() prototype. 2019-05-21 12:31:14 +02:00
Andreas Kling
3c7b46a85a LibC: Add htonl() and ntohl(). 2019-05-21 02:22:21 +02:00
Andreas Kling
02033873b7 LibC: Add sigsuspend() stub. 2019-05-21 02:22:02 +02:00
Andreas Kling
52f135fe13 AK: Add some more features to Vector iterators. 2019-05-21 01:36:36 +02:00
Andreas Kling
ae470ec955 Kernel: Add getpeername() syscall, and fix getsockname() behavior.
We were copying the raw IPv4 addresses into the wrong part of sockaddr_in,
and we didn't set sa_family or sa_port.
2019-05-20 20:33:03 +02:00
Andreas Kling
f008156dbf Socket: Fix missing kprintf() args in setsockopt(). 2019-05-20 19:45:27 +02:00
Andreas Kling
9df8d28542 WindowServer: Don't start window resize for MouseUp or MouseMove. 2019-05-20 11:06:10 +02:00
Andreas Kling
bcc6ddfb6b Kernel: Let PageDirectory own the associated RangeAllocator.
Since we transition to a new PageDirectory on exec(), we need a matching
RangeAllocator to go with the new directory. Instead of juggling this in
Process and MemoryManager, simply attach the RangeAllocator to the
PageDirectory instead.

Fixes #61.
2019-05-20 04:46:29 +02:00
Andreas Kling
d65114afd7 WindowServer: Convert some assertions into client did_misbehave()'s. 2019-05-20 04:29:07 +02:00
Andreas Kling
091448b8f3 WindowServer: Use blocking sockets for client connections. 2019-05-20 04:08:09 +02:00
Andreas Kling
5023464d95 LocalSocket: Make send() and sendto() work, too. 2019-05-20 03:59:30 +02:00
Andreas Kling
668bfaa2af LocalSocket: Bump internal buffer sizes to 16KB.
This gives us some leeway for WindowServer to queue up a bunch of messages
for one of its clients. Longer-term we should improve DoubleBuffer to be
able to grow dynamically in a way that gets billed to some reasonable place.
2019-05-20 03:57:25 +02:00
Andreas Kling
dc03b50f41 GEventLoop: Make the WindowServer connection use a blocking socket. 2019-05-20 03:47:50 +02:00
Andreas Kling
b3a1671f1a Kernel: Add support for recv() with MSG_DONTWAIT.
Passing this flag to recv() temporarily puts the file descriptor into
non-blocking mode.

Also implement LocalSocket::recv() as a simple forwarding to read().
2019-05-20 03:47:02 +02:00
Andreas Kling
0b850cf726 WindowServer: Allow sending up to 32 invalidation rects inline.
Oops, it looks like I left the max inline rects limit at 1 while debugging
this code.. We can fit 32 rects in a single WSAPI message without needing
a second "extra data" message, so let's use the space we have!
2019-05-20 03:18:43 +02:00
Robin Burchell
d791bce6af CEventLoop: Allow manually driving the event loop
Move the bulk of exec() into a new pump(). Since SDL wants to drive the
event loop itself, this is a requirement. We also add a WaitMode flag to
allow for immediately pumping events -- again, this is required because
SDL wants to be in full control of the event loop, and not let us wait.
2019-05-20 03:03:48 +02:00
Andreas Kling
85d2e85912 LocalSocket: Fix mismatch between can_write() and write() logic.
can_write() was saying yes in situations where write() would overflow the
internal buffer. This patch adds a has_attached_peer() helper to make it
easier to understand what's going on in these functions.
2019-05-20 02:54:52 +02:00
Andreas Kling
612e1c7023 Toolchain: Oops, let's unbreak UseIt.sh. 2019-05-20 02:06:41 +02:00
Robin Burchell
a8864dc590 Kernel: Report EAGAIN from read() on a non-blocking socket if the buffer is empty
This is not EOF, and never should have been so -- can trip up other code
when porting.

Also updates LibGUI and WindowServer which both relied on the old
behaviour (and didn't work without changes). There may be others, but I
didn't run into them with a quick inspection.
2019-05-20 01:31:28 +02:00
Robin Burchell
40a5eb4e6e Minesweeper: Make things a little more friendly at the start
Rather than having the first click hit a bomb, if the first click would
hit a bomb, instead, reset the game board.

This is a (sort of) feature of Windows minesweeper, and IMO makes
playing a bit more fun :-)
2019-05-19 21:33:50 +02:00
Andreas Kling
5b6e66195b LibC: Add an h_addr macro for old code that doesn't know about h_addr_list. 2019-05-19 19:55:49 +02:00
Andreas Kling
212a263f0a Kernel+LibC: Implement getsockname() syscall. 2019-05-19 19:55:27 +02:00
Andreas Kling
0eb788d641 LibC: Add stub for fsync(). 2019-05-19 19:54:20 +02:00
Andreas Kling
189b342e6f LibC: Add mmap_with_name() that names the allocation immediately.
This allows us to skip the separate call to set_mmap_name() in code that
we control, e.g malloc() and GraphicsBitmap.
2019-05-19 15:54:56 +02:00
Andreas Kling
5f26f83451 IDEDiskDevice: Add sysctl variable for turning DMA on/off. 2019-05-19 15:54:33 +02:00
Andreas Kling
29863d3815 LibC: unsetenv() should take a const char*, not a char*. 2019-05-19 15:19:48 +02:00
Robin Burchell
5f597d0cb2 WindowServer: Improve client write handling a little
* EPIPE now correctly deletes the client connection
* EAGAIN (which is now returned by the kernel if the write buffer fills)
  terminates the connection also
2019-05-19 14:13:49 +02:00