Andreas Kling
86361d3d45
WindowServer: Improve the look of menus.
...
This patch makes menus stand out a bit more from their background by using
the same kind of shading that Windows 2000 had.
2019-04-16 17:02:26 +02:00
Andreas Kling
311019d8ee
WindowServer: Don't waste time pre-filling windows with background color.
...
There's a subsequent pass that fills whatever the backing store didn't
cover anyway, just a few lines later. This was all wasted work.
2019-04-16 15:10:57 +02:00
Andreas Kling
f61549ca5f
Make better use of geometry class helpers in some places.
2019-04-16 13:58:02 +02:00
Andreas Kling
bc6ac1c2f2
WindowServer: Let the CPU monitor keep /proc/all open between refreshes.
...
Just seek to the beginning on every iteration and start over. This avoids
a bunch of syscalls.
2019-04-15 23:57:31 +02:00
Andreas Kling
a3e8fc3d9c
LibCore: Add a convenience constructor for CTimer.
...
new CTimer(250, [] { thing_to_do_every_250_msec(); });
2019-04-14 05:44:15 +02:00
Andreas Kling
2af729a58a
WindowServer: Simplify a few things in WSEventLoop.
2019-04-14 05:37:07 +02:00
Andreas Kling
94a5e08faf
WindowServer: Rename WSMessage* => WSEvent*.
...
Since I'm on a roll here, I'll just rename WSMessageFoo to WSEventFoo now
that these inherit from CEventFoo anyway.
2019-04-14 05:23:37 +02:00
Andreas Kling
de184d0999
WindowServer: Port WindowServer to LibCore.
...
This was pretty straightforward thanks to the work I did separating out
LibCore from LibGUI already. :^)
- WSMessageLoop now inherits from CEventLoop.
- WSMessage now inherits from CEvent.
- WSMessageReceiver goes away.
Now there is only one event loop in Serenity. Very nice!
2019-04-14 05:15:22 +02:00
Andreas Kling
c2093ad994
WindowServer: Move the CPU monitor thingy to its own class.
2019-04-14 04:33:43 +02:00
Andreas Kling
3f6408919f
AK: Improve smart pointer ergonomics a bit.
2019-04-14 02:36:06 +02:00
Andreas Kling
d5dec1922b
WindowServer: Make menu windows inherently modal.
...
It was confusing that you could interact with other windows with a menu up.
2019-04-14 02:16:49 +02:00
Andreas Kling
91e1f3ffb1
LibGUI+WindowServer: Add a way to dismiss opened menus from the client.
2019-04-14 01:53:19 +02:00
Andreas Kling
c09c114d77
WindowServer+LibGUI: Add ability to set per-window icons.
...
The icons are passed around as filesystem paths for now, since the shared
memory bitmaps only support 2 sides.
2019-04-13 16:59:55 +02:00
Andreas Kling
c06a3bdeb4
LibGUI+WindowServer: Add support for per-GWidget context menus.
...
You can now simply assign a GMenu as a GWidget's context menu and it will
automagically pop up on right click. :^)
2019-04-12 17:18:13 +02:00
Andreas Kling
054c982181
LibGUI+WindowServer: Add support for enabled/disabled actions.
...
The enabled state of a GAction now propagates both to any toolbar buttons
and any menu items linked to the action. Toolbar buttons are painted in
a grayed out style when disabled. Menu items are gray when disabled. :^)
2019-04-12 02:53:27 +02:00
Andreas Kling
af070324db
WindowServer: Tweak window title positioning.
2019-04-11 02:59:40 +02:00
Andreas Kling
77a77b5bf7
WindowServer: Add 1440x900 resolution shortcut to system menu.
2019-04-11 00:21:08 +02:00
Andreas Kling
5e0577a042
Introduce LibCore and move GElapsedTimer => CElapsedTimer.
...
I need a layer somewhere between AK (usable both by userspace and kernel)
and LibGUI (usable by userspace except WindowServer.) So here's LibCore.
2019-04-10 16:14:44 +02:00
Andreas Kling
cfab81a961
WindowServer: Stop tracking whether clients have painted since last resize.
...
This optimization is no longer needed now that clients coalesce resizes
on their own. :^)
2019-04-10 15:46:56 +02:00
Andreas Kling
55811f233f
LibGUI+WindowServer: Coalesce paints and resizes on the client side.
...
Only process paint and resize events on the GUI client side if those events
have the latest up-to-date window size. This drastically reduces async
overdraw during interactive resize.
2019-04-10 15:39:28 +02:00
Andreas Kling
d4818dd2dd
WindowServer: Give windows a "background color" to use for missing parts.
...
When resizing a window, we often end up having to paint some part of it
without coverage in the current backing store. This patch makes those cases
look nicer by having a fallback background color for each window, passed
along with the CreateWindow client message.
2019-04-10 14:29:47 +02:00
Andreas Kling
30e2d62c38
WindowServer: Factor out some parts of compose().
...
The main compositing loop was getting pretty unwieldy. Break out some parts
into functions so it's more understandable.
2019-04-10 13:51:47 +02:00
Andreas Kling
a00a2a9db5
WindowServer: Show ongoing resize in number of w/h increments, too.
...
This makes something like "(80x25)" show up in the resizing label as well
during Terminal resize. :^)
2019-04-09 17:48:01 +02:00
Andreas Kling
1ab99903af
WindowServer: Display the window geometry while it's being moved or resized.
2019-04-09 17:17:30 +02:00
Andreas Kling
4ba5e472be
WindowServer: Always activate newly added windows.
...
This feels a lot better than new windows popping in inactive state.
2019-04-09 16:25:14 +02:00
Andreas Kling
7f2eeb0b35
LibGUI+WindowServer: Add support for GWidget tooltips.
...
Any GWidget can have a tooltip and it will automatically pop up below the
center of the widget when hovered. GActions added to GToolBars will use
the action text() as their tooltip automagically. :^)
2019-04-08 18:58:44 +02:00
Andreas Kling
c7365a00f8
WindowServer: Add ability to initiate window resize from window edges.
2019-04-06 23:20:06 +02:00
Andreas Kling
0808d5158c
WindowServer: Make WSButton a Weakable and stop rawly pointing to it.
...
We had a crash due to dereferencing a destroyed WSButton after clicking
a window close button. Avoid that problem by using WeakPtr.
2019-04-06 21:17:02 +02:00
Andreas Kling
d89d759c36
WindowServer: Pick a new active window when the active window is minimized.
...
Also use the same logic when the active window is removed.
2019-04-06 20:50:38 +02:00
Andreas Kling
8bda69e32f
WindowServer: Remove some debug spam.
2019-04-06 13:45:42 +02:00
Andreas Kling
f12573cb63
Add a slight hover highlight to GButton and WSButton. :^)
2019-04-06 04:08:09 +02:00
Andreas Kling
ef9fbef4c6
Taskbar: Show minimized window titles in [brackets].
...
Had to plumb the minimization state from WindowServer to Toolbar in order
to implement this.
2019-04-06 00:58:30 +02:00
Andreas Kling
f6ca94605c
WindowServer: Add a window minimization button.
...
The window is simply ignored in the painting and hit testing traversal
when in minimized state, same as we do for invisible windows.
The WM_SetActiveWindow message (sent by Taskbar) brings it back into the
non-minimized state. :^)
2019-04-05 22:32:00 +02:00
Andreas Kling
0fc3ccaa52
WindowServer: Make WSButton behave more like a normal button.
...
Previously it would just close the window on MouseDown. Now we do the normal
thing where we require a MouseUp inside the button rect before committing.
2019-04-05 21:53:45 +02:00
Andreas Kling
0d60c56b51
WindowServer: Make WSWindowFrame and WSButton deal in relative coordinates.
...
This was a bit painful to get right. The code is a lot more pleasant to
deal with now that all coordinates are relative to their local system
instead of being absolute screen coordinates.
2019-04-05 21:33:34 +02:00
Andreas Kling
2ac2d79a8e
WindowServer: Simplify two mouse coordinate conversions.
2019-04-05 20:27:12 +02:00
Andreas Kling
3155a2e128
WindowServer: Add a WSButton class and make the window close buttons use it.
2019-04-05 18:40:36 +02:00
Andreas Kling
47d270b577
WindowServer: Factor out window frame logic into a WSWindowFrame class.
...
The window frame is an object that contains a window, its title bar and
window border. This way WSWindowManager doesn't have to know about all the
different types of window borders, titlebar rects, etc.
2019-04-05 15:54:56 +02:00
Andreas Kling
99b98dc653
WindowServer: Merge WM_WindowAdded and WM_WindowStateChanged.
...
These events are identical, so it's silly to send both. Just broadcast
window state changes everywhere instead, it doesn't matter when it was
added as clients are learning about this asynchronously anyway.
2019-04-05 15:01:28 +02:00
Andreas Kling
bcc00857a4
AK: Revert Eternal<T> for now since it doesn't work as intended.
2019-04-05 05:14:20 +02:00
Andreas Kling
02b523f9cd
WindowServer: Clip dirty cursor rects to the screen in compose().
2019-04-04 17:36:28 +02:00
Andreas Kling
8f38c01600
WindowServer: WM_SetActiveWindow should move the window to front as well.
2019-04-04 16:38:42 +02:00
Andreas Kling
64a5abf8db
Taskbar: Only include "Normal" windows in the taskbar window list.
2019-04-04 16:23:23 +02:00
Andreas Kling
ce7341be87
WindowServer: Add WM_SetActiveWindow client request and use it in Taskbar.
...
This makes it possible for Taskbar to switch windows. :^)
2019-04-04 14:38:53 +02:00
Andreas Kling
1374195a0d
WindowServer: Broadcast the full window list to new WM listener clients.
2019-04-04 13:33:09 +02:00
Andreas Kling
9e1682c265
WindowServer: Remove some unused debugging code.
2019-04-04 13:23:59 +02:00
Andreas Kling
7b1384c4ef
Taskbar: Plumb window active state from the WindowServer to the taskbar.
2019-04-04 13:19:26 +02:00
Andreas Kling
96104b5524
Taskbar: More bringup work. We now see a basic window list.
2019-04-04 01:44:35 +02:00
Andreas Kling
a22774ee3f
Taskbar: Start working on a taskbar app.
...
I originally thought I would do this inside WindowServer, but let's try to
make it as a standalone app that communicates with WindowServer instead.
That will allow us to use LibGUI. :^)
2019-04-03 19:38:44 +02:00
Andreas Kling
318db1e48e
WindowServer: Broadcast screen rect changes to all clients.
...
GUI clients can now obtain the screen rect via GDesktop::rect().
2019-04-03 17:22:14 +02:00