Commit graph

17037 commits

Author SHA1 Message Date
Brian Gianforcaro
a977cdd9ac Kernel: Remove unneeded Thread::set_default_signal_dispositions
The `default_signal_action(u8 signal)` function already has the
full mapping. The only caveat being that now we need to make
sure the thread constructor and clear_signals() method do the work
of resetting the m_signal_action_data array, instead or relying on
the previous logic in set_default_signal_dispositions.
2021-02-21 12:54:39 +01:00
Brian Gianforcaro
df73a86875 AK: Add an implementation of Array<T, Size>::fill(...) 2021-02-21 12:54:39 +01:00
Brian Gianforcaro
21a959e29b AK: Add Span<T> constructor for arrays
The array constructor allows arrays to be easily treated
as generic span of data.
2021-02-21 12:54:39 +01:00
Brian Gianforcaro
3019445492 Userland: Use uniform initialization instead of memset 2021-02-21 11:52:47 +01:00
Brian Gianforcaro
cbd8f78cce Kernel: Use uniform initialization instead of memset for a few stack buffer.
Raw memset is relatively easy to mess up, avoid it when there are
better alternatives provided by the compiler in modern C++.
2021-02-21 11:52:47 +01:00
Brian Gianforcaro
7c950c2d01 Kernel: Use ByteBuffer::zero_fill() instead of raw memset in Ext2
There was a typo in one of the memsets, use the type safe wrapper instead.

Fix EXt
2021-02-21 11:52:47 +01:00
Brian Gianforcaro
5e84320ecb AK: Add safe memset() wrapper to ByteBuffer
In the interest memory safety and of removing as many
of foot guns as possible (like raw memset's which are
notorious for typo's), a zeroing method seems like a
useful utility to have on a buffer class.
2021-02-21 11:52:47 +01:00
Andreas Kling
86a3363ddf DHCPClient: Actually randomize transaction ID's (XID)
We were using unseeded rand() for the XID, which meant that our DHCP
XID's were 100% predictable.

Switch to using AK::get_random<u32>() instead. :^)
2021-02-21 11:01:55 +01:00
Andreas Kling
e928022bb3 DHCPClient: Silence a debug message 2021-02-21 10:57:39 +01:00
Andreas Kling
2a22d346dc utmpupdate: Don't complain about an error if the utmp is just empty
This removes a misleading error message during startup.
2021-02-21 10:56:55 +01:00
Andreas Kling
3b3e7d3f46 Kernel: Silence TTY signal debug spam 2021-02-21 10:52:30 +01:00
Tom
5d2159ee24 Cube: Add an option to render a frameless cube 2021-02-21 10:33:28 +01:00
Tom
7143a6026d Taskbar: Remove window button if a window state change demands it
We didn't add buttons for certain window types or states when the
window was created, but when a window with a button changed its
state to where we would not have created the button, we didn't
remove the existing button.
2021-02-21 10:33:28 +01:00
Tom
1c31bcb24e WindowServer: Allow changing frameless state after a window is created 2021-02-21 10:33:28 +01:00
Linus Groh
368fe0f7f8 LibVT: Don't paint selection with opacity
Fixes #5442.
2021-02-21 10:33:22 +01:00
AnotherTest
d8a3285d78 LibLine: Move the search editor exactly after the last line
Previously, we'd always put it right after the prompt.
2021-02-21 09:01:00 +01:00
AnotherTest
9790ee4649 LibLine: Make clear_lines() work when only clearing the current line 2021-02-21 09:01:00 +01:00
AnotherTest
6472e5239c LibLine: Update the lazy refresh data and flags in some more places
These were forgotten in the last LibLine commit, any changes to m_buffer
not going through insert() and remove_at_index() should also be updating
these.

Fixes #5440.
2021-02-21 09:01:00 +01:00
Andreas Kling
84b2d4c475 Kernel: Add "map_fixed" pledge promise
This is a new promise that guards access to mmap() with MAP_FIXED.

Fixed-address mappings are rarely used, but can be useful if you are
trying to groom the process address space for malicious purposes.

None of our programs need this at the moment, as the only user of
MAP_FIXED is DynamicLoader, but the fixed mappings are constructed
before the process has had a chance to pledge anything.
2021-02-21 01:08:48 +01:00
Tom
a0cbb9068b LibGUI: Let ScrollableWidget handle the wheel events of its ScrollBars
Route the ScrollBar's wheel event to the ScrollableWidget so it can
handle it itself. This allows it to handle it consistently (e.g.
speed) when the cursor is hovering the scroll bars rather than the
widget's contents.

Fixes #5419
2021-02-21 01:06:17 +01:00
Andreas Kling
cb2db3710b LibELF: Fix build with ELF_IMAGE_DEBUG 2021-02-21 00:48:00 +01:00
Andreas Kling
1bc859fb68 Kernel: Make UNMAP_AFTER_INIT imply NEVER_INLINE as well
We want to make sure these functions actually do get unmapped. If they
were inlined somewhere, the inlined version(s) would remain mapped.

Thanks to "thislooksfun" for the suggestion! :^)
2021-02-21 00:43:29 +01:00
Andreas Kling
f23b29f605 LibELF: Move DynamicObject::lookup_symbol() to DynamicLoader
Also simplify it by removing an unreachable code path.
2021-02-21 00:29:52 +01:00
Andreas Kling
a43910acc3 LibELF: Make SymbolLookupResult::address a VirtualAddress
Let's use a stronger type than void* for this since we're talking
specifically about a virtual address and not necessarily a pointer
to something actually in memory (yet).
2021-02-21 00:02:21 +01:00
Andreas Kling
c5d93e55d0 LibELF: Simplify DynamicObject::Symbol class a bit
We no longer need the create_undefined() helper function.
Also we don't need a member field for is_undefined().
2021-02-21 00:02:21 +01:00
Andreas Kling
1997d5de1a LibELF: Make symbol lookup functions return Optional<Symbol>
It was very confusing how these functions used the "undefined" state
of Symbol to signal lookup failure. Let's use Optional<T> to make things
a bit more understandable.
2021-02-21 00:02:21 +01:00
Andreas Kling
46c3ff2acf LibELF: Remove "always bind now" global flag
This looked like someone's forgotten debug mechanism.
2021-02-21 00:02:21 +01:00
Andreas Kling
ba1eea9898 LibELF+DynamicLoader: Rename DynamicObject::construct() => create() 2021-02-21 00:02:21 +01:00
Andreas Kling
01f1e480e5 LibELF: Fix various clang-tidy warnings
Remove a bunch of unused code, unnecessary const, and make some
non-object-specific member functions static.
2021-02-21 00:02:21 +01:00
Andreas Kling
0c0127dc3f LibELF: Use StringView instead of "const char*" in dynamic linker code
There's no reason to use C strings more than absolutely necessary.
2021-02-20 22:29:12 +01:00
Sameem Zahoor Taray
2c3f284b06
Run: Prevent printing [null] in case of empty history (#5433)
Pressing up-arrow or down-arrow with empty command history printed
[null] in the text area.

Fixes #5426
2021-02-20 22:28:54 +01:00
AnotherTest
074e2ffdfd LibLine: Avoid refreshing the entire line when inserting at the end
This patchset allows the editor to avoid redrawing the entire line when
the changes cause no unrecoverable style updates, and are at the end of
the line (this applies to most normal typing situations).
Cases that this does not resolve:
- When the cursor is not at the end of the buffer
- When a display refresh changes the styles on the already-drawn parts
  of the line
- When the prompt has not yet been drawn, or has somehow changed

Fixes #5296.
2021-02-20 22:28:23 +01:00
Tom
101c6b01ed WindowServer: Improve small tooltips/windows shadows a bit
This fixes some artifacts with very small tooltip windows.
2021-02-20 22:28:11 +01:00
thankyouverycool
ef61a963e9 LibGUI: Always set tree column content width to widest open node
Fixes hidable horizontal scrollbars remaining visible even after
collapsing their responsible nodes. Tree column width defaults to
column header width if wider than current content.
2021-02-20 22:27:52 +01:00
thankyouverycool
2df219d608 LibGUI: Recheck size excesses when scrollbars become visible
Fixes edge cases in which hidden scrollbars could become visible
and obscure content or fail to hide when no longer needed
2021-02-20 22:27:52 +01:00
thankyouverycool
8789a91a4e LibGUI: Set IconView content width to actual content only
Fixes incorrect excess size reporting when updating scrollbars
and allows horizontal scrolling if IconView is resized smaller
than a single column
2021-02-20 22:27:52 +01:00
Andreas Kling
08476e7fe7 DynamicLoader: Always make .data segment read+write
Let's just ignore the program header and always go with read+write.
Nothing else makes sense anyway.
2021-02-20 19:02:48 +01:00
Andreas Kling
81c6d8e98e AK: Make Nonnull*PtrVector use size_t for indexes
This was weird. It turns out these class were using int indexes and
sizes despite being derived from Vector which uses size_t.

Make the universe right again by using size_t here as well.
2021-02-20 18:34:32 +01:00
Linus Groh
46efd2f741 Ports: Update vttest version in AvailablePorts.md 2021-02-20 18:31:00 +01:00
Andreas Kling
fa581a7470 Kernel: Mark some IDEController functions with UNMAP_AFTER_INIT 2021-02-20 17:28:29 +01:00
Andreas Kling
efd4f66f36 Kernel: Don't take debug logging lock in sprintf()
This function doesn't write to the log, and so doesn't need to acquire
the logging lock. (This is only used by GCC's name demangling thingy.)
2021-02-20 17:21:53 +01:00
Andreas Kling
4d9ce42532 AK: Remove unused kprintf macro
This hasn't been used for quite some time.
2021-02-20 17:21:03 +01:00
Andreas Kling
8d98051551 AK+LibC: Remove dbgprintf() :^)
Everything has been moved to dbgln() or other AK::Format-based APIs.
We can finally get rid of this old thing.
2021-02-20 17:17:30 +01:00
Andreas Kling
542d8591e0 LibVT: Oops, fix dbgln() invocation mistake 2021-02-20 17:16:33 +01:00
Andreas Kling
68406fc0ef LibCpp: Replace dbgprintf() with outln() 2021-02-20 17:12:25 +01:00
Andreas Kling
b1a705d7d8 LibTLS: Replace dbgprintf() with dbgln() 2021-02-20 17:06:39 +01:00
Andreas Kling
499a59ed86 LibVT: Put "unimplemented escape" whining on debug log
I'm not sure why we were injecting these debug messages into the
terminal output, but it makes a big mess for no benefit.
2021-02-20 17:04:46 +01:00
Andreas Kling
81b21504a7 LibVT: Implement switching between 80/132 column modes (DECCOLM)
This gets us past a few more screens in vttest. :^)
2021-02-20 17:04:46 +01:00
Andreas Kling
8c9ae4e537 Terminal+LibVT: Resize Terminal app window when requested by VT
This will allow us to react to things like DECCOLM.
2021-02-20 17:04:46 +01:00
Andreas Kling
bb6d6dce7b LibVT: Give proper names to remaining VTxxx control functions 2021-02-20 17:04:46 +01:00