Commit graph

1139 commits

Author SHA1 Message Date
Andreas Kling
96943dbad1 WindowServer: Remove some unused WSWindowManager members. 2019-02-20 13:17:09 +01:00
Andreas Kling
3df4a902df Ext2FS: Lock a lot. Go way overkill with locking for now. 2019-02-20 13:09:59 +01:00
Andreas Kling
809ffa56d7 Kernel: Reduce code duplication in exception handlers. 2019-02-20 12:28:41 +01:00
Andreas Kling
9763eb44f9 LibGUI: Pack toolbar buttons closer together. 2019-02-20 11:56:28 +01:00
Andreas Kling
bf30502560 LibGUI: Implement enter/leave events (with WindowServer support.)
Windows now learn when the mouse cursor leaves or enters them.
Use this to implement GWidget::{enter,leave}_event() and use that
to implement the CoolBar button effect. :^)
2019-02-20 10:12:19 +01:00
Andreas Kling
af7eb5c89c Launcher: Let's use CoolBar style buttons in here for now.
This will be helpful for testing the hover events.
2019-02-20 09:33:59 +01:00
Andreas Kling
d353c7c3d6 LibGUI: Support different button styles.
I want to try an MS Office 97 "CoolBar" inspired look for my toolbars.
This is only the painting support, we still need hover events to implement
the actual effect.
2019-02-20 09:22:38 +01:00
Andreas Kling
dc753b58a5 LibGUI: Improve GBoxLayout so it can better support GToolBar.
Added spacing and margin concepts to GLayout. Support layout a sequence
of nothing but fixed-size objects in the desired orientation. :^)
2019-02-20 09:04:28 +01:00
Andreas Kling
b704d3d295 LibGUI: Add a GToolBar class that can be populated with GActions.
The same action can be added to both a menu and a toolbar.
Use this to put a toolbar into FileManager. This is pretty neat. :^)
2019-02-20 02:39:46 +01:00
Andreas Kling
4804609b7e WindowServer: Display menus with 95% opacity by default. 2019-02-19 16:41:13 +01:00
Andreas Kling
210646edd2 SharedGraphics: Minor tweaks in rect shattering code. 2019-02-19 16:37:12 +01:00
Andreas Kling
57546d8420 WindowServer: Only invalidate the menubar rect when switching menubars. 2019-02-19 16:32:06 +01:00
Andreas Kling
b561a5976f WindowServer: Correct invalidation rects for menu windows. 2019-02-19 15:46:48 +01:00
Andreas Kling
98784ad3cb WindowServer: Avoid overdraw by shattering dirty rects into unique shards.
The algorithm I came up with is O(n^2) but given the small numbers of rects
we're typically working with, it doesn't really matter. May need to revisit
this in the future if we find ourselves with a huge number of rects.
2019-02-19 14:49:23 +01:00
Andreas Kling
420b7bd55f FileManager: Add an icon for socket files. 2019-02-19 03:13:43 +01:00
Andreas Kling
bf6b0ea181 Base: Remove an unused icon. 2019-02-19 03:11:12 +01:00
Andreas Kling
fad69464f6 Kernel: Fix wrong calculation of current Unix timestamp. 2019-02-19 02:39:18 +01:00
Andreas Kling
9b71307d49 WindowServer: Support windows with alpha channels. And per-WSWindow opacity.
This patch also adds a Format concept to GraphicsBitmap. For now there are
only two formats: RGB32 and RGBA32. Windows with alpha channel have their
backing stores created in the RGBA32 format.

Use this to make Terminal windows semi-transparent for that comfy rice look.
There is one problem here, in that window compositing overdraw incurs
multiple passes of blending of the same pixels. This leads to a mismatch in
opacity which is obviously not good. I will work on this in a later patch.

The alpha blending is currently straight C++. It should be relatively easy
to optimize this using SSE instructions.

For now I'm just happy with the cute effect. :^)
2019-02-19 01:42:53 +01:00
Andreas Kling
d4973842c9 Kernel: Run the sync daemon once every second.
This is obviously not a final design, but 10 seconds was way too long.
2019-02-17 15:18:35 +01:00
Andreas Kling
8eedbbc9ca Prune compiler flags a bit. Let's go with -march=i686 for now. 2019-02-17 15:17:21 +01:00
Andreas Kling
e952a35994 WindowServer: Assume wallpaper images are 1024x768.
This is obviously not always the right thing to do, but it removes some
confusion while using other resolutions. Eventually we're gonna need some
kind of compressed image decoder.
2019-02-17 13:44:39 +01:00
Andreas Kling
e241f3a801 Kernel: Shrink kmalloc() chunk size from 128 to 64.
This sacrifices some speed for more space. I don't want to work on a new
allocator right this moment, so this buys me some time.
2019-02-17 13:41:15 +01:00
Andreas Kling
0730b3c15f Add ability to switch video modes from the system menu.
I had to change PhysicalPage around a bit for this. Physical pages can now
be instantiated for any arbitrary physical address without worrying that
such pages end up in the kernel page allocator when released.

Most of the pieces were already in place, I just glued everything together.
2019-02-17 13:12:59 +01:00
Andreas Kling
8321908abe LibGUI: Tweak the scrollbar and button styles a bit. 2019-02-17 12:08:28 +01:00
Andreas Kling
ff786aa38a Spawn Launcher and FileManager on startup by default again.
I disabled this while debugging WindowServer-in-userspace, and now that it
works fine we can bring these back up.
2019-02-17 11:31:52 +01:00
Andreas Kling
d5f515cf6c Kernel: Give each FileDescriptor a chance to co-open sockets.
Track how many fds are open for a socket's Accepted and Connected roles.
This allows fork() to clone a socket fd without a subsequent close() walking
all over the parent process's fd.
2019-02-17 11:00:35 +01:00
Andreas Kling
b0be3299b5 WindowServer: Close accepted sockets when the client has disconnected. 2019-02-17 10:59:58 +01:00
Andreas Kling
7bb00ea1e3 Kernel: socket() with SOCK_CLOEXEC was setting the wrong fd flag.
Turns out FD_CLOEXEC and O_CLOEXEC are different values. Silly mistake.
I noticed that Terminal's shell process still had the Terminal's window
server connection open, albeit in a broken state.
2019-02-17 10:41:37 +01:00
Andreas Kling
b6bf26430d Kernel: Have devices automagically register themselves with the VFS. 2019-02-17 10:38:07 +01:00
Andreas Kling
e74c833af3 AK: Fix broken instrumentation code for StringImpl. 2019-02-17 10:35:48 +01:00
Andreas Kling
cf8dd312ab Kernel: Fix String leaks in exec().
When the kernel performs a successful exec(), whatever was on the kernel
stack for that process before goes away. For this reason, we need to make
sure we don't have any stack objects holding onto kmalloc memory.
2019-02-17 10:18:25 +01:00
Andreas Kling
4b15dd2bca LibGUI: Rename GEventLoop::exit() and GApplication::exit() to quit().
These functions don't exit immediately, but rather on the next iteration
of the event loop.

Since exit() is already used by the standard library, let's call it quit()
instead. That way, saying exit() means the same thing here as anywhere else.
2019-02-17 09:59:56 +01:00
Andreas Kling
fa13e1977e Meta: Add some quick instructions for how to build and run this thing. 2019-02-17 09:45:39 +01:00
Andreas Kling
c81b217fa7 SharedGraphics: Assign a human-friendly name for mmapped GraphicsBitmap. 2019-02-17 09:41:26 +01:00
Andreas Kling
df2d46d5dc Kernel: Add SocketRole::Listener and report the role nicely in /proc/PID/fds. 2019-02-17 09:40:52 +01:00
Andreas Kling
a0b55987d3 Kernel: Report the correct name for NullDevice. 2019-02-17 09:40:19 +01:00
Andreas Kling
fa452fadca WindowServer: Let menu objects reference the WSClientConnection by pointer.
Since these are owner/ownee relationships, there's no need for indirection.
2019-02-17 09:07:07 +01:00
Andreas Kling
459cc23441 Kernel: Remove Process::gui_client_id(). 2019-02-17 09:05:49 +01:00
Andreas Kling
f02a490230 WindowServer: Get rid of unnecessary messaging indirection. 2019-02-17 08:58:42 +01:00
Andreas Kling
9a39c01551 WindowServer: WSWindow can have a pointer to the client rather than an ID.
Since WSWindows are owned by WSConnectionClients, it's fine for them to just
reference the client directly.
2019-02-17 08:54:57 +01:00
Andreas Kling
1056a39bd6 WindowServer: Remove some debug spam. 2019-02-17 08:43:49 +01:00
Andreas Kling
bd2fdcbbaa Kernel: Rename BochsVGADevice to BXVGADevice. 2019-02-17 08:41:05 +01:00
Andreas Kling
10b43f3d1d Kernel: Rename Keyboard to KeyboardDevice. 2019-02-17 08:39:09 +01:00
Andreas Kling
2dc0ef8813 Kernel: munmap() should round up to nearest page size, just like mmap().
The mismatch between the two was causing some trouble if you'd mmap e.g 1KB
and then try to munmap() it. The kernel would whine that it couldn't find
any such mapping (because mmap() actually rounded the 1KB to a 4KB page.)
2019-02-17 08:33:13 +01:00
Andreas Kling
82768e7ac5 WindowServer: Move video mode setup to WSScreen. 2019-02-17 01:43:01 +01:00
Andreas Kling
809266a9fb Kernel: Remove tracking of bitmap memory.
There are no more kernel bitmaps. It's much better this way.
2019-02-17 01:16:38 +01:00
Andreas Kling
cc9ff96a98 Kernel: FileDescriptor::absolute_path() should "support" sockets. 2019-02-17 01:11:37 +01:00
Andreas Kling
3eb6c22a22 WindowServer: Make the menubar clock work again in the post-kernel world.
This is actually so much better. Grabbing directly at the RTC was silly. :^)
2019-02-17 01:05:53 +01:00
Andreas Kling
18062f4ad6 LibGUI: Remove some debugging noise. 2019-02-17 01:05:24 +01:00
Andreas Kling
9b2b9fe39b SharedGraphics: Fix #ifdef mismatch in Painter.
This mistake created an incredible amount of confusion. We would allocate
a slightly too small Painter on the stack and then invoke its constructor,
overwriting whatever came after it on the stack.
2019-02-17 00:52:17 +01:00