Commit Graph

125 Commits

Author SHA1 Message Date
Andreas Kling
dbeac6e093 LibGUI: Reduce overdraw in GListBox. 2019-01-28 20:38:13 +01:00
Andreas Kling
83228d03d8 LibGUI: GButton should only react to the left mouse button (for pushing.) 2019-01-27 20:26:45 +01:00
Andreas Kling
35c06f1520 LibGUI: More work on GCheckBox.
- Make it track the mouse cursor just like GButton does so that changes only
  get committed if the mouseup event happens while inside the widget rect.

- Draw a focus rect around the box when appropriate.

- When focused, support toggling the checked state with the space bar.
2019-01-27 20:22:06 +01:00
Andreas Kling
90e898b771 GTextBox: Avoid one instance of overdraw + naming cleanup. 2019-01-27 15:12:33 +01:00
Andreas Kling
069d21ed7f Make buttons unpress when the cursor leaves the button rect.
Implement this functionality by adding global cursor tracking.
It's currently only possible for one GWidget per GWindow to track the cursor.
2019-01-27 08:48:34 +01:00
Andreas Kling
c7b005c47b Font: Eagerly load all 256 glyphs. It's not that many. 2019-01-27 05:19:00 +01:00
Andreas Kling
2e370fa4d5 LibGUI: Don't consider a GWidget focused if the window is inactive. 2019-01-26 21:58:43 +01:00
Andreas Kling
25d045dee5 LibGUI: Reduce GEventLoop debug spam. 2019-01-26 21:44:13 +01:00
Andreas Kling
de2423de5f LibGUI: Flesh out focus implementation and more GTextBox work. 2019-01-26 11:24:16 +01:00
Andreas Kling
d72575d196 LibGUI: Start bringing up GTextBox in the standalone world. 2019-01-26 06:39:13 +01:00
Andreas Kling
7cf3c7461c Refactor GUI rendering model to be two-phased.
Instead of clients painting whenever they feel like it, we now ask that they
paint in response to a paint message.

After finishing painting, clients notify the WindowServer about the rect(s)
they painted into and then flush eventually happens, etc.

This stuff leaves us with a lot of badly named things. Need to fix that.
2019-01-26 05:20:32 +01:00
Andreas Kling
dfdca9d2a7 Kernel: Implement lazy FPU state restore. 2019-01-25 07:52:44 +01:00
Andreas Kling
86eae0f8df Let userland retain the window backing store while drawing into it.
To start painting, call:
gui$get_window_backing_store()

Then finish up with:
gui$release_window_backing_store()

Process will retain the underlying GraphicsBitmap behind the scenes.
This fixes racing between the WindowServer and GUI clients.

This patch also adds a WSWindowLocker that is exactly what it sounds like.
2019-01-24 23:44:19 +01:00
Andreas Kling
05f18febb6 Ext2FS: Delete inodes when their link count goes to zero. 2019-01-22 16:34:24 +01:00
Andreas Kling
786b903d62 WindowServer: Don't invalidate already frontmost window for moving to front. 2019-01-21 02:19:08 +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
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