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

142 commits

Author SHA1 Message Date
Andreas Kling
a149ad9b44 WindowServer: Window iteration should see the highlight window "in front". 2019-03-10 02:33:43 +01:00
Andreas Kling
2336d43abc WindowServer: Tweak CPU usage history color. 2019-03-10 01:22:36 +01:00
Andreas Kling
94df0c1ba6 WindowServer: Fix bug where window content could bleed through menus.
We have to iterate using for_each_visible_window_from_back_to_front()
if we want every window in the correct order.
2019-03-10 01:08:21 +01:00
Andreas Kling
272a41d02d WindowServer: Skip composing windows where entire dirty rect is covered.
If another window is currently in front of us and is fully opaque,
we can just skip to the next window. This avoids a whole lot of painting
with overlapping windows. :^)
2019-03-09 21:38:28 +01:00
Andreas Kling
ffe4522316 SharedGraphics: Allow passing a Font to text drawing functions.
This way we don't have to juggle around with calls to Painter::set_font()
which simplifies a bunch of places.
2019-03-09 21:24:12 +01:00
Andreas Kling
b1c272a507 WindowServer: Initiating a window drag/resize should also make frontmost. 2019-03-09 17:10:53 +01:00
Andreas Kling
684c52941d WindowServer: Always clip window updates to the window's outer rect. 2019-03-09 17:03:08 +01:00
Andreas Kling
88f6ce152f SharedGraphics: Add PainterStateSaver RAII helper and Point::operator-().
Two little things to help tidy up a bit in WSWindowManager.
2019-03-09 16:54:41 +01:00
Andreas Kling
f40d11f06d LibGUI+WindowServer: Implement drag-to-select behavior in GTextEditor.
To make this feel right, I needed to start passing keyboard modifiers along
with mouse events. That allows shift-clicking to extend the selection. :^)
2019-03-08 17:53:02 +01:00
Andreas Kling
1e0971c8b4 WindowServer: Fix slightly off alignment of menubar clock. 2019-03-08 01:31:03 +01:00
Andreas Kling
c9c40e1da6 Base+WindowServer: Add a new default wallpaper for fun. 2019-03-07 23:58:04 +01:00
Andreas Kling
67ee579113 WindowServer: Add window icons. Every window has the same icon for now.
The icons show up both in the title bars and in the window switcher.
Eventually I'd like to be able to minimize to icon, and maybe even have
myself a taskbar.
2019-03-06 23:03:36 +01:00
Andreas Kling
495c4f940d WindowServer: Only the left mouse button should initiate window drag. 2019-03-06 22:38:19 +01:00
Andreas Kling
eedfb2649e WindowServer: Tweak appearance of window close buttons. 2019-03-06 22:36:37 +01:00
Andreas Kling
5773b91a04 WindowServer: Use the right font for computing titlebar text rects. 2019-03-06 22:34:45 +01:00
Andreas Kling
66a5ddd94a More work on the variable-width font support.
Katica is now the default system font, and it looks quite nice. :^)
I'm gonna need to refine the GTextBox movement stuff eventually,
but it works well-enough for basic editing now.
2019-03-06 14:06:40 +01:00
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