Commit Graph

145 Commits

Author SHA1 Message Date
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