Commit graph

15831 commits

Author SHA1 Message Date
Andreas Kling
4fa8435310 Kernel: Use current process EUID in doing profiling access control 2021-01-12 23:34:01 +01:00
Andreas Kling
1a08ac72ad LibC+Everywhere: Remove open_with_path_length() in favor of open()
This API was a mostly gratuitous deviation from POSIX that gave up some
portability in exchange for avoiding the occasional strlen().

I don't think that was actually achieving anything valuable, so let's
just chill out and have the same open() API as everyone else. :^)
2021-01-12 23:34:01 +01:00
Nico Weber
d551263b11 LibGfx: Make it possible to apply an (integer) scale to a Painter
This adds a scale factor to Painter, which will be used for HighDPI
support. It's also a step towards general affine transforms on Painters.

All of Painter's public API takes logical coordinates, while some
internals deal with physical coordinates now. If scale == 1, logical
and physical coordinates are the same. For scale == 2, a 200x100 bitmap
would be covered by a logical {0, 0, 100, 50} rect, while its physical
size would be {0, 0, 200, 100}.

Most of Painter's functions just assert that scale() == 1 is for now,
but most functions called by WindowServer are updated to handle
arbitrary (integer) scale.

Also add a new Demo "LibGfxScaleDemo" that covers the converted
functions and that can be used to iteratively add scaling support
to more functions.

To make Painter's interface deal with logical coordinates only,
make translation() and clip_rect() non-public.
2021-01-12 23:32:54 +01:00
Linus Groh
545b4879e4 LibGfx: Make Painter::draw_pixel() with thickness = 1 work with RGBA
The underlying fill_rect() works correctly, but the special case for
thickness = 1 was not blending the new color with the target pixel's
color, causing RGBA colors to be painted as their RGB counterpart.
2021-01-12 21:41:14 +01:00
Nico Weber
dc34ecf394 Docs: Add design doc and implementation plan for highdpi
I have a local branch that gets us past implementation stage 1
in this doc, and it seems like a useful enough checkpoint to
upstream it and then iterate in tree.
2021-01-12 20:44:42 +01:00
AnotherTest
a90905c54c Shell: Use lstat instead of access to check if glob target exists
Fixes #4905
2021-01-12 16:23:26 +01:00
AnotherTest
b2b3ccb12d LibCore: Don't create an RPC server when built for lagom
There's no reason to have this, and it will most likely fail anyway
(since there's likely no /tmp/rpc).
2021-01-12 16:21:34 +01:00
Andreas Kling
096d2d5071 Ports: Remove some no-longer-needed patches for git :^)
We can mmap files with MAP_PRIVATE these days.
2021-01-12 13:50:39 +01:00
Andreas Kling
f2a6ee76c0 LibPthread: Add pthread_equal() 2021-01-12 13:42:45 +01:00
Andreas Kling
bee1145bdf LibPthread: Stub pthread_setcancelstate() and pthread_setcanceltype() 2021-01-12 13:40:48 +01:00
Andreas Kling
51a2d3c1fa Libraries: Remove LibUnwind
This was not used for anything.
2021-01-12 13:32:34 +01:00
Andreas Kling
aea2eac3d1 HexEditor: Hide unnecessary scrollbars in the main file view 2021-01-12 13:31:32 +01:00
Andreas Kling
affcdafc8d Lagom: Add Userland/ to include paths
This should make FuzzShell build.
2021-01-12 13:28:00 +01:00
Andreas Kling
20a18d2137 Demos: Remove HelloWorld demo 2021-01-12 13:17:00 +01:00
Andreas Kling
c7ac7e6eaf Services: Move to Userland/Services/ 2021-01-12 12:23:01 +01:00
Andreas Kling
4055b03291 DevTools: Move to Userland/DevTools/ 2021-01-12 12:18:55 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Andreas Kling
dc28c07fa5 Applications: Move to Userland/Applications/ 2021-01-12 12:05:23 +01:00
Andreas Kling
aa939c4b4b Games: Move to Userland/Games/ 2021-01-12 12:04:23 +01:00
Andreas Kling
b8d6a56fa3 MenuApplets: Move to Userland/MenuApplets/ 2021-01-12 12:04:20 +01:00
Andreas Kling
7fc079bd86 Demos: Move to Userland/Demos/ 2021-01-12 12:04:17 +01:00
Andreas Kling
ececac65c2 Userland: Move command-line utilities to Userland/Utilities/ 2021-01-12 12:04:09 +01:00
Andreas Kling
c4e2fd8123 Shell: Move to Userland/Shell/ 2021-01-12 12:04:07 +01:00
Andreas Kling
07c7e35372 Demos: Remove "DynamicLink" and "DynamicObject"
The whole system builds & runs with dynamic linking now, so we don't
really need these little test apps anymore.
2021-01-12 11:42:47 +01:00
Andreas Kling
76b5869bf4 Demos: Remove "WebView" demo
This was useful while originally bringing up OOPWV, but now we can
simply use "Browser -m" for testing it.
2021-01-12 11:40:31 +01:00
Andreas Kling
52b05a08c7 LibCrypto: Reduce use of ByteBuffer in AES code
Use Bytes/ReadonlyBytes more where possible.
2021-01-12 09:34:04 +01:00
Lenny Maiorani
e6f907a155 AK: Simplify constructors and conversions from nullptr_t
Problem:
- Many constructors are defined as `{}` rather than using the ` =
  default` compiler-provided constructor.
- Some types provide an implicit conversion operator from `nullptr_t`
  instead of requiring the caller to default construct. This violates
  the C++ Core Guidelines suggestion to declare single-argument
  constructors explicit
  (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit).

Solution:
- Change default constructors to use the compiler-provided default
  constructor.
- Remove implicit conversion operators from `nullptr_t` and change
  usage to enforce type consistency without conversion.
2021-01-12 09:11:45 +01:00
Emanuele Torre
9dc44bf8c4 wc: Remove a memory leak. 2021-01-12 09:01:21 +01:00
Emanuele Torre
dcd259a100 wc: printf(), fprintf(stderr, ...) -> out(), outln(), warnln().
Problem:
- We were using some incorrect format strings in printf-functions:
 * "%7lu" to print `size_t` values instead of "%7zu";
 * "%7i" to print `unsigned int` values instead of "%7u".

Solution:
- Use out(), outln() and warnln() instead of printf-functions. :^)
2021-01-12 09:01:21 +01:00
Emanuele Torre
725eb702b7 wc: Fix code style.
`unsigned int` -> `unsigned`.
Use brace initialisers instead of equal initialisers for struct members.
Prefix global variables with `g_`.
Wrap multi-line statements in curly braces.

Also:
Use const references instead of references when possible.
Rename `file_name` to `file_specifier`: "-" is not a file name.
Rename `files` to `file_specifiers`.
Avoid some useless checks.
2021-01-12 09:01:21 +01:00
Brendan Coles
24d6814ee5 CatDog: Add pledge() and lock unveil state 2021-01-12 08:59:39 +01:00
Brendan Coles
959970e060 userdel: Use pledge() and unveil() 2021-01-12 08:59:24 +01:00
Brendan Coles
eece9edd91 useradd: Use pledge() 2021-01-12 08:58:59 +01:00
Nick Vella
eeffdb9725 FileManager: Show location bar on breadcrumb bar double-click. 2021-01-12 08:58:49 +01:00
Nick Vella
4b3c61fad8 LibGUI: Add 'on_doubleclick' event to BreadcrumbBar. 2021-01-12 08:58:49 +01:00
Andreas Kling
254312aa22 Revert "Themes: Tweak "Sunshine" theme colors slightly"
This reverts commit 0ae9ae48fa.

@bcoles informs me that these match Solaris 9 and it checks out.
I don't know what version I was comparing against, and who cares?
2021-01-12 08:49:18 +01:00
Andreas Kling
6412e7e8e3 Kernel: Remove /proc/mounts
Everyone was already using /proc/df which has all the info anyway.
2021-01-11 23:00:07 +01:00
Andreas Kling
9b907e27ce Kernel: Remove /proc/inodes
There was nothing interesting in this file.
2021-01-11 22:51:28 +01:00
Andreas Kling
a0506cb39e Kernel: Only send SIGTTOU if TTY termios has TOSTOP flag
Fixes #4909
2021-01-11 22:40:40 +01:00
Andreas Kling
e5234f9560 strace: Use pledge() 2021-01-11 22:36:09 +01:00
Andreas Kling
f03800cee3 Kernel: Add dedicated "ptrace" pledge promise
The vast majority of programs don't ever need to use sys$ptrace(),
and it seems like a high-value system call to prevent a compromised
process from using.

This patch moves sys$ptrace() from the "proc" promise to its own,
new "ptrace" promise and updates the affected apps.
2021-01-11 22:32:59 +01:00
Andreas Kling
127ce32d9e LibGfx: Adjust margin between window title/stripes by 1px
This makes it symmetrical with the margin between window icon/title.
2021-01-11 22:15:09 +01:00
Andreas Kling
f7435dd95f Kernel: Remove MM_DEBUG debug spam code
This was too spammy to ever actually be used anyway.
2021-01-11 22:09:40 +01:00
Andreas Kling
7c4ddecacb Kernel: Convert a bunch of String::format() => String::formatted() 2021-01-11 22:07:01 +01:00
Andreas Kling
0ae9ae48fa Themes: Tweak "Sunshine" theme colors slightly
Bring them a little closer to the original CDE colors. :^)
2021-01-11 21:49:39 +01:00
asynts
843ebbd2c3 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-11 21:49:29 +01:00
asynts
6fa42af567 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.

The modifications in this commit were automatically made using the
following command:

    find . -name '*.h' -exec sed -i -E 's/dbg\(\) << ("[^"{]*");/dbgln\(\1\);/' {} \;
2021-01-11 21:49:29 +01:00
asynts
a410bb8fd5 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-11 21:49:29 +01:00
AnotherTest
510030971b LibLine: Handle history across multiple concurrent sessions better
- Store history entries as (timestamp)::(entry)\n\n
- Merge the entries together when saving to avoid loss of history
  entries

To ideally make having two concurrently open shells
(or `js` repls or whatever) not overwrite each others' history entries.
2021-01-11 21:09:36 +01:00
AnotherTest
711ced80c0 LibCore: Add line iterators to IODevice 2021-01-11 21:09:36 +01:00