Commit graph

40153 commits

Author SHA1 Message Date
Timothy Flynn
becec3578f LibTimeZone+LibUnicode: Generate string data with run-length encoding
Currently, the unique string lists are stored in the initialized data
sections of their shared libraries. In order to move the data to the
read-only section, generate the strings using RLE arrays.

We generate two arrays: the first is the RLE data itself, the second is
a list of indices into the RLE array for each string. We then generate a
decoding method to convert an RLE string to a StringView.
2022-08-16 16:56:17 +02:00
Mike Akers
de980de0e4 Kernel: Lock the inode before writing in SharedInodeVMObject::sync
We ensure that when we call SharedInodeVMObject::sync we lock the inode
lock before calling Inode virtual write_bytes method directly to avoid
assertion on the unlocked inode lock, as it was regressed recently. This
is not a complete fix as the need to lock from each path before calling
the write_bytes method should be avoided because it can lead to
hard-to-find bugs, and this commit only fixes the problem temporarily.
2022-08-16 16:54:03 +02:00
David Smith
0b9d83fe0d Profiler: Fix unmovable splitter
Set preferred height instead of fixed height to allow the splitter to
move.

The splitter respects set_fixed_height() after a808cfa7 "LibGUI+
Applications: Govern Splitter resizing by opportunistic growth", and
that caused the splitter in Profiler to stop working.
2022-08-16 16:53:24 +02:00
thankyouverycool
a74f512f6b LibGUI+WindowServer+DisplaySettings: Add Tooltips to SystemEffects
Tooltips can now be toggled on and off system-wide.
2022-08-16 16:53:00 +02:00
thankyouverycool
d286bf85e6 WindowServer: Remove unused header in SystemEffects 2022-08-16 16:53:00 +02:00
thankyouverycool
63b8d04100 WindowServer: Walk the open menu stack in reverse on MouseMove events
Fixes lower level menus stealing focus from higher submenus.
2022-08-16 16:52:09 +02:00
thankyouverycool
e87eb97e68 WindowServer: Do not pop-up submenus directly atop their ancestors
Previously submenus would pop-up on their immediate open ancestors in
cases of limited screen real estate. If the submenu was sufficiently
large, this could make it difficult to navigate back down the menu
stack. Now submenus display on either side of their ancestors, making
it easy to zig-zag up and down menu stacks. This is similar to how
menus operate in many other DEs.
2022-08-16 16:52:09 +02:00
thankyouverycool
4489f9dbef WindowServer: Add MenuManager helper to find closest open ancestor 2022-08-16 16:52:09 +02:00
thankyouverycool
db852548ce WindowServer: Force cursor invalidation when composing immediately
And invalidate the cursor before creating a new drag-and-drop
overlay. Fixes dnd overlay bitmaps failing to draw at the correct
location immedately after changing cursors.
2022-08-16 16:43:27 +02:00
thankyouverycool
9bcd7dc0ce WindowServer: Don't start a drag and drop unless holding Primary mouse
Adds a member to record the last processed mouse buttons. If they
do not include MouseButton::Primary, return early before creating
a new drag and drop client. This fixes race conditions in which
MouseUp events canceling or completing a drop could be swallowed
by Overlay creation or postponed by an executing DragOperation,
leaving the operation in limbo.
2022-08-16 16:43:27 +02:00
thankyouverycool
db058a22ae LibGUI: Put DragOperation dbgln() behind DRAG_DEBUG 2022-08-16 16:43:27 +02:00
thankyouverycool
7c1995993f WindowServer: Use correct config group for workspace settings
WindowServer.ini already contained the correct pluralized group by
default, but was left unused by a typo.
2022-08-16 16:41:47 +02:00
thankyouverycool
71a437b512 DisplaySettings: Update Workspaces tab GML
Removes some verbiage and arranges things consistent with other
settings dialogs.

Ideally we shouldn't litter UIs with shortcuts, tips, tricks,
self-evident or redundant descriptions, etc, so this can be
refined again in the future once there's an official way to expose/
customize keyboard shortcuts.
2022-08-16 16:41:47 +02:00
thankyouverycool
2d706ba753 Base: Add 32x32 workspaces settings icon 2022-08-16 16:41:47 +02:00
thankyouverycool
1f1ac99ef9 WindowServer+WorkspacePicker: Adjust active and inactive colors
Now uses the Selection ColorRole for the active desktop and a
slightly darkened Window for inactive ones. Several themes use
the same color for thread highlighting and inactive windows which
was causing frames to draw without the correct perception of depth.
2022-08-16 16:41:47 +02:00
Ryan Liptak
24424d265d Base: Add 16 new emoji
😁 - U+1F601 GRINNING FACE WITH SMILING EYES
😮‍💨 - U+1F62E U+200D U+1F4A8 FACE EXHALING
😵‍💫 - U+1F635 U+200D U+1F4AB FACE WITH SPIRAL EYES
😶‍🌫️ - U+1F636 U+200D U+1F32B U+FE0F FACE IN CLOUDS
🤗 - U+1F917 SMILING FACE WITH OPEN HANDS
🤧 - U+1F927 SNEEZING FACE
🤪 - U+1F92A ZANY FACE
🤫 - U+1F92B SHUSHING FACE
🤭 - U+1F92D FACE WITH HAND OVER MOUTH
🥱 - U+1F971 YAWNING FACE
🥲 - U+1F972 SMILING FACE WITH TEAR
🥳 - U+1F973 PARTYING FACE
🥴 - U+1F974 WOOZY FACE
🥸 - U+1F978 DISGUISED FACE
🥺 - U+1F97A PLEADING FACE
🧐 - U+1F9D0 FACE WITH MONOCLE
2022-08-16 14:06:18 +01:00
kleines Filmröllchen
2d3d4ecef5 Base: Add audio MIME type associations 2022-08-16 13:58:51 +01:00
kleines Filmröllchen
e52a7663ce Utilities/file: Handle all supported audio MIME types 2022-08-16 13:58:51 +01:00
kleines Filmröllchen
f48651fccc LibCore: Add MIME sniffing for MP3 and WAV 2022-08-16 13:58:51 +01:00
kleines Filmröllchen
2c485a8e7b LibCore: The MIME type is 'audio/flac', not 'extra/flac' 2022-08-16 13:58:51 +01:00
Tim Schumacher
0598f52fc0 Meta: Remove an outdated MAKE_DIRECTORY call for pnp IDs
We are downloading these directly into the build directory now, and
generating the source code from there, so we no longer need the
manually created directory.

While we are at it, remove two variables that seem to be no longer in
use, and at least one of which is confusing regarding a missing prefix.
2022-08-16 06:07:19 -04:00
watkinsr
35dbeb064a LibWeb: Render flex line items RTL (reversed items) for FlexEnd
This is a basic attempt at trying to handle parent container case
justify-content: flex-end.

Test-scenario:
Head to https://ryanwatkins.me and note that now the header nav is on
the right as opposed to the left in-line with how Chrome/Firefox would
respectively handle it also, i.e. 'flex-end'

Implementation:
Move cursor to the end and render in reverse backwards shifting the
cursor leftwards.
2022-08-16 09:55:49 +01:00
huttongrabiel
279caade73 TextEditor: Correct typo in MainWidget.{cpp,h} 2022-08-16 09:53:30 +01:00
djwisdom
8ae2771097 Base: Add new emojis U+1F7E0-U+1F7EB
🟠 - U+1F7E0 ORANGE CIRLE
🟡 - U+1F7E1 YELLOW CIRLE
🟢 - U+1F7E2 GREEN CIRLE
🟣 - U+1F7E3 PURPLE CIRLE
🟤 - U+1F7E4 BROWN CIRLE
🟥 - U+1F7E5 RED SQUARE
🟦 - U+1F7E6 BLUE SQUARE
🟧 - U+1F7E7 ORANGE SQUARE
🟨 - U+1F7E8 YELLOW SQUARE
🟩 - U+1F7E9 GREEN SQUARE
🟪 - U+1F7EA PURPLE SQUARE
🟫 - U+1F7EB BROWN SQUARE

Coverage: https://emoji.serenityos.net
2022-08-16 09:52:58 +01:00
Ryan Liptak
213e037f80 Base: Add new emoji U+1F923
🤣 - U+1F923 ROLLING ON THE FLOOR LAUGHING
2022-08-16 09:52:29 +01:00
dylanbobb
8180211431 Kernel: Release 1 page instead of all pages when starved for pages
Previously, when starved for pages, *all* clean file-backed memory
would be released, which is quite excessive.

This patch instead releases just 1 page, since only 1 page is needed
to satisfy the request to `allocate_physical_page()`
2022-08-16 01:13:17 +02:00
dylanbobb
09d0fae2c6 Kernel: Allow release of a specific amount of of clean pages
Previously, we could only release *all* clean pages.
This patch makes it possible to release a specific amount of clean
pages. If the attempted number of pages to release is more than the
amount of clean pages, all clean pages will be released.
2022-08-16 01:13:17 +02:00
Andreas Kling
072dde9387 WindowServer: Always use the automatic cursor tracking window's cursor
Whenever we're in the "automatic cursor tracking" state, we should only
display the tracking window's cursor, as the state is globally modal.
2022-08-16 00:58:26 +02:00
Andreas Kling
296e68fdbf WindowServer: Move "automatic cursor tracking window" to WindowManager
It didn't make sense for this to be a per-WindowStack concept, since
automatic cursor tracking is globally modal.
2022-08-16 00:58:26 +02:00
Andreas Kling
add4f42d21 WindowServer: Rename "active input tracking window"
...to "automatic cursor tracking window". This matches what we call its
sibling concept in LibGUI ("automatic cursor tracking widget").
2022-08-16 00:58:26 +02:00
Andreas Kling
6548ae8afd LibGUI: Retain the active input tracking widget's cursor
Until the tracking stops, we want to keep displaying the same cursor.
2022-08-16 00:58:26 +02:00
djwisdom
1885445a79 Base: Add new emojis U+1F534-U+1F539
Add new emojis:
🔴 - U+1F534 RED CIRCLE
🔵 - U+1F535 BLUE CIRCLE
🔶 - U+1F536 LARGE ORANGE DIAMOND
🔷 - U+1F537 LARGE BLUE DIAMOND
🔸 - U+1F538 SMALL ORANGE DIAMOND
🔹 - U+1F539 SMALL BLUE DIAMOND

Coverage: https://emoji.serenityos.net
2022-08-15 21:48:48 +01:00
Andreas Kling
6135411ea8 Terminal: Enable double-buffering for the terminal widget
This was disabled originally because of performance paranoia, but it
resulted in flickering sometimes, so let's err on the side of nicer
looking terminals. :^)
2022-08-15 17:18:11 +02:00
Andreas Kling
e7d2696a56 Kernel: Shrink default userspace stack size from 4 MiB to 1 MiB
This knocks 70 MiB off our idle footprint, (from 350 MiB to 280 MiB.)
2022-08-15 17:18:11 +02:00
Andreas Kling
c1af2f28e3 LibCore: Add Directory::chown() API and use it in Core::Account
Since we already have the directory open, let's have an API to fchown()
the underlying file descriptor instead of forcing clients to do another
path lookup.
2022-08-15 17:18:11 +02:00
Andreas Kling
3f14582b85 LoginServer+LibCore: Only create user temp directory from LoginServer
Other programs use Core::Account::login(), notably su(1), which stopped
working due to a missing "cpath" pledge promise.

This patch moves the /tmp/user/ creation logic to a separate function
that LoginServer can call.
2022-08-15 17:18:11 +02:00
Timothy Flynn
32642394a9 LibGUI: Programatically draw table header sorting arrows
These arrows were previously drawn using the code points U+2B06 and
U+2B07. The .png files for these emoji were removed in commit bfe99eb
and added to the Katica Regular 10 font in commit cf62d08. The emoji
were not added to the bold Katica variants that are used by the table
header view. The effect is that a "?" replacement character was
rendered.

Instead of rendering the emoji, we can draw the arrows programatically,
like we do in other GUI components (e.g. the scrollbar).
2022-08-15 17:17:54 +02:00
davidot
e746360b9a LibJS: Use NaN boxing to decrease the memory size of Values
Using the fact that there are 2^52-2 NaN representations we can
"NaN-box" all the Values possible. This means that Value no longer has
an explicit "Type" but that information is now stored in the bits of a
double. This is done by "tagging" the top two bytes of the double.
For a full explanation see the large comment with asserts at the top of
Value.

We can also use the exact representation of the tags to make checking
properties like nullish, or is_cell quicker. But the largest gains are
in the fact that the size of a Value is now halved.

The SunSpider and other benchmarks have been ran to confirm that there
are no regressions in performance compared to the previous
implementation. The tests never performed worse and in some cases
performed better. But the biggest differences can be seen in memory
usage when large arrays are allocated. A simple test which allocates a
1000 arrays of size 100000 has roughly half the memory usage.

There is also space in the representations for future expansions such as
tuples and records.

To ensure that Values on the stack and registers are not lost during
garbage collection we also have to add a check to the Heap to check for
any of the cell tags and extracting the canonical form of the pointer
if it matches.
2022-08-15 17:11:25 +02:00
davidot
6c504e2bff LibJS: Specialize Optional<Completion>
Since Completion has an enum for state we have plenty of space to add
an extra type which indicates on empty completion.
Since Optional<Completion> is used in every ThrowCompletionOr<...>
this saves quite some stack space as most function in LibJS return
types like that.
This saves 8 bytes for every Optional<Completion>.
2022-08-15 17:11:25 +02:00
davidot
8381e7f1e6 LibJS: Specialize Optional<Value>
Values can be "empty" which only has a valid meaning for array holes.
We can however use this state the represent the empty state of an
Optional<Value> which is used in a lot of placed, because of Completion
having one.
This saves 8 bytes for every Optional<Value>.
2022-08-15 17:11:25 +02:00
davidot
8be96cd7ff AK: Allow bit_cast to be used in constant evaluated context 2022-08-15 17:11:25 +02:00
davidot
da8715a07c LibJS: Add extreme value tests for cos and sin
These sometimes produce different NaN patterns which can mess up the
value encoding.
2022-08-15 17:11:25 +02:00
huttongrabiel
27abbfdf09 TextEditor: Display widget when needle not found in replace all
When the given needle is not found, replace displays a widget that says
the needle is not found, but replace all does not.

This change adds that widget to replace all.
2022-08-15 13:09:56 +02:00
Emily Trau
d43640037e Meta: Remove TZDB duplication 2022-08-15 09:57:49 +01:00
djwisdom
6511aa4e18 Base: Add more emojis U+1F344,45,47-4C
🍄 - U+1F344 MUSHROOM
🍅 - U+1F345 TOMATO
🍇 - U+1F347 GRAPES
🍈 - U+1F348 MELON
🍉 - U+1F349 WATERMELON
🍊 - U+1F34A TANGERINE
🍋 - U+1F34B LEMON
🍌 - U+1F34C BANANA

Coverage: https://emoji.serenityos.net
2022-08-15 09:55:54 +01:00
Idan Horowitz
4edae21bd1 Kernel: Remove regions from the region tree after failing to map them
At the point at which we try to map the Region it was already added to
the Process region tree, so we have to make sure to remove it before
freeing it in the mapping failure path, otherwise the tree will contain
a dangling pointer to the free'd instance.
2022-08-15 02:42:28 +02:00
Andreas Kling
ae8f1c7dc8 Kernel: Leak a ref() on the new Process ASAP in sys$fork()
This fixes an issue where failing the fork due to OOM or other error,
we'd end up destroying the Process too early. By the time we got to
WaitBlockerSet::finalize(), it was long gone.
2022-08-15 00:53:28 +02:00
Jorropo
ec4b83326b Kernel: Don't release file-pages if volatile memory purge did it 2022-08-15 00:11:33 +02:00
Andreas Kling
3c7b0dab0b Kernel: Dump list of processes and their memory usage when OOMing 2022-08-14 23:33:28 +02:00
Andreas Kling
9e9924115f Kernel: Release some clean file-backed memory when starved for pages
Until now, our only backup plan when running out of physical pages
was to try and purge volatile memory. If that didn't work out, we just
hung userspace out to dry with an ENOMEM.

This patch improves the situation by also considering clean, file-backed
pages (that we could page back in from disk).

This could be better in many ways, but it already allows us to boot to
WindowServer with 256 MiB of RAM. :^)
2022-08-14 23:33:28 +02:00