Commit Graph

111 Commits

Author SHA1 Message Date
Andreas Kling
d7270059ab WindowServer: Tweak window minimize button appearance. 2019-04-30 15:09:40 +02:00
Andreas Kling
c8aae534d7 WindowServer: Make WSMenu wide enough that shortcuts are always rightmost. 2019-04-29 23:41:48 +02:00
Andreas Kling
ed957ca2e1 WindowServer: Add 1280x720 resolution to the system menu. 2019-04-28 05:24:52 +02:00
Andreas Kling
8f81a3f9dd LibGUI+WindowServer: Make it possible to have checkable GActions.
They show up as checkable GButtons in GToolBar, and with (or without) check
marks in menus.

There are a bunch of places to make use of this. This patch only takes
advantage of it in the FileManager for the view type actions.
2019-04-26 21:09:56 +02:00
Andreas Kling
de4b77ef27 WindowServer: Ignore title change notifications for non-normal windows. 2019-04-25 17:38:16 +02:00
Andreas Kling
956bd23aae WindowServer+TaskBar: Add a taskbar window button popup menu.
This patch only hooks up the minimize and unminimize actions.
2019-04-23 23:14:14 +02:00
Andreas Kling
e2cd572e60 WindowServer: Add some padding to the window switcher items. 2019-04-23 22:01:33 +02:00
Andreas Kling
f520d87097 WindowServer: Remove debug spam about activating non-normal windows. 2019-04-23 20:46:10 +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
62f7e8ac62 WindowServer: WSButton should be more discerning with MouseUp/MouseMove. 2019-04-23 01:17:20 +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
84f96c393c WindowServer: Limit paint request rects to the visible window rect.
Don't send unnecessarily large paint requests to clients. This avoids some
unnecessary work and fixes choppiness when dragging widgets outside the
visible part of a VisualBuilder form.
2019-04-21 04:20:29 +02:00
Andreas Kling
57da00b731 Include Makefile.common in all other Makefiles. 2019-04-21 04:09:39 +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
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
ab94a6be00 AK: Add String::copy(BufferType) helper.
This will create a String from any BufferType that has data() and size().
2019-04-20 14:13:40 +02:00
Andreas Kling
301a269ca0 Get rid of SERENITY macro since the compiler already defines __serenity__
This makes it a bit easier to use AK templates out-of-tree.
2019-04-20 12:58:49 +02:00
Andreas Kling
6aead8998a WindowServer: Fix minor header dependency issue. 2019-04-20 12:49:11 +02:00
Andreas Kling
3c0afccca0 WindowServer: Improve the look of menu separators. 2019-04-18 19:58:25 +02:00
Andreas Kling
b88f2bc799 WindowServer: Broadcast window icons to newly joined WM listener clients. 2019-04-18 19:42:48 +02:00
Andreas Kling
e74b5bc054 ProcessManager+WindowServer: Do a little less malloc() in CPU monitor code. 2019-04-18 03:37:01 +02:00
Andreas Kling
c7d6e568ba WindowServer: Tweak window icon placement again. 2019-04-18 02:11:44 +02:00
Andreas Kling
f6b4013329 WindowServer: Make window title bars slightly thicker. :^) 2019-04-18 01:45:52 +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
c4c7f224d5 WindowServer: Use CFile in the CPU monitor code. 2019-04-18 00:12:04 +02:00
Andreas Kling
18ef6b111b WindowServer: Mouse switching between system menu and app menu was broken. 2019-04-17 12:06:09 +02:00
Andreas Kling
486ed41fd2 WindowServer: Tweak window icon placement. 2019-04-16 22:37:46 +02:00
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