Andreas Kling
e115ae5641
Kernel: Clone Process::m_gids on fork() and hook up any framebuffer region.
2019-01-21 01:49:30 +01:00
Andreas Kling
6d9959e367
LibGUI: Open the GUI event stream with O_CLOEXEC.
2019-01-21 01:33:16 +01:00
Andreas Kling
d66b0f7dd8
LibGUI: Mass coding style fixes.
2019-01-21 00:54:35 +01:00
Andreas Kling
6c4f1bad09
guitest2: Add a simple launcher so I can easily spawn more Terminals.
...
Also update GButton coding style.
2019-01-21 00:31:48 +01:00
Andreas Kling
3271c115e2
WindowServer: Only blit dirty rect of windows to back buffer.
...
Previously we'd blit every pixel in every window that intersected any dirty
rect to the back buffer. With this patch, we limit ourselves to blitting the
pixels inside the actual dirty rects.
There's still a lot of optimizations to make in this code.
2019-01-20 23:42:36 +01:00
Andreas Kling
1586bc99e3
WSWindowManager: Add an invalidation and a FIXME.
2019-01-20 08:37:24 +01:00
Andreas Kling
d4cce87dbc
LibGUI: Minor fixes.
2019-01-20 08:16:02 +01:00
Andreas Kling
a9e60fc800
LibGUI: Only redraw the dirty rect in GWidget.
...
There is some trouble here with the asynchronous nature of WindowServer
and the single per-window backing store we're drawing into. If we start
repainting a widget with a pending invalidation, that invalidation might
get flushed by the WindowServer mid-paint.
2019-01-20 07:59:19 +01:00
Andreas Kling
ea6678b7b3
LibGUI: Hook up GWindow event dispatch for paint and mouse events.
2019-01-20 07:03:38 +01:00
Andreas Kling
dbe83f3a83
Make it possible for userspace to alter window title/geometry.
...
I'm not in love with this syscall API but it allows me to make progress.
2019-01-20 06:04:13 +01:00
Andreas Kling
8eae89a405
Start bringing up LibGUI properly (formerly Widgets.)
2019-01-20 05:48:43 +01:00
Andreas Kling
b91479d9b9
Rename all the LibGUI classes to GClassName.
2019-01-20 04:49:48 +01:00
Andreas Kling
a026da47e7
Move Widget & friends into LibGUI.
2019-01-19 23:49:56 +01:00
Andreas Kling
7e5b81fe48
Make a SharedGraphics directory for classes shared between Kernel and LibGUI.
2019-01-19 23:22:46 +01:00
Andreas Kling
b75ee4aacb
Coding style fixes in AK.
2019-01-19 22:53:05 +01:00
Andreas Kling
b413e234e1
WSWindowManager: Minor style fixes.
2019-01-19 14:33:59 +01:00
Andreas Kling
102a5add16
Invalidate the window when starting to drag it.
...
This ensures that the drag color shows up immediately.
2019-01-19 14:29:59 +01:00
Andreas Kling
4bffdd2394
WindowServer: Use a different border color for windows being dragged.
...
Also get rid of an unnecessary invalidation on drag end.
2019-01-18 15:55:28 +01:00
Andreas Kling
7e044cf293
Add a simple /bin/sysctl that wraps the files in /proc/sys.
2019-01-18 15:35:38 +01:00
Andreas Kling
f7cc454162
Add mechanism to expose kernel variables to userspace via ProcFS.
...
Only booleans are supported at first. More types can be added easily.
Use this to add /proc/sys/wm_flash_flush which when enabled flashes pending
screen flush rects in yellow before they happen.
2019-01-18 15:01:40 +01:00
Andreas Kling
9454c5dd52
WindowServer: Merge WSFrameBuffer into WSScreen.
2019-01-18 05:41:15 +01:00
Andreas Kling
bb28c143fd
Update coding style in WSWindowManager.
2019-01-18 05:33:35 +01:00
Andreas Kling
dff5051905
Support polling with select() by using a zero timeout.
...
Use this in WindowServer to avoid getting blocked in select() when
there are pending injected events.
2019-01-18 05:28:07 +01:00
Andreas Kling
a01e119e05
WindowServer: Always select() in the event loop.
...
This fixes an issue where a steady stream of injected events would prevent
us from ever draining the mouse and keyboard inputs.
2019-01-18 04:59:08 +01:00
Andreas Kling
dff70021ab
Make it possible to invalidate only a portion of a window.
...
Use this in Terminal to only invalidate rows where anything changed.
2019-01-18 04:37:49 +01:00
Andreas Kling
9d7da26b4e
StringBuilder: Use a ByteBuffer internally instead of a Vector<String>.
2019-01-18 03:27:51 +01:00
Andreas Kling
074edffc44
Add a simple StringBuilder::appendf() and use it for ProcFS.
...
Okay, now ProcFS doesn't crash due to the crappy buffer size estimates
not really working out. This thing has dogshit performance and I will
fix that separately.
2019-01-18 02:46:39 +01:00
Andreas Kling
dad58db757
Add WindowActivated and WindowDeactivated events.
...
Use this to implement different looking Terminal cursors depending on
the window active state.
2019-01-17 17:38:04 +01:00
Andreas Kling
135ff48bb9
Terminal: Tighten the glyph rects.
...
This makes the cursor look a bit nicer.
2019-01-17 16:34:37 +01:00
Andreas Kling
e9e57c5f65
Rename SpinLock to Lock. It hasn't been a SpinLock for some time.
...
I'm pretty happy with the mechanism of AK::Lock for now.
2019-01-17 16:25:02 +01:00
Andreas Kling
133f9aa352
WindowServer: Slap everything with locks.
2019-01-17 16:21:04 +01:00
Andreas Kling
5983a217c3
Terminal: Draw the terminal cursor.
2019-01-17 16:19:49 +01:00
Andreas Kling
3ad0ec9b1b
Paper over annoying race in GraphicsBitmap instantiation.
...
This works for now. This has to be done quite differently when I eventually
move the WindowServer to userspace.
2019-01-17 02:58:34 +01:00
Andreas Kling
36e0ab3f18
Ignore WM_Invalidate events if there is an unprocessed one in the queue.
2019-01-17 02:42:52 +01:00
Andreas Kling
1c63a37bc9
Only drain mouse/keyboard streams if they actually have data.
...
Technically we could just grab directly at the CharacterDevices like we've
been doing but I'd like to stay away from in-kernel behavior like that.
This should eventually become a userspace process.
2019-01-17 02:34:08 +01:00
Andreas Kling
d793323254
Respect the overflow bit in PS/2 mouse data.
2019-01-17 02:32:40 +01:00
Andreas Kling
dc20f00872
PS2MouseDevice: Try to synchronize the data reporting stream.
...
Turns out this was the reason QEMU wouldn't boot us.
2019-01-17 02:13:21 +01:00
Andreas Kling
b5c76d7559
Get rid of #ifdef SERENITY. We're past that phase of bootstrapping.
2019-01-17 01:41:36 +01:00
Andreas Kling
5605295d00
Oops, forgot to add the select() files to LibC a while ago.
2019-01-17 01:41:13 +01:00
Andreas Kling
f92e721ae8
Tidy up Painter::fill_rect() a bit.
2019-01-17 01:25:26 +01:00
Andreas Kling
61bba1b9dd
WindowServer: Skip blitting windows into the back buffer if possible.
...
Windows that don't intersect any of the dirty rects don't need to be copied
into the back buffer since they won't be affected by the subsequent flushes.
2019-01-16 20:21:44 +01:00
Andreas Kling
b6c3df5188
Optimize Painter::draw_rect() a bit.
...
Reorganize the loops to make it go fast. The draw_rect() part of painting
window frames is now ~2.65x faster.
2019-01-16 20:21:41 +01:00
Andreas Kling
f651405694
Optimize the Painter::blit() loop a bit. ~3% fewer cycles, I'll take it.
2019-01-16 19:50:25 +01:00
Andreas Kling
7750e6952b
Move some more classes to the new coding style.
2019-01-16 17:57:58 +01:00
Andreas Kling
a2ec09bc20
Allow the scheduler to unblock the current process.
...
It's a bit confusing that the "current" process is not actually running
while we're inside the scheduler. Perhaps the scheduler should redirect
"current" to its own dummy Process. I'm not sure.
Regardless, this patch improves responsiveness by allowing the scheduler
to unblock a process right after it calls select() in case it already has
a pending wakeup request.
2019-01-16 17:47:18 +01:00
Andreas Kling
4fef895eda
Rework WindowServer to use select() in its main event loop.
...
The system can finally idle without burning CPU. :^)
There are some issues with scheduling making the mouse cursor sloppy
and unresponsive that need to be dealt with.
2019-01-16 17:20:58 +01:00
Andreas Kling
f7ca6d254d
Tear out or duplicate what's unique for WindowServer from Widgets.
...
This turned into a huge refactoring that somehow also includes
making locks recursive/reentrant.
2019-01-16 16:03:50 +01:00
Andreas Kling
e655aebd70
Window: Update coding style.
2019-01-16 13:50:24 +01:00
Andreas Kling
9dd29f9aa9
Add a PTY multiplexer (/dev/ptmx) device.
...
When you open /dev/ptmx, you get a file descriptor pointing to one of the
available MasterPTY's. If none are available, you get an EBUSY.
This makes it possible to open multiple (up to 4) Terminals. :^)
To support this, I also added a CharacterDevice::open() that gets control
when VFS is opening a CharacterDevice. This is useful when we want to return
a custom FileDescriptor like we do here.
2019-01-16 13:39:32 +01:00
Andreas Kling
b46ae2bf09
Get rid of Vnode concept.
...
We already have an abstraction between Process and Inode/CharacterDevice/FIFO
and it's called FileDescriptor. :^)
2019-01-16 12:57:07 +01:00