Commit graph

15374 commits

Author SHA1 Message Date
Dan MacDonald
b7fd5315e5
Ports: Hard-code SERENITY_ARCH=i686 until other architectures work (#4688) 2020-12-31 21:54:51 +01:00
Linus Groh
fb220d5678 Meta+Docs+CI: Require clang-format >= 11 2020-12-31 21:51:00 +01:00
Linus Groh
bbe787a0af Everywhere: Re-format with clang-format-11
Compared to version 10 this fixes a bunch of formatting issues, mostly
around structs/classes with attributes like [[gnu::packed]], and
incorrect insertion of spaces in parameter types ("T &"/"T &&").
I also removed a bunch of // clang-format off/on and FIXME comments that
are no longer relevant - on the other hand it tried to destroy a couple of
neatly formatted comments, so I had to add some as well.
2020-12-31 21:51:00 +01:00
AnotherTest
2568a93b5d ProtocolServer: Avoid blocking all downloads when client stops reading
Fixes #4668.
2020-12-31 16:57:09 +01:00
AnotherTest
83fed3fd5d LibWeb: Don't hold on to the Download instance after it's finished
Fixes* 4668
2020-12-31 16:57:09 +01:00
AnotherTest
a6b04cf8ef LibProtocol: Ensure download is finished before invoking on_finished 2020-12-31 16:57:09 +01:00
Linus Groh
a8ac8c6a8f AK: Add missing 'template' keywords in TypeList
This caused the AK build to be broken on OpenBSD (and possibly other
platforms / compiler versions).
Fixes #4692.
2020-12-31 16:16:07 +01:00
Andreas Kling
e6e4fe4f51 LibGUI: Add 1px of margin to EmojiPickerDialog
The left and top highlight edges were cut off by the dialog frame.
Add a small margin to make sure all buttons can be painted fully.
2020-12-31 14:39:23 +01:00
Andreas Kling
d441dec5d8 LibGUI: Make the emojis in the emoji input dialog fit in the window
GUI::Button has a default min-width of 32, so we have to override that
here in order to squeeze all the emojis into the window.

Fixes #4689.
2020-12-31 14:32:09 +01:00
Linus Groh
c0356fc183 WindowServer: Send WindowDeactivated event to windows blocked by modal
When a new modal window is created, we still want to forward the
WindowDeactivated event to its parent window, despite it being blocked
by the newly created modal (which causes WindowServer's Window::event()
to ignore all incoming events from WindowManager for that window).

This fixes the "terminal doesn't stop blinking when blocked by modal
window" bug.
2020-12-31 14:31:05 +01:00
Andreas Kling
e27d281bf1 UserspaceEmulator: Support sys$mremap()
This makes UE able to run dynamically linked executables once again.
2020-12-31 14:22:56 +01:00
Andreas Kling
fbf8751485 WidgetGallery: Add a GUI::OpacitySlider to the sliders tab :^) 2020-12-31 12:16:05 +01:00
Andreas Kling
47028c56c6 PixelPaint: Use GUI::OpacitySlider for layer opacity settings 2020-12-31 12:10:01 +01:00
Andreas Kling
0b55b0bdb8 Terminal: Use GUI::OpacitySlider in the settings window 2020-12-31 12:10:01 +01:00
Andreas Kling
ddaa13577e LibGUI: Add a new GUI::OpacitySlider widget :^)
This widgets offers a more visually intuitive way to adjust the opacity
of something.
2020-12-31 12:10:01 +01:00
Andreas Kling
acb87cd164 LibGfx: Remove unnecessary assertion in Painter::draw_pixel() 2020-12-31 12:10:01 +01:00
Tom
eabbe03b97 LibGUI: Constrain relative cursor delta to valid range 2020-12-31 10:54:02 +01:00
Tom
0c57e16ce4 LibGUI: Don't change the actual combobox value while hovering it
We don't want to trigger an actual selection change until either
confirming the new selection by keyboard or clicking on it.
Dismissing the dropdown should have no effect on the current
selection.

Fixes #4657
2020-12-31 10:54:02 +01:00
Tom
72440d90fe Kernel: Fix BlockCondition::unblock return value
BlockCondition::unblock should return true if it unblocked at
least one thread, not if iterating the blockers had been stopped.
This is a regression introduced by 49a76164c.

Fixes #4670
2020-12-31 10:52:58 +01:00
Tom
82c4812730 Kernel: Remove flawed SharedInodeVMObject assertion
This assertion cannot be safely/reliably made in the
~SharedInodeVMObject destructor. The problem is that
Inode::is_shared_vmobject holds a weak reference to the instance
that is being destroyed (ref count 0). Checking the pointer using
WeakPtr::unsafe_ptr will produce nullptr depending on timing in
this case, and WeakPtr::safe_ref will reliably produce a nullptr
as soon as the reference count drops to 0. The only case where
this assertion could succeed is when WeakPtr::unsafe_ptr returned
the pointer because it won the race against revoking it. And
because WeakPtr::safe_ref will always return a nullptr, we cannot
reliably assert this from the ~SharedInodeVMObject destructor.

Fixes #4621
2020-12-31 10:52:45 +01:00
Andreas Kling
1fdd39ff14 Kernel: Sprinkle some lockers in Inode
It did look pretty suspicious the way we were accessing members in some
of these functions without taking the lock first.
2020-12-31 02:10:31 +01:00
Andreas Kling
34d458d111 PixelPaint: Don't focus toolbox buttons on click 2020-12-31 02:05:35 +01:00
Andreas Kling
412a91d58f LibGfx: Add Gfx::Font::bold_variant() that does a proper font lookup
We previously had a cached bold variant font in Gfx::Font that was very
haphazardly located by filename pattern. This patches replaces that
mechanism with a proper Gfx::FontDatabase lookup for the same font but
with bold weight (700).
2020-12-31 01:51:18 +01:00
Luke
0f66589007 Everywhere: Fix more typos 2020-12-31 01:47:41 +01:00
Tom
22250780ff Kernel: Fix heap expansions deadlock
If a heap expansion is triggered by allocating from e.g. the
RangeAllocator, which may be holding a spin lock, we cannot
immediately allocate another block of backup memory, which could
require the same locks to be acquired. So, defer allocating the
backup memory

Fixes #4675
2020-12-31 01:15:37 +01:00
Andreas Kling
4f1db41a6c LibGUI: Show font weight names instead of numeric weights in FontPicker
Map font weights to their names from the OpenType specification.
2020-12-31 01:13:52 +01:00
Luke
28bad49ed4 DevTools: Add open, save as and quit actions to GML playground 2020-12-31 01:08:58 +01:00
William Marlow
146fac2481 DynamicLoader: Handle Loader.so being invoked directly as an executable
Loader.so is an actual executable, as well as the interpreter for dynamic
libraries. Currently launching Loader.so as a standalone executable results
in an obsucre crash as it tries to load itself over itself.

Now we at least print a helpful message saying that you're doing the wrong
thing and exit gracefully. In future we may wish to allow users to specify
additional options to learn more about what's going on during dynamic
linking, such as ld-linux.so.2 on Linux.
2020-12-31 00:52:02 +01:00
asynts
a7c014125f AK: Add operator* and operator-> overloads in Optional. 2020-12-31 00:51:12 +01:00
Andreas Kling
c770b0bbec LibGUI: Don't keep creating new models in FontPicker
We can reuse the same model, as long as we call update() on them when
the list of weights/sizes change.
2020-12-31 00:46:00 +01:00
Andreas Kling
91493be4f3 LibGUI: Simplify FontPicker::set_font()
Use Vector::find_first_index() instead of iterating manually. :^)
2020-12-31 00:45:43 +01:00
Tom
34b3d92a13 AK: Fix some WeakPtr copy constructor variants not copying the link 2020-12-31 00:39:43 +01:00
Tom
54eeb8ee9a AK: Fix a race condition with WeakPtr<T>::strong_ref and destruction
Since RefPtr<T> decrements the ref counter to 0 and after that starts
destructing the object, there is a window where the ref count is 0
and the weak references have not been revoked.

Also change WeakLink to be able to obtain a strong reference
concurrently and block revoking instead, which should happen a lot
less often.

Fixes a problem observed in #4621
2020-12-31 00:39:43 +01:00
Andreas Kling
3e00e3da72 LibGUI: Sort all the lists in the FontPicker
Fixes #4671.
2020-12-31 00:33:50 +01:00
Andreas Kling
a68275914e LibGUI: Tweak FontPicker layout
Make everything a bit smaller and hide the horizontal scrollbars in the
list views since we don't really need them.
2020-12-30 21:01:28 +01:00
Stephan Unverwerth
b4d1390714 LibGFX: Move default_xxx_font() methods from Font to FontDatabase
When we have an abstract font class it makes no sense to keep
these methods in the Font class.
2020-12-30 20:40:30 +01:00
Stephan Unverwerth
1a072a61fb LibTTF: Cache rasterized glyphs within TTF::ScaledFont 2020-12-30 20:40:30 +01:00
Stephan Unverwerth
0f6cf9caa1 LibTTF: Use ReadonlyBytes where possible to avoid copies 2020-12-30 20:40:30 +01:00
Stephan Unverwerth
187acd8f21 LibTTF: Do not assert on glyphs with broken line coordinates
Until we figure out what causes this problem or we can
fixup the coordinates we should simply not render this line.
2020-12-30 20:40:30 +01:00
Stephan Unverwerth
9689d914b4 LibTTF: Use ByteBuffer::copy() since wrap() was removed 2020-12-30 20:40:30 +01:00
Stephan Unverwerth
222b7f6c87 LibTTF: Use AffineTransform::multiply() instead of * operator 2020-12-30 20:40:30 +01:00
Stephan Unverwerth
a060b6cefd LibTTF: Fix code after rebase 2020-12-30 20:40:30 +01:00
Srimanta Barua
3b31f069f0 LibTTF: Address code-style comments, gracefully handle load failures. 2020-12-30 20:40:30 +01:00
Srimanta Barua
ec08e9e780 LibTTF: Split up Font.h into smaller internal header files. 2020-12-30 20:40:30 +01:00
Srimanta Barua
1e1d2cdedf LibTTF: Initial work on parsing and rasterizing composite glyphs.
This doesn't handle every case yet.
2020-12-30 20:40:30 +01:00
Srimanta Barua
bd354bc2ae LibTTF: Reorganized TTF parsing code into LibTTF 2020-12-30 20:40:30 +01:00
Srimanta Barua
22fbe59126 LibGfx: Address awesomekling's comments on API and codestyle 2020-12-30 20:40:30 +01:00
Srimanta Barua
1931535218 LibGfx: Cut down on magic constants in the TTF parser. 2020-12-30 20:40:30 +01:00
Srimanta Barua
186499cc25 LibGfx: Update Painter's bezier curve drawing algorithm.
The new algorithm is an iterative one with an arbitrary threshold for splitting
curves. It splits curves evenly. This should theoretically be less accurate
than the existing recursive approach, but seems to give subjectively better
results in practice.
2020-12-30 20:40:30 +01:00
Srimanta Barua
0e9fb803c8 LibGfx: Finally render simple TTF outlines. 2020-12-30 20:40:30 +01:00