Commit Graph

87 Commits

Author SHA1 Message Date
Linus Groh
421587c15c Everywhere: Fix typos 2021-01-22 18:41:29 +01:00
Jonathan Turner
0bf5669ba3
Meta: Get building on NixOS (#5005) 2021-01-22 17:44:05 +01:00
Ben Wiederhake
7980268b7b Meta: Document QtCreator 'lic' auto-complete 2021-01-22 11:28:07 +01:00
Nico Weber
98637bd549 WindowServer: In HighDPI mode, load high-res window buttons and high-res cursors
Bitmap::load_from_file("foo.png", 2) will now look for "foo-2x.png" and
try load that as a bitmap with scale factor 2 if it exists. If it
doesn't, it falls back to the 1x bitmap as normal.
Only places that know that they'll draw the bitmap to a 2x painter
should pass "2" for the second argument.

Use this new API in WindowServer for loading window buttons and
cursors.

As a testing aid, ctrl-shift-super-i can force HighDPI icons off in
HighDPI mode. Toggling between low-res and high-res icons makes it easy
to see if the high-res version of an icon looks right: It should look
like the low-res version, just less jaggy.

We'll likely have to grow a better API for loading scaled resources, but
for now this suffices.

Things to check:
- `chres 640 480` followed by `chres 640 480 2` followed by
  `chres 640 480`
- window buttons in window context menu (in task bar and on title bar)
  still have low-res icons
- ctrl-shift-super-i in high-res mode toggles sharpness of window
  buttons and of arrow cursorf
- arrow cursor hotspot is still where you'd expect
2021-01-20 10:28:27 +01:00
Nico Weber
5f9c42c404 LibGfx: Give Bitmap a scale factor
Gfx::Bitmap can now store its scale factor. Normally it's 1, but
in high dpi mode it can be 2.

If a Bitmap with a scale factor of 2 is blitted to a Painter with
scale factor of 2, the pixels can be copied over without any resampling.
(When blitting a Bitmap with a scale factor of 1 to a Painter with scale
factor of 2, the Bitmap is painted at twice its width and height at
paint time. Blitting a Bitmap with a scale factor of 2 to a Painter with
scale factor 1 is not supported.)

A Bitmap with scale factor of 2 reports the same width() and height() as
one with scale factor 1. That's important because many places in the
codebase use a bitmap's width() and height() to layout Widgets, and all
widget coordinates are in logical coordinates as well, per
Documentation/HighDPI.md.

Bitmap grows physical_width() / physical_height() to access the actual
pixel size. Update a few callers that work with pixels to call this
instead.

Make Painter's constructor take its scale factor from the target bitmap
that's passed in, and update its various blit() methods to handle
blitting a 2x bitmap to a 2x painter. This allows removing some gnarly
code in Compositor. (In return, put some new gnarly code in
LibGfxScaleDemo to preserve behavior there.)

No intended behavior change.
2021-01-20 10:28:27 +01:00
Nico Weber
b1c640a956 Docs: Start outlining options for highdpi resource handling 2021-01-19 16:48:21 +01:00
Andrew Thurman
6d20b54b09
Documentation: Add patch to fedora build deps (#4968) 2021-01-17 08:08:11 +01:00
Nico Weber
f37f281f89 DisplaySettings: Add UI for switching the scale factor
For now, only support 1x and 2x scale.

I tried doing something "smarter" first where the UI would try
to keep the physical resolution constant when toggling between
1x and 2x, but many of the smaller 1x resolutions map to 2x
logical resolutions that Compositor rejects (e.g. 1024x768 becomes
512x384, which is less than the minimum 640x480 that Compositor
wants) and it felt complicated and overly magical.

So this instead just gives you a 1x/2x toggle and a dropdown
with logical (!) resolutions. That is, 800x600 @ 2x gives you
a physical resolution of 1600x1200.

If we don't like this after trying it for a while, we can change
the UI then.
2021-01-17 08:06:12 +01:00
Ben Wiederhake
b3d04b3a3c Documentation: Make serenity.includes more easily copyable 2021-01-15 21:51:19 +01:00
Ben Wiederhake
7562cf5157 Documentation: Recommend ninja by default 2021-01-15 21:51:19 +01:00
Nico Weber
e87b8a79ed WindowServer: Make HighDPI aware
Almost all logic stays in "logical" (unscaled coordinates), which
means the patch is small and things like DnD, window moving and
resizing, menu handling, menuapplets, etc all work without changes.

Screen knows about phyiscal coordinates and mouse handling internally is
in physical coordinates (so that two 1 pixel movements in succession can
translate to one 1 logical coordinate mouse movement -- only a single
event is sent in this case, on the 2nd moved pixel).

Compositor also knows about physical pixels for its backbuffers. This is
a temporary state -- in a follow-up, I'll try to let Bitmaps know about
their intrinsic scale, then Compositor won't have to know about pixels
any longer. Most of Compositor's logic stays in view units, just
blitting to and from back buffers and the cursor save buffer has to be
done in pixels. The back buffer Painter gets a scale applied which
transparently handles all drawing. (But since the backbuffer and cursor
save buffer are also HighDPI, they currently need to be drawn using a
hack temporary unscaled Painter object. This will also go away once
Bitmaps know about their intrinsic scale.)

With this, editing WindowServer.ini to say

  Width=800
  Height=600
  ScaleFactor=2

and booting brings up a fully-functional HighDPI UI.
(Except for minimizing windows, which will crash the window server
until #4932 is merged. And I didn't test the window switcher since the
win-tab shortcut doesn't work on my system.) It's all pixel-scaled,
but it looks pretty decent :^)
2021-01-15 19:10:16 +01:00
bcoles
8e6c320af1 Documentation: UsingQtCreator: Include Userland in includes paths 2021-01-14 16:19:53 +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
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
Linus Groh
fb220d5678 Meta+Docs+CI: Require clang-format >= 11 2020-12-31 21:51:00 +01:00
Peter Nelson
d014277973 Docs: Update WSL notes with some workarounds for known issues 2020-12-30 20:31:30 +01:00
meme
23b23cee5a Build: Support non-i686 toolchains
* Add SERENITY_ARCH option to CMake for selecting the target toolchain
* Port all build scripts but continue to use i686
* Update GitHub Actions cache to include BuildIt.sh
2020-12-29 17:42:04 +01:00
Nathan Lanza
33834090bb
Documentation: Update macOS build instructions cask invocation (#4561)
brew deprecated `brew cask` and requires `brew install --cask` instead
2020-12-27 01:18:15 +01:00
Dan MacDonald
277c44c2dc Meta: Update install guide with link to hardware compatibility list 2020-12-24 11:02:43 +01:00
Dan MacDonald
00dc615d53 Meta: Add Hardware Compatbility List 2020-12-16 17:30:09 +01:00
Dan MacDonald
0e8702c310 Meta: Update bare metal installation guide 2020-12-11 09:35:24 +01:00
Linus Groh
2c9e6585f8 Documentation: Update required GCC version to >= 10
I initially thought as long as Lagom is not built >= 9 would be fine,
but LagomCore is always built for the code generators.
2020-11-07 18:22:18 +01:00
Andreas Kling
69a015cd9a Documentation: Remove outdated comment about global git identity
This was used by the toolchain build script at one point but is now
only used when running BuildIt.sh with --dev.
2020-10-18 20:33:02 +02:00
Andreas Kling
57c2da1f86 Documentation: Remove "flock" from dependencies
The build system no longer uses "flock", so stop telling people they
need to install it.
2020-10-18 20:33:02 +02:00
Andreas Kling
75d5f436bc Toolchain: Upgrade to GCC 10.2.0 2020-10-12 19:53:25 +02:00
Linus Groh
bcfc6f0c57 Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
zilrich
a2ffe95a8c
Meta: Update OpenSUSE build dependencies (#3655) 2020-10-02 13:08:06 +02:00
Robbe De Greef
fd7a2278b9 Documentation: Debian gcc-9 installation instructions
We already have installation instructions for ubuntu but not yet for
Debian. Gcc-9 is not available on Debian stable so instructions for
switching to and from Debian testing are added.
2020-09-26 17:16:53 +02:00
Robbe De Greef
926fb3ff48 Documentation: Serenity requires GCC 9 or higher
Gcc 8.3.0 (which is the current version in debian 10 stable) seems to
fail at building AK. New people might get stuck when they try to run
make inside the ./Build folder and fail at building serenity.
2020-09-26 17:16:53 +02:00
Jakob-Niklas See
86d230ab5f Documentation: Fixed minor typo in UsingQtCreator 2020-09-07 16:53:29 +02:00
Luke
9b9c752dbe Documentation: Add Windows section in build instructions
It seems that new people go to the build instructions from the main
README, don't see Windows and are then stuck.

We do have instructions for Windows, but they aren't noted in the build
instructions, so new people get stuck thinking there's no way to build
on Windows.
2020-09-03 11:03:34 +02:00
Sergio Ahumada
647f3b87bd Documentation: Update BuildInstructions.md
Add missing `cmake ..' line before compiling with make
2020-08-25 09:36:56 +02:00
Ben Wiederhake
1176865276 Meta: Explain how to build with ninja
Inspired by #3047, and my struggles to understand how cmake is supposed to work ^^

Thanks to @bgianfo, who made me realize that ninja can be used just like make.
No idea why I didn't notice that earlier.
2020-08-17 23:05:55 +02:00
Andreas Kling
b6e18133ae LibWeb: Rename WebContentView => OutOfProcessWebView 2020-08-17 18:05:35 +02:00
Ben Wiederhake
7a8c72d136 Meta: Document QtCreator auto-format and compiler kits 2020-08-15 20:48:52 +02:00
Peter Nelson
e36fce9cfc Docs: explain how to enable QEMU hardware acceleration on Windows
Describes how to enable QEMU hardware acceleration on Windows using the
Windows Hypervisor Platform feature.
2020-08-14 15:09:59 +02:00
Peter Nelson
d00df4e721 Docs: clarify steps to use Windows-native QEMU when building under WSL
This now descibes how to get the regular `make run` workflow to work
under Windows using native QEMU. It describes how to override the QEMU
binary path, as well as overriding the SerenityOS disk image file
location with a native Windows path.

Also fixes some minor spelling and punctuation issues.
2020-08-14 15:09:59 +02:00
Andrew Mbugua
1f7190d3bd
Meta: Fix typo in NotesOnWSL.md (#3086) 2020-08-11 14:27:00 +02:00
Valtteri Koskivuori
c1f633e1ee Documentation: Add a mention of the recent requirement for a newer
host compiler. On macOS this might have to be specified explicitly.
2020-08-07 09:07:10 +02:00
Valtteri Koskivuori
b4a29113e4 Documentation: Add a guide for setting up Qt Creator
This was already in video form, but I figured it might be nice to
have this here as well, to make it easier to discover.
2020-08-06 10:22:14 +02:00
Luke
f71b112530 Documentation: Add an installation guide for VirtualBox
Now that Serenity can run on VirtualBox, it's time for the documentation.
2020-08-05 10:52:48 +02:00
Paul Scharnofske
fbc54a2dba Documentation: Only install missing packages for Arch Linux.
By default `pacman -S` will reinstall all the packages that are already installed on the system.
2020-07-26 17:48:24 +02:00
Dominik M. Kwiatek
782cd93c01
Meta: Add openSUSE dependencies to build documentation (#2801) 2020-07-15 00:06:16 +02:00
Andreas Kling
1037a24076 Documentation: Add note about DNS lookups to browser architecture docs 2020-07-06 18:41:41 +02:00
Andreas Kling
d897940e02 Documentation: Add a document about the Browser process architecture 2020-07-06 16:17:43 +02:00
Petr Akhlamov
188c83328f
Meta: Add ALT Linux packages to BuildInstructions.md (#2688) 2020-07-04 10:51:16 +02:00
Andrew Kaster
4f71bd54a7 Documentation: Add filesystem note to WSL2 notes
WSL2 is now available in non-insider builds of Windows, starting
with version 2004.

Add a filesystem note regarding use of /mnt/c et al from WSL2 for
compiling serenity. Namely, recommend against it as the performance
across the 9p file system protocol is terrible for IO heavy jobs.
2020-06-28 00:06:27 +02:00
Emanuele Torre
e42f4abd61 Meta: tweak build-image-grub.sh to allow running make grub-image..
without sudo.
2020-06-21 10:13:04 +02:00
Érico Nogueira Rolim
fef9ad520b
Toolchain: Use curl instead of wget (#2574)
- For Linux: curl is already listed as a dependency;
- For macOS: curl is pre-installed;
- For OpenBSD and FreeBSD: curl is a dependecy of git.
2020-06-18 16:31:12 +02:00
Ewan
0609a85166 Docs: Correct wording on CMake downloads 2020-06-17 15:08:47 +02:00