Commit graph

11 commits

Author SHA1 Message Date
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
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
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
e6de6c4f45 WindowServer: Don't keep menu items in hovered state after the cursor leaves. 2019-02-11 11:06:41 +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