Commit Graph

16656 Commits

Author SHA1 Message Date
Andreas Kling
cef73f2010 Kernel: Remove CMake spam when setting up KUBSAN flags 2021-02-11 22:16:28 +01:00
Andreas Kling
54986228bf Kernel: Oops, add missing #include to fix ENABLE_ALL_THE_DEBUG_MACROS 2021-02-11 22:15:55 +01:00
Andreas Kling
0dbb22e9e0 Kernel: Remove a handful of unused things in VM/ directory
Also add some missing initializers.
2021-02-11 22:02:39 +01:00
Andreas Kling
ba42d741cb Kernel: Add explicit __serenity__ define to workaround CLion problem
CLion doesn't understand that we switch compilers mid-build (which I
can understand since it's a bit unusual.) Defining __serenity__ makes
the majority of IDE features work correctly in the kernel context.
2021-02-11 21:23:31 +01:00
Jean-Baptiste Boric
f8c352a022 Kernel: Fix undefined signed overflow in KernelRng's RTC fallback 2021-02-11 20:58:39 +01:00
Jean-Baptiste Boric
eedb6480df Kernel: Don't assert if RTC believes we're in the past 2021-02-11 20:58:39 +01:00
Hendiadyoin1
4d5496b2b2
KUBSAN: Add nearly all missing -fsanitize handlers (#5254) 2021-02-11 20:58:01 +01:00
DexesTTP
c98ad27803 LibGUI: Use Core::FileWatcher in FileSystemModel
This replaces the manual watch_file and Notifier handling with the new
Core::FileWatcher wrapper, which reduces the manual handling and makes
the code easier to reason about :^)
2021-02-11 13:13:32 +01:00
DexesTTP
2acbb811b1 LibCore: Added FileWatcher, a binding for the watch_file syscall
This wrapper abstracts the watch_file setup and file handling, and
allows using the watch_file events as part of the event loop via the
Core::Notifier class.

Also renames the existing DirectoryWatcher class to BlockingFileWatcher,
and adds support for the Modified mode in this class.
2021-02-11 13:13:32 +01:00
Linus Groh
0304ab3e67 WindowServer: Fix compositing of fullscreen window
I honestly don't know the internals of all this and what exactly is
going on, but this fixes compositing of the fullscreen window. By trial
and error I found that specifically m_invalidated_all needs to be set to
false, so it's probably different behaviour in prepare_dirty_rects(),
which depends on that...
Either way, the code composing all windows in non-fullscreen mode calls
Window::clear_dirty_rects() for each, so not doing that for the fullscreen
window as well seems like an oversight.

Fixes #4810.
2021-02-11 13:12:17 +01:00
Tom
e1333724ea WindowServer: Blit backing bitmap with transparency for hung windows
We should respect the opacity of the window when painting the window
content of a hung application.
2021-02-11 13:11:57 +01:00
Tom
130d48fa13 LibGfx: Painter::blit_filtered should take into account alpha value
If either the destination or calculated source pixel color contains
an alpha value, we should blend them together.
2021-02-11 13:11:57 +01:00
Tom
dd0833107f WindowServer: Fix clearing area not covered by backing bitmap
We only cleared the area not covered by the backing bitmap if a
rendering rectangle intersected with the backing bitmap. But because
we are potentially calling the render function many times we need
to always clear the area not covered by the backing bitmap, whether
it intersects or not.

Fixes #5291
2021-02-11 13:11:57 +01:00
Itamar
ef9bfbd383 LanguageServers/Cpp: Autocomplete declarations from included headers
We now also look at the available declarations from included header
files when autocompleting names.

Additionally, you can now request autocomplete on an empty token, which
brings up all available names, starting from the inner-most scope.
2021-02-10 23:09:40 +01:00
Itamar
64c80f6ea4 LanguageServers/Cpp: Autocomplete function and struct/class names 2021-02-10 23:09:40 +01:00
Itamar
e42b9e879c HackStudio: Show notification if 'make' is not available
We previously popped a MessageBox for this, but a notification is less
disruptive.
2021-02-10 23:04:54 +01:00
Itamar
653c3d5812 NotificationWindow: Set notification text as tooltip content 2021-02-10 23:04:54 +01:00
Tom
f8d65e57ba WindowServer: Don't re-render the window frame when not needed
Merely moving a window shouldn't require re-rendering the window
frame anymore now that we cache the rendered frame in bitmaps. This
reduces CPU usage significantly when moving windows.
2021-02-10 23:03:22 +01:00
Andreas Kling
497d48a8de AK: Make IsUnsigned<T> behave as you would expect 2021-02-10 22:23:54 +01:00
Andreas Kling
8743ea3149 LibWeb: Relayout document on CharacterData data change
This can definitely be optimized to avoid full relayouts in many
situations, but for now let's just go for correctness.
2021-02-10 19:06:20 +01:00
Andreas Kling
29a2aac89a LibWeb: Start implementing <input type=text> using a shadow DOM
Text <input> fields will now generate a basic shadow DOM and attach it
to the input element.

The shadow DOM contains a <div> with some inline style, and an always-
editable text node inside it. Accessing the "value" attribute on such
an input element will get/set the value from that text node.

This is really cool, although not super stable since HTML editing is
not super stable. But it's a start! :^)
2021-02-10 19:06:20 +01:00
Andreas Kling
e4e325ff61 LibWeb: Include shadow DOM subtrees in DOM dumps 2021-02-10 19:06:20 +01:00
Andreas Kling
e562819a7e LibWeb: Generate layout nodes for shadow subtrees
Elements with shadow roots will now recurse into those shadow trees
while building the layout tree.

This is the first step towards basic Shadow DOM support. :^)
2021-02-10 19:06:20 +01:00
Andreas Kling
41ff7268db LibWeb: Add a way to make a DOM::Text always editable
This will be useful for input element purposes.
2021-02-10 19:06:20 +01:00
Andreas Kling
2eddd74e85 LibWeb: Add DOM::Node::parent_or_shadow_host()
This is useful when you want to traverse across shadow boundaries.
2021-02-10 19:06:20 +01:00
Andreas Kling
d597626ea1 LibWeb: Add a way to give DOM::Element a ShadowRoot
You can now attach a shadow root to your favorite Element. It doesn't
do anything yet, but you can.
2021-02-10 19:06:20 +01:00
Andreas Kling
bf82e7fba2 LibWeb: Add DOM::ShadowRoot to forwarding header 2021-02-10 19:06:20 +01:00
Andreas Kling
bbce1ab1c1 LibWeb: Use the DOM::Node::node_name() a bit more in dumps 2021-02-10 17:15:16 +01:00
Andreas Kling
70bd1724db LibJS: Include <typeinfo> in AST.cpp again
Linus points out that oss-fuzz wants this to be there.
2021-02-10 12:21:14 +01:00
Andreas Kling
acd46dcb0c LibWeb: Respect the bgcolor attribute on <marquee> elements
We don't yet animate marquees, but we can at least fill them with the
right background color.
2021-02-10 09:54:16 +01:00
Andreas Kling
5e91e61900 LibWeb: Remove WidgetBox layout node
The approach of attaching sub-widgets to the web view widget was only
ever going to work in single-process mode, and that's not what we're
about anymore, so let's just get rid of WidgetBox so we don't have the
dead-end architecture hanging over us.

The next step here is to re-implement <input type=text> using LibWeb
primitives.
2021-02-10 09:13:30 +01:00
Andreas Kling
1ad65b173b LibWeb+WebContent: Support window.confirm() in OOPWV 2021-02-10 09:13:30 +01:00
Andreas Kling
abf7c02acb LibWeb: Move window.confirm() to using a PageClient callback
This allows us to move the GUI::MessageBox out of DOM::Window and up to
the widget layer.
2021-02-10 09:13:30 +01:00
Andreas Kling
794ebb699c LibWeb: Remove low-hanging LibGUI fruit from LibWeb
We'll want to remove the LibGUI dependency from the WebContent process.
This is the first basic step of removing unnecessary LibGUI includes
and swapping out GUI::Painter for Gfx::Painter.
2021-02-10 09:13:29 +01:00
Andreas Kling
548f8a0644 AK: TypeCasts.h should include Assertions.h 2021-02-10 09:13:29 +01:00
Andreas Kling
635a5eec75 LibJS: Remove a whole bunch of unnecessary #includes 2021-02-10 09:13:29 +01:00
Andreas Kling
9de1253f44 LibWeb: Remove a whole bunch of unnecessary #includes 2021-02-10 09:13:29 +01:00
Tom
a807d92a32 WindowServer: Fix switching between shadows and no shadows with themes
We weren't properly handling switching between having a shadow and
not having a shadow when switching themes. This allows an empty string
in the theme configuration for a shadow path, meaning no shadow should
be rendered.
2021-02-10 09:12:49 +01:00
Tom
5d4c4bd372 WindowServer: Occlusion calculation fixes
We didn't properly determine whether a window was fully covered, which
caused some artifacts in certain cases.

Fixes #5283
2021-02-10 09:12:49 +01:00
AnotherTest
338bb73289 AK: Fix build with Clang>=12
Build failure as in https://oss-fuzz-build-logs.storage.googleapis.com/log-79750138-f41e-4f39-8812-7c536f1d2e35.txt
Clang does not appear to like using consteval functions' arguments as
constant expressions, so move all the arguments that need to appear as
constant expressions into the template parameters for now.

This patch should fix the OSS-Fuzz build.
2021-02-10 08:01:47 +01:00
Linus Groh
1fd349b8c2 Userland: Use INET_ADDRSTRLEN for inet_ntop() buffers
There's no point in using different, seemingly randomly sized buffers as
the required size for storing an IPv4 address representation is well
known (16 bytes).
2021-02-09 22:58:19 +01:00
Andreas Kling
f24b674d7a LibWeb+WebContent: Don't relayout page on every scroll event
The WebContent process was redoing page layout every time you scrolled
the page. This was a huge CPU hog for no reason. Fix this by only doing
a relayout when the viewport is resized, not when it moves around.
2021-02-09 22:40:16 +01:00
Tom
964894dee6 WindowServer: Allow specifying different shadows for menus and tooltips
Also update the Redmond 2000 theme to drop shadows more Redmond-like.
2021-02-09 22:27:14 +01:00
Andreas Kling
c9aa7539a6 LibWeb: Make OOPWV resizing flicker-free :^)
When resizing, keep a copy of the last good bitmap we have, and keep
using that until we receive a new one from the WebContent process.
2021-02-09 22:08:55 +01:00
Camisul
8c220dee03 WindowServer: Vertically maximize window
Button now can handle middle and right clicks.
Added 2 new handlers in button class: on_right_click for Right mouse
button and on_middle_click for middle mouse button.

Added functionality to vertically maximize window with middle mouse
click on the maximize window button.

Also added a way to vertically maximize window by resizing window
height-wise lower than the maximum window height.
2021-02-09 21:36:11 +01:00
Tom
e1ee59ac9d WindowServer: Recompute occlusions and re-render shadows on theme change
Since theme changes may change geometrics, which are also affected by
window shadows, we need to recompute occlusions as well as re-render
window frames.
2021-02-09 21:33:54 +01:00
Andreas Kling
ace1b34798 LibWeb: Reset the HTML editing cursor blink cycle on arrow key movement
Also stop exposing the DOM cursor as a mutable reference on Frame,
since event handling code was using that to mess with the text offset
directly. Setting the cursor now always goes through the Frame where
we can reset the blink cycle appropriately.

This makes cursor movement look a lot more natural. :^)
2021-02-09 21:25:38 +01:00
Andreas Kling
2c4829cb14 LibWeb: Remove duplicated locals in EventHandler::handle_mousedown() 2021-02-09 20:49:37 +01:00
Andreas Kling
da7a8fc055 LibGUI: TextEditor widget should default to no wrapping
Since we don't support wrapping in right-aligned text mode, let's keep
the old behavior of wrapping being off-by-default for now.

Fixes #5275.
2021-02-09 20:28:29 +01:00
Nico Weber
106939c11f Base: Fill in rightmost pixel in crosshair cursor
gimp claimed that the rightmost white pixel was actually transparent.
It didn't look transparent in Serenity, but I painted it white like
the other inner pixels anyways.
2021-02-09 20:10:00 +01:00