Commit Graph

1679 Commits

Author SHA1 Message Date
Tom
ab1075e296 DisplaySettings: Show DPI for selected resolution
This uses the EDID provided by the connected display to show the pixel
density of a selected resolution.
2022-01-23 22:45:21 +00:00
mjz19910
1ef633472b Everywhere: Convert VM::call() to JS::call() 2022-01-23 15:24:45 +00:00
kleines Filmröllchen
69c1910037 LibCore: Allow EventLoops to run on multiple threads safely
The event loop system was previously very singletony to the point that
there's only a single event loop stack per process and only one event
loop (the topmost) can run at a time. This commit simply makes the event
loop stack and related structures thread-local so that each thread has
an isolated event loop system.

Some things are kept at a global level and synchronized with the new
MutexProtected: The main event loop needs to still be obtainable from
anywhere, as it closes down the application when it exits. The ID
allocator is global as IDs should not be shared even between threads.
And for the inspector server connection, the same as for the main loop
holds.

Note that currently, the wake pipe is only created by the main thread,
so notifications don't work on other threads.

This removes the temporary mutex fix for notifiers, introduced in
0631d3fed5 .
2022-01-23 15:21:10 +01:00
Timothy Flynn
d365559839 ClockSettings: Add a GUI application to set the system time zone
This application can be expanded with other clock-related options. For
an initial iteration, it has just an option to change the time zone.
2022-01-23 12:48:26 +00:00
Timothy Flynn
bcf4ec9c61 Userland: Add promises to programs that will read /etc/timezone
This will require unveiling /etc/timezone itself for reading, as well as
the rpath pledge promise.
2022-01-23 12:48:26 +00:00
Rummskartoffel
c93dfe8097 TextEditor: Fix crash on startup when file specified cannot be opened
Due to a bug introduced in f674102, TE would attempt to access the value
of an ErrorOr that didn't hold one, hitting an assertion.
2022-01-23 00:27:41 +00:00
davidot
2d4b345bb1 Spreadsheet: Enable dynamic import of javascript modules
This has some risks as it can (attempt to) load arbitrary files on the
filesystem but for now it can only load local files which do go through
normal file operations. But let's enable it for now to see what we can
do with it.
2022-01-22 01:21:18 +00:00
Luke Wilde
631bbcd00a LibJS: Refactor interpreter to use Script and Source Text Modules
This also refactors interpreter creation to follow
InitializeHostDefinedRealm, but I couldn't fit it in the title :^)

This allows us to follow the spec much more closely rather than being
completely ad-hoc with just the parse node instead of having all the
surrounding data such as the realm of the parse node.

The interpreter creation refactor creates the global execution context
once and doesn't take it off the stack. This allows LibWeb to take the
global execution context and manually handle it, following the HTML
spec. The HTML spec calls this the "realm execution context" of the
environment settings object.

It also allows us to specify the globalThis type, as it can be
different from the global object type. For example, on the web, Window
global objects use a WindowProxy global this value to enforce the same
origin policy on operations like [[GetOwnProperty]].

Finally, it allows us to directly call Program::execute in perform_eval
and perform_shadow_realm_eval as this moves
global_declaration_instantiation into Interpreter::run
(ScriptEvaluation) as per the spec.

Note that this doesn't evalulate Source Text Modules yet or refactor
the bytecode interpreter, that's work for future us :^)

This patch was originally build by Luke for the environment settings
object change but was also needed for modules. So I (davidot) have
modified it with the new completion changes and setup for that.

Co-authored-by: davidot <davidot@serenityos.org>
2022-01-22 01:21:18 +00:00
Dylan Katz
3919a1dcc0 Browser: Load icons at start of program
Previously, Browser loaded icons from the disk every time an icon
was set. In addition to making more calls to the disk and decoding
more images, this makes error propagation impossible. This change
moves all icon loading to the start of the program.
2022-01-21 22:14:13 +01:00
Mustafa Quraish
bba32de857 SpreadSheet: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
ca2c7dced5 3DFileViewer: Use FileSystemAccessClient::try_* APIs
This commit also removed the redundant `filename` parameter from
`GLContextWidget::load_file`, since the filename is already stored
within the file itself.
2022-01-20 10:39:12 +01:00
Mustafa Quraish
abb16683c9 ThemeEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
f674102447 TextEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
effb19f996 PDFViewer: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
1c3e93c6e0 PixelPaint: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Mustafa Quraish
aae96af812 HexEditor: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
Sam Atkins
94f2508519 CrashReporter: Don't crash when investigating a HackStudio crash
Previously when opening a crash report for HackStudio, the
`unveil("/bin/HackStudio", "rx")` call was failing because of the
earlier `unveil(executable_path.characters(), "r")` call requesting only
"r" permissions for it. This patch handles this specific case, so you
can crash HackStudio to your heart's content. :^)

Also, we were unveiling the executable path twice, once manually and
once implicitly as part of the coredump's libraries, so we now check for
the latter and avoid it.

Thanks to Daniel for noticing what was right in front of me and I didn't
see!

Co-authored-by: Daniel Bertalan <dani@danielbertalan.dev>
2022-01-20 10:38:10 +01:00
Dmitry Petrov
1662213737 Userland: Add horizontal mouse scroll support 2022-01-20 10:37:52 +01:00
Undefine
9a28ef7aa9 SystemMonitor: Show unknown in PCI devices
In case when the PCI class, device or vendor is unknown, show
that it is unknown instead of just putting the ID
2022-01-19 21:47:40 -08:00
Timothy Flynn
d51d5f9591 FontEditor: Retrieve code point abbreviations from LibUnicode
Rather than using a hard-coded list from AK::UnicodeUtils, LibUnicode
contains the up-to-date official names and contains abbreviations for
more control code points.
2022-01-18 15:13:25 +00:00
Brian Gianforcaro
974e36e7a9 TextEditor: Hookup git commit message detection and highlighting 2022-01-18 09:01:16 +01:00
Jesse Buhagiar
865e7bbe5e LibGL+LibSoftGPU+3DFileViewer: Implement Specular highlighting :^) 2022-01-18 01:48:51 +02:00
thankyouverycool
c094bb60bc FontEditor: Set GlyphEditor glyph on initialization
Fixes GlyphEditor appearing blank on start and subsequent
re-initializations.
2022-01-16 21:36:39 +01:00
thankyouverycool
8f60ea4470 FontEditor: Disambiguate save function from save-as action 2022-01-16 21:36:39 +01:00
thankyouverycool
c2b7bbbb2c FontEditor: Update GlyphEditor and width widgets on paste and delete
Fixes unsynced state between widgets after paste and delete actions.
2022-01-16 21:36:39 +01:00
thankyouverycool
7d7f683715 FontEditor: Correct GroupBox height
Font Metadata's GroupBox height was off by an _unsightly_ 2 pixels.
Now we make heights explicit for all child widgets and let shrink_to_fit
automatically calculate things.
2022-01-16 21:36:39 +01:00
thankyouverycool
24bd2a427c FontEditor: Calculate GlyphEditor toolbar widths more precisely
Fixes pixel imperfect toolbar widths when editing small fonts.
2022-01-16 21:36:39 +01:00
thankyouverycool
2e849250eb FontEditor: Remove unnecessary call during GlyphEditor init
GlyphEditor's relative rect is automatically set during layout.
2022-01-16 21:36:39 +01:00
thankyouverycool
ff42ad88ee FontEditor: Remove .gitignore artifact from old build system 2022-01-16 21:36:39 +01:00
Marcus Nilsson
8b39ec7c18 SystemMonitor: Don't display empty CPU graphs when number of CPUs < 4
When we have less than 4 CPUs we don't need to display a whole row of
CPU graphs.
2022-01-16 15:04:40 +01:00
Sam Atkins
53cd87cc1d CharacterMap+Base: Give Character Map an icon 2022-01-16 11:17:03 +01:00
Sam Atkins
83a9661c04 CharacterMap+Base: Add man page for Character Map :^) 2022-01-16 11:17:03 +01:00
Sam Atkins
2a7c638cd9 CharacterMap: Add a find-by-name window
This works the same way as the command-line usage, searching against the
display name as provided by LibUnicode.

I've modified the search loop to cover every possible unicode
code-point, since my previous logic was flawed. Code-points are not
dense, there are gaps, so simply iterating up to the count of them will
skip ones with higher values. Surprisingly, iterating all 1,114,112 of
them still runs in a third of a second. Computers are fast!
2022-01-16 11:17:03 +01:00
Sam Atkins
2bf7abcb28 CharacterMap: Add previous, next, and go-to glyph buttons
These work the same as in FontEditor, where I shamelessly stole them
from. :^)
2022-01-16 11:17:03 +01:00
Sam Atkins
e975db23c0 LibGUI+FontEditor: Move seek-prev/next-glyph logic into GlyphMapWidget 2022-01-16 11:17:03 +01:00
Sam Atkins
9ca8428238 CharacterMap: Add output box for copying arbitrary character sequences
This adds a TextBox along the bottom of the window. Double-clicking on a
character will append it to this box, which you can edit as any other
TextBox, or click the copy button to copy the output to the clipboard.
2022-01-16 11:17:03 +01:00
Sam Atkins
2327ea8970 CharacterMap: Add new Character Map application :^) 2022-01-16 11:17:03 +01:00
Sam Atkins
21a24c36a8 LibGUI: Make GlyphMapWidget work with vector fonts
This basically just meant replacing the `m_font` field with the one
inherited from Widget.
2022-01-16 11:17:03 +01:00
Sam Atkins
8175cd0a28 LibGUI+FontEditor: Move GlyphMapWidget to LibGUI
This will allow us to use this in other apps, such as the upcoming
Character Map. :^)
2022-01-16 11:17:03 +01:00
Olivier De Cannière
d3dfb957a6 PixelPaint: Add delete selection behavior
The delete key can now be used to erase the pixels on the active layer
contained within the selection rectangle.

Closes #11861
2022-01-15 23:38:00 +01:00
creator1creeper1
19d9d5bfe1 Everywhere: Mark Vector of mutable references as mutable
The point of a reference type is to behave just like the referred-to
type. So, a Foo& should behave just like a Foo.

In these cases, we had a const Vector. If it was a const Vector of Foo,
iterating over the Vector would only permit taking const references to
the individual Foos.

However, we had a const Vector of Foo&. The behavior should not
change. We should still only be permitted to take const references to
the individual Foos. Otherwise, we would be allowed to mutate the
individual Foos, which would mutate the elements of the const Vector.
This wouldn't modify the stored pointers, but it would modify the
objects that the references refer to. Since references should be
transparent, this should not be legal.

So it should be impossible to get mutable references into a const
Vector. Since we need mutable references in these cases to call the
mutating member functions, we need to mark the Vector as mutable as
well.
2022-01-16 00:38:21 +03:30
Mateusz Krajewski
ae71d2b70e PixelPaint: Restrict "crop to selection" to image boundaries 2022-01-15 21:55:41 +01:00
Rummskartoffel
a610d9a3d1 Assistant: Fix crash in FileProvider background thread upon exit
If the Threading::BackgroundAction for filesystem indexing in
FileProvider hadn't finished by the time the main thread exited, it
would still try to access the FileProvider object that lived in the main
thread, thereby causing a segfault and crashing. This commit prevents
FileProvider from being destroyed while the background thread is still
running by giving the background thread a strong reference to its
FileProvider.
2022-01-15 21:45:03 +01:00
Rummskartoffel
ada1d4906e Assistant: Make Provider ref-counted 2022-01-15 21:45:03 +01:00
Glenford Williams
c55dfabdd5 Spreadsheet: Use FileSystemAccessClient for the reading of files 2022-01-15 22:20:15 +03:30
Brian Gianforcaro
ef2fd31288 Terminal: Add config listeners for controlling scrollbar visibility 2022-01-15 11:03:23 +01:00
Brian Gianforcaro
ab4035e227 TerminalSettings: Expose a CheckBox controlling scrollbar visibility 2022-01-15 11:03:23 +01:00
sin-ack
2e1bbcb0fa LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServer
This change unfortunately cannot be atomically made without a single
commit changing everything.

Most of the important changes are in LibIPC/Connection.cpp,
LibIPC/ServerConnection.cpp and LibCore/LocalServer.cpp.

The notable changes are:
- IPCCompiler now generates the decode and decode_message functions such
  that they take a Core::Stream::LocalSocket instead of the socket fd.
- IPC::Decoder now uses the receive_fd method of LocalSocket instead of
  doing system calls directly on the fd.
- IPC::ConnectionBase and related classes now use the Stream API
  functions.
- IPC::ServerConnection no longer constructs the socket itself; instead,
  a convenience macro, IPC_CLIENT_CONNECTION, is used in place of
  C_OBJECT and will generate a static try_create factory function for
  the ServerConnection subclass. The subclass is now responsible for
  passing the socket constructed in this function to its
  ServerConnection base; the socket is passed as the first argument to
  the constructor (as a NonnullOwnPtr<Core::Stream::LocalServer>) before
  any other arguments.
- The functionality regarding taking over sockets from SystemServer has
  been moved to LibIPC/SystemServerTakeover.cpp. The Core::LocalSocket
  implementation of this functionality hasn't been deleted due to my
  intention of removing this class in the near future and to reduce
  noise on this (already quite noisy) PR.
2022-01-15 13:29:48 +03:30
Colin
dc89ac1463 PixelPaint: Update SelectedColorWidget::m_color consistently 2022-01-14 21:33:32 +01:00
kleines Filmröllchen
be6418cc50 Everywhere: Use my new serenityos.org e-mail :^) 2022-01-14 11:54:09 +01:00