Commit Graph

325 Commits

Author SHA1 Message Date
DrewStratford
6bd1879189 SystemServer: Reap dead processes. (#706)
SystemServer didn't reap its child processes. This commit adds
sigchld_handler, which reaps children when appropriate.
2019-10-31 09:49:53 +01:00
Andreas Kling
d0799f3648 WindowServer: Center the mouse cursor on startup
The code was already trying to do this, but it was centering inside the
screen rect before we had a screen rect. :^)
2019-10-26 11:39:15 +02:00
Chyza
4d99856f95 WindowManager: Make maximised windows unmaximise when dragged. 2019-10-23 07:44:27 +02:00
Till Mayer
406aabff23 AudioServer: Added ability to get count of samples in the buffer queue
Now the AClientConnection can get the count of samples still in the
buffer queue.
2019-10-19 20:05:13 +02:00
Till Mayer
8bb919d1cc ASMixer: Removed unused variable in ASBufferQueue
The variable m_playing_queued_buffer_id was defined but not used.
2019-10-19 20:05:13 +02:00
Andreas Kling
96f10c8de2 LibDraw: Rename Painter::blit_tiled() => draw_tiled_bitmap()
Also change the API to take a destination rect instead of a source rect
since internally it was basically creating a destination rect from the
source rect anyway. It was a little confusing.
2019-10-19 11:05:21 +02:00
Till Mayer
4c8341d080 LibAudio: Fixed stuttery playback of audio
When playing an ABuffer, the count of samples were determined by the
size of the SharedBuffer. This caused small pauses of up to 512
samples during the playback, when the size of the shared buffer was
rounded up to a multiple of 4096. This problem was amplified by the
fact that the AResampleHelper was created every time a new chunk of
audio was to be processed, causing inconsistencies in the playback of
wav files.
2019-10-16 16:25:38 +02:00
Andreas Kling
7e97e1c5d9 LookupServer: Remove debug spam about /etc/hosts 2019-10-16 12:10:33 +02:00
Andreas Kling
3a4da5aa05 LookupServer: Cache successful DNS lookup responses for 1 minute
This reduces DNS traffic spam during web browsing. We can definitely do
a lot better here, this is just a very low-hanging fruit.
2019-10-16 12:10:16 +02:00
Andreas Kling
76266862d1 LibGUI+WindowServer: Add a "Hand" cursor to the standard cursors 2019-10-10 21:35:12 +02:00
Andreas Kling
8f45a259fc ByteBuffer: Remove pointer() in favor of data()
We had two ways to get the data inside a ByteBuffer. That was silly.
2019-09-30 08:57:01 +02:00
Larkin Nickle
ab67f74588 TelnetServer: Accept arbitrary command with -c
For example, this allows you to do something like
`TelnetServer -c /usr/bin/nyancat` to have the TelnetServer run
`/usr/bin/nyancat` instead of `/bin/Shell`.
2019-09-28 22:37:14 +02:00
Andreas Kling
e61aa01745 WindowServer: Remove debug spam about child window removals 2019-09-22 00:44:18 +02:00
Andreas Kling
d6abfbdc5a LibCore: Remove ObjectPtr in favor of RefPtr
Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
2019-09-22 00:31:54 +02:00
Andreas Kling
bc319d9e88 LibCore: Make CObject reference-counted
Okay, I've spent a whole day on this now, and it finally kinda works!
With this patch, CObject and all of its derived classes are reference
counted instead of tree-owned.

The previous, Qt-like model was nice and familiar, but ultimately also
outdated and difficult to reason about.

CObject-derived types should now be stored in RefPtr/NonnullRefPtr and
each class can be constructed using the forwarding construct() helper:

    auto widget = GWidget::construct(parent_widget);

Note that construct() simply forwards all arguments to an existing
constructor. It is inserted into each class by the C_OBJECT macro,
see CObject.h to understand how that works.

CObject::delete_later() disappears in this patch, as there is no longer
a single logical owner of a CObject.
2019-09-22 00:25:25 +02:00
Andreas Kling
8d550c174e LibCore: Convert CFile to ObjectPtr 2019-09-21 20:50:06 +02:00
Andreas Kling
f4b51a63ec LibCore: Remove CTimer::create() overloads in favor of construct() 2019-09-21 18:13:17 +02:00
Andreas Kling
4ea229accd LibCore: Convert CTCPServer to ObjectPtr
Also get rid of the custom CNotifier::create() in favor of construct().
2019-09-21 15:25:08 +02:00
Andreas Kling
953cb4e436 LibCore: Convert CLocalServer to ObjectPtr 2019-09-21 15:25:08 +02:00
Andreas Kling
c83da29a9d LibCore: Convert CLocalSocket to ObjectPtr 2019-09-21 15:25:08 +02:00
Andreas Kling
4298ba25c3 LibCore: Convert CTCPSocket to ObjectPtr, add construct() helper
The C_OBJECT macro now also inserts a static construct(...) helper into
the class. Now we can make the constructor(s) private and instead call:

    auto socket = CTCPSocket::construct(arguments);

construct() returns an ObjectPtr<T>, which we'll later switch to being
a NonnullRefPtr<T>, once everything else in in place for ref-counting.
2019-09-21 15:25:08 +02:00
Andreas Kling
fcc3745b02 LibCore+LibGUI+WindowServer: Make events bubble up through ancestors
With this patch, CEvents no longer stop at the target object, but will
bubble up the ancestor chain as long as CEvent::is_accepted() is false.

To the set accepted flag, call CEvent::accept().
To clear the accepted flag, call CEvent::ignore().

Events start out in the accepted state, so if you want them to bubble
up, you have to call ignore() on them.

Using this mechanism, we now ignore non-tabbing keydown events in
GWidget, causing them to bubble up through the widget's ancestors. :^)
2019-09-20 20:37:31 +02:00
Andreas Kling
d1bacb9885 LibCore: Convert CNotifier to ObjectPtr 2019-09-20 15:39:15 +02:00
Andreas Kling
50a6560413 LibCore: Convert CTimer to ObjectPtr 2019-09-20 15:20:10 +02:00
Andreas Kling
1fc2bca856 SystemServer: Don't wake up every single second 2019-09-18 18:39:30 +02:00
Andreas Kling
270adea22f WindowServer: Remove the default background wallpaper
Booting without a wallpaper is significantly faster in QEMU when the
host machine is under load (e.g while recording the screen..)

Using a wallpaper is now optional. :^)
2019-09-18 16:36:15 +02:00
Andreas Kling
bd45a55d86 SystemServer: Let's only spawn one TTYServer by default
We're rarely/never accessing these anyway, and this tidies up the
process table a little bit. A futile pursuit, perhaps..
2019-09-18 13:53:36 +02:00
Andreas Kling
d92e26d023 WindowServer+LibGUI: Allow switching windows in/out of fullscreen mode
You can now call GWindow::set_fullscreen(bool) and it will go in or out
of fullscreen mode.

WindowServer will also remember the previous window rect when switching
to fullscreen, and restore it when switching back. :^)
2019-09-16 18:38:42 +02:00
Andreas Kling
814346606f SystemServer: Drop GID before dropping UID
Otherwise the setgid() will fail :^)
2019-09-15 21:18:48 +02:00
Andreas Kling
c543ee5c5b WindowServer+LibGUI: Store a "data type" with the clipboard content
This will allow us to distinguish between different types of data
stored on the clipboard.
2019-09-14 09:19:05 +02:00
Andreas Kling
c8be606acf WindowServer: Avoid doing sqrt() in double-click detection
Compare the distance travelled squared against the max distance squared
to avoid using sqrt().

Thanks to Nagy Tibor for the suggestion :^)
2019-09-09 08:51:16 +02:00
Conrad Pankoff
040947ee47 TelnetServer: Implement basic telnet server
Fixes #407

Depends on #530 to run reliably.
2019-09-08 10:56:34 +02:00
Andreas Kling
423807d772 WindowServer: Don't transform quick far-apart clicks into double-clicks
We now require that the two clicks that make up a double-click be no
more than 4px apart.

This fixes the annoying behavior where you'd often get incorrect
double-click events on GUI widgets.
2019-09-08 10:16:33 +02:00
Jesse Buhagiar
ecbc0322c1 Applications: Create a display properties manager
An interactive application to modify the current display settings, such as
the current wallpaper as well as the screen resolution. Currently we're
adding the resolutions ourselves, because there's currently no way to
detect was resolutions the current display adapter supports (or at least
I can't see one... Maybe VBE does and I'm stupid). It even comes with
a very nice template'd `ItemList` that can support a vector of any type,
which makes life much simpler.
2019-09-07 16:51:15 +02:00
Andreas Kling
cb62890f8e WindowServer: Elide window titles that don't fit
Also skip painting the titlebar stripes and/or title entirely if we
don't have enough space for them.

Fixes #524.
2019-09-06 19:09:33 +02:00
Andreas Kling
73fdbba59c AK: Rename <AK/AKString.h> to <AK/String.h>
This was a workaround to be able to build on case-insensitive file
systems where it might get confused about <string.h> vs <String.h>.

Let's just not support building that way, so String.h can have an
objectively nicer name. :^)
2019-09-06 15:36:54 +02:00
Sergey Bugaev
22e6978c71 WindowServer+LibGUI+FontEditor: Encode special characters as UTF-8 2019-09-05 16:37:39 +02:00
Conrad Pankoff
6fb7eeb81a SystemServer: Use dbg() instead of dbgprintf() 2019-09-03 16:17:26 +02:00
Conrad Pankoff
a8bd43588b SystemServer: Allow more arguments for startup processes 2019-09-03 16:17:26 +02:00
Andreas Kling
353bf57378 WindowServer: Don't crash when trying to close an empty menu
It's not normal to add empty menus to an app's menubar, but just in
case someone does it anyway, let's not crash trying to close it.
2019-09-01 13:24:57 +02:00
Andreas Kling
63e6b09816 WindowServer+LibGUI: Add support for nested menus
It's now possible to add a GMenu as a submenu of another GMenu.
Simply use the GMenu::add_submenu(NonnullOwnPtr<GMenu>) API :^)

The WindowServer now keeps track of a stack of open menus rather than
just one "current menu". This code needs a bit more work, but the basic
functionality is now here!
2019-08-29 06:36:29 +02:00
Andreas Kling
4ec698d1b0 WindowServer: Fix off-by-one in menu height calculation
This removes the unecessary empty scanline at the bottom of menus and
makes it look nice and tidy when the bottom item is highlighted. :^)
2019-08-27 13:51:09 +02:00
Andreas Kling
9a80554943 WindowServer: Reverse the menu background colors
Let's try putting the warm gray under the icons/checkboxes. This makes
the checkboxes look more natural.
2019-08-27 13:24:05 +02:00
Andreas Kling
d3c21163a5 WindowServer: Don't highlight disabled menu items when hovered 2019-08-27 10:20:10 +02:00
Andreas Kling
2147b587b2 WindowServer: Improve look of disabled menu items somewhat 2019-08-27 06:57:14 +02:00
Andreas Kling
161c862f21 WindowServer: Add an icon for the system menu / About action
It's a little ladybug. Maybe someday we'll have a fancy icon, but until
then, this ladybug character is a cute placeholder. :^)
2019-08-27 06:53:23 +02:00
Andreas Kling
1077c15917 WindowServer: Add some app icons to the system menu 2019-08-26 21:15:35 +02:00
Andreas Kling
c0d81bea06 WindowServer: Make the global menubar selection consistent with items 2019-08-26 21:14:50 +02:00
Andreas Kling
0f48e3b007 WindowServer: Align menu separators correctly
These were off by one vertically, oops!
2019-08-26 20:53:33 +02:00
Andreas Kling
11bb88f513 WindowServer: Improve the menu look a bit
Take some inspiration from the first release of Visual Studio .NET and
add a left-hand stripe to contain the icons. And various other tweaks.
This isn't quite perfect, but it's pretty neat! :^)
2019-08-26 20:46:19 +02:00