summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-03LibGUI: Rename ScrollableWidget => AbstractScrollableWidgetAndreas Kling
2021-05-03Minesweeper: Tweak main UI layout a little bitAndreas Kling
Move the clock/flag icons closer to their respective text labels.
2021-05-03Minesweeper: Add a tasteful separator line between menubar and UIAndreas Kling
2021-05-03Revert "LibGfx: Add directional floating-point scaling to Painter"Andreas Kling
This reverts commit ff76a5b8d2e4dfe007c20a1376cb6862a2c2dbe0.
2021-05-03Revert "LibGfx: Re-add missing bounds-checks to Painter::draw_rect"Andreas Kling
This reverts commit 4cf5514672409dcec11a4069b075f996a30e93cb.
2021-05-03Kernel: Remove unused header includes from various files.Brian Gianforcaro
Found while browsing code with CLion.
2021-05-03Kernel: Mark AsyncBlockDeviceRequest + AnonymousVMObject as finalBrian Gianforcaro
Mark final to aid in de-virtualization since they are not currently derived from.
2021-05-03Documentation: Add a note about excluding the Build directory in CLionBrian Gianforcaro
This was discussed a while back on discord, but no one got around to writing it down yet.
2021-05-03LibC: Fix invalid 1-byte read I introduced in dirent.Brian Gianforcaro
When attempting to fix the dirent code I also changed this to use strlcpy instead of the custom string copy loop that was there before. Looking over strlcpy it looked like it should work when using a non null terminated string, I obviously misinterpreted the implementation as it will read till it finds a null terminator. Manually null terminate the string to address this. Gunnar found this after he fixed UserspaceEmulator. I reproduced it locally using his branch, and also found the memory leak I had in the unit test for the scandir that I added, so lets fix that as well. Reported-by: Gunnar Beutner <gbeutner@serenityos.org>
2021-05-03LibDebug: add DW_LNS_set_basic_block supportspigwitmer
This adds support for the basic_block register to the Dwarf line number state machine.
2021-05-03TextEditor: Clear the selection before deleting itPaul Berg
This patches fixes a crash of the Userland/TextEditor where it would crash when deleting a range spanning two lines. This was because the TextEditor would delete the range and modify the cursor position before clearing the selection. This would trigger a status bar update with the invalid selection.
2021-05-03LibGUI: Debounce TextDocument undo stackCarlos César Neves Enumo
This replaces the repeating 2-sec timer with a debounced single-shot timer on user input.
2021-05-03DynamicLoader: Fix compiler warningGunnar Beutner
math.cpp: In function 'int64_t __moddi3(int64_t, int64_t)': math.cpp:168:13: error: 'r' may be used uninitialized [-Werror=maybe-uninitialized] 168 | return ((int64_t)r ^ s) - s; // negate if s == -1 | ^~~~~~~~~~
2021-05-03AK: Silence -Wmaybe-uninitialized warningGunnar Beutner
Adding -fno-semantic-interposition to the GCC command line caused this new warning. I don't see how output.data() could be uninitialized here. Also, commenting out the ensure_capacity() call for the Vector also gets rid of this warning.
2021-05-03Toolchain: Enable building all code with -fPICGunnar Beutner
Ordinarily this would force the compiler to not inline certain symbols and call them via the PLT instead. To counteract this I've also added -fno-semantic-interposition which disables ELF symbol interposition. Our dynamic loader doesn't support this anyway and we might even consider not implementing this at all. Even though this is a toolchain change this doesn't require rebuilding the toolchain unless you're planning to build for the x86_64 arch.
2021-05-03LibELF: Implement x86_64 relocation supportGunnar Beutner
There are definitely some relocations missing and this is untested for now.
2021-05-03Kernel: Fix some 64-bit portability issuesGunnar Beutner
2021-05-03Userland: Fix 64-bit portability issuesGunnar Beutner
2021-05-03LibELF+LibC: Support building LibELF for 64-bit targetsGunnar Beutner
2021-05-03UserspaceEmulator: Make sure TLS allocation behavior matches kernelGunnar Beutner
2021-05-03UserspaceEmulator: Add missing argument for sys$allocate_tlsGunnar Beutner
2021-05-03UserspaceEmulator: Add stub for sys$futexGunnar Beutner
2021-05-03LibWeb: Use node_to_insert instead of node in Node::insert_beforeLuke
It was using the passed in node instead of the node from the vector. Fixes a crash I found while testing jQuery.
2021-05-03LibGfx: Re-add missing bounds-checks to Painter::draw_rectMatthew Olsson
This commit adds a draw_physical_line method, which is the exact same as draw_line, except it's parameters are already transformed and scaled. This is used by both draw_line and draw_rect, as a slight optimization to save some work. It also fixed draw_rect not checking whether it should draw the lines before drawing them.
2021-05-02LibWeb: Expose Node.ownerDocumentLuke
Required by jQuery.
2021-05-02HackStudio: Show dialog on build and exit if there are unsaved changesItamar
If the user tries to exit HackStudio, or build the project, when there are unsaved changes in some of the editors, A Yes/No/Cancel dialog will be shown.
2021-05-02HackStudio: Add a "document dirty" indicator to the EditorWrapperItamar
2021-05-02HackStudio: Get rid of m_currently_open_file memberItamar
It had the following FIXME: // FIXME: This doesn't seem compatible with multiple split editors In practice this member was used to get the filename of the currently active edtior. So we now get it directly from the currently active EditorWrapper.
2021-05-02LibGfx: Add scaling methods to BitmapMatthew Olsson
2021-05-02Color: Add interpolate methodMatthew Olsson
2021-05-02LibGfx: Add directional floating-point scaling to PainterMatthew Olsson
This allows the painter to be scaled separately in both directions, and not just in integer intervals. This is crucial for proper SVG viewBox support. Most bitmap-related things verify the scale to be one as of now.
2021-05-02LibGfx: Unify Rect, Point, and SizeMatthew Olsson
This commit unifies methods and method/param names between the above classes, as well as adds [[nodiscard]] and ALWAYS_INLINE where appropriate. It also renamed the various move_by methods to translate_by, as that more closely matches the transformation terminology.
2021-05-02LibGfx: Add some helper methods to AffineTransformMatthew Olsson
Also makes some basic getters ALWAYS_INLINE and [[nodiscard]], as well as fixing as error with the map method.
2021-05-02Tests: Add unit tests for the pthread_spinlock_t API.Brian Gianforcaro
This change establishes a new set of LibTest based tests for validating the functionality of our pthread implementation. The first tests added validate the error handling for the pthread spinlock API: * pthread_spin_init * pthread_spin_lock * pthread_spin_try_lock * pthread_spin_unlock * pthread_spin_destroy
2021-05-02LibPthread: Implement pthread_spinlock_t API.Brian Gianforcaro
This change implements the pthread user space spinlock API. The stress-ng Port requires a functioning version to work correctly. To facilitate the requirements of the posix specification for the API we implement the spinlock so that the owning tid is the value stored in the spinlock. This gives us the proper ownership semantics needed to implement the proper error handling.
2021-05-02LaunchServer: Only consider path in OpenURLValtteri Koskivuori
This resolves the crash in #6812 where the browser was trying to open a file in the Download directory, but the check against allowed paths was also trying to match the URL fragment. Resolves #6812
2021-05-02Shell: Only match entries from PATH when a program name is givenAli Mohammad Pur
This commit makes the shell: - highlight executables in the current directory as invalid, unless an explicit `./' is given (so, `./foo` isn't red, but `foo` is) - not suggest executables in the current directory unless explicitly requested (by prepending `./`) - not attempt to run an executable in the current directory that has been invoked as a program name and failed execvp(). Note that `./foo` is still executed because it's not invoked as a name, but rather as a path. Fixes the other half of #6774.
2021-05-02Shell: Replace fprintf(stderr) => warnln()Ali Mohammad Pur
2021-05-02Shell: Update shebang handling logicAli Mohammad Pur
This bit of code was kept unmodified since it was first implemented, and I'm not entirely convinced that it ever actually worked :P This commit updates the code to use "modern" classes and constructs, and fixes an issue where the shebang would still contain the '#!' when it was passed to execvp(). Fixes #6774.
2021-05-02Kernel: Fix ProcFS for non-process backed sub dirsSpencer Dixon
While hacking on `sysctl` an issue in ProcFS was making me unable to read/write from `/proc/sys/XXX`. Some directories in the ProcFS are not actually backed by a process and need to return `nullptr` so callbacks get properly set. We now do an explicit check for the parent to ensure it's one that is PID-based.
2021-05-02Meta: Add a post-commit commit message linter hookIdan Horowitz
This should help with getting commit messages tidy before they pass through CI's commit linter :^) For this hook to work pre-commit has to be explicitly installed via: `pre-commit install --hook-type commit-msg`
2021-05-02Kernel: Remove outdated UBSan commentsHendiadyoin1
The triple-fault issue has long been fixed
2021-05-02LibGUI+HackStudio: Remove editing specific hacks from GUI::CommandAndreas Kling
Use is<T> to check for specific types of command in HackStudio instead of cluttering up GUI::Command with specialized getters.
2021-05-02WindowServer+Base: Show alternate close button for "modified" windowsAndreas Kling
Windows that are marked as modified will now have another (themable) close button. This gives an additional visual clue that some action will be required by the user before the window gets closed. The default window-close-modified icon is an "X" with "..." underneath, building on the established use of "..." in menus to signify that additional user input will be required before an action is completed.
2021-05-02WindowServer: Minor tweaks to Window.hAndreas Kling
2021-05-02LibC: Implement scandir(...) to enumerate directories.Brian Gianforcaro
I ran into a need for this when running stress-ng against the system. This change implements the full functionality of scandir, where it accepts a selection callback, as well as a comparison callback. These can be used to trim and sort the entries from the directory that we are being asked to enumerate. A test was also included to validate the new functionality.
2021-05-02LibC: Fix bugs in the population of dirent members.Brian Gianforcaro
While adding new functionality which used the d_reclen member to copy a dirent, I realized that the value being populated was incorrect. sys_ent::total_size() function calculates the size of the sys_ent structure, but dirent is larger than sys_ent. This causes the malloc to be too small and you end up missing the end of the copy, which can miss the null terminator resulting in corrupt dirent names. Since we don't actually use the variable length member nature of dirent on other platforms we can just use the full size of the struct ad the d_reclen value. Also replace the custom strcpy with the standard version.
2021-05-02Kernel: Change Inode::{read/write}_bytes interface to KResultOr<ssize_t>Brian Gianforcaro
The error handling in all these cases was still using the old style negative values to indicate errors. We have a nicer solution for this now with KResultOr<T>. This change switches the interface and then all implementers to use the new style.
2021-05-02LibIPC: Make sure FDs survive when passed into a MessageBufferGunnar Beutner
2021-05-02WindowServer+LibGUI+Taskbar: Store window progress as Optional<int>Andreas Kling
We were previously using the magical constant -1 to signify that a window had no progress state. Be more explicit an use an Optional. :^)