Commit graph

2426 commits

Author SHA1 Message Date
Andreas Kling
6a5d92f0ad WindowServer+LibGUI: Allow changing whether windows have alpha channels.
Use this in Terminal to tell the window server to not bother with the alpha
channel in the backing store if we're running without transparency.
Semi-transparent terminals look neat but they slow everything down, so this
keeps things fast while making it easy to switch to the flashy mode. :^)
2019-05-03 21:07:16 +02:00
Andreas Kling
2470fdcd9b Kernel: Make Socket inherit from File. 2019-05-03 20:42:43 +02:00
Andreas Kling
03da7046bd Kernel: Prepare Socket for becoming a File.
Make the Socket functions take a FileDescriptor& rather than a socket role
throughout the code. Also change threads to block on a FileDescriptor,
rather than either an fd index or a Socket.
2019-05-03 20:15:54 +02:00
Andreas Kling
9f633a1871 LibC: Add strcoll() and strxfrm().
These are obviously not locale-aware implementations, but rather really just
strcmp() and strcpy() with different names. This makes vim build and run :^)
2019-05-03 18:17:33 +02:00
Andreas Kling
052be28c3b LibM: Stub out a whole bunch of math functions so vim will build. 2019-05-03 18:17:02 +02:00
Andreas Kling
c46f1cbbc2 Meta: Add IRC channel to the ReadMe.
Bonus points to anyone who joins using the Serenity IRCClient. ;^)
2019-05-03 16:25:15 +02:00
Andreas Kling
ea9a39a9f2 LibGUI+WindowServer: Add a GResizeCorner widget.
This widget is automatically included in GStatusBar, but can be added in
any other place, too. When clicked (with the left button), it initiates a
window resize (using a WM request.)

In this patch I also fixed up some issues with override cursors being
cleared after the WindowServer finishes a drag or resize.
2019-05-03 01:38:24 +02:00
Andreas Kling
34c5db61aa Kernel: Simplify VMObject::is_anonymous().
This doesn't need a separate flag. A VMObject is always anonymous if it has
no backing inode.
2019-05-02 23:34:28 +02:00
Andreas Kling
b8e60b6652 Kernel: Remove unused Region::is_bitmap(). 2019-05-02 23:31:11 +02:00
Andreas Kling
66e401d668 LibC: Tune the number of ChunkedBlocks we keep around empty.
At the moment, both mmap() and munmap() are kind of slow. Compiling with GCC
was suffering quite badly from munmap() slowness, so let's keep a few more
of the ChunkedBlocks around after they are empty, to avoid having to munmap.
2019-05-02 18:11:36 +02:00
Andreas Kling
b4e7925e31 LibC: Move full ChunkedBlocks to a separate list in the allocator.
This way we only check actually usable blocks when trying to satisfy a new
allocation request.
2019-05-02 17:06:05 +02:00
Andreas Kling
60023ff70b LibC: free() should move kept empty ChunkedBlocks to the end of the list.
This ensures that we continue allocating from partially-used blocks until
they are full.
2019-05-02 16:35:57 +02:00
Andreas Kling
658fff195c LibC: free() should return free blocks back to the operating system.
Okay fine, I'll give them back. But we'll keep 4 blocks per size class on
hand, to reduce churn.
2019-05-02 15:58:10 +02:00
Andreas Kling
2a65f0ee4f strace: Allow "strace command" to trace a process from start to finish.
Tracing a specific pid is now done via "strace -p PID".
To ensure we don't miss any syscalls, we fork and have the child immediately
SIGSTOP itself. Then when the parent has set up the systrace() fd, we send
SIGCONT to the child which then execs the command. :^)
2019-05-02 15:51:39 +02:00
Andreas Kling
25ddcd1022 Kernel: Emit systrace events for exit, thread_exit and sigreturn.
Since these syscalls don't return to caller, we have to emit the trace
events manually.
2019-05-02 15:49:48 +02:00
Andreas Kling
4508287cb2 GButton: Draw disabled buttons with grayed-out text.
Based on a patch from "pd" (thanks!)
2019-05-02 13:57:35 +02:00
Andreas Kling
13b8c7eab8 Minesweeper: Fix lag when changing the field size.
Use a number of techniques to avoid freezing the UI for too long.

- Keep reusing the same widgets for the squares once they've been created.
- Temporarily disable widget updates.
- Avoid some redundant work on each run of reset().
2019-05-02 04:21:21 +02:00
Andreas Kling
49d0cdabac GWidget: Ignore updates if self has !updates_enabled().
We were only checking when propagating updates to parents, duh.
2019-05-02 04:19:59 +02:00
Andreas Kling
6d5507313e GWidget: Add set_updates_enabled() for temporarily suppressing updates. 2019-05-02 03:47:01 +02:00
Andreas Kling
c3b7ace3e0 Kernel: Assign Lock names in class member initializers. 2019-05-02 03:28:20 +02:00
Andreas Kling
2dc72bb297 LibC: Improve malloc() mmap names somewhat. 2019-05-02 02:58:06 +02:00
Andreas Kling
4291e96991 LibC: Implement a simple freelist-based malloc() with size classes.
It's not thread-safe yet, and there is lots of room for improvement.
Still it's a lot faster than the first-fit bitmap-based one it replaces.
2019-05-02 02:35:29 +02:00
Andreas Kling
d3bd4fdcfe sh: Log to debugger how long command took. 2019-05-02 02:22:28 +02:00
Mustafa Ali CAN
9fa8324f7a Fix jittery mouse 2019-05-01 21:54:41 +02:00
Andreas Kling
202e922ce8 CLock: Remove a redundant call to gettid(). 2019-05-01 19:11:08 +02:00
Andreas Kling
b34f376329 GButton: Update hovered state on mouseover as well.
We can't rely exclusively on enter and leave events to update the hovered
state, since leave will not be delivered while the widget is auto-tracking
the mouse (between mousedown and mouseup.)
2019-05-01 18:53:05 +02:00
Andreas Kling
288e97a206 WindowServer+LibGUI: Wait for the extra_data to arrive.
Since the sockets we use are non-blocking, just slap a select before the
second call to read(). This fixes some flakiness seen under load.

This should eventually work a bit differently, we could use recv() once
it has MSG_WAITALL, and we should not let WindowServer handle all the
client connections on the main thread. But for now, this works.

Fixes #24.
2019-05-01 18:28:33 +02:00
Andreas Kling
ded3652f6c Base: Replace system About box icon with something home-drawn.
I don't recall where the previous one came from, so let's not assume we can
use it. Here's one I drew myself instead.
2019-05-01 17:17:31 +02:00
Andreas Kling
6614746ca8 WindowServer: Spawn a secondary thread to decode wallpapers.
The threading API's are not very mature, so this code looks a bit crufty
but it does take the load off the WindowServer main thread when changing
wallpapers. :^)
2019-05-01 16:07:47 +02:00
Andreas Kling
cff3685a4c GButton: Handle mousemove correctly while multiple buttons are pressed.
We should still update the pressed state depending on the event position,
even if GMouseButton::Left is not the only button pressed.
2019-05-01 15:59:23 +02:00
Andreas Kling
f95ba881f0 VisualBuilder: Tweak form grid color. 2019-04-30 17:01:59 +02:00
Andreas Kling
86aad50818 VisualBuilder: Add GSlider to the widgets toolbox. 2019-04-30 16:18:05 +02:00
Andreas Kling
fb0c598d22 Meta: Tweak ReadMe and add a new screenshot. 2019-04-30 15:27:35 +02:00
Andreas Kling
d7270059ab WindowServer: Tweak window minimize button appearance. 2019-04-30 15:09:40 +02:00
Andreas Kling
28244039a5 Kernel: Don't symbolicate symbol+offset for obvious non-kernel addresses. 2019-04-30 14:47:22 +02:00
Andreas Kling
f4b190c58b PNGLoader: Tag the decoded bitmap with the source PNG path. 2019-04-30 13:46:03 +02:00
Andreas Kling
d55ff4756a Base: Import a slightly larger font I started working on.
This still needs a bunch of work but it will be good to have a larger font
available to us.
2019-04-30 05:09:39 +02:00
Andreas Kling
a274196bd7 Terminal: <esc>[m should clear the current attribute.
This was causing GCC error messages to appear in all-red text.
2019-04-30 01:23:20 +02:00
Andreas Kling
98a0e10319 LibC: Log all malloc() calls if LIBC_LOG_MALLOC is set.
This makes it easier to quickly determine if a userspace process is getting
bogged down in memory allocation.
2019-04-30 01:22:18 +02:00
Andreas Kling
87c256a7d5 GSlider: Highlight the knob when hovering it. :^) 2019-04-30 00:47:46 +02:00
Andreas Kling
55d7d4e3d8 GSlider: Improve appearance by thinning the track a bit. 2019-04-29 23:42:55 +02:00
Andreas Kling
c8aae534d7 WindowServer: Make WSMenu wide enough that shortcuts are always rightmost. 2019-04-29 23:41:48 +02:00
Andreas Kling
0ae475ff5b Terminal: Add ability to adjust the terminal's opacity. 2019-04-29 19:24:18 +02:00
Andreas Kling
9c6be9b21e LibGUI: Add a GSlider widget. 2019-04-29 19:20:34 +02:00
Andreas Kling
65f2f19b41 CEventLoop: Protect the message queue with a Lock. 2019-04-29 15:57:49 +02:00
Andreas Kling
14ac77131b Kernel: The exit_thread() syscall should unlock the big lock.
Since exit_thread() never returns, it can't rely on the syscall trap handler
to unlock the big lock before returning.
2019-04-29 15:56:25 +02:00
Andreas Kling
80850e274d LibC: Oops, exit_thread() never returns. 2019-04-29 15:18:21 +02:00
Andreas Kling
d07be1087a Kernel+LibC: Add exit_thread() syscall. 2019-04-29 15:17:20 +02:00
Andreas Kling
02b69cf06a Toolchain: Build GCC with --with-newlib 2019-04-29 15:09:57 +02:00
Andreas Kling
8cbb7f101f Kernel: Have File virtuals take a FileDescriptor& rather than a Process&.
This will allow us to implement different behaviors depending on the role
of the descriptor a File is being accessed through.
2019-04-29 13:58:40 +02:00