Commit Graph

83 Commits

Author SHA1 Message Date
Andreas Kling
5cd588a497 WindowServer: Always include the system menu in the menubar.
Solve this by adding a for_each_active_menubar_menu() iteration helper that
automagically visits the system menu before the current menubar's menus.
2019-02-12 08:49:07 +01:00
Andreas Kling
15b4c9f9f1 WindowServer: More work on the menu system.
Menus are now tied to a Process (by WeakPtr.) This will allow us to pass
notifications to the correct event stream.
2019-02-12 08:39:19 +01:00
Andreas Kling
133706d697 Add API's and plumbing for WindowServer clients to make menus. 2019-02-12 00:52:19 +01:00
Andreas Kling
bb31d961b4 WindowServer: Let's call the default menu "Dummy" for now. 2019-02-11 15:39:19 +01:00
Andreas Kling
8d0bfa62fd WindowServer: Add a bunch of horizontal padding to menu items.
All right, this looks a lot nicer. :^)
2019-02-11 14:14:49 +01:00
Andreas Kling
3c863e0ffa WindowServer: Make automatic menu dismissal feel more "natural." 2019-02-11 13:59:26 +01:00
Andreas Kling
43d9994d93 WindowServer: Oops, we have to keep processing WSMessages with !m_process.
Otherwise we'll never handle WM_DestroyWindow and the window sticks around.
2019-02-11 13:23:26 +01:00
Andreas Kling
26230c0647 WindowServer: Remove "unsafe" flag in WSMessageLoop::post_event().
This hack is no longer needed now that we have a Finalizer process that can
take locks without having to worry about the interrupt flag.
2019-02-11 13:05:51 +01:00
Andreas Kling
f7b25773ab WindowServer: Let's have a cute little symbol for the system menu. 2019-02-11 13:00:41 +01:00
Andreas Kling
e6de6c4f45 WindowServer: Don't keep menu items in hovered state after the cursor leaves. 2019-02-11 11:06:41 +01:00
Andreas Kling
6dd1a1f26d WindowServer: Switch current menu if hovering over another menu with button. 2019-02-11 10:59:48 +01:00
Andreas Kling
145aa27b8f WindowServer: Give menu items an identifier field and add a simple callback.
Eventually these identifiers will be sent to the userspace client who created
the menu. None of that is hooked up yet though.
2019-02-11 10:55:02 +01:00
Andreas Kling
78fc7a9ef2 WindowServer: Menu windows should be at least as wide as their menubar rects. 2019-02-11 10:19:56 +01:00
Andreas Kling
5f288014d4 WindowServer: More work on menus. 2019-02-11 10:08:54 +01:00
Andreas Kling
443b043b49 WindowServer: Start implementing a menu system.
I'm going with a global top-of-the-screen menu instead of per-window menus.
The basic idea is that menus will live in the WindowServer and clients can
create menus via WindowServer requests.
2019-02-11 09:47:10 +01:00
Andreas Kling
a6f9ddbb58 Let's have two wallpapers installed so we can test switching. 2019-02-08 17:14:47 +01:00
Andreas Kling
33d34d9b26 Kernel: Use a Lockable<bool> for sysctl booleans as well. 2019-02-08 16:18:24 +01:00
Andreas Kling
7a996e608c WindowServer: Allow changing the desktop wallpaper through a sysctl.
Just write the path of your new wallpaper to /proc/sys/wm_wallpaper. :^)
2019-02-08 09:49:09 +01:00
Andreas Kling
004aad0995 WindowServer: Set the WSMessageLoop::server_process() as early as possible. 2019-02-08 09:47:57 +01:00
Andreas Kling
90d3375dc2 WindowServer: Support desktop wallpapers.
For now, you don't get to choose the wallpaper, but it's still pretty cool.
2019-02-08 08:45:59 +01:00
Andreas Kling
71b9ec1ae0 Kernel: Add basic process priority support.
For now, the WindowServer process will run with high priority,
while the Finalizer process will run with low priority.
Everyone else gets to be "normal".

At the moment, priority simply determines the size of your time slices.
2019-02-07 12:21:17 +01:00
Andreas Kling
5582a0a254 Kernel: When a lock is busy, donate remaining process ticks to lock holder.
Since we know who's holding the lock, and we're gonna have to yield anyway,
we can just ask the scheduler to donate any remaining ticks to that process.
2019-02-07 11:14:58 +01:00
Andreas Kling
443d1c2237 WindowServer: Coordinate double-buffering with the BochsVGA card.
Use the BochsVGA card's virtual-height + virtual-y features to implement
a "hardware double buffering" type scheme.

This is a performance degradation since we now draw a bunch more than before.
But there's also no tearing or cursor flickering. I'm gonna commit this and
try to improve upon it. :^)
2019-02-07 08:56:26 +01:00
Andreas Kling
e29060620f WindowServer: Improve parsing of mouse packets. 2019-02-07 08:08:08 +01:00
Andreas Kling
a1b63bb6d4 Bootloader: Locate the kernel's data segment and clear it.
This was a constant source of stupid bugs and I kept postponing it because
I wasn't in the mood to write assembly code. Until now! :^)
2019-02-06 16:02:10 +01:00
Andreas Kling
731fc5a7c8 Kernel: Much improved BochsVGA (BXVGA) support.
Instead of cowboy-calling the VESA BIOS in the bootloader, find the emulator
VGA adapter by scanning the PCI bus. Then set up the desired video mode by
sending device commands.
2019-02-06 10:17:26 +01:00
Andreas Kling
caff611ca3 WindowServer: Tweak window title bar look. 2019-02-05 13:20:36 +01:00
Andreas Kling
0a183df655 WindowServer: Tweak look of window close button. 2019-02-05 12:01:47 +01:00
Andreas Kling
38f589a9cb SharedGraphics: Add some useful painting helpers and make use of them. 2019-02-05 11:42:58 +01:00
Andreas Kling
cd1bbdf052 WindowServer: Make the window close button look a bit nicer. 2019-02-05 11:05:24 +01:00
Andreas Kling
11db8c1697 Add a simple close button ("X") to windows.
Clicking the button generates a WindowCloseRequest event which the client app
then has to deal with. The default behavior for GWindow is to close() itself.

I also added a flag, GWindow::should_exit_event_loop_on_close() which does
what it sounds like it does.

This patch exposed some bugs in GWindow and GWidget teardown.
2019-02-05 10:31:37 +01:00
Andreas Kling
b1e054ffe8 Rename LizaBold to LizaRegular and LizaBlack to LizaBold.
LizaRegular is quickly becoming my favorite bitmap font. It's so pretty :^)
2019-02-05 09:08:25 +01:00
Andreas Kling
0c38a4c30f WindowServer: Sever the WSWindow/Process link when the process dies.
This fixes a deadlock where the WindowServer would get stuck trying to
acquire a dead process's event stream lock.
2019-02-05 08:32:32 +01:00
Andreas Kling
cacba45f1c LizaBold8x10: Import a bold variant of Liza8x10 and make it the default bold.
Start using it right away for window titles.
2019-02-04 11:37:15 +01:00
Andreas Kling
5e9ba2ac84 Kernel: Rewrite ProcFS.
Now the filesystem is generated on-the-fly instead of manually adding and
removing inodes as processes spawn and die.

The code is convoluted and bloated as I wrote it while sleepless. However,
it's still vastly better than the old ProcFS, so I'm committing it.

I also added /proc/PID/fd/N symlinks for each of a process's open fd's.
2019-02-03 12:33:11 +01:00
Andreas Kling
2a093ada33 WindowServer: Add some stripes to the window titles.
I like the look of this right now. Maybe later I'll feel differently.
2019-02-03 03:38:44 +01:00
Andreas Kling
5e0b7f1a56 Add basic automatic dependency management to Makefiles. 2019-02-02 04:41:59 +01:00
Andreas Kling
ffab6897aa Big, possibly complete sweep of naming changes. 2019-01-31 17:31:23 +01:00
Andreas Kling
5c25f0c4db Destroy all remaining windows in a process when it dies. 2019-01-30 19:35:38 +01:00
Andreas Kling
027d26cd5d Add a String::format() and use that in place of ksprintf() in the Kernel.
You're never gonna be right 100% of the time when guessing how much buffer
space you need. This avoids having to make that type of decision in a bunch
of cases. :^)
2019-01-30 16:28:51 +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
d72575d196 LibGUI: Start bringing up GTextBox in the standalone world. 2019-01-26 06:39:13 +01:00
Andreas Kling
f34c0e414b WindowServer: Remove unused WSMessage::is_paint_event(). 2019-01-26 05:49:04 +01:00
Andreas Kling
9fa8d4e22f WindowServer: Rename the two painting phases.
Work now happens in terms of two messages:

    - WM_ClientWantsToPaint
    - WM_ClientFinishedPaint

This feels fairly obvious compared to the old Paint/Invalidate.
2019-01-26 05:45:47 +01:00
Andreas Kling
244d5bcce1 WindowServer: More event -> message renaming. 2019-01-26 05:35:45 +01:00
Andreas Kling
bba21adae3 WindowServer: Rename WSEvent to WSMessage.
Also do the same for WSMessageLoop and WSMessageReceiver. More to come.
2019-01-26 05:28:02 +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
5f14e22a31 WindowServer: Make dragging window frames look kinda cool. 2019-01-25 05:19:45 +01:00
Andreas Kling
0db72786cf Snazz up the windows with some title bar gradients. :^) 2019-01-25 05:02:32 +01:00
Andreas Kling
c6b7b92625 WindowServer: Put the desktop background color in a member. 2019-01-25 03:48:50 +01:00