Commit Graph

1009 Commits

Author SHA1 Message Date
Andreas Kling
c61f9eba61 WindowServer: Add a WSWindowType enum.
So far there's only Normal and Menu. Maybe we'll need more later.
2019-02-12 11:53:45 +01:00
Andreas Kling
111589a558 Kernel: Make sure processes always start out with fds 0, 1 and 2 open.
If we don't have a TTY for the process, fall back to /dev/null.
2019-02-12 11:25:25 +01:00
Andreas Kling
7def86c86d WindowServer: Send all mouse events inside the menubar rect to the menubar. 2019-02-12 10:47:02 +01:00
Andreas Kling
e03af1e8b9 WindowServer: Make it possible to launch a terminal from the system menu. 2019-02-12 10:45:09 +01:00
Andreas Kling
4b8133e925 WindowServer: Clean up any menu objects on process exit.
..and now that this works, implement the Quit menu action in Terminal. :^)
2019-02-12 10:41:09 +01:00
Andreas Kling
f311d0f353 Kernel: Don't bother trying to pass environment to init's testing processes. 2019-02-12 10:19:52 +01:00
Andreas Kling
db98327bdc Plumb menu item activation events from WindowServer to clients.
GMenu now has an "on_item_activation" callback that fires whenever one
of its items are activated. The menu item identifier is used to distinguish
between items.

Use this to implement font switching in Terminal. :^)
2019-02-12 10:08:35 +01:00
Andreas Kling
9c1c885483 WindowServer: Add locking and fix coalesced invalidation race.
WSWindowManager::invalidate() had a bug where it would mark the entire screen
rect as dirty, but it wouldn't scheduled a deferred recompose.

This would cause any subsequent calls to invalidate(Rect) to be coalesced
with the pending compose, but the pending compose never happened.
2019-02-12 09:25:50 +01:00
Andreas Kling
431e7bf085 PS2MouseDevice: Add current buffer size to debug logging. 2019-02-12 09:22:55 +01:00
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
757429fb55 LibGUI: More work on client-side menus. 2019-02-11 15:37:12 +01:00
Andreas Kling
c75ecaae32 Terminal: Move the notifier into the Terminal class. 2019-02-11 15:07:05 +01:00
Andreas Kling
3351f1ccc1 Port all apps to GApplication. 2019-02-11 14:56:23 +01:00
Andreas Kling
9483b39227 LibGUI: Add GMenu* and GApplication classes. 2019-02-11 14:43:43 +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
14c0f18de9 Kernel: Update block cache on write.
If a block is present in the cache, just overwrite the cached block.
2019-02-11 13:18:24 +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
f8951afe17 Ext2FS: Fix broken logic for accessing inode and block bitmaps.
This logic only worked for the very first block group.
2019-02-11 12:46:56 +01:00
Andreas Kling
fd5136a1ab AK: Oops, the optimization in Vector::append(Vector&&) was broken.
It forgot to clear out the moved-from vector. It's easy to see where this bug
came from: I assumed m_impl was an OwnPtr. It would be comfy if move() on some
arbitrary T* would also null it out but alas that's not how things work.
2019-02-11 12:44:59 +01:00
Andreas Kling
298a49c688 IDEDiskDevice: Detect disk errors and report failure to clients.
Previously we'd just fail silently if there was an I/O error of any kind.
2019-02-11 11:38:14 +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
7abef6ba9e LibGUI: Put some logspam behind debugging macros. 2019-02-11 08:27:13 +01:00
Andreas Kling
6b2d2cc5e3 Create /dev files for null, full, zero and random. 2019-02-11 06:59:28 +01:00
Andreas Kling
1511afc4e2 LibGUI: Add GWindow::move_to(). 2019-02-11 06:09:54 +01:00
Andreas Kling
18962bf102 Kernel: Oops, the kernel image access validator thought 0x0 was allowed.
We forgot to look at the ELF segment type when validating accesses.
We should only consider accesses inside non-empty LOAD segments.
2019-02-11 06:05:12 +01:00
Andreas Kling
7014daa235 Kernel: Add an LRU block cache.
This papers over some of the incredibly inefficient access patterns in the
Ext2FS implementation for a while longer. :^)
2019-02-10 20:07:14 +01:00
Andreas Kling
052a101cc5 Terminal: Fix lagged full flush after scrolling the whole buffer.
Now that we're using the lazy rendering model of LibGUI, we can't wait until
paint_event() to decide how much we want to update. :^)
2019-02-10 14:47:09 +01:00
Andreas Kling
08322ab8e1 LibGUI: Coalesce update rects at the GWindow level. 2019-02-10 14:46:43 +01:00
Andreas Kling
53d34a0885 Port Terminal to LibGUI.
To facilitate listening for action on arbitrary file descriptors,
I've added a GNotifier class. It's quite simple but very useful:

GNotifier notifier(fd, GNotifier::Read);
notifier.on_ready_to_read = [this] (GNotifier& fd) {
    // read from fd or whatever else you like :^)
};

The callback will get invoked by GEventLoop when select() says we
have something to read on the fd.
2019-02-10 14:28:39 +01:00
Andreas Kling
ae4811fbae ProcFS: Show region flags in /proc/PID/vm
It's useful to be able to see the readable, writable and bitmap flags.
2019-02-10 13:02:38 +01:00
Andreas Kling
6103e374cc Kernel: Drop the "helper" region after ELF load is finished.
The individual segment mappings will keep the VMObject alive.
2019-02-10 12:47:15 +01:00
Andreas Kling
d333013a54 LibGUI: Support horizontal GScrollBars as well. 2019-02-10 12:27:21 +01:00
Andreas Kling
8313ce57dc LibGUI: Improve GScrollBar button look a bit.
The arrows look better when they're sharp. :^)
2019-02-10 11:57:19 +01:00
Andreas Kling
ddd580c30f SharedGraphics: Tighten clip when blitting without alpha.
Also don't try to clean up the Painter's window backing store in ~Painter()
if we don't actually have a window backing store.
2019-02-10 11:45:02 +01:00
Andreas Kling
9860e55047 Kernel: Put page fault logspam behind PAGE_FAULT_DEBUG. 2019-02-10 11:37:59 +01:00
Andreas Kling
5e8d6b1bf4 Base: Rename /users to /home.
I didn't like seeing /users next to /usr. /home looks nicer.
2019-02-10 11:18:12 +01:00
Andreas Kling
2def3d8d3f LibGUI: Start adding an automatic widget layout system.
My needs are really quite simple, so I'm just going to add what I need
as I go along. The first thing I needed was a simple box layout with
widgets being able to say whether they prefer fixed or fill for both
their vertical and horizontal sizes.

I also made a simple GStatusBar so FileManager can show how many bytes
worth of files are in the current directory.
2019-02-10 11:07:13 +01:00
Andreas Kling
2cf1dd5b6f Move apps into a top-level Applications/ directory. 2019-02-10 08:35:01 +01:00
Andreas Kling
29f2a22d34 LibGUI: Minor cleanup in GScrollBar. 2019-02-10 08:23:03 +01:00