Commit Graph

779 Commits

Author SHA1 Message Date
Andreas Kling
09b08d8e35 WindowServer: Re-evaluate hover state when active window changes
This effectively makes us send a "mouse move" event to windows when they
become active, even if the mouse didn't actually move. By doing this, we
trigger hover/tooltip/etc logic immediately, instead of doing it on the
next 1px mouse movement.

It's a small detail but my goodness does it feel better this way. :^)
2021-10-22 13:22:09 +02:00
xSlendiX
bf80dea39c LoginServer: Capitalize username and password fields
This commit changes the TextBox's placeholders for the username and
password fields to be capitalized.
2021-10-21 16:08:13 +01:00
Timothy Flynn
6d6cd87b7b LoginServer: Mark the login window as non-closeable and non-minimizable
Previously, you could close the window and be permanently logged out.
2021-10-21 14:45:30 +01:00
Timothy Flynn
176155c695 LibGUI+WindowServer: Add option to hide a widow's close button
This allows windows to be closed only programatically, and not from e.g.
the user clicking the X button on the window frame.
2021-10-21 14:45:30 +01:00
Karol Kosek
a36d13e36c LoginServer: Mark this component as REQUIRED
Prior to this change, there was no requirement to build this server.

If you build serenity without -DBUILD_EVERYTHING flag, or just play
around with your build configuration[1], it left you with a blank
screen and this debug line:

  SystemServer(6:6): LoginServer: binary "/bin/LoginServer" does not
  exist, skipping service.

[1]: Documentation/AdvancedBuildInstructions.md#component-configuration
2021-10-21 00:25:21 +02:00
Idan Horowitz
40eb3a39d4 LibJS: Rename define_native_function => define_old_native_function
This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
2021-10-20 12:27:19 +01:00
Idan Horowitz
20163c0584 LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and
JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all
native functions were converted to the new format.
2021-10-20 12:27:19 +01:00
Idan Horowitz
56e769e4ba LibJS: Replace usages of JS_{DECLARE, DEFINE}_NATIVE_GETTER
These macros are equivalent to JS_{DECLARE, DEFINE}_NATIVE_FUNCTION and
were only sometimes used, so let's just get rid of them altogether.
2021-10-20 12:27:19 +01:00
Linus Groh
3f311ec0ac LoginServer: Fix typo in --auto-login option value name 2021-10-19 17:58:04 +01:00
Timothy Flynn
05d7ac1193 LoginServer: Log in when the user presses the enter key 2021-10-19 18:19:33 +02:00
Andreas Kling
b78a69f7dd LoginServer: Use the verb "log in" for window title & submit button 2021-10-18 03:04:01 +02:00
Peter Elliott
b77dad5ba3 LoginServer: Add --auto-login switch
Auto login will automatically log in a user without prompting for a
password, but will still allow logouts and subsequent password logins.
2021-10-17 22:18:48 +02:00
Peter Elliott
92b6e4fd76 TaskBar+Utilities: Add logout(1) command, and call it in ShutdownDialog
logout kills the session that SystemServer --user was started with.
2021-10-17 22:18:48 +02:00
Peter Elliott
e3ed7f76c5 LoginServer: Process logins and start SystemServer in user mode 2021-10-17 22:18:48 +02:00
Peter Elliott
9e3d6d161b LoginServer: Layout a basic login window 2021-10-17 22:18:48 +02:00
Peter Elliott
f8fb0359ae SystemServer: Add per user mode (--user)
System server running in user mode will form the basis of a "session"
for login purposes in serenity.
2021-10-17 22:18:48 +02:00
Andreas Kling
27d4ac316f LibWeb: Introduce simple scrollable overflow, size ICB to viewport
Per spec, the initial containing block (ICB) should have the size of the
viewport. We have only done this for the width until now, since we had
no way to express scrollable overflow.

This patch adds Layout::Box::m_overflow_data, an optional struct that
can hold on to information about a box's overflow. Then we have BFC
set the ICB up with some scrollable overflow instead of sizing it to fit
its content vertically.

This fixes a number of broken layouts where correctness depends on
having the appropriate ICB height.
2021-10-14 23:22:59 +02:00
Valtteri Koskivuori
a38983dc0c ConfigServer: Sync config files to disk automatically
At the risk of introducing premature optimization, it only syncs to disk
5 seconds after the latest valid configuration update, to handle cases
where programs might send frequent updates that would go to disk every
time otherwise.
Also syncs to disk when the client connection closes.

Co-authored-by: Timothy Flynn <trflynn@pm.me>
2021-10-14 21:41:48 +02:00
Ben Wiederhake
f7daf04f81 SystemServer: Avoid uninitialized memory 2021-10-13 16:11:30 +02:00
Linus Groh
52976bfac6 LibJS: Convert to_object() to ThrowCompletionOr 2021-10-13 09:55:10 +01:00
James Magahern
4041848caa ClockWidget: Left-align clock and center based on ideal width
I personally find it very distracting when the clock continuously
shifts around as seconds tick. Because we're not using a monospace
font for the clock, this is to be expected since each number has a
different typographic width.

However, a tradeoff can be made to make this slightly less distracting.
Instead of _perfectly_ centering the time string for every given
possible time, we can center it once based on a constant measurement
and render the rest of the string as left-aligned.

The advantage is that the clock no longer shifts around anymore while
seconds tick. The disadvantage is that the time may sometimes be not
perfectly centered by a pixel or two for certain numbers. Personally,
I find the tradeoff well worth it, and I don't think I would even
notice the imperfect centering unless I was specifically looking for
it and watching it for a long time.
2021-10-11 10:15:34 +02:00
Andreas Kling
2bf3a263c5 CrashDaemon: Stop automatically compressing coredumps
This was a nice idea in theory, but in practice it makes big crashes
(e.g WebContent) even more CPU intensive. Let's disable this for now
(but keep the ability for CrashReporter to open compressed coredumps.)
2021-10-08 00:35:29 +02:00
fleximus
3115a5306d LookupServer: Fix to handle whitespaces and tabs in /etc/hosts 2021-10-05 02:23:45 +02:00
Jan de Visser
e923cb3739 SQLServer+SQL+LibSQL: Allow sql client to specify the database name
The database the sql client connected to was 'hardcoded' to the login
name of the calling user.
- Extended the IPC API to be more expressive when connecting, by
returning the name of the database the client connected to in the
'connected' callback.
- Gave the sql client a command line argument (-d/--database) allowing
an alternative database name to be specified

A subsequent commit will have a dot command allowing the user to
connect to different databases from the same sql session.
2021-10-05 02:22:19 +02:00
Jan de Visser
c5c7a9d198 SQLServer: Do not capture stack variables by reference in lambdas
If you capture a stack variable by reference in a lamdba definition,
and this lambda outlives the scope of the stack variable, this reference
may point to garbage when the lambda is executed. Therefore capture as
little as possible (typically only ``this``), and what is captured is
captured by value
2021-10-05 02:22:19 +02:00
Linus Groh
3be26f56db LibJS: Convert has_own_property() to ThrowCompletionOr 2021-10-03 20:14:03 +01:00
davidot
0d73487204 LibWeb: Fix that $0 was no longer accessible
We now set the realm (twice) on every console input. This can probably
be avoided if we use two executing contexts one for the website the
other for the console.
This achieves a similar behavior but is not really nice and not really
spec like.
2021-10-03 17:42:05 +02:00
Andreas Kling
77f0e57b27 RequestServer: Don't hide the SIGINFO state dump behind a debug macro
Until we're confident that RequestServer doesn't need this runtime debug
dump helper, it's much nicer if everyone has it built in, so they can
simply send a SIGINFO if they see it acting up.
2021-10-01 20:17:15 +02:00
Ali Mohammad Pur
a3fe981daa RequestServer: Ignore preconnect requests for available connections
There's no need to schedule a useless job when the connection is already
there and established.
2021-10-01 13:52:26 +02:00
Idan Horowitz
890d5e45ee Browser: Check m_console_client is non-null before dereferencing it
This added check matches CientConnection::js_console_input and makes
sure the webcontent process doesn't crash if the console is opened
while no page is available (like in a file not found situation)
2021-10-01 01:17:44 +02:00
Ali Mohammad Pur
146aaec129 RequestServer: Avoid storing a strong reference to a socket in callbacks
Unused sockets created by EnsureConnection should not keep the socket
around (storing a strong reference will create a reference cycle).
This fixes a whole bunch more RS spins.
2021-09-30 11:46:37 +02:00
Ali Mohammad Pur
56bb7dde87 RequestServer: Use an OwnPtr for the connection cache vector
Just as removing individual connections can cause the vector entries to
change positions, adding or removing connections to the cache can also
move the connections around, which would make it possible for a
connection to avoid being deleted (and make the RS spin on the Notifier
for that connection).
This commit makes it so that no connection cache is left when it's
supposed to be deleted.
Fixes a few more RS spins.
2021-09-30 11:46:37 +02:00
Linus Groh
ee8380edea LibJS: Convert internal_own_property_keys() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
fbfb0bb908 LibJS: Convert internal_delete() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
e5409c6ead LibJS: Convert internal_set() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
6c2b974db2 LibJS: Convert internal_get() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
d9895ec12d LibJS: Convert internal_has_property() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
5da210125e LibJS: Convert internal_define_own_property() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
0e69a6e487 LibJS: Convert internal_get_own_property() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
73bae7d779 LibJS: Convert internal_prevent_extensions() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
9b4362f10a LibJS: Convert internal_is_extensible() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
8c81c84c18 LibJS: Convert internal_set_prototype_of() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Linus Groh
5148150e1c LibJS: Convert internal_get_prototype_of() to ThrowCompletionOr 2021-09-29 23:49:53 +01:00
Ali Mohammad Pur
398435277b RequestServer: Use an OwnPtr for cached connections
Otherwise we'd end up trying to delete the wrong connection if a
connection made before us is deleted.
Fixes _some_ RequestServer spins (though not all...).
This commit also adds a small debug mechanism to RequestServer (which
can be enabled by turning REQUEST_SERVER_DEBUG on), that can dump all
the current active connections in the cache, what they're doing, and how
long they've been doing that by sending it a SIGINFO.
2021-09-29 11:47:18 +02:00
Ali Mohammad Pur
2020ced9f1 RequestServer: Correctly start preconnected TLS sockets
We need to set the root certificates, and tell the connection cache that
the preconnect job finished (otherwise it would spin forever, waiting
for us to tell it that).
2021-09-29 00:47:54 +02:00
Andreas Kling
651f30dfbe WebContent: Coalesce paint invalidations to avoid spamming client
Some content cause a lot of paint invalidations (e.g someone drawing to
a <canvas> repeatedly) and we don't need to spam the client about this.
Instead, accumulate a dirty rect, and send it once per event loop step.
2021-09-28 22:53:59 +02:00
Ali Mohammad Pur
3ec39fc62e RequestServer+LibProtocol: Add an 'EnsureConnection' IPC endpoint
This will allow LibWeb (and other components) to request a connection to
be premade and cached, to make subsequent loads faster.
2021-09-28 22:32:31 +02:00
Andreas Kling
0af0ee4293 LibWeb: Fire "keyup" events as well :^)
This was easy, now that we have KeyboardEvent.
2021-09-28 16:56:24 +02:00
Andreas Kling
a79bdd2bd5 LibWeb+Browser: Make ad blocking work in the multi-process world
We now send the list of content filters over to new WebContent processes
after creating an OutOfProcessWebView. :^)
2021-09-27 11:40:56 +02:00
Karol Kosek
620e4fd0d2 WebContent: Pass an empty bitmap object if the pointer is null
Prior this commit we were always dereferencing the image bitmap pointer,
even if it was null, which resulted in a crash when trying to open
the context menu when an image wasn't loaded.

Closes: #10178
2021-09-22 22:10:11 +02:00