Commit Graph

5749 Commits

Author SHA1 Message Date
Hüseyin ASLITÜRK
e50deb55d3 WindowServer: Remove Clock from server.
We have clock applet.
2019-12-27 22:47:31 +01:00
Hüseyin ASLITÜRK
3d4dddd111 MenuApplets: Add Clock applet, move code from WindowServer to the applet. 2019-12-27 22:47:31 +01:00
Mauri de Souza Nunes
0e49c842de LibC: Add timeval operations
This commit add macros for the timeval operations timeradd, timersub,
timercmp, timerisset, timerclear.
2019-12-27 22:43:43 +01:00
Andreas Kling
4d997308c2 LibC: Remove some functions we had two of 2019-12-27 16:55:10 +01:00
Andreas Kling
cbdd65e4d9 LibDraw: Remove redundant Rect copy constructor 2019-12-27 16:55:10 +01:00
Andreas Kling
4a0fb34eb8 Toolchain: Allow building shared objects
Here goes a small first step towards dynamic linking.
2019-12-27 16:55:10 +01:00
Valtteri Koskivuori
2b9c9bf663 LibPthread: Log debug info to debug console instead of stdout (#931) 2019-12-27 15:53:02 +01:00
Valtteri Koskivuori
415a5d68ce Build: Fix missing IPC dependency for Browser.
It forgot to compile IPC for ProtocolClient before building the browser.
2019-12-27 15:52:12 +01:00
Andreas Kling
159289af03 WindowServer: Use the system theme for the fallback window background
When filling in some missing part of a window (typically happens during
interactive window resize) we now use the ColorRole::Background from
the system theme palette instead of expecting the clients to send us
the same information when creating windows.
2019-12-27 13:28:55 +01:00
Andreas Kling
fd06164fa0 WindowServer: Recompute window occlusions on window stack changes
When adding/removing windows, or moving a window from the front to the
back, we have to recompute everyone's occlusion states.
2019-12-27 11:44:37 +01:00
Andreas Kling
74968f0ec1 WindowServer: Don't send paint events to occluded windows
We wouldn't be able to see what they paint anyway, and nobody should
be using paint events to drive program logic.
2019-12-27 11:40:29 +01:00
Andreas Kling
c7847d7c81 WindowServer+LibGUI: Mark window bitmaps volatile in occluded windows
WindowServer now tracks whether windows are occluded (meaning that
they are completely covered by one or more opaque windows sitting above
them.) This state is communicated to the windows via WindowStateChanged
messages, which then allow GWindow to mark its backing store volatile.

This reduces the effective memory impact of windows that are not at all
visible to the user. Very cool. :^)
2019-12-27 11:34:40 +01:00
Valtteri Koskivuori
5d1acdda82 AK: Fix unused parameter bug in SinglyLinkedList (#928) 2019-12-27 10:29:28 +01:00
Andreas Kling
d1c16944ce gron: Implement a simplified variant of @tomnomnom's "gron"
This program takes JSON input and turns it into JavaScript statements
that construct the same data step by step. This format is much more
greppable than what "jp" gives us. :^)
2019-12-27 03:27:37 +01:00
Stefano Cristiano
49a789ad04 Build: Allow building serenityOS ext2 root filesystem on macOS host 2019-12-27 02:19:55 +01:00
Stefano Cristiano
b62dbcbf59 Build: Disable compiling tests on macOS host
Tests fail to compile for a mix of reasons, some due to macOS file systems
being by default case-insensitive and some specific to clang.
Both issues are better left to a dedicated set of PR that addressed them.
2019-12-27 02:19:55 +01:00
Stefano Cristiano
1222b94ab8 LibCore: Allow LibCore to be compiled on macOS host
Compiling LibCore on macOS is needed if one wants to compile host tools
(like IPCCompiler) on a non Linux host.
These changes could be possibly reverted once "event loop" functionality
and "base library" (Vector, String etc.) will be split in two separate libraries,
updating all relevant projects.
2019-12-27 02:19:55 +01:00
Stefano Cristiano
aab412bd85 LibCore: Fix errors when compiling LibCore using clang instead of gcc 2019-12-27 02:19:55 +01:00
Stefano Cristiano
250f6b9a1e Build: Disable unknown GCC specific warnings when compiling host tools using clang 2019-12-27 02:19:55 +01:00
Stefano Cristiano
18e3e4f236 Build: Make sure that RANLIB and AR use cross-compiler provided executables
This is very much needed when compiling host tools on macOS for example
2019-12-27 02:19:55 +01:00
Stefano Cristiano
9537ce918c Toolchain: Statically link serenity cross-compiler on macOS to keep the cross-toolchain self contained 2019-12-27 02:19:55 +01:00
Conrad Pankoff
fe3311d458 AK: Simplify const T& versions of append/insert in SinglyLinkedList 2019-12-27 02:15:45 +01:00
Conrad Pankoff
115b315375 Kernel: Add kernel-level timer queue (heavily based on @juliusf's work)
PR #591 defines the rationale for kernel-level timers. They're most
immediately useful for TCP retransmission, but will most likely see use
in many other areas as well.
2019-12-27 02:15:45 +01:00
Conrad Pankoff
13cf7e76b9 AK: Add insert_{before,after}(iterator, value) to SinglyLinkedList 2019-12-27 02:15:45 +01:00
Andreas Kling
abdd5aa08a Kernel: Separate runnable thread queues by priority
This patch introduces three separate thread queues, one for each thread
priority available to userspace (Low, Normal and High.)

Each queue operates in a round-robin fashion, but we now always prefer
to schedule the highest priority thread that currently wants to run.

There are tons of tweaks and improvements that we can and should make
to this mechanism, but I think this is a step in the right direction.

This makes WindowServer significantly more responsive while one of its
clients is burning CPU. :^)
2019-12-27 00:52:30 +01:00
Andreas Kling
23e16a3e2e LibGUI: Remove bitrotted automatic keybinds feature
This feature hasn't been working at all for several months, so let's
just remove it and simplify GWindow event handling.
2019-12-27 00:52:30 +01:00
Shannon Booth
c85bdff57a PaintBrush: Add an "ellipse tool"
The tool currently supports drawing an elliptical line of a specified
thickness. Further improvements can include adding a fill mode, and
holding down shift to draw a perfect circle.

Closes #375.
2019-12-27 00:52:17 +01:00
Shannon Booth
123b5c9d34 LibDraw: Add draw_ellipse_intersecting function
This functon will draw an ellipse which is intersecting the corners of
the rect given. It is a very naive implementation, taking 200 samples of
points around the ellipse, and drawing straight lines between each of
these points.

The ellipses look good enough to me though!
2019-12-27 00:52:17 +01:00
Conrad Pankoff
0b3a868729 Kernel: Simplify force_pio logic in PATA driver (#923) 2019-12-26 22:57:58 +01:00
Andreas Kling
95034fdfbd Kernel: Move PC speaker beep timing logic from scheduler to the syscall
I don't know why I put this in the scheduler to begin with.. the caller
can just block until the beeping is finished.
2019-12-26 22:31:26 +01:00
Andreas Kling
154d10e4e9 Kernel: Process::for_each_in_pgrp() should not include dead processes
We don't care about dead processes that were once members of a specific
process group.

This was causing us to try and send SIGINT to already-dead processes
when pressing Ctrl+C in a terminal whose pgrp they were once in.

Fixes #922.
2019-12-26 22:20:39 +01:00
Andreas Kling
43da941de5 LibGUI: Use NeverDestroyed<T> for the global GWindow tables
We don't need these to be destroyed on exit, since that would race with
the destruction of static global RefPtr<GWindow>'s.

Fixes #900.
2019-12-26 22:13:50 +01:00
Andreas Kling
f607cab235 AK: Add NeverDestroyed<T>, for things that should never be destroyed
This template allows you to define static globals without having them
destroyed on exit.
2019-12-26 22:12:45 +01:00
Shannon Booth
b830639912 PaintBrush: Add a "rectangle tool"
Fill, line, and gradient modes initially supported :^)
2019-12-26 21:22:29 +01:00
Shannon Booth
70a2355963 LibDraw: Add dx/dy_relative_to() helper functions for Points 2019-12-26 21:22:29 +01:00
Tibor Nagy
f0a82e1bcc Base: Add 3x upscaled Liza fonts
Upscaled with hq3x then cleaned up the glyphs manually.
2019-12-26 14:35:51 +01:00
Andreas Kling
519cb80a96 LibGUI+WindowServer: Mark minimized window backing stores as volatile
WindowServer will now send out a WindowStateChanged message to clients
when one of their windows is minimized.

This is then forwarded to the GWindow, which will try to mark its
underlying window backing store as volatile.

This allows the kernel to steal the memory used by minimized windows
in case it starts running low. Very cool! :^)
2019-12-26 12:06:07 +01:00
Andreas Kling
23591f2a95 munch: Add a simple userland program for chewing up lots of memory 2019-12-26 11:48:34 +01:00
Andreas Kling
c1f8291ce4 Kernel: When physical page allocation fails, try to purge something
Instead of panicking right away when we run out of physical pages,
we now try to find a PurgeableVMObject with some volatile pages in it.
If we find one, we purge that entire object and steal one of its pages.

This makes it possible for the kernel to keep going instead of dying.
Very cool. :^)
2019-12-26 11:45:36 +01:00
Andreas Kling
dafd715743 ProcFS: Fix inconsistent numbers in /proc/memstat
We were listing the total number of user/super pages as the number of
"available" pages in the system. This was then misinterpreted in the
SystemMonitor program and displayed wrong in the GUI.
2019-12-26 11:43:42 +01:00
Andreas Kling
6fd655102e Kernel: Add Lock::is_locked() 2019-12-26 11:43:23 +01:00
Andreas Kling
9d681beaf0 LibC: Oops x2, we can't use "bool" in stdlib.h either 2019-12-26 10:30:34 +01:00
Andreas Kling
b1fc5d9143 LibC: Oops, we can't use [[nodiscard]] when this is included from C 2019-12-26 10:24:37 +01:00
Andreas Kling
22776589f0 HackStudio: Fix failure to open files
Use FileSystemPath to figure out that "./foo.cpp" == "foo.cpp"
2019-12-26 10:19:44 +01:00
Shannon Booth
64842fd0ac LibHTML: Remove fixed FIXME 2019-12-26 10:05:59 +01:00
Shannon Booth
bbf878e987 LibC: Implement tmpfile() 2019-12-26 10:05:59 +01:00
Shannon Booth
f6bd4f8691 LibC: Use shared functon to generate unique filenames
Move some dupliated code into __generate_unique_filename()
2019-12-26 10:05:59 +01:00
Conrad Pankoff
17aef7dc99 Kernel: Detect support for no-execute (NX) CPU features
Previously we assumed all hosts would have support for IA32_EFER.NXE.
This is mostly true for newer hardware, but older hardware will crash
and burn if you try to use this feature.

Now we check for support via CPUID.80000001[20].
2019-12-26 10:05:51 +01:00
Andreas Kling
5be6a43860 LibDraw: Add MenuBaseText and MenuSelectionText color roles
This allows the very aesthetic "Hotdog Stand" theme to have quite
reasonable looking menus.
2019-12-26 00:58:46 +01:00
Conrad Pankoff
5330593e38 Base: Add Hotdog Stand theme 2019-12-26 00:46:16 +01:00