Commit Graph

21358 Commits

Author SHA1 Message Date
Matthew Jones
0ff09d4f74 WindowServer: Add sanity checks to create_window IPC 2021-06-03 08:27:57 +02:00
Matthew Jones
ef92493aba LibGUI: ComboBox now goes upwards when running out of room to render 2021-06-03 08:24:18 +02:00
Matthew Jones
36a1162eb8 LibGUI: ComboBox now correctly sizes height in relation to taskbar 2021-06-03 08:23:45 +02:00
Matthew Jones
6c520fab87 LibGUI: Desktop.h should get actual value from TaskbarWindow.h 2021-06-03 08:23:45 +02:00
Matthew Jones
b0682a73ee WindowServer: Position popup menu with offset of 1 pixel 2021-06-03 08:21:01 +02:00
Gunnar Beutner
a4f320c76b AK: Allow inlining more string functions 2021-06-03 08:06:51 +02:00
Gunnar Beutner
ed0068d04d AK: Allow inlining ref-count functionality
Previously we'd incur the costs for a function call via the PLT even
for the most trivial ref-count actions like increasing/decreasing the
reference count.

By moving the code to the header file we allow the compiler to inline
this code into the caller's function.
2021-06-03 08:06:51 +02:00
Matthew B. Jones
ab4f4ddc3c
Solitaire: Add undo functionality 2021-06-03 01:16:49 +01:00
Gunnar Beutner
9444272ba0 Profiler: Remove m_deepest_stack_depth
This isn't used anymore so let's remove it entirely.
2021-06-03 01:16:32 +01:00
Gunnar Beutner
a607f13fc7 Profiler: Use sequential serial numbers for profiling events
Previously Profiler was using timestamps to distinguish processes.
However it is possible that separate processes with the same PID exist
at the exact same timestamp (e.g. for execve). This changes Profiler
to use unique serial numbers for each event instead.
2021-06-03 01:16:32 +01:00
Matthew Jones
af72b5ec82 LibGUI: Show pressed state for Space and Return key events
Also allows the user to press Esc while the button is being pressed
to cancel the button action.
2021-06-03 00:33:26 +01:00
Hediadyoin1
6fe7d4d7b8 Toolchain: Use gcc's ar
the vanilla versions might not handle all things, that gcc can do;
For example is lto not really supported by the vanilla versions
source:
https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ
2021-06-03 00:24:06 +01:00
BrandonKi
0d1481be7d LibWasm: Use builtins for clz, ctz, and popcnt 2021-06-03 03:45:06 +04:30
BrandonKi
e53df2ca9d LibWasm: Implement rotr and rotl 2021-06-03 03:45:06 +04:30
Matthew Jones
ea4116f5bd LibGUI+LibGfx+WindowServer: Sanity check window size dimensions
Previous to this commit, if a `Window` wanted to set its width or height
greater than `INT16_MAX` (32768), both the application owning the Window
and the WindowServer would crash.

The root of this issue is that `size_would_overflow` check in `Bitmap`
has checks for `INT16_MAX`, and `Window.cpp:786` that is called by
`Gfx::Bitmap::create_with_anonymous_buffer` would get null back, then
causing a chain of events resulting in crashes.

Crashes can still occur but with `VERIFY` and `did_misbehave` the
causes of the crash can be more readily identified.
2021-06-02 23:59:57 +01:00
Oleg Kosenkov
839aad6e5b
Toolchain: Set CMAKE_AR to the right executable 2021-06-02 23:25:44 +01:00
Marcus Nilsson
3931b292b0 HackStudio: Make locator lose focus on close
Make locator lose focus when pressing escape or by clicking in the
editor area.
2021-06-02 23:15:52 +01:00
Marcus Nilsson
b43dad1741 HackStudio: Remove unused includes 2021-06-02 23:15:52 +01:00
Marcus Nilsson
8d3539a1c4 HackStudio: Close locator on exit 2021-06-02 23:15:52 +01:00
Matthew B. Jones
3ad7a1e944
Hearts: Play the first valid card (left-to-right) when pressing space 2021-06-02 23:07:12 +01:00
Gunnar Beutner
6f38ce8f47 Kernel: Avoid allocations in the VMObject constructor
This avoids allocations in the VMObject constructor. The number of
inline elements was determined empirically and covers most common cases
including LibC malloc.
2021-06-02 23:00:14 +01:00
Gunnar Beutner
596361791c Kernel: Add operator delete for KString
This doesn't change anything because our global operator delete also
calls kfree() - however instead of relying on this implementation
detail this makes this dependency more explicit.
2021-06-02 22:59:39 +01:00
Matthew Jones
f0e9fd09b4 LibGUI: Tooltip no longer exceeds screen width, now truncates 2021-06-02 22:50:51 +01:00
Linus Groh
d1d1f4f251 LibJS: Remove declarations of some TODO()'d BigInt and Promise functions
In hindsight declaring these prematurely wasn't the greatest idea - that
just makes any script checking for their existence believe they'll work,
and what follows next is a crash of the js or WebContent process. If we
omit the declarations, a polyfill can be provided instead.

This also affects the test262, which tests these - instead of reporting
a bunch of assertion crash errors, we should simply report test failure
for 'not a function', which in turn makes it easier to spot any actual
bugs causing crashes.
2021-06-02 21:06:21 +01:00
Linus Groh
163d776df6 LibJS: Replace iterator hint string argument with an enum
There's no reason at all for this to be a string or to accept arbitrary
values - just because it's displayed as strings in the spec doesn't mean
we have to do the same :^)
2021-06-02 20:52:46 +01:00
Linus Groh
a5903ac4b6 LibRegex: Hide stray dbgln() behind REGEX_DEBUG 2021-06-02 18:31:43 +01:00
Matthew Jones
123848f0c1 LibGUI: Fixes Widget->set_visible(false) still maintains focus bug
When setting a Widget->set_visible(false), if that Widget->has_focus()
it will continue to have focus, even though it's not visible to the user
anymore.

Now calling Widget->set_visible(false) will remove focus from the Widget
if it had focus, and the Window will give focus back to the Widget
that had it previously, if there was one.
2021-06-02 18:22:05 +02:00
Matthew Jones
9720261540 TextEditor/GMLPlayground: Don't close app if user aborts save on exit 2021-06-02 18:15:19 +02:00
NonStandardModel
a7d3709e1c KeyboardMapper: Add default path to keymaps 2021-06-02 18:10:06 +02:00
Gunnar Beutner
9e3fb73169 LibC: Use memory_order_acquire instead of memory_order_acq_rel
Acquire ordering should be sufficient for pthread_mutex_lock
and pthread_mutex_trylock.
2021-06-02 18:09:32 +02:00
Gunnar Beutner
90f4c9e44c LibC: Fix race condition in pthread_mutex_unlock()
This ensures the store to mutex->lock doesn't get re-ordered before
the store to mutex->owner which could otherwise result in a locked
owner-less mutex if another thread tries to acquire the lock at
the same time.
2021-06-02 18:09:32 +02:00
Gunnar Beutner
5ca1d4289b LibC: Remove reinterpret_cast in pthread_mutex_{try,}lock 2021-06-02 18:09:32 +02:00
Marcus Nilsson
11fa3e4f92 Terminal/LibGUI::TextEditor: Add shift+return to search forwards
This adds support for shift+return key combo in single line TextEditor
fields. Used in this case for searching backwards/forwards in the
Terminal find window.
2021-06-02 18:08:56 +02:00
Marcus Nilsson
9550564767 Terminal: Remove unused includes 2021-06-02 18:08:56 +02:00
Marcus Nilsson
734bd9841a Terminal: Close find & settings windows on application exit
Since the find & settings windows are not children of the main window,
they stayed open after exiting the application.
2021-06-02 18:08:56 +02:00
Gunnar Beutner
b5778675a5 WindowServer: Use RefPtr instead of raw pointers
Now that we have static initializers and destructors we can use
RefPtr here.
2021-06-02 18:08:11 +02:00
Marco Cutecchia
ea03b43fff PixelPaint: Update Image.{cpp, h} to use east const 2021-06-02 18:07:14 +02:00
Marco Cutecchia
76adac103e PixelPaint: Support opening more image file formats
Previously we could only open .pp files, now we can open all formats
supported by Gfx::Bitmap::load_from_file
2021-06-02 18:07:14 +02:00
Siddhant Rao
566d3cb393 Documentation: Correct some typos in kernel and browser docs 2021-06-02 18:02:59 +02:00
Ali Mohammad Pur
ea7ba34a31 AK+LibWasm+LibJS: Disallow Variant.has() on types that aren't contained
Checking for this (and get()'ing it) is always invalid, so let's just
disallow it.
This also finds two bugs where the code is checking for types that can
never actually be in the variant (which was actually a refactor
artifact).
2021-06-02 18:02:47 +02:00
Gunnar Beutner
87ff76bd57 Kernel: Make KString non-copyable and non-movable
The user is supposed to hold these in an OwnPtr but bad things would
happen if the user takes these out of the OwnPtr so let's make the
class non-copyable and non-movable.
2021-06-02 18:00:13 +02:00
Gunnar Beutner
fe0ae3161a Kernel: Fix use-after-free in sys$mremap
Now that Region::name() has been changed to return a StringView we
can't rely on keeping a copy of the region's name past the region's
destruction just by holding a copy of the StringView.
2021-06-02 18:00:13 +02:00
Filip Kania
33cdc59dff Utilities: Add support for relative paths in open command 2021-06-02 17:34:27 +04:30
Ali Mohammad Pur
b15a5d6ada LibWasm: Ensure that value signs are preserved when casting
Also makes normal arithmetic operations more spec-compliant by actually
ignoring overflow on them.
2021-06-02 16:09:16 +04:30
Ali Mohammad Pur
02b3238c41 LibWasm: Parse the "extend" set of instructions 2021-06-02 16:09:16 +04:30
Ali Mohammad Pur
6b5d1eedcb Meta: Make the wasm test generator cast numbers to i32 when needed
Otherwise the sign would be out of whack
2021-06-02 16:09:16 +04:30
Ali Mohammad Pur
6cd9906f60 AK: Make checked division also check for divide by zero 2021-06-02 16:09:16 +04:30
Ali Mohammad Pur
9a1853c388 LibWasm: Don't execute the last instruction in the frame after return 2021-06-02 16:09:16 +04:30
Ali Mohammad Pur
b250a6ae7e wasm: Add a way to create dummy function exports
This should allow running modules with their imports stubbed out
in wasm, to debug them.
2021-06-02 16:09:16 +04:30
Ali Mohammad Pur
56bf80251c LibWasm: Implement reference instructions (ref.{null,func,is_null}) 2021-06-02 16:09:16 +04:30