Commit graph

4021 commits

Author SHA1 Message Date
Andreas Kling
a6a57830d0 FileManager: Reorganize main toolbar a little bit
Re-group things so they match the menus better.
2021-05-12 21:37:37 +02:00
Andreas Kling
bed2356b11 FileManager: Reorganize menus a little bit
Move the common editing actions (cut/copy/paste/select-all) into a new
"Edit" menu. And move the "Open Terminal Here" action to the "Go" menu.
2021-05-12 21:32:54 +02:00
Andreas Kling
bc0146932e LibGUI: Never resolve Key_Invalid to a GUI::Action
Fixes #7047.
2021-05-12 20:59:07 +02:00
Andreas Kling
8c7bce818d LibGUI: Move action-from-key-event code to a separate function
The logic that figures out which (if any) action should be activated
by a keydown event was getting a bit unwieldy. This patch moves it to
a separate helper function.
2021-05-12 20:51:45 +02:00
Linus Groh
91eda22208 Everywhere: Add Alt shortcuts to remaining top-level menus
Not sure why some menus did have one and others didn't, even in the
same application - now they all do. :^)
I added character shortcuts to some menu actions as well.
2021-05-12 18:09:42 +01:00
Linus Groh
f2154bca17 Browser: Use URL for window title if tab title is empty
Seeing " - Browser" for loading pages is annoying, so let's do something
more sensible instead for empty tab document titles: "<URL> - Browser".
Also consolidate the two places where this code is used into a lambda to
make any future changes easier.
2021-05-12 17:55:48 +01:00
Linus Groh
c8738bbd7e SystemMonitor: Spell process window title as "System Monitor"
This is what we use for the main window and elsewhere.
2021-05-12 17:52:56 +01:00
Linus Groh
ff1d3f53c4 Everywhere: Rename app_menu to file_menu, continued
These were missed in 4b0098e.
2021-05-12 17:50:48 +01:00
Mart G
b00cdf8ed8 Kernel+LibC: Make get_dir_entries syscall retriable
The get_dir_entries syscall failed if the serialized form of all the
directory entries together was too large to fit in its temporary buffer.

Now the kernel uses a fixed size buffer, that is flushed to an output
buffer when it is full. If this flushing operation fails because there
is not enough space available, the syscall will return -EINVAL. That
error code is then used in userspace as a signal to allocate a larger
buffer and retry the syscall.
2021-05-12 12:50:23 +02:00
Ali Mohammad Pur
c7b60164ed LibCore: Don't use has_flag() with multiple flags (OpenMode::ReadWrite)
Fixes boot, regressed in a91a49337c.
2021-05-12 12:49:31 +02:00
Ali Mohammad Pur
1ae8775a1b LibCore+Everywhere: Move SeekMode out of IODevice 2021-05-12 11:00:45 +01:00
Ali Mohammad Pur
a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
Tobias Christiansen
e7498bb918 LibWeb: Position the ListItemMarkers according to their width
Previously they were positioned with a fixed offset. However this lead
to wider markers with more than one character to collide with the
element itself.
Now the ListItemMarkerBox generates and stores the appropriate String
in its constructor and sets its own width according to that.
The ListItemBox then lays out the Marker taking this width into
account.
This also made the painting a lot easier since we don't generate the
needed Strings every time we repaint, just once.
2021-05-12 08:53:18 +01:00
Tobias Christiansen
a51cee748f LibWeb: Remove unused alphabet constants from ListItemMarkerBox
Why exactly the linter didn't whine about this is a mystery. These
constants aren't needed anymore since the functionality moved to
AK/String a while ago.
2021-05-12 08:53:18 +01:00
Timothy Flynn
1ec23f38ed LibWeb: Move clearing boxes below preceding floating boxes
When computing the y-position of a clearing element, use the height of
the border box of the associated floating elements.

This also extracts this block of code to a helper lambda since it is
used twice.
2021-05-12 08:50:20 +01:00
Ali Mohammad Pur
8419ddb4d8 RequestServer: Only attempt to flush() on a timer
...instead of doing so immediately.
This makes RequestServer not spin as much when its client isn't fast
enough to empty the download pipe.
It also has the nice benefit of allowing multiple downloads to happen
at the same time without one blocking the other too much.
2021-05-12 08:36:58 +01:00
Ali Mohammad Pur
afa98fcb55 LibTLS: Always send the signature_algorithms extension
At some point since Sep 2018, OpenSSL added a ~~bug~~ feature that makes
the default set of signature algorithms defined in TLSv1.2 unusable
without reducing what they call the "security level", which caused
communication with servers using more recent versions of openssl to
fail with "internal error".
This commit makes LibTLS always send its supported sigalgs, making the
server not default to the insecure defaults, and thus enabling us to
talk to such servers.
2021-05-12 08:35:02 +01:00
Linus Groh
0a329d2d70 LibJS: Make super() in catch block work
The TryStatement handler execution creates a new LexicalEnvironment
without a current function set, which we were not accounting for when
trying to get the super constructor while executing a SuperExpression.
This makes it work but isn't pretty - this needs some refactoring to be
close to the spec for that to happen.

Fixes #7045.
2021-05-11 23:31:30 +01:00
Linus Groh
d85b9fd5a0 LibJS: Bring back runtime validation of RegExp flags
This is a partial revert of commit 60064e2, which removed the validation
of RegExp flags during runtime and expected the parser to do that
exclusively - however this was not taking into account the RegExp()
constructor, which was subsequently crashing on invalid flags.

Also adds test for these constructor error cases, which were obviously
missing before.

Fixes #7042.
2021-05-11 22:47:14 +01:00
Linus Groh
431782bcd6 LibJS/Tests: Add details for toThrowWithMessage() expectation error 2021-05-11 22:41:35 +01:00
Idan Horowitz
ce86026ac6 LibWeb: Add a maximum redirects limit to FrameLoader
This prevents the browser from crashing when trying to load an infinite
redirects loop. The chosen limit is based on the fetch specification:
"If request's redirect count is twenty, return a network error."
2021-05-11 21:41:48 +01:00
miere43
c4bd4cbd76 LibWeb: Implement :nth-last-child pseudo-class 2021-05-11 21:17:16 +01:00
Luke
c5c9494f48 LibJS: Use u64 instead of u32 in NumberPrototype::to_string
Update to #7033
Partial fix for #7034 (just ups the range to about 2 ** 54 before
losing precision)
2021-05-11 18:29:55 +01:00
Luke
2ff03ecfa8 LibJS: Make number parts unsigned in NumberPrototype::to_string
Fixes #3931
2021-05-11 17:29:37 +01:00
sin-ack
ecbe17fb11 LibLine+Shell: Add dirty history flag and use it
This patch adds a new flag called history_dirty to Line::Editor that is
set when history is added to but written.  Applications can leverage
this flag to write history only when it changes.  This patch adds an
example usage of this functionality to Shell, which will now only save
the history when it is dirty.
2021-05-11 17:26:30 +01:00
Timothy Flynn
227ccfc61a LibWeb: Paint an element's foreground before painting its children
The current implementation is missing the emphasized text of the
following rule in the painting order spec:

    7. Otherwise: *first for the element*, then for all its in-flow,
       non-positioned, block-level descendants in tree order...

This ensures the foreground is painted for the current element before
descending into its children.
2021-05-11 18:03:21 +02:00
Linus Groh
8afcd22900 Magnifier: Make window resizable
Instead of having the window non-resizable, it now defaults to a frame
size of 200 x 200 pixels but is user-resizable. The shown screenshot
updates its size accordingly. :^)
Sometimes we might need a larger view, or a non-square shape.
2021-05-11 18:01:55 +02:00
Luke
1c1b106f6c LibWeb: Make Element::tag_name return the HTML uppercased qualified name
I forgot to change tag_name when this was added.
Also makes html_uppercased_qualified_name return a const reference.
2021-05-11 18:01:36 +02:00
Luke
56d7d28d41 LibWeb: Expose Element.{prefix,localName} 2021-05-11 18:01:36 +02:00
Ali Mohammad Pur
d42d984a2d GLTeapot: Use glGenLists() a bit to demonstrate that it works 2021-05-11 14:09:17 +01:00
Ali Mohammad Pur
720d21411b LibGL: Implement glGenLists and a few friends
This commit implements glGenLists(), glNewList(), glDeleteLists(), and
glCallList().
The 'compiled' records are implemented as a vector of member function
pointers and tuples containing their arguments, and a mechanism is
implemented to allow the recorded calls to copy-capture values from the
time of the call; this is currently only used with glLoadMatrix.
2021-05-11 14:09:17 +01:00
Umar Haroon
53e1ee2cb7 2048: Added Redo Support 2021-05-11 10:22:27 +01:00
Ali Mohammad Pur
a527256356 Shell: Add an option to autosave history every N ms
...and set it to 10 seconds by default.
2021-05-11 10:19:07 +01:00
Valtteri Koskivuori
4d01183f5c Userland: Implement a magnifier app
This utility is useful for making sure those UI elements are pixel
perfect. A simple 2x/4x magnification around the mouse cursor, shown in
a window.
2021-05-11 10:18:29 +01:00
Valtteri Koskivuori
4864ef9440 WindowServer: Add Optional<Gfx::IntRect> argument to get_screen_bitmap()
This way, we can optionally specify a region of the display to capture.
Defaults to entire screen if no rectangle is given.
2021-05-11 10:18:29 +01:00
Valtteri Koskivuori
cb74f7992a LibGfx: Implement Bitmap::cropped()
This cuts a region of a bitmap specified by the provided Gfx::IntRect
and returns it. Areas outside of the bounds of the original bitmap are
filled in with black.
2021-05-11 10:18:29 +01:00
SViN24
e60c0d675e
strace: Write output to stderr instead of stdout (#7016)
Fixes #7014.
2021-05-11 09:56:28 +02:00
Gunnar Beutner
0ab37dbd03 LibELF: Propagate ELF image validation errors to the caller
With this fixed dlopen() no longer crashes when given an invalid
ELF image and instead returns an error code that can be retrieved
with dlerror().

Fixes #6995.
2021-05-10 21:27:11 +02:00
Gunnar Beutner
461acda76f LibELF: Don't use assignments in return statements
Sure, this saves a couple of characters, but it's probably not
the best style.
2021-05-10 21:27:11 +02:00
Sergey Bugaev
d8faafef14 Userland: Implement paste --watch mode
You can now watch the clipboard for changes and run a command each time
the clipboard contents change like this:

$ paste --watch some command here

The command will be spawned each time the clipboard contents change. It
can read the clipboard contents from its stdin, and CLIPBOARD_STATE
environment variable will be set to "data" if there is data to be read,
or to "nil"/"clear" if the clipboard has been cleared.
2021-05-10 19:09:53 +01:00
Sergey Bugaev
93a1b88965 Userland: Implement copy --clear
You can now clear the clipboard using copy(1) like this:

$ copy --clear
2021-05-10 19:09:53 +01:00
Sergey Bugaev
f15f03376b LibGUI: Add Clipboard::clear()
Does exactly what it says on the tin :^)
2021-05-10 19:09:53 +01:00
Gunnar Beutner
759acdb938 LibC: Partially implement pthread_setcancel{state,type}()
With those partially implemented I can start to clone the SerenityOS
git repository via HTTPS.

The download still fails half-way through because SSL_read returns
an error for reasons I haven't investigated yet.
2021-05-10 17:44:18 +01:00
Gunnar Beutner
212cd9d8ac LookupServer: Do cache eviction when mDNS cache flush bit is set 2021-05-10 17:26:17 +02:00
Gunnar Beutner
edb21e02ea LookupServer: Track the receive timestamp for DNS answers 2021-05-10 17:26:17 +02:00
Gunnar Beutner
3304d675e1 LookupServer: Correct some flags for DNS packets
This corrects some of the flags in the DNS packets to match
what I saw on my local network.
2021-05-10 17:26:17 +02:00
Gunnar Beutner
a569381037 LookupServer: Handle DNS record types TXT, AAAA, SRV and CNAME
They're not being used elsewhere at the moment but this gets
rid of the debug message for incoming mDNS response packets.
2021-05-10 17:26:17 +02:00
Gunnar Beutner
7b3bed7910 LookupServer: Turn #defines into enum classes and add formatter 2021-05-10 17:26:17 +02:00
Gunnar Beutner
6e70888315 LookupServer: Split mDNS flags into separate field 2021-05-10 17:26:17 +02:00
Andreas Kling
233a9554a5 HackStudio: Tweak Files/Classes tab views
Put a bit of padding around the views, and retitle the "ClassView" tab
to simply "Classes".
2021-05-10 13:45:49 +02:00