Commit graph

7165 commits

Author SHA1 Message Date
Sergey Bugaev
bf8dacf0c1 Kernel: Add placement new[] operator 2020-02-18 11:23:27 +01:00
Andreas Kling
4b16ac0034 Kernel: Purging a page should point it back to the shared zero page
Anonymous VM objects should never have null entries in their physical
page list. Instead, "empty" or untouched pages should refer to the
shared zero page.

Fixes #1237.
2020-02-18 09:56:11 +01:00
Shannon Booth
52c76aa9bf WindowServer: Remove unsued MenuManager::menu_selection_color() 2020-02-18 09:42:02 +01:00
Andreas Kling
0bb4111735 HackStudio: Unbreak the form editor's widget icons
This is breakage from the GFoo => GUI::Foo rename.
2020-02-17 21:49:17 +01:00
Andreas Kling
25b987ce4c SystemMenu: Use pledge() and unveil() 2020-02-17 20:20:46 +01:00
Andreas Kling
2060da829c WindowServer: Remove unveils of /bin and /etc/passwd
This is no longer needed now that we have SystemMenu. :^)
2020-02-17 20:20:46 +01:00
Andreas Kling
a008e2f63a WindowServer: Drop the "exec" pledge promise entirely
Now that the system menu is out-of-process, we no longer need to exec()
from WindowServer, allowing us to drop this promise. Very cool!
2020-02-17 20:20:46 +01:00
Andreas Kling
b711f1eab5 SystemMenu: Finish the implementation and start this at boot :^)
Fixes #1231.
2020-02-17 20:20:32 +01:00
Andreas Kling
84520d8b59 WindowServer: Make way for the out-of-process system menu
This patch removes the internal system menu from WindowServer and
replaces it with two IPC API's:

    SetSystemMenu(menu_id)
    SetSystemTheme(theme_path, theme_name)

These API's will allow us to complete the SystemMenu program and
move it entirely out of process.
2020-02-17 20:08:00 +01:00
Andreas Kling
189fa68c0b LibGUI: Expose GUI::Menu::menu_id() and also allow forced realization
Menu realization is when we instruct WindowServer to create the
server-side menu objects on our behalf.
2020-02-17 20:04:05 +01:00
Andreas Kling
7afd9039d1 Base: Add a Minesweeper app icon that's actually 16x16
The one we were using was actually 15x15 which tripped up an assertion
when loading it into a menu using the GUI::Action code path.
2020-02-17 19:58:33 +01:00
Andreas Kling
737e455cbc SystemMenu: Add a separate program to host the system menu
This will allow us to run the system menu as any user. It will also
enable further lockdown of the WindowServer process since it should no
longer need to pledge proc and exec. :^)

Note that this program is not finished yet.

Work towards #1231.
2020-02-17 16:50:48 +01:00
Andreas Kling
a0ad372b08 AudioServer: Remove ASEventLoop class and do all the setup in main()
This class was too small and unnecessary.
2020-02-17 16:50:48 +01:00
thatlittlegit
6eccd166ed SystemDialog: Use Yes/No dialog instead of OK/Cancel
This also removes some unecessary debug lines. (The debug lines are
unnecessary because LibGUI already outputs the debug information, so
SystemDialog just doubled it up.)
2020-02-17 16:28:21 +01:00
thatlittlegit
14aaf75e3a TextEditor: Use Yes/No/Cancel for some dialogs when buffer is dirty 2020-02-17 16:28:21 +01:00
thatlittlegit
4755f355c6 LibGUI: Add Yes/No and Yes/No/Cancel MessageBoxes 2020-02-17 16:28:21 +01:00
Andreas Kling
48f7c28a5c Kernel: Replace "current" with Thread::current and Process::current
Suggested by Sergey. The currently running Thread and Process are now
Thread::current and Process::current respectively. :^)
2020-02-17 15:04:27 +01:00
Andreas Kling
4f4af24b9d Kernel: Tear down process address space during finalization
Process teardown is divided into two main stages: finalize and reap.

Finalization happens in the "Finalizer" kernel and runs with interrupts
enabled, allowing destructors to take locks, etc.

Reaping happens either in sys$waitid() or in the scheduler for orphans.

The more work we can do in finalization, the better, since it's fully
pre-emptible and reduces the amount of time the system runs without
interrupts enabled.
2020-02-17 14:33:06 +01:00
Andreas Kling
0e33f53cf8 Kernel: Allow multiple inspectors of a process (in /proc)
Replace Process::m_being_inspected with an inspector reference count.
This prevents an assertion from firing when inspecting the same process
in /proc from multiple processes at the same time.

It was trivially reproducible by opening multiple FileManagers.
2020-02-17 13:29:49 +01:00
Andreas Kling
a78bc5e6fc LibGUI: Generate NotificationServer IPC messages during build
I hacked this to skip using flock since NotificationServer and LibGUI
depend on each other. There's probably a better solution.
2020-02-16 22:37:04 +01:00
Andreas Kling
30549502ca LibGUI: Generate NotificationServerEndpoint.h if needed 2020-02-16 22:28:48 +01:00
Andreas Kling
7efb497837 NotificationServer: Add new notification windows below the lowest one
Don't stack notifications on top of each other, instead put them below
one another on the y axis.

This will obviously break if the screen fills with notifications, but
that's a FIXME for now. :^)
2020-02-16 21:58:17 +01:00
Andreas Kling
9f54ea9bcd NotificationServer: Add a system service for desktop notifications
This patch adds NotificationServer, which runs as the "notify" user
and provides an IPC API for desktop notifications.

LibGUI gains the GUI::Notification class for showing notifications.

NotificationServer is spawned on demand and will unspawn after
dimissing all visible notifications. :^)

Finally, this also comes with a small /bin/notify utility.
2020-02-16 21:58:17 +01:00
Andreas Kling
a6e69bda71 AK: Add basic Traits for RefPtr
This allows RefPtr to be stored in a HashTable<RefPtr<T>> :^)

It's unfortunate about the const_casts. We'll need to fix HashMap::get
to play nice with non-const Traits<T>::PeekType at some point.
2020-02-16 21:58:17 +01:00
Andreas Kling
9794e18a20 Base: Run WindowServer as a separate "window" user
This was actually rather painless and straightforward. WindowServer now
runs as the "window" user. Users in the "window" group can connect to
it via the socket in /tmp/portal/window as usual.
2020-02-16 21:58:17 +01:00
Andreas Kling
0415db30c6 WindowServer: Move configuration file into /etc/WindowServer
This is in preparation for running WindowServer as a separate user.
2020-02-16 21:58:17 +01:00
Tibor Nagy
1176167944 Piano: Set step property for ADSR sliders 2020-02-16 21:58:01 +01:00
Tibor Nagy
c7f549ba19 LibGUI: Add mouse wheel event and step property to Slider 2020-02-16 21:58:01 +01:00
Andreas Kling
69bb0c0246 malloc: Use 64KB blocks (instead of 4KB)
We now allocate 64KB at a time and divide them into chunks for handing
out to malloc() callers. This significantly reduces the number of
system calls made due to memory allocation.

This yields a ~15% speedup when compiling Process.cpp inside SerenityOS
(down from 24 sec to 20 sec on my machine.)

There's more performance on the table here, no doubt.
2020-02-16 14:11:14 +01:00
Andreas Kling
31e1af732f Kernel+LibC: Allow sys$mmap() callers to specify address alignment
This is exposed via the non-standard serenity_mmap() call in userspace.
2020-02-16 12:55:56 +01:00
Andreas Kling
02e199a9cb AK: Don't construct a String every time we LogStream<< a number 2020-02-16 12:48:58 +01:00
Andreas Kling
14bd978928 Revert "LibC: Implement isblank()"
This reverts commit 4e79a60b78.

This broke the GCC port. Apparently isblank() was added in C99 and for
some reason it needs special treatment in headers.
2020-02-16 10:47:54 +01:00
Andreas Kling
4ba153668b chmod: Tweak usage string
Fixes #1223.
2020-02-16 09:51:49 +01:00
Andreas Kling
fe343a0497 LibGUI: ItemView painting was not respecting the frame thickness
Fixes #1112.
2020-02-16 09:50:38 +01:00
Andreas Kling
2143da6434 LibGUI: Add forwarding header
This patch adds <LibGUI/Forward.h> and uses it a bunch.
It also dragged various header dependency reduction changes into it.
2020-02-16 09:41:56 +01:00
Andreas Kling
2e6ab58117 LibGfx: Reduce header dependencies of StylePainter 2020-02-16 09:41:56 +01:00
Tibor Nagy
9041e95e79 LibGUI: Render ScrollBar buttons as pressed when they are being pressed 2020-02-16 09:41:40 +01:00
Kaif Mavani
fa21c7e8bf
AK: Fixed a typo in NeverDestroyed.h (#1228) 2020-02-16 09:32:18 +01:00
Andreas Kling
7a8be7f777 Kernel: Remove SmapDisabler in sys$accept() 2020-02-16 08:20:54 +01:00
Andreas Kling
7717084ac7 Kernel: Remove SmapDisabler in sys$clock_gettime() 2020-02-16 08:13:11 +01:00
Andreas Kling
7533d61458 Kernel: Fix weird whitespace mistake in RangeAllocator 2020-02-16 08:01:33 +01:00
Tibor Nagy
fc24b2b57d LibGUI: Make ResizeCorner theme-aware 2020-02-16 08:01:20 +01:00
Shannon Booth
4d8547d112 Userland: Use DirIterator in rm 2020-02-16 02:19:22 +01:00
Shannon Booth
42399167b3 LibCore: Add DirIterator::next_full_path() 2020-02-16 02:19:22 +01:00
Andreas Kling
e90765e957 Kernel: Remove Process inheriting from Weakable
This mechanism wasn't actually used to create any WeakPtr<Process>.
Such pointers would be pretty hard to work with anyway, due to the
multi-step destruction ritual of Process.
2020-02-16 02:16:22 +01:00
Andreas Kling
635ae70b8f Kernel: More header dependency reduction work 2020-02-16 02:15:33 +01:00
Andreas Kling
16818322c5 Kernel: Reduce header dependencies of Process and Thread 2020-02-16 02:01:42 +01:00
Andreas Kling
e61cdf5c39 AK: Add HashMap, HashTable and Traits to Forward.h 2020-02-16 02:01:18 +01:00
Andreas Kling
e28809a996 Kernel: Add forward declaration header 2020-02-16 01:50:32 +01:00
Andreas Kling
1d611e4a11 Kernel: Reduce header dependencies of MemoryManager and Region 2020-02-16 01:33:41 +01:00