summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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. :^)
2021-05-02TextEditor: Specify the starting line and column number using colonsry755
This allows the user to specify a specific line and column number to start at when opening a file in TextEditor through the terminal, by adding a colon after the file name. For example, `TextEditor ReadMe.md:10:5` will open ReadMe.md and put the cursor on line 10 at column 5. To ensure that the user isn't trying to open a file that actually has colons in its name, it checks if the file exists before parsing. Replaces the feature added in b474f4916479fbf64e6fb5a66cb25b8496e153b3 Closes #5589
2021-05-02LaunchServer: Actually seal the allow-list on SealAllowListAndreas Kling
Fixes #6804.
2021-05-02Userland: Make IPC handlers return void if they don't have any outputsGunnar Beutner
2021-05-02Userland: Get rid of the OwnPtr<...> boilerplate code for IPC handlersGunnar Beutner
2021-05-02HackStudio: Use common copy functions in ProjectTemplate.cppValtteri Koskivuori
This removes the duplicated copy logic and uses the ones from Core::File instead.
2021-05-01Ports: Fix hatari install stepLinus Groh
Fixes #6798.
2021-05-01Kernel: Don't use ref_count() in MasterPTY::close()Gunnar Beutner
With the recent fixes to how close() gets called this is not necessary anymore.
2021-05-01Ports: Fix building libpuffyGunnar Beutner
2021-05-01Everywhere: Turn #if *_DEBUG into dbgln_if/if constexprGunnar Beutner
2021-05-01PixelPaint: Add fill mode for the ellipse toolValtteri Koskivuori
Functionality was already there, just had to hook it up!
2021-05-01Kernel: Handle both shift keys being pressed and then releasedIdan Horowitz
Our current implementation does not work in the special case in which both shift keys are pressed, and then only one of the keys is released, as this would result in writing lower case letters, instead of the expected upper case letters. This commit fixes that by keeping track of the amount of shift keys that are pressed (instead of if any are at all), and only switching to the unshifted keymap once all of them are released.
2021-05-01Userland: Improve how traceroute reports timing data for packetsGunnar Beutner
Previously we'd include the time required to do DNS resolution in the time we'd report for traceroute packets. This would skew the times reported.
2021-05-01Meta: Remove trailing whitespace from ro.jsonLinus Groh
This fixes the CI linting step.
2021-05-01Kernel: Make processes start with a 16-byte-aligned stackSahan Fernando
2021-05-01Kernel: Make sure we read all packetsGunnar Beutner
The previous patch already helped with this, however my idea of only reading a few packets didn't work and we'd still sometimes end up not receiving any more packets from the E1000 interface. With this patch applied my NIC seems to receive packets just fine, at least for now.
2021-05-01Keymap: Added Romanian layoutxSlendiX
2021-05-01Kernel: Expose minor device numbers for keyboard and mouseValtteri Koskivuori
A fix for two FIXMEs, and paving the way for multi-keyboard/mouse support, I guess.
2021-05-01LibGUI: Improve a FIXME comment in TextDocumentAndreas Kling
2021-05-01TextEditor: Make sure to mark the Window as unmodified after savingAndreas Kling
This comes with a FIXME, as it would be nicer if this information would propagate from TextDocument all the way out somehow.
2021-05-01TextEditor: Use an automatic "modified" marker in the window titleAndreas Kling
This simplifies the application somewhat as we no longer need to manually update the window title whenever the text document changes.
2021-05-01WindowServer+LibGfx: Automatic "modified" markers in window titlesAndreas Kling
You can now add the string "[*]" to a window title and it will be replaced with " (*)" if the window is modified, and with "" otherwise.
2021-05-01TextEditor: Plumb modified state from GUI::TextDocument to GUI::WindowAndreas Kling
Instead of tracking this stuff ourselves at the application level, we now just act as an intermediary and pass along the information to the windowing system.
2021-05-01LibGUI: Track modified state in GUI::TextDocumentAndreas Kling
Until now, this has been hackishly tracked by the TextEditor app's main widget. Let's do it in GUI::TextDocument instead, so that anyone who uses this class can know whether it's modified or not.
2021-05-01TextEditor: Add some missing curly braces around a nested if statementAndreas Kling
2021-05-01TextEditor: Remove some unnecessary #include statementsAndreas Kling
2021-05-01TextEditor: Rename TextEditorWidget => TextEditor::MainWidgetAndreas Kling
2021-05-01LibGUI: Add getter/setter for GUI::Window modified stateAndreas Kling
This state lives in WindowServer and has no local copy in the client process for now. This may turn out to be a performance issue, and if it does we can easily cache it.
2021-05-01WindowServer: Add Window "modified" stateAndreas Kling
This will be used to track which windows contain some kind of unsaved data that the user may want some help remembering to save. :^)
2021-05-01Lagom/Fuzzers: Add fuzzers for Windows-1251 and Windows-1255 decodersIdan Horowitz
2021-05-01LibTextCodec: Implement a Windows-1251 decoderIdan Horowitz
This encoding (a superset of ascii that adds in the cyrillic alphabet) is currently the third most used encoding on the web, and because cyrillic glyphs were added by Dmitrii Trifonov recently, we can now support it as well :^)
2021-05-01Everywhere: Rename app_menu to file_menu or game_menuAndreas Kling