Commit Graph

324 Commits

Author SHA1 Message Date
Andreas Kling
1c0669f010 LibDraw: Introduce (formerly known as SharedGraphics.)
Instead of LibGUI and WindowServer building their own copies of the drawing
and graphics code, let's it in a separate LibDraw library.

This avoids building the code twice, and will encourage better separation
of concerns. :^)
2019-07-18 10:18:16 +02:00
Andreas Kling
2167f60235 WindowServer: Rename (files) WSMenuBarKeeper => WSMenuManager. 2019-07-18 10:18:16 +02:00
Andreas Kling
66e9de8aaa WindowServer: Rename WSMenuBarKeeper => WSMenuManager. 2019-07-18 10:18:16 +02:00
Robin Burchell
b907608e46 SharedBuffer: Split the creation and share steps
This allows us to seal a buffer *before* anyone else has access to it
(well, ok, the creating process still does, but you can't win them all).

It also means that a SharedBuffer can be shared with multiple clients:
all you need is to have access to it to share it on again.
2019-07-18 10:06:20 +02:00
Robin Burchell
a9d1a86e6e CProcessStatisticsReader: Be consistent about terminology from the kernel down 2019-07-18 07:23:26 +02:00
Andreas Kling
4adbddeb36 AudioServer: Use Vector::append(Vector&&) for pending mix buffers.
Vector::append(Vector&&) is a simple pointer transfer when appending to an
empty Vector. :^)
2019-07-17 20:54:09 +02:00
Robin Burchell
9c8dd836fc Rename new IPC headers & classes
Sticking these in a namespace allows us to use a more generic
("Connection") term without clashing, which is way easier to understand
than to try to come up with unique names for both.
2019-07-17 20:16:44 +02:00
Robin Burchell
3837de0573 WSEventLoop: Remove inheritance from CEventLoop
The only reason for the inheritance was to add FDs to the select set.

Since CNotifier is available (and now also quite useful), we can make use of it
instead, and remove the inheritance.
2019-07-17 20:16:44 +02:00
Robin Burchell
6eaa6826fa Port WSClientConnection to CIPCServerSideClient 2019-07-17 20:16:44 +02:00
Robin Burchell
edcbba9e98 Introduce CIPCServerSideClient
As a new base class of IPC connections server-side.
Port ASClientConnection to CIPCServerSideClient.
2019-07-17 20:16:44 +02:00
Robin Burchell
fd6cafaa84 ABuffer: clamp -> clip
More natural term when talking about audio :)
2019-07-17 09:47:52 +02:00
Robin Burchell
ed25d524f2 ABuffer: move it and groove it 2019-07-17 09:47:52 +02:00
Robin Burchell
2df6f0e87f Work on AudioServer
The center of this is now an ABuffer class in LibAudio.
ABuffer contains ASample, which has two channels (left/right) in
floating point for mixing purposes, in 44100hz.

This means that the loaders (AWavLoader in this case) needs to do some
manipulation to get things in the right format, but that we don't need
to care after format loading is done.

While we're at it, do some correctness fixes. PCM data is unsigned if
it's 8 bit, but 16 bit is signed. And /dev/audio also wants signed 16
bit audio, so give it what it wants.

On top of this, AudioServer now accepts requests to play a buffer.
The IPC mechanism here is pretty much a 1:1 copy-paste from
LibGUI/WindowServer. It can be generalized more in the future, but for
now I want to get AudioServer working decently first :)

Additionally, add a little "aplay" tool to load and play a WAV file. It
will break with large WAVs (run out of memory, heh...) but it's a start.

Future work needs to make AudioServer block buffer submission from
clients until it has played the buffer they are requesting to play.
2019-07-17 09:39:31 +02:00
Andreas Kling
62335c5f0c WindowServer: Spawn a SystemDialog when activating the shutdown menu.
This allows us to ask the user for confirmation instead of just shutting
down the system abruptly.
2019-07-16 21:41:13 +02:00
Robin Burchell
818a29c964 WSEventLoop: Move message processing into WSClientConnection
Tidier encapsulation than splitting messages between two classes.
2019-07-14 15:29:59 +02:00
Robin Burchell
0a1bd03f1d WindowServer: Add a custom window type for Launcher
This keeps it out of the taskbar window list.
The stacking order is a little gnarly, but it seems to work OK still.
2019-07-14 00:06:47 +02:00
Robin Burchell
bee4544192 WSEventLoop: Treat invalid window types the same as unknown window types
And forcefully disconnect the client in both cases.
2019-07-14 00:06:47 +02:00
Robin Burchell
ffa8cb668f AudioServer: Assorted infrastructure work
* Add a LibAudio, and move WAV file parsing there (via AWavFile and AWavLoader)
* Add CLocalSocket, and CSocket::connect() variant for local address types.
  We make some small use of this in WindowServer (as that's where we
  modelled it from), but don't get too invasive as this PR is already
  quite large, and the WS I/O is a bit carefully done
* Add an AClientConnection which will eventually be used to talk to
  AudioServer (and make use of it in Piano, though right now it really
  doesn't do anything except connect, using our new CLocalSocket...)
2019-07-13 22:57:24 +02:00
Andreas Kling
85674aa498 WindowServer: Don't deliver the same mouse event twice.
We were sometimes delivering the same mouse event twice to the active input
window. This happened because we had already delivered it via the automatic
cursor tracking mechanism.
2019-07-13 11:50:39 +02:00
Robin Burchell
6c4024c04a Kernel: First cut of a sb16 driver
Also add an AudioServer that (right now) doesn't do much.
It tries to open, parse, and play a wav file. In the future, it can do more.

My general thinking here here is that /dev/audio will be "owned" by AudioServer,
and we'll do mixing in software before passing buffers off to the kernel
to play, but we have to start somewhere.
2019-07-13 08:00:24 +02:00
Robin Burchell
8a1a9e78d7 WSWindowManager: Ensure that we pick a single window to deliver a full stream of events to
This is effectively a mouse grab except that we don't require any client
coordination to request it (which is probably OK, and certainly a lot
simpler to implement).

This prevents e.g. dragging the mouse cursor out of paint and over the
terminal from selecting text unexpectedly.
2019-07-12 18:19:45 +02:00
Andreas Kling
64d9b43734 WindowServer: Use CProcessStatisticsReader in WSCPUMonitor. 2019-07-10 15:22:44 +02:00
Andreas Kling
1791ebaacd WindowServer: Convert dbgprintf() in WSWindowManager to dbg().
Here goes the first trial run for the new LogStream mechanism.
I like it so far. :^)
2019-07-04 07:07:40 +02:00
Andreas Kling
27f699ef0c AK: Rename the common integer typedefs to make it obvious what they are.
These types can be picked up by including <AK/Types.h>:

* u8, u16, u32, u64 (unsigned)
* i8, i16, i32, i64 (signed)
2019-07-03 21:20:13 +02:00
Andreas Kling
575acfac98 WindowServer: Add a separator before "close" in window menus. 2019-06-30 15:59:11 +02:00
VAN BOSSUYT Nicolas
802d4dcb6b Meta: Removed all gitignore in the source tree only keeping the root one 2019-06-30 10:41:26 +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
14b51253c0 WindowServer: Allow changing window opacity with Logo+MouseWheel.
This is just a silly little feature that I thought was a bit neat. :^)
2019-06-29 09:27:55 +02:00
Andreas Kling
2bd8118843 Kernel: Change the format of /proc/all to JSON.
Update ProcessManager, top and WSCPUMonitor to handle the new format.

Since the kernel is not allowed to use floating-point math, we now compile
the JSON classes in AK without JsonValue::Type::Double support.
To accomodate large unsigned ints, I added a JsonValue::Type::UnsignedInt.
2019-06-29 09:04:45 +02:00
Andreas Kling
872cccb8f7 WindowServer: Make use of the new Vector(initializer_list). 2019-06-28 20:21:28 +02:00
Andreas Kling
5980007e44 Userland: Fix many compiler warnings. 2019-06-22 15:47:08 +02:00
Andreas Kling
0deade2883 WindowServer: Fix compiler warnings. 2019-06-22 14:49:01 +02:00
Andreas Kling
550b0b062b AK: Rename RetainPtr.h => RefPtr.h, Retained.h => NonnullRefPtr.h. 2019-06-21 18:45:59 +02:00
Andreas Kling
c26e3ce86b Change "retain" to "ref" in various comments. 2019-06-21 18:40:24 +02:00
Andreas Kling
90b1354688 AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr. 2019-06-21 18:37:47 +02:00
Andreas Kling
77b9fa89dd AK: Rename Retainable => RefCounted.
(And various related renames that go along with it.)
2019-06-21 15:30:03 +02:00
Andreas Kling
ef1bfcb9d8 WindowServer: Move some event code from WSWindowManager to WSMenuBarKeeper. 2019-06-21 15:02:11 +02:00
Andreas Kling
ede598589a WindowServer: Make most of WSMenuBarKeeper private.
The outside world doesn't need to know about all this stuff.
2019-06-21 11:12:45 +02:00
Andreas Kling
2e9cc75d11 WindowServer+Taskbar: Let WindowServer manage the "window menus".
Taskbar now simply asks the WindowServer to popup a window menu when right
clicking on a taskbar button.

This patch also implements the "close" menu item, and furthermore makes the
window menu show up when you left-click a window's titlebar icon. :^)
2019-06-21 11:03:43 +02:00
Andreas Kling
9ac17c7bc9 WindowServer: Render the global menubar into a separate WSWindow.
Previously we were rendering the whole menubar on every compose(),
even if nothing changed about it. Now it's in its own window and can
be invalidated and painted separately.
2019-06-21 08:19:43 +02:00
Andreas Kling
8cb0c765ca LookupServer: Use a CFile for loading /etc/hosts.
This fixes an issue with the lines having extra bytes at the end due after
converting from ByteBuffer to String.
2019-06-20 21:48:33 +02:00
Andreas Kling
4080221547 WindowServer: Remove unused WSWindowManager::m_windows hash table. 2019-06-18 14:40:18 +02:00
Robin Burchell
862682b1bb SystemServer: Shut down after 5 seconds if testmode=1 is set on the kernel command line 2019-06-16 14:33:59 +02:00
Robin Burchell
c52d553249 WindowServer: Add a shutdown option to the menu, rather than forcing terminal use 2019-06-16 12:25:30 +02:00
Andreas Kling
39d1a9ae66 Meta: Tweak .clang-format to not wrap braces after enums. 2019-06-07 17:13:23 +02:00
Andreas Kling
e09c3a1ae8 SystemServer: Run clang-format on everything. 2019-06-07 11:47:46 +02:00
Andreas Kling
8358833bc8 WindowServer: Run clang-format on everything. 2019-06-07 11:47:19 +02:00
Christopher Dumas
0491d34d0c LookupServer: use /etc/hosts even for reverse lookups 2019-06-07 08:35:41 +02:00
Christopher Dumas
70a37f9a26 LookupServer: Load hostnames 2019-06-07 08:35:41 +02:00
Christopher Dumas
4f62176c3e LookupServer: Clang-Format 2019-06-07 08:35:41 +02:00
Christopher Dumas
908d9458c7 WindowServer: New API for Scaled Blit 2019-06-06 18:35:00 +02:00
Christopher Dumas
90d924a97c WindowServer: Implement scaled backgrounds and scaled blitting function 2019-06-06 18:35:00 +02:00
Christopher Dumas
c72953cf06 WindowServer: Clang-Format 2019-06-06 18:35:00 +02:00
Andreas Kling
01f1333856 LookupServer+LibC: Add support for reverse DNS lookups via gethostbyaddr().
LookupServer can now take two types of requests:

* L: Lookup
* R: Reverse lookup

The /bin/host program now does a reverse lookup if the input string is a
valid IPv4 address. :^)
2019-06-06 05:35:03 +02:00
Andreas Kling
3fa0b6cd92 WindowServer: Always update the maximize button icon when we should.
We were only updating it in the WSButton callback, not when changing the
maximized state by calling WSWindow::set_maximized().

Fixes #119.
2019-06-02 15:35:00 +02:00
Robin Burchell
b55b6cd7fc AK: Add implicit String -> StringView conversion
And tidy up existing view() users.
2019-06-02 12:55:51 +02: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
8d7fbbe1fb WindowServer: Don't reach the end of mode_to_enum() without returning. 2019-06-01 20:02:05 +02:00
Mustafa
a4726b846c ls: Show user name and group name if available. (#151)
Fixes #150
2019-06-01 13:23:35 +02:00
Robin Burchell
d31ce9eccd Misc: Add a simple init process
This doesn't do much right now, just fork off a bunch of stuff and set priorities.
2019-05-30 02:57:15 +02:00
Robin Burchell
0dc9af5f7e Add clang-format file
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
2019-05-28 17:31:20 +02:00
Andreas Kling
cbd858544d LibC: Move struct timeval to sys/time.h. #POSIX 2019-05-28 13:48:06 +02:00
Christopher Dumas
3e26faa226 removed extra impl of scaling 2019-05-27 21:40:53 +02:00
Christopher Dumas
da9c70598f centered backgrounds are now an option 2019-05-27 21:40:53 +02:00
Christopher Dumas
c23882dde1 can now tile background and made sure the IRC choose server popup still works 2019-05-27 21:40:53 +02:00
Christopher Dumas
e3f81bce49 IRC client setttings, Terminal settings, more WM settings 2019-05-27 21:40:53 +02:00
Christopher Dumas
63486b8438 implemented settings for window manager. 2019-05-27 21:40:53 +02:00
Christopher Dumas
d4a16d6031 Network stack is now configurable, and resolution is also configurable, but loading cursors causes a page-fault? 2019-05-27 21:40:53 +02:00
Robin Burchell
9b86eb9fad WSCompositor: Allow a compose to bypass the timer when it first happens
d66fa60fcf introduced the use of a timer
to coalesce screen updates. This is OK, but it does introduce update
latency.

To help mitigate the impact of this, we now have a second (immediate)
timer. When a compose pass is first triggered, the immediate timer will
allow the compose to happen on the next spin of the event loop (so, only
coalescing updates across a single event loop pass). Any updates that
trigger while the delayed timer is running, though, will be delayed to
that (~60fps) timer.

This fixes #103.
2019-05-26 18:22:33 +02:00
Robin Burchell
d66fa60fcf WSCompositor: Use a timer to schedule compose rather than an event
Really poor man's vsync. Still not actual vsync, but at least we won't
constantly spin buffers if we get many dirty rects.
2019-05-26 04:10:05 +02:00
Robin Burchell
79dba9a545 WSEventLoop: Don't assert when being told to construct a crazy window type
Seriously non-cool :(
2019-05-26 03:41:53 +02:00
Andreas Kling
41ebb3eba3 WindowServer: Tweak window titlebar look somewhat.
Add a subtle shadow to the titlebar text. Also make the titlebar one pixel
taller to fully accomodate the 90s "3D frame" effect. :^)
2019-05-25 21:55:53 +02:00
Andreas Kling
34150f0836 WindowServer: Remove unused old "middle border" color. 2019-05-25 21:19:42 +02:00
Andreas Kling
e478a2fb0a WindowServer: Don't draw titlebar separator for titlebar-less windows. 2019-05-25 04:17:21 +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
d0bc21b96f WindowServer: Remove some unused WSWindowManager members. 2019-05-24 21:11:55 +02:00
Christopher Dumas
dd84dcf31f Launcher loads applications from Launcher.ini, is started by default, and is resized automatically
Co-Authored-By: Andreas Kling <awesomekling@gmail.com>
2019-05-24 20:40:09 +02:00
Andreas Kling
ad908f1395 WindowServer: Factor out compositing from WSWindowManager into WSCompositor.
This is far from finished and the two classes are awkwardly grabbing at each
other's innards, but here's a first step in the right direction.
2019-05-24 19:32:46 +02:00
Andreas Kling
abbcdba72e WindowServer: Add 2560x1440 resolution option.
Also expand the QEMU VGA memory size to 64 MB, since otherwise we won't
have enough memory for double-buffering the screen.
2019-05-24 14:02:17 +02:00
Robin Burchell
9aa9454c6b WindowServer: Don't eat a MouseUp when producing a MouseDoubleClick
Otherwise, double clicking a button will leave it in pressed state.
2019-05-21 16:43:56 +02:00
Andreas Kling
9df8d28542 WindowServer: Don't start window resize for MouseUp or MouseMove. 2019-05-20 11:06:10 +02:00
Andreas Kling
d65114afd7 WindowServer: Convert some assertions into client did_misbehave()'s. 2019-05-20 04:29:07 +02:00
Andreas Kling
091448b8f3 WindowServer: Use blocking sockets for client connections. 2019-05-20 04:08:09 +02:00
Andreas Kling
0b850cf726 WindowServer: Allow sending up to 32 invalidation rects inline.
Oops, it looks like I left the max inline rects limit at 1 while debugging
this code.. We can fit 32 rects in a single WSAPI message without needing
a second "extra data" message, so let's use the space we have!
2019-05-20 03:18:43 +02:00
Robin Burchell
a8864dc590 Kernel: Report EAGAIN from read() on a non-blocking socket if the buffer is empty
This is not EOF, and never should have been so -- can trip up other code
when porting.

Also updates LibGUI and WindowServer which both relied on the old
behaviour (and didn't work without changes). There may be others, but I
didn't run into them with a quick inspection.
2019-05-20 01:31:28 +02:00
Robin Burchell
5f597d0cb2 WindowServer: Improve client write handling a little
* EPIPE now correctly deletes the client connection
* EAGAIN (which is now returned by the kernel if the write buffer fills)
  terminates the connection also
2019-05-19 14:13:49 +02:00
Robin Burchell
ec0d598934 WSWindowManager: Add double click to maximize/restore 2019-05-18 15:54: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
5babcac289 Build: Install most headers to Root (and libcore.a/libgui.a)
This makes out-of-tree linking possible. And at the same time, add a
CMakeToolchain.txt file that can be used to build arbitrary cmake-using
applications on Serenity by pointing to the CMAKE_TOOLCHAIN_FILE when
running cmake:

    -DCMAKE_TOOLCHAIN_FILE=~/code/serenity/Toolchain/CMakeToolchain.txt
2019-05-17 21:59:48 +02:00
Robin Burchell
805e87a21c WindowServer: Add a more dynamic app list
This contains more stuff, and is easier to add to since it's just a vector :)
2019-05-17 14:20:44 +02:00
Andreas Kling
bcb7893156 WindowServer: Don't treat bottom titlebar edge as part of the border.
We were allowing initiation of resize from the bottom titlebar edge
since everything inside the window frame that's not either inside the
title bar, or inside the window content, is considered the border.
2019-05-16 20:29:42 +02:00
Andreas Kling
4e7e2950bc WindowServer: Fill unbacked windows with their background color.
This avoids flashing a content-less window frame during client startup.
2019-05-16 20:11:09 +02:00
Robin Burchell
c4610b825d WSWindowManager: Fix a small whoopsie with double click delivery
We must reset the click clock to invalid after delivering the double
click event. Otherwise, a subsequent click will make us (incorrectly)
deliver another double click.
2019-05-16 01:24:34 +02:00
Robin Burchell
f55965b5e8 WindowServer/GMenu: Adjust the popup position to fit the window inside the screen
Rather than passing a "top_anchored" bool. Fixes #22.
2019-05-16 01:22:54 +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
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
852d648912 Fix "make clean" not deleting app binaries. 2019-05-13 14:56:18 +02:00
Andreas Kling
42cf09fdf1 WindowServer: Don't add maximize button to non-resizable windows.
The minimize button can stay though, since it doesn't change the window
size, just the visibility. :^)
2019-05-13 00:48:54 +02:00
Andreas Kling
8c4b7fe385 WindowServer: Make the ordering in the window switcher a bit more sane. 2019-05-13 00:08:56 +02:00
Andreas Kling
a20ce4d2b8 WindowServer: Rearrange minimize/maximize/close buttons (in that order.) 2019-05-12 21:33:25 +02:00
Andreas Kling
641893104a WindowServer: Add a maximize/unmaximize button to windows. 2019-05-12 21:32:02 +02:00
Andreas Kling
dddf45f563 Change String&& arguments to const String& in a couple of places.
String&& is more nuisance than anything, and the codegen improvement is
basically negligible since the underlying type is already retainable.
2019-05-12 14:57:15 +02:00
Andreas Kling
23e6c45e87 WindowServer: Show downscaled window thumbnails in the window switcher. 2019-05-12 04:15:25 +02:00
Andreas Kling
c9951bbe60 WindowServer: Improve window frames by giving them a raised frame look. :^) 2019-05-11 01:31:10 +02:00
Andreas Kling
d8ae6c31ce LibGUI+WindowServer: Improve checkmark appearance. 2019-05-10 22:50:42 +02:00
Andreas Kling
99aead4857 Kernel: Add a writev() syscall for writing multiple buffers in one go.
We then use this immediately in the WindowServer/LibGUI communication in
order to send both message + optional "extra data" with a single syscall.
2019-05-10 03:19:25 +02:00
Andreas Kling
5b2e122624 WindowServer: Don't launch a terminal when clicking system menu separators.
The menu item for launching a terminal was sharing ID's with the separators.
2019-05-07 17:11:28 +02:00
Andreas Kling
8750f93201 WindowServer: Don't invalidate the cursor on left button state change.
This was needed back when pressing the left button would cause the cursor
to switch colors.
2019-05-07 03:56:54 +02:00
Andreas Kling
dc919352b0 WindowServer: Don't send Paint messages to minimized windows.
There's no point in painting if it can't be seen anyway. We also make sure
to request a repaint when un-minimizing, so the window gets a chance to
repaint itself then.
2019-05-04 23:59:04 +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
288e97a206 WindowServer+LibGUI: Wait for the extra_data to arrive.
Since the sockets we use are non-blocking, just slap a select before the
second call to read(). This fixes some flakiness seen under load.

This should eventually work a bit differently, we could use recv() once
it has MSG_WAITALL, and we should not let WindowServer handle all the
client connections on the main thread. But for now, this works.

Fixes #24.
2019-05-01 18:28:33 +02:00
Andreas Kling
6614746ca8 WindowServer: Spawn a secondary thread to decode wallpapers.
The threading API's are not very mature, so this code looks a bit crufty
but it does take the load off the WindowServer main thread when changing
wallpapers. :^)
2019-05-01 16:07:47 +02:00
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