1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 11:05:06 +00:00
Commit graph

126 commits

Author SHA1 Message Date
Andreas Kling
0a86366c71 Make a preparation pass for variable-width fonts. 2019-03-06 11:03:10 +01:00
Andreas Kling
b85fe0bd07 WindowServer: Let the window switcher render itself as a WSWindow.
Much better than drawing directly into the back buffer.
2019-03-06 10:03:10 +01:00
Andreas Kling
f3ff402cf3 WindowServer: Store the mouse button state in one variable.
This makes the logic around it a lot less verbose.
2019-03-05 14:13:07 +01:00
Andreas Kling
b67d0a3632 WindowServer: Determine resizing "hot corner" based on window's outer rect. 2019-03-04 11:34:25 +01:00
Andreas Kling
5c27e74fac WindowServer: Add a window switcher.
This needs some work on the window ordering and things like that, but it
works quite nicely as a starting point.

The keyboard shortcut is Logo+Tab. :^)
2019-03-03 15:17:05 +01:00
Andreas Kling
b4631d2083 WindowManager: Allow moving windows around using Logo+LMB. 2019-03-03 13:18:58 +01:00
Andreas Kling
57fe316e01 Detect the "Logo" (Windows/Apple/whatever) key and use it for window resize.
This will be comfortable enough while I'm still developing with emulators.
QEMU keeps eating my "Alt" key presses and it's making things difficult.
2019-03-03 12:56:48 +01:00
Andreas Kling
6c2089c59d Put miscellaneous debug spam behind #ifdefs. 2019-03-01 10:51:58 +01:00
Andreas Kling
b5e5f26a82 Base: Add Csilla Bold 7x10 variant.
It's nice to have a thin and a bold variant to complement each other.
2019-03-01 02:50:50 +01:00
Andreas Kling
fd428d6ed3 SharedGraphics: Make Painter clipping work with translated clip origin. 2019-02-28 18:57:36 +01:00
Andreas Kling
05f9257621 WindowServer: Add "Open ProcessManager..." to system menu.
This will no doubt come in handy. :^)
2019-02-28 11:36:50 +01:00
Andreas Kling
c80182f81f WindowServer: Add 1920x1080 resolution option.
Because it's fun to go fullscreen on my development machine. :^)
2019-02-26 14:11:01 +01:00
Andreas Kling
f6b41d166d WindowServer: Reduce resize related debug spam. 2019-02-26 12:47:45 +01:00
Andreas Kling
88e77fe3af WindowServer: Bump height of window titlebars and menus from 16 to 18. 2019-02-26 11:04:14 +01:00
Andreas Kling
1effe70543 WindowServer+LibGUI: Fix global mouse tracking with recursive widget trees.
Also avoid sending multiple copies of mouse events to global trackers.
2019-02-26 10:34:05 +01:00
Andreas Kling
2fb3fa7f69 WindowServer: Add a simple CPU usage graph to the global menu bar.
This is pretty cute and helps me spot when something's chewing up CPU.
2019-02-26 02:17:25 +01:00
Andreas Kling
b341cab9cc WindowServer: Only invalidate the menubar rect when an app changes menubar. 2019-02-26 01:07:10 +01:00
Andreas Kling
d77f8ba413 WindowServer: Make message receivers be weak pointers. 2019-02-26 00:54:10 +01:00
Andreas Kling
15fb917f28 Convert more RetainPtr use to Retained. 2019-02-25 16:04:08 +01:00
Andreas Kling
b6115ee5b7 WindowServer: Choose resizing direction based on where it's initiated.
Divide the window into 3x3 hot areas and resize in the direction of the
corner where the resize starts. The middle is a no-op area.

This needs some polish but the basic mechanism is good.
2019-02-21 11:06:37 +01:00
Andreas Kling
6084cd0c56 Add concept of size increments to windowing system.
Use this to implement incremental resizing for Terminal so that we only
ever resize to fit a perfect number of rows and columns.

This is very nice. :^)
2019-02-21 00:21:23 +01:00
Andreas Kling
fa02d2a39b Rework the rendering model so that clients instantiate backing stores.
This makes interactive resizing work a lot better, althought it's still not
perfect. There are still glitches and unpleasant flashes of zeroed memory.
2019-02-20 22:08:14 +01:00
Andreas Kling
d054fbee91 WindowServer: Don't spam clients with resize events.
Wait for them to finish a paint, then send them a new resize event.
The exception is when releasing the mouse button to end the resize.
Then we send a new resize event right away.
2019-02-20 15:50:05 +01:00
Andreas Kling
59b8183c4b WindowServer: Support resizing windows.
This is pretty limited and not entirely stable, but it does work! :^)
2019-02-20 15:34:55 +01:00
Andreas Kling
a9911fca80 WindowServer: Minor style tweak. 2019-02-20 13:59:13 +01:00
Andreas Kling
96943dbad1 WindowServer: Remove some unused WSWindowManager members. 2019-02-20 13:17:09 +01:00
Andreas Kling
bf30502560 LibGUI: Implement enter/leave events (with WindowServer support.)
Windows now learn when the mouse cursor leaves or enters them.
Use this to implement GWidget::{enter,leave}_event() and use that
to implement the CoolBar button effect. :^)
2019-02-20 10:12:19 +01:00
Andreas Kling
57546d8420 WindowServer: Only invalidate the menubar rect when switching menubars. 2019-02-19 16:32:06 +01:00
Andreas Kling
b561a5976f WindowServer: Correct invalidation rects for menu windows. 2019-02-19 15:46:48 +01:00
Andreas Kling
98784ad3cb WindowServer: Avoid overdraw by shattering dirty rects into unique shards.
The algorithm I came up with is O(n^2) but given the small numbers of rects
we're typically working with, it doesn't really matter. May need to revisit
this in the future if we find ourselves with a huge number of rects.
2019-02-19 14:49:23 +01:00
Andreas Kling
9b71307d49 WindowServer: Support windows with alpha channels. And per-WSWindow opacity.
This patch also adds a Format concept to GraphicsBitmap. For now there are
only two formats: RGB32 and RGBA32. Windows with alpha channel have their
backing stores created in the RGBA32 format.

Use this to make Terminal windows semi-transparent for that comfy rice look.
There is one problem here, in that window compositing overdraw incurs
multiple passes of blending of the same pixels. This leads to a mismatch in
opacity which is obviously not good. I will work on this in a later patch.

The alpha blending is currently straight C++. It should be relatively easy
to optimize this using SSE instructions.

For now I'm just happy with the cute effect. :^)
2019-02-19 01:42:53 +01:00
Andreas Kling
e952a35994 WindowServer: Assume wallpaper images are 1024x768.
This is obviously not always the right thing to do, but it removes some
confusion while using other resolutions. Eventually we're gonna need some
kind of compressed image decoder.
2019-02-17 13:44:39 +01:00
Andreas Kling
0730b3c15f Add ability to switch video modes from the system menu.
I had to change PhysicalPage around a bit for this. Physical pages can now
be instantiated for any arbitrary physical address without worrying that
such pages end up in the kernel page allocator when released.

Most of the pieces were already in place, I just glued everything together.
2019-02-17 13:12:59 +01:00
Andreas Kling
fa452fadca WindowServer: Let menu objects reference the WSClientConnection by pointer.
Since these are owner/ownee relationships, there's no need for indirection.
2019-02-17 09:07:07 +01:00
Andreas Kling
9a39c01551 WindowServer: WSWindow can have a pointer to the client rather than an ID.
Since WSWindows are owned by WSConnectionClients, it's fine for them to just
reference the client directly.
2019-02-17 08:54:57 +01:00
Andreas Kling
82768e7ac5 WindowServer: Move video mode setup to WSScreen. 2019-02-17 01:43:01 +01:00
Andreas Kling
3eb6c22a22 WindowServer: Make the menubar clock work again in the post-kernel world.
This is actually so much better. Grabbing directly at the RTC was silly. :^)
2019-02-17 01:05:53 +01:00
Andreas Kling
640360e958 Move WindowServer to userspace.
This is a monster patch that required changing a whole bunch of things.
There are performance and stability issues all over the place, but it works.
Pretty cool, I have to admit :^)
2019-02-17 00:13:47 +01:00
Andreas Kling
c3d36a5fe9 WindowServer: Prune more kernel-related gunk. 2019-02-16 12:25:47 +01:00
Andreas Kling
468113422f Kernel: Add ioctls to BochsVGADevice for mode setting and page flipping.
Use these in WindowServer instead of poking at the BochsVGADevice directly.
2019-02-16 10:26:01 +01:00
Andreas Kling
dc200923f2 WindowServer: Ignore attempts to make menu windows the active window. 2019-02-14 10:56:45 +01:00
Andreas Kling
7c53171b0a WindowServer: Add debug logging if we try to activate a client-less window. 2019-02-14 10:53:28 +01:00
Andreas Kling
7723c06f27 WindowServer: Make WSMenu use WSClientConnection::post_message(). 2019-02-14 10:45:27 +01:00
Andreas Kling
c4703bedea WindowServer: Get rid of the WSWindow lock now that accesses are serial. 2019-02-14 10:35:56 +01:00
Andreas Kling
aa7947c889 WindowServer: Add WSClientConnection class to manage an individual client.
This makes both object lifetimes and object ID's a lot easier to understand.
2019-02-14 08:22:47 +01:00
Andreas Kling
f529b845ec WindowServer: Convert entire API to be message-based.
One big step towards userspace WindowServer. :^)
2019-02-14 01:21:32 +01:00
Andreas Kling
ef4e9860fd WindowServer: Convert the remaining menu APIs into messages. 2019-02-13 21:47:14 +01:00
Andreas Kling
cf432b4c3d WindowServer: Refactor more of the menu APIs to be message-based.
This is all pretty verbose but I can whittle it down later. :^)
2019-02-13 18:49:23 +01:00
Andreas Kling
fbbf57b61c Rename GUI_Event to GUI_ServerMessage.
Now that communication is becoming bidirectional, "event" is no longer right.
2019-02-13 17:59:38 +01:00
Andreas Kling
4f98a35beb WindowServer: Begin refactoring towards a fully asynchronous protocol.
In order to move the WindowServer to userspace, I have to eliminate its
dependence on system call facilities. The communication channel with each
client needs to be message-based in both directions.
2019-02-13 17:54:30 +01:00