Commit graph

16672 commits

Author SHA1 Message Date
Andreas Kling
e00f519cdd AK: Add formatter for DistinctNumeric 2021-02-12 12:31:09 +01:00
Andreas Kling
489317e573 Kernel: Make BlockBasedFS::BlockIndex a distinct integer type 2021-02-12 11:59:27 +01:00
Andreas Kling
900865975a AK: Allow default-constructing DistinctNumeric
This makes it much more useful as a replacement type for integers.
It's zeroed out by default.
2021-02-12 11:59:15 +01:00
Andreas Kling
e44c1792a7 Kernel: Add distinct InodeIndex type
Use the DistinctNumeric mechanism to make InodeIndex a strongly typed
integer type.
2021-02-12 10:26:29 +01:00
Andreas Kling
c8a90a31b6 Kernel: Remove default arguments from Inode::resolve_as_link()
Nobody was calling it without specifying all arguments anyway.
2021-02-12 09:06:03 +01:00
Tom
7e06afb822 WindowServer: Recompute occlusions when changing window's alpha channel
Fixes #4845
2021-02-12 08:57:42 +01:00
Owen Smith
c2de22a635 Kernel: Merge split function and data sections into one during linking
Also add an assertion to make sure the safemem sections are never
discarded by the linker.
2021-02-12 08:57:26 +01:00
Sahan Fernando
9e68752264 Themes: Improve syntax highlighting colors of Nord theme 2021-02-12 08:55:34 +01:00
Tom
cd2874dfcf Themes: Make Redmond 2000 menu shadows a bit lighter 2021-02-12 08:55:11 +01:00
Andreas Kling
a50ba0a491 LibSyntax: Make rehighlight() take Gfx::Palette as by const-reference 2021-02-11 23:52:39 +01:00
Tom
cf1c159ed5 WindowServer: Allow different shadows for active/inactive windows
Also allow specifying different shadows for the task and menu bar.
2021-02-11 23:36:11 +01:00
Andreas Kling
8c694ed6eb Kernel: Don't call Thread::set_should_die() twice on every thread
This stops the "should already die" debug spam we've been seeing.
2021-02-11 23:33:42 +01:00
Andreas Kling
3c7782fdbe LibC: Remove FIXME spam in setlocale() 2021-02-11 23:31:56 +01:00
Andreas Kling
95064f8b58 Ext2FS: Convert #if EXT2_DEBUG => dbgln_if() and constexpr-if 2021-02-11 23:05:16 +01:00
Andreas Kling
abe4463b1c Kernel: Remove an unnecessary InterruptDisabler in early initialization 2021-02-11 22:56:14 +01:00
Andreas Kling
a280cdf9ba Ext2FS: Shrink Ext2FSDirectoryEntry from 16 to 12 bytes
The way we read/write directories is very inefficient, and this doesn't
solve any of that. It does however reduce memory usage of directory
entry vectors by 25% which has nice immediate benefits.
2021-02-11 22:45:50 +01:00
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