Commit graph

99 commits

Author SHA1 Message Date
Andreas Kling
04b9dc2d30 Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
2019-07-04 16:16:50 +02:00
Andreas Kling
315716d193 GUI: Use Win2K-like "warm gray" color instead of the older colder gray.
Someone suggested this a long time ago and I never got around to it.
So here we go, here's the warm gray! I have to admit I like it better. :^)
2019-06-30 09:23:16 +02:00
Andreas Kling
3f0f7caa45 LibGUI: Fix compiler warnings. 2019-06-22 14:41:11 +02:00
Andreas Kling
e9cbda29e9 GWindow: Make destroy-on-close an optional behavior.
Also add missing implementation of GWindow::is_visible().
2019-06-22 10:37:03 +02:00
Andreas Kling
90b1354688 AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr. 2019-06-21 18:37:47 +02:00
Andreas Kling
da475ce3f5 LibGUI: Refactor the keyboard activation code a bit to use WeakPtr<GWidget>. 2019-06-21 10:09:57 +02:00
faissaloo
54005e6942 GWindow: Get rid of superflous variable 2019-06-16 21:07:55 +01:00
faissaloo
55e115b0cd LibGUI: clang-format 2019-06-16 21:01:51 +01:00
faissaloo
770907f90c GWindow: Cleanup 2019-06-16 16:55:39 +01:00
faissaloo
b635c3db54 Merge remote-tracking branch 'origin/master' into serenity-keys 2019-06-15 21:55:17 +01:00
faissaloo
50fd9ed383 GWindow: Hide SerenityKeys when window is deselected 2019-06-15 21:53:25 +01:00
faissaloo
6e0e9481a4 GWindow: Make SerenityKeys labels look better 2019-06-09 17:01:25 +01:00
faissaloo
185bff6714 GWindow: SerenityKeys refactor 2019-06-08 15:13:16 +01:00
Andreas Kling
7ad8790d80 LibGUI: Run clang-format on everything. 2019-06-07 11:46:02 +02:00
faissaloo
d449cda3d8 GWindow: Highlight for multicharacter SerenityKeys 2019-06-03 21:04:50 +01:00
Robin Burchell
1024dfa81a StringViewize a bunch of things -- mostly LibGUI 2019-06-03 20:27:05 +02:00
faissaloo
053f41f4f9 GWindow: Leave SerenityKey mode if non-existent keybind is used 2019-06-03 18:13:41 +01:00
faissaloo
72264661fd GWindow: Add SerenityKeys minimum functionality 2019-06-03 16:03:19 +01:00
Andreas Kling
51581c21fc WindowServer+LibGUI: Add a way to bring a window to the front.
GWindow::move_to_front() can now be used to move a window to the top of
the window stack.

We use this in Terminal to bring the settings window to the front if it
already exists when it's requested, in case it's hiding behind something.
2019-06-01 20:10:37 +02:00
Andreas Kling
723ba91f74 LibGUI: Add GWidget::for_each_child_widget(callback). 2019-05-27 03:52:33 +02:00
Christopher Dumas
957f8b84f2 WindowServer: Make it possible to turn off window title bars (#88)
Also, Launcher now does not use titlebars.
Only check if titlebar should be shown if the window type works with that.
2019-05-24 23:37:23 +02:00
Andreas Kling
b0ccd04a9c LibGUI: When tabbing between focusable widgets, skip over disabled ones. 2019-05-24 22:57:05 +02:00
Andreas Kling
08228f34b9 GWindow: Only flip the window backing stores once per paint event. 2019-05-21 21:05:10 +02:00
Andreas Kling
33d0916d29 WindowServer: Add support for fullscreen windows.
Fullscreen windows are rendered alone and above everything else when they
are active, and as part of the regular window stack order when something
else is active.

Currently windows cannot be made fullscreen after-the-fact, but must have
the fullscreen flag included in their CreateWindow message.

It should not possible to interact with the menu, taskbar or window frame
while the active window is fullscreened. :^)
2019-05-17 22:33:19 +02:00
Robin Burchell
a4b0dfff43 Move double click events from LibGUI to the window server 2019-05-15 22:45:28 +02:00
Andreas Kling
ad731cc08f LibGUI: Support cycling through focusable widgets with Tab and Shift-Tab. 2019-05-15 02:39:58 +02:00
Andreas Kling
dab9901235 WindowServer+LibGUI: Handle mouse wheel deltas in the mouse event stream.
The wheel events will end up in GWidget::mousewheel_event(GMouseEvent&)
on the client-side. This patch also implements basic wheel scrolling in
GScrollableWidget via this mechanism. :^)
2019-05-13 19:52:57 +02:00
Andreas Kling
b227b57508 GWindow: Mirror the correct number of pixels to newly created back bitmaps. 2019-05-08 03:34:36 +02:00
Andreas Kling
cec16105cc Make sure all GraphicsBitmap scanlines are 16-byte aligned.
This is a prerequisite for some optimizations.
2019-05-06 14:04:54 +02:00
Andreas Kling
6a5d92f0ad WindowServer+LibGUI: Allow changing whether windows have alpha channels.
Use this in Terminal to tell the window server to not bother with the alpha
channel in the backing store if we're running without transparency.
Semi-transparent terminals look neat but they slow everything down, so this
keeps things fast while making it easy to switch to the flashy mode. :^)
2019-05-03 21:07:16 +02:00
Andreas Kling
ea9a39a9f2 LibGUI+WindowServer: Add a GResizeCorner widget.
This widget is automatically included in GStatusBar, but can be added in
any other place, too. When clicked (with the left button), it initiates a
window resize (using a WM request.)

In this patch I also fixed up some issues with override cursors being
cleared after the WindowServer finishes a drag or resize.
2019-05-03 01:38:24 +02:00
Andreas Kling
9ff36afeaa GWindow: Fix crash when calling set_rect() repeatedly.
We throw away the backing store if the window rect changes size. Since the
resizing happens asynchronously at the mercy of the WindowServer, we might
end up in set_rect() again before gaining a new backing store. So there are
no guarantees that the back/front bitmaps exist here.
2019-04-26 20:08:30 +02:00
Andreas Kling
8495abd140 GWindow: Don't send InvalidateRect message with 0 rects to WindowServer.
This could happen if GWindow::hide() was called while a window had pending
repaint rects. The deferred_invoke() lambda in GWindow::update() would
eventually run, but by then, hide() had cleared all pending rects.
2019-04-23 20:43:51 +02:00
Andreas Kling
58240fdb33 Do a pass of compiler warning fixes.
This is really making me question not using 64-bit integers more.
2019-04-23 13:00:53 +02:00
Andreas Kling
9f122bff5a WindowServer+LibGUI: Allow arbitrary number of rects in messages.
To get truly atomic updates, add a mechanism for passing arbitrary amounts
of extra data along with WindowServer messages. This allows us to pass all
the rects in a single message.
2019-04-22 01:15:47 +02:00
Andreas Kling
7234900f61 WindowServer+LibGUI: Coalesce multiple client paints into GMultiPaintEvents.
This allows GWindow to paint up to 32 separate rects before telling the
WindowServer to flip the buffers. Quite a bit smoother. :^)
2019-04-20 17:38:51 +02:00
Andreas Kling
7efd61fcf5 WindowSerer+LibGUI: Send multiple rects in invalidation/flush messages.
This patch moves to sending up to 32 rects at a time when coordinating the
painting between WindowServer and its clients. Rects are also merged into
a minimal DisjointRectSet on the server side before painting.

Interactive resize looks a lot better after this change, since we can
usually do all the repainting needed in one go.
2019-04-20 17:23:35 +02:00
Andreas Kling
45a30b4dfa LibGUI: Bundle up update() invalidations and send them on next event loop. 2019-04-20 15:19:02 +02:00
Andreas Kling
49e7ffc06a WindowServer: Introduce a WM event mask so Taskbar can ignore window rects.
Taskbar was waking up to do nothing every time a window rect changed.
2019-04-20 14:40:59 +02:00
Andreas Kling
cc9cefbd5f LibGUI: GWindow's focused widget should be a WeakPtr.
This fixes some very obvious use-after-free accesses.
2019-04-18 23:16:57 +02:00
Andreas Kling
c931eaa22c WindowServer: Generate a separate WM event for window icon changes. 2019-04-18 00:39:11 +02:00
Andreas Kling
952f334de7 GWidget: Tidy up the hit-testing code somewhat. 2019-04-16 13:25:00 +02:00
Andreas Kling
3f6408919f AK: Improve smart pointer ergonomics a bit. 2019-04-14 02:36:06 +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
2f1f51b8ab LibCore: Move LibGUI/GObject to LibCore/CObject. 2019-04-10 17:01:54 +02:00
Andreas Kling
b8062f69d8 LibCore: Add CEvent and make LibGUI/GEvent inherit from it. 2019-04-10 16:56:55 +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
0ac55f2c38 GWindow: Discard wrongly-sized backing stores in set_rect().
The WindowServer still holds on to at least one backing store in case it
needs to paint us again before we can render a new one. This ensures that
we don't end up stuck with an undersized backing store.
2019-04-10 14:35:13 +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
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