Commit graph

19642 commits

Author SHA1 Message Date
Gunnar Beutner
3b759451c6 LibC: setspent() should not print to stderr 2021-05-04 13:45:49 +01:00
Gunnar Beutner
3cab91e8d7 LibCore: Let Account::from_* succeed if /etc/shadow is unreadable
This previously worked and was broken by 302f9798e.
2021-05-04 13:45:49 +01:00
Andreas Kling
19bef3877a Profiler: Don't link against LibCoreDump 2021-05-04 14:38:43 +02:00
Andreas Kling
f7de453716 LibGUI: Rename ScrollableWidget.cpp => AbstractScrollableWidget.cpp 2021-05-04 14:38:43 +02:00
Brian Gianforcaro
cc94495a29 Profiler: Print addresses in debug log in hex. 2021-05-04 10:57:55 +02:00
Brian Gianforcaro
35bb8ab4db Kernel: Return one kernel frame from procfs$tid_stack for normal users.
Previously we would return a 0xdeadc0de frame for every kernel frame
in the real kernel stack when an non super-user issued the request.
This isn't useful, and just produces visual clutter in tools which
attempt to symbolize stacks.
2021-05-04 10:57:39 +02:00
Brian Gianforcaro
869becc944 Kernel: Remove unused function ProcFS::add_sys_string 2021-05-04 10:57:39 +02:00
Brian Gianforcaro
9b5c137f46 Kernel: Remove unused header includes from ProcFS.cpp 2021-05-04 10:57:39 +02:00
Gunnar Beutner
a3baf06549 WindowServer: Ignore mouse clicks we're not handling
This ignores unhandled mouse clicks for the window buttons. Right now
right-clicking on the window buttons animates them as if some action
were to occur when the mouse button is released.
2021-05-04 08:40:00 +02:00
Linus Groh
aa70a56174 LibGUI: Fix off-by-one in Scrollbar::scrubber_rect()
Recent changes in the button painting code made this unnecessary. For
the case of value() == max(), the scrubber button would overlap the
increment button.

Fixes #6838.
2021-05-03 22:22:53 +01:00
Linus Groh
0c1d1d97d5 LibGUI: Remove unused Scrollbar::{de,in}crement_gutter_rect() 2021-05-03 22:21:21 +01:00
Andreas Kling
1ee31981da WindowServer: Close any open menus when starting window move/resize 2021-05-03 23:13:02 +02:00
J-VdS
396ff6401f
Meta: Add Discord badge to README.md (#6839)
Add a Discord badge to the top of the README.md file. It will show
the number of online users in the Discord server. If clicked it will
redirect you to the invite page.
2021-05-03 23:03:57 +02:00
Andreas Kling
1aa56f0129 WindowServer+LibGUI: Make much of window construction asynchronous
Most of the IPC that happens between clients and WindowServer when
creating and configuring windows can be asynchronous. This further
reduces the amount of ping-ponging played during application startup.
2021-05-03 21:56:19 +02:00
Andreas Kling
a8a899adbf WindowServer+LibGUI: Make much of menu construction asynchronous
Creating a menu/menubar needs to be synchronous because we need the
ID from the response, but adding stuff *to* menus (and adding menus
to menubars, and menubars to windows) can all be asynchronous.

This dramatically reduces the amount of IPC ping-pong played by
each GUI application during startup.

I measured how long it takes TextEditor to enter the main event loop
and it's over 10% faster here. (Down from ~86ms to ~74ms)
2021-05-03 21:56:13 +02:00
Gunnar Beutner
8a6db55e79 Userland: Add try_* IPC handlers
This enables calling auto-generated IPC methods in a way that doesn't
crash the client if the peer disconnects.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
34cf5cf07f IPCCompiler: Don't generate handlers for response messages
For some reason we had IPC handler methods for the return types. This
removes those handlers.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
9e22e9ce88 Userland: Use snake case names in .ipc files
This updates all .ipc files to have snake case names for IPC methods.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
eb21aa65d1 Userland: Make IPC results with one return value available directly
This changes client methods so that they return the IPC response's
return value directly - instead of the response struct - for IPC
methods which only have a single return value.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
5bb79ea0a7 Userland: Update IPC calls to use proxies
This updates all existing code to use the auto-generated client
methods instead of post_message/send_sync.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
78803ce384 Userland: Split IPC endpoints into proxies and stubs
This enables support for automatically generating client methods.
With this added the user gets code completion support for all
IPC methods which are available on a connection object.
2021-05-03 21:14:06 +02:00
Gunnar Beutner
065040872f Userland: Change IPC funcs to use plain arguments instead of a struct
Instead of having a single overloaded handle method each method gets
its own unique method name now.
2021-05-03 21:14:06 +02:00
Andreas Kling
d47f15ab8b LibGUI: Rename ScrollableWidget => AbstractScrollableWidget 2021-05-03 21:03:13 +02:00
Andreas Kling
62125796c3 Minesweeper: Tweak main UI layout a little bit
Move the clock/flag icons closer to their respective text labels.
2021-05-03 18:07:35 +02:00
Andreas Kling
6e4e3cefb2 Minesweeper: Add a tasteful separator line between menubar and UI 2021-05-03 17:08:28 +02:00
Andreas Kling
381dcca2f6 Revert "LibGfx: Add directional floating-point scaling to Painter"
This reverts commit ff76a5b8d2.
2021-05-03 16:37:05 +02:00
Andreas Kling
f43adb816e Revert "LibGfx: Re-add missing bounds-checks to Painter::draw_rect"
This reverts commit 4cf5514672.
2021-05-03 16:36:57 +02:00
Brian Gianforcaro
4bf9b399f7 Kernel: Remove unused header includes from various files.
Found while browsing code with CLion.
2021-05-03 16:03:17 +02:00
Brian Gianforcaro
65138171f9 Kernel: Mark AsyncBlockDeviceRequest + AnonymousVMObject as final
Mark final to aid in de-virtualization since they are not currently
derived from.
2021-05-03 16:03:17 +02:00
Brian Gianforcaro
f1c4a42840 Documentation: Add a note about excluding the Build directory in CLion
This was discussed a while back on discord, but no one got around to
writing it down yet.
2021-05-03 15:20:26 +02:00
Brian Gianforcaro
0726d39cb1 LibC: Fix invalid 1-byte read I introduced in dirent.
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-03 09:47:05 +02:00
spigwitmer
3a5f9b2f7e LibDebug: add DW_LNS_set_basic_block support
This adds support for the basic_block register to the Dwarf line
number state machine.
2021-05-03 09:01:14 +02:00
Paul Berg
bd68ca362b TextEditor: Clear the selection before deleting it
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-03 08:45:32 +02:00
Carlos César Neves Enumo
97d0028098 LibGUI: Debounce TextDocument undo stack
This replaces the repeating 2-sec timer with a debounced single-shot
timer on user input.
2021-05-03 08:43:10 +02:00
Gunnar Beutner
824bfa9600 DynamicLoader: Fix compiler warning
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-03 08:42:39 +02:00
Gunnar Beutner
56ee4a1af2 AK: Silence -Wmaybe-uninitialized warning
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-03 08:42:39 +02:00
Gunnar Beutner
d685db6eb6 Toolchain: Enable building all code with -fPIC
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-03 08:42:39 +02:00
Gunnar Beutner
a050b43290 LibELF: Implement x86_64 relocation support
There are definitely some relocations missing and this is untested
for now.
2021-05-03 08:42:39 +02:00
Gunnar Beutner
6990ab41c8 Kernel: Fix some 64-bit portability issues 2021-05-03 08:42:39 +02:00
Gunnar Beutner
b613817bca Userland: Fix 64-bit portability issues 2021-05-03 08:42:39 +02:00
Gunnar Beutner
fdbe66a7b4 LibELF+LibC: Support building LibELF for 64-bit targets 2021-05-03 08:42:39 +02:00
Gunnar Beutner
e468bf08b1 UserspaceEmulator: Make sure TLS allocation behavior matches kernel 2021-05-03 08:25:44 +02:00
Gunnar Beutner
92cc8a47dd UserspaceEmulator: Add missing argument for sys$allocate_tls 2021-05-03 08:25:44 +02:00
Gunnar Beutner
ce0c76dcb5 UserspaceEmulator: Add stub for sys$futex 2021-05-03 08:25:44 +02:00
Luke
8b5ea01cfb LibWeb: Use node_to_insert instead of node in Node::insert_before
It was using the passed in node instead of the node from the vector.
Fixes a crash I found while testing jQuery.
2021-05-03 08:20:02 +02:00
Matthew Olsson
4cf5514672 LibGfx: Re-add missing bounds-checks to Painter::draw_rect
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-03 08:19:39 +02:00
Luke
8bafbdddc6 LibWeb: Expose Node.ownerDocument
Required by jQuery.
2021-05-02 22:51:46 +02:00
Itamar
329cb134d6 HackStudio: Show dialog on build and exit if there are unsaved changes
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-02 22:49:25 +02:00
Itamar
672b14b70d HackStudio: Add a "document dirty" indicator to the EditorWrapper 2021-05-02 22:49:25 +02:00
Itamar
7f2e1991cc HackStudio: Get rid of m_currently_open_file member
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-02 22:49:25 +02:00