gtk4.git
2 years agosortlistmodel: add a fast path for get_section()
Benjamin Otte [Sat, 19 Feb 2022 02:39:13 +0000 (03:39 +0100)]
sortlistmodel: add a fast path for get_section()

2 years agotestsuite: Add section tests to sortlistmodel test
Benjamin Otte [Sat, 19 Feb 2022 01:37:53 +0000 (02:37 +0100)]
testsuite: Add section tests to sortlistmodel test

2 years agoAdd a test for sortlistmodel sections
Matthias Clasen [Sat, 26 Feb 2022 23:52:49 +0000 (18:52 -0500)]
Add a test for sortlistmodel sections

2 years agosortlistmodel: Implement GtkSectionModel
Benjamin Otte [Fri, 18 Feb 2022 02:21:48 +0000 (03:21 +0100)]
sortlistmodel: Implement GtkSectionModel

The get_section() implementation is a slow and steady implementation
that has to be careful to not screw up when an incremental sort is only
partially sorted.

2 years agoflattenlistmodel: Implement GtkSectionModel
Benjamin Otte [Sat, 26 Feb 2022 03:52:16 +0000 (04:52 +0100)]
flattenlistmodel: Implement GtkSectionModel

Each child model is reported as one section.

2 years agoImplement GtkSectionModel for all selection models
Benjamin Otte [Tue, 15 Feb 2022 01:03:00 +0000 (02:03 +0100)]
Implement GtkSectionModel for all selection models

2 years agoAdd GtkSectionModel
Benjamin Otte [Mon, 14 Feb 2022 02:18:36 +0000 (03:18 +0100)]
Add GtkSectionModel

Prototyping the interface to be used for sections in listview, so people
can review and play with it.

2 years agotestsuite: Add a listitemmanager test
Benjamin Otte [Wed, 5 Apr 2023 23:55:18 +0000 (01:55 +0200)]
testsuite: Add a listitemmanager test

2 years agoMerge branch 'node-editor-smarts' into 'main'
Matthias Clasen [Sun, 7 May 2023 13:59:42 +0000 (13:59 +0000)]
Merge branch 'node-editor-smarts' into 'main'

node-editor: Add some editor smarts

See merge request GNOME/gtk!5934

2 years agoCleanup
Matthias Clasen [Sun, 7 May 2023 13:32:09 +0000 (09:32 -0400)]
Cleanup

2 years agonode-editor: Add some editor smarts
Matthias Clasen [Sun, 7 May 2023 02:31:58 +0000 (22:31 -0400)]
node-editor: Add some editor smarts

Allow control-clicks on some fields to bring up
a more specific UI. This functionality is also
available via Ctrl-E and the context menu.

At this point, it can edit colors, fonts and
files in some places, as well as a few enums.

2 years agoFix a typo in the node format definition
Matthias Clasen [Sun, 7 May 2023 02:29:44 +0000 (22:29 -0400)]
Fix a typo in the node format definition

2 years agoMerge branch 'wip/exalm/action-fixes' into 'main'
Matthias Clasen [Sun, 7 May 2023 12:12:57 +0000 (12:12 +0000)]
Merge branch 'wip/exalm/action-fixes' into 'main'

modelbutton: Fix a use after free when unsetting accel

See merge request GNOME/gtk!5933

2 years agomodelbutton: Fix a use after free when unsetting accel
Alice Mikhaylenko [Sun, 7 May 2023 11:21:16 +0000 (15:21 +0400)]
modelbutton: Fix a use after free when unsetting accel

gtk_widget_remove_controller() already destroys the controller.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 7 May 2023 00:58:05 +0000 (00:58 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

rendernodeparser: Handle shader nodes better

See merge request GNOME/gtk!5930

2 years agorendernodeparser: Handle shader nodes better
Matthias Clasen [Sat, 6 May 2023 18:33:30 +0000 (14:33 -0400)]
rendernodeparser: Handle shader nodes better

Avoid criticals when editing shader nodes in
the node editor.

2 years agoMerge branch 'headless-test-logging' into 'main'
Matthias Clasen [Sat, 6 May 2023 13:28:06 +0000 (13:28 +0000)]
Merge branch 'headless-test-logging' into 'main'

ci: Improve headless test logging

See merge request GNOME/gtk!5929

2 years agoAdd a test for quick key events
Matthias Clasen [Sat, 6 May 2023 00:47:38 +0000 (20:47 -0400)]
Add a test for quick key events

2 years agoci: Improve headless test logging
Matthias Clasen [Sat, 6 May 2023 13:00:27 +0000 (09:00 -0400)]
ci: Improve headless test logging

2 years agoMerge branch 'wip/otte/update-texture' into 'main'
Benjamin Otte [Sat, 6 May 2023 00:59:25 +0000 (00:59 +0000)]
Merge branch 'wip/otte/update-texture' into 'main'

Add texture update regions

See merge request GNOME/gtk!5880

2 years agoMerge branch 'tiled-states' into 'main'
Matthias Clasen [Fri, 5 May 2023 23:58:08 +0000 (23:58 +0000)]
Merge branch 'tiled-states' into 'main'

Fix a corner-case in window states

Closes #5809

See merge request GNOME/gtk!5926

2 years agoMerge branch 'wip/kabus/column-id-leak' into 'main'
Matthias Clasen [Fri, 5 May 2023 23:55:34 +0000 (23:55 +0000)]
Merge branch 'wip/kabus/column-id-leak' into 'main'

gtk/columnviewcolumn: Fix id leak

See merge request GNOME/gtk!5927

2 years agoHandle the opposite case too
Matthias Clasen [Fri, 5 May 2023 23:40:42 +0000 (19:40 -0400)]
Handle the opposite case too

Just in case.

2 years agogtk/columnviewcolumn: Fix id leak
Khalid Abu Shawarib [Fri, 5 May 2023 22:18:16 +0000 (22:18 +0000)]
gtk/columnviewcolumn: Fix id leak

Add a free that was missing in commit 3e2b962a

2 years agoFix a corner-case in window states
Matthias Clasen [Fri, 5 May 2023 20:46:39 +0000 (16:46 -0400)]
Fix a corner-case in window states

Remove detailed tiled states when not tiled.

Fixes: #5809
2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 5 May 2023 20:34:39 +0000 (20:34 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

ci: Bump timeouts for headless tests

See merge request GNOME/gtk!5925

2 years agoci: Bump timeouts for headless tests
Matthias Clasen [Fri, 5 May 2023 20:07:06 +0000 (16:07 -0400)]
ci: Bump timeouts for headless tests

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 5 May 2023 20:12:12 +0000 (20:12 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Add a masked variation to gsk tests

See merge request GNOME/gtk!5924

2 years agoAdd a masked variation to gsk tests
Matthias Clasen [Fri, 5 May 2023 19:03:27 +0000 (15:03 -0400)]
Add a masked variation to gsk tests

This improves test coverage for mask nodes.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 5 May 2023 18:50:16 +0000 (18:50 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

node-editor: Be a bit better about saving

See merge request GNOME/gtk!5923

2 years agonode-editor: Be a bit better about saving
Matthias Clasen [Fri, 5 May 2023 17:58:34 +0000 (13:58 -0400)]
node-editor: Be a bit better about saving

When we have a file, suggest it for saving.
This has the side benefit of giving us a test case
for gtk_file_dialog_set_initial_file.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 5 May 2023 17:48:14 +0000 (17:48 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

gsk: Add a few assertions

See merge request GNOME/gtk!5922

2 years agoci: Bump timeouts of headless tests
Matthias Clasen [Fri, 5 May 2023 15:57:10 +0000 (11:57 -0400)]
ci: Bump timeouts of headless tests

2 years agogsk: Introduce a constant
Matthias Clasen [Fri, 5 May 2023 13:42:54 +0000 (09:42 -0400)]
gsk: Introduce a constant

We need this number in a couple of places,
so pull it out as a constant.

2 years agogsk: Add a few assertions
Matthias Clasen [Fri, 5 May 2023 13:42:34 +0000 (09:42 -0400)]
gsk: Add a few assertions

Make sure we don't overflow our fixed-size arrays.

2 years agogsk: Add some debug helpers
Matthias Clasen [Fri, 5 May 2023 10:57:08 +0000 (06:57 -0400)]
gsk: Add some debug helpers

2 years agoMerge branch 'better-masks' into 'main'
Matthias Clasen [Fri, 5 May 2023 15:56:16 +0000 (15:56 +0000)]
Merge branch 'better-masks' into 'main'

gsk: Avoid some offscreens

See merge request GNOME/gtk!5921

2 years agoMerge branch 'fix-typo' into 'main'
Matthias Clasen [Fri, 5 May 2023 15:39:46 +0000 (15:39 +0000)]
Merge branch 'fix-typo' into 'main'

gtkapplication-quartz: fix typo

Closes #5807

See merge request GNOME/gtk!5920

2 years agogsk: Better handling of offscreens
Matthias Clasen [Fri, 5 May 2023 15:35:35 +0000 (11:35 -0400)]
gsk: Better handling of offscreens

Take the scale into account for sizing the
offscreens for masks, blends and cross-fades.

2 years agogtkapplication-quartz: fix typo
Luca Bacci [Fri, 5 May 2023 14:26:26 +0000 (16:26 +0200)]
gtkapplication-quartz: fix typo

Fixes #5807

2 years agogsk: Avoid some offscreens
Matthias Clasen [Fri, 5 May 2023 02:30:12 +0000 (22:30 -0400)]
gsk: Avoid some offscreens

We don't have to be too conservative when checking
if a rect is contained in a rounded rect, we have
a precise api for this.

2 years agoRemove a no longer building test
Matthias Clasen [Fri, 5 May 2023 00:53:15 +0000 (20:53 -0400)]
Remove a no longer building test

2 years agoMerge branch 'smalltexture-plus-gles' into 'main'
Matthias Clasen [Thu, 4 May 2023 21:12:40 +0000 (21:12 +0000)]
Merge branch 'smalltexture-plus-gles' into 'main'

Merge wayland_smalltexture and wayland_gles

See merge request GNOME/gtk!5917

2 years agoSkip another failing gsk test with small textures
Matthias Clasen [Thu, 4 May 2023 19:36:57 +0000 (15:36 -0400)]
Skip another failing gsk test with small textures

2 years agoMerge wayland_smalltexture and wayland_gles
Matthias Clasen [Thu, 4 May 2023 18:56:51 +0000 (14:56 -0400)]
Merge wayland_smalltexture and wayland_gles

We don't really need to have two full separate
test runs for these conditions, so combine them
into one test setup.

2 years agoMerge branch 'headless-tests' into 'main'
Matthias Clasen [Thu, 4 May 2023 15:51:21 +0000 (15:51 +0000)]
Merge branch 'headless-tests' into 'main'

Get the headless monitor test to work in ci

See merge request GNOME/gtk!5915

2 years agoci: Mark headless monitor test as working
Matthias Clasen [Thu, 4 May 2023 15:39:35 +0000 (11:39 -0400)]
ci: Mark headless monitor test as working

2 years agoci: Make run-docker run work
Matthias Clasen [Thu, 4 May 2023 10:55:53 +0000 (06:55 -0400)]
ci: Make run-docker run work

We want to have a writable volume and the same user
inside the container.

2 years agoMore debug spew
Matthias Clasen [Thu, 4 May 2023 11:32:57 +0000 (07:32 -0400)]
More debug spew

Lets see what MUTTER_DEBUG=screen-cast says.

2 years agoAdd generous waits
Matthias Clasen [Thu, 4 May 2023 10:53:35 +0000 (06:53 -0400)]
Add generous waits

These tests work in the smae container locally.
Perhaps this is down to timing?

2 years agoMerge branch 'headless-tests' into 'main'
Matthias Clasen [Thu, 4 May 2023 04:20:11 +0000 (04:20 +0000)]
Merge branch 'headless-tests' into 'main'

Add headless tests using mutter

See merge request GNOME/gtk!5908

2 years agoMark the headless monitor test as failing
Matthias Clasen [Thu, 4 May 2023 03:53:14 +0000 (23:53 -0400)]
Mark the headless monitor test as failing

This is failing because I can't figure out
how to make wireplumber and pipewire work
in ci enough to let me add a new monitor :(

As usual, the test works fine locally.

2 years agoTry to fix dnd tests
Matthias Clasen [Thu, 4 May 2023 03:18:43 +0000 (23:18 -0400)]
Try to fix dnd tests

2 years agoTypo fix
Matthias Clasen [Thu, 4 May 2023 00:20:43 +0000 (20:20 -0400)]
Typo fix

2 years agoheadless tests: Add debug spew
Matthias Clasen [Wed, 3 May 2023 23:54:41 +0000 (19:54 -0400)]
headless tests: Add debug spew

Trying to track down what is going on with our
missing monitors.

2 years agoci: Launch pipewire and wireplumber
Matthias Clasen [Wed, 3 May 2023 22:45:56 +0000 (18:45 -0400)]
ci: Launch pipewire and wireplumber

The headless tests require pipewire and wireplumber
for screencast sessions to work. So launch them.

2 years agoUse python3
Matthias Clasen [Wed, 3 May 2023 18:50:14 +0000 (14:50 -0400)]
Use python3

No /usr/bin/python in our CI image :(

2 years agoMake the headless input tests work
Matthias Clasen [Wed, 3 May 2023 14:48:32 +0000 (10:48 -0400)]
Make the headless input tests work

These needed some updates and workarounds.

They are now part of the testsuite and can
be run like this:

    meson test -Cbuild --suite headless

2 years agoDisable a11y for the headless tests
Matthias Clasen [Wed, 3 May 2023 12:49:23 +0000 (08:49 -0400)]
Disable a11y for the headless tests

Otherwise, we go off activating things and end up
failing to launch systemd.

2 years agoAdd a dnd test to the headless tests
Matthias Clasen [Wed, 28 Apr 2021 10:29:41 +0000 (06:29 -0400)]
Add a dnd test to the headless tests

2 years agoUse headless mutter for input tests
Matthias Clasen [Sun, 21 Mar 2021 12:31:25 +0000 (08:31 -0400)]
Use headless mutter for input tests

Add some input tests that are using headless
mutter, and python with our in-tree gir files.

So far, test that we can roundtrip key events,
and move the pointer around.

2 years agoUse headless mutter for monitor tests
Matthias Clasen [Sat, 20 Mar 2021 20:23:36 +0000 (16:23 -0400)]
Use headless mutter for monitor tests

Add some monitor tests that are using headless
mutter, and python with our in-tree gir files.

So far, we test that we get expected signals
when monitors are added and removed.

2 years agoMerge branch 'ci-update-meson' into 'main'
Matthias Clasen [Thu, 4 May 2023 02:57:23 +0000 (02:57 +0000)]
Merge branch 'ci-update-meson' into 'main'

ci: Use newer meson

See merge request GNOME/gtk!5914

2 years agoci: Remove the hack
Matthias Clasen [Thu, 4 May 2023 02:32:00 +0000 (22:32 -0400)]
ci: Remove the hack

2 years agoci: Use newer meson
Matthias Clasen [Thu, 4 May 2023 00:01:20 +0000 (20:01 -0400)]
ci: Use newer meson

2 years agoci: Add meson back to the fedora image
Matthias Clasen [Thu, 4 May 2023 00:18:24 +0000 (20:18 -0400)]
ci: Add meson back to the fedora image

2 years agoci: Add pipewire-gstreamer too
Matthias Clasen [Wed, 3 May 2023 23:26:04 +0000 (19:26 -0400)]
ci: Add pipewire-gstreamer too

2 years agoci: Add pipewire to the image
Matthias Clasen [Wed, 3 May 2023 22:49:45 +0000 (18:49 -0400)]
ci: Add pipewire to the image

And its buddy, wireplumber.

But we don't need gnome-desktop-testing
anymore, now that installed tests are gone.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Wed, 3 May 2023 19:54:24 +0000 (19:54 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

ci: Stop running failing tests

See merge request GNOME/gtk!5913

2 years agoMerge branch 'stop-running-failing-tests' into 'main'
Matthias Clasen [Wed, 3 May 2023 19:33:35 +0000 (19:33 +0000)]
Merge branch 'stop-running-failing-tests' into 'main'

ci: Stop running failing tests

See merge request GNOME/gtk!5912

2 years agoci: Produce less terminal output
Matthias Clasen [Wed, 3 May 2023 19:32:50 +0000 (15:32 -0400)]
ci: Produce less terminal output

Pass --quiet to meson test.
Less is more, in this case.

2 years agoFix scan-build warning
Matthias Clasen [Tue, 2 May 2023 23:30:30 +0000 (19:30 -0400)]
Fix scan-build warning

2 years agoci: Stop running the unstable test setups
Matthias Clasen [Wed, 3 May 2023 19:10:17 +0000 (15:10 -0400)]
ci: Stop running the unstable test setups

This is just duplicating all our test runs,
for no discernible gain.

2 years agoci: Stop running failing tests
Matthias Clasen [Wed, 3 May 2023 18:41:37 +0000 (14:41 -0400)]
ci: Stop running failing tests

This makes the test output much harder to read,
and is just a waste of time.

2 years agoUpdate Persian translation
Danial Behzadi [Wed, 3 May 2023 09:00:53 +0000 (09:00 +0000)]
Update Persian translation

(cherry picked from commit 954011ef807538b2b38b7881554f10d4788f1425)

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Tue, 2 May 2023 18:09:13 +0000 (18:09 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

build: Use generated SPIR-V files

Closes #5798

See merge request GNOME/gtk!5910

2 years agocss: Don't transition to currentColor
Benjamin Otte [Tue, 2 May 2023 17:48:54 +0000 (19:48 +0200)]
css: Don't transition to currentColor

Transition to the color that is in use instead.

Fixes crashes because currentColor is not an RGBA color and
therefor could not be queried later.

Fixes #5798

2 years agovulkan: Compute offscreen texture coords properly
Benjamin Otte [Tue, 2 May 2023 17:44:06 +0000 (19:44 +0200)]
vulkan: Compute offscreen texture coords properly

Most of the time we want to compute them based on the child node we
render to the offscreen, but not always.
For blend and cross-fade nodes, they need to be computed based on the
node's bounds.

Fixes widget-factory page fade animation weirdly resizing the fading
pages.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 2 May 2023 17:42:29 +0000 (17:42 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Expand gtk_init docs

Closes #5781

See merge request GNOME/gtk!5909

2 years agoAdd a comment to pango.wrap
Matthias Clasen [Tue, 2 May 2023 11:13:32 +0000 (07:13 -0400)]
Add a comment to pango.wrap

So we remember the next time we try to
switch to stable dependencies.

2 years agoExpand gtk_init docs
Matthias Clasen [Tue, 2 May 2023 17:17:41 +0000 (13:17 -0400)]
Expand gtk_init docs

Make it clear that some aspects of GApplication
functionality happen before startup.

Fixes: #5781
2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 2 May 2023 13:29:20 +0000 (13:29 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Don't build fribidi docs

See merge request GNOME/gtk!5906

2 years agoMake run-test.sh easier to use locally
Matthias Clasen [Tue, 2 May 2023 10:36:18 +0000 (06:36 -0400)]
Make run-test.sh easier to use locally

Set a default timeout multiplier so we don't
have to rememver obscure environment variables.

2 years agoGo back to fribidi master
Matthias Clasen [Tue, 2 May 2023 10:22:44 +0000 (06:22 -0400)]
Go back to fribidi master

Fribidi 1.0.12 does not work as a subproject :(

2 years agoDon't build fribidi docs
Matthias Clasen [Tue, 2 May 2023 10:22:24 +0000 (06:22 -0400)]
Don't build fribidi docs

There's no need for that. This matches what pango does.

2 years agovulkan: Rebuild SPIR-V files
Benjamin Otte [Tue, 2 May 2023 06:47:10 +0000 (08:47 +0200)]
vulkan: Rebuild SPIR-V files

It's been a while since somebody last compiled them, glslc should be
somewhat newer by now.

2 years agobuild: Use generated SPIR-V files
Benjamin Otte [Tue, 2 May 2023 06:41:43 +0000 (08:41 +0200)]
build: Use generated SPIR-V files

We weren't looking in the build dir for generated files.

Actually make sure that we look in the build dir *first*, otherwise
glib-compile-resources will still use the wrong files.

2 years agoUse pango main as subproject
Matthias Clasen [Tue, 2 May 2023 02:23:34 +0000 (22:23 -0400)]
Use pango main as subproject

This is necessary to get the latest pango docs
built in ci.

2 years agostop using deprecated pango api
Matthias Clasen [Tue, 2 May 2023 03:49:42 +0000 (23:49 -0400)]
stop using deprecated pango api

2 years agoci: Add mutter to the fedora image
Matthias Clasen [Tue, 2 May 2023 01:11:01 +0000 (21:11 -0400)]
ci: Add mutter to the fedora image

This is in preparation for trying to use mutter --headless
in ci.

2 years agoTEST TEST TEST
Benjamin Otte [Fri, 28 Apr 2023 04:10:02 +0000 (06:10 +0200)]
TEST TEST TEST

Add some random updates to the GL Area, so that funky testing can be
done with the GLArea and Gears gtk-demo.

2 years agorendernode: Implement texture diffing for scale nodes
Benjamin Otte [Mon, 1 May 2023 20:23:50 +0000 (22:23 +0200)]
rendernode: Implement texture diffing for scale nodes

2 years agotexturebuilder: Add ::udpate-region and ::update-texture
Benjamin Otte [Fri, 28 Apr 2023 03:40:14 +0000 (05:40 +0200)]
texturebuilder: Add ::udpate-region and ::update-texture

2 years agoMerge branch 'gsk-flip-tests' into 'main'
Matthias Clasen [Mon, 1 May 2023 21:06:32 +0000 (21:06 +0000)]
Merge branch 'gsk-flip-tests' into 'main'

more gsk tests

See merge request GNOME/gtk!5811

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Mon, 1 May 2023 20:41:13 +0000 (20:41 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Cosmetics: Unset baseline too

See merge request GNOME/gtk!5904

2 years agoSkip some tests with small textures
Matthias Clasen [Mon, 1 May 2023 20:00:24 +0000 (16:00 -0400)]
Skip some tests with small textures

When textures are too large, we will scale them down
to fit the max texture size, which will cause comparisons
to fail.

2 years agotexture: Add gdk_texture_diff()
Benjamin Otte [Thu, 27 Apr 2023 22:12:49 +0000 (00:12 +0200)]
texture: Add gdk_texture_diff()

... and use it in rendernodes.

Setting up textures for diffing is done via gdk_texture_set_diff() which
should only be used during texture construction.

Note that the pointers to next/previous are allowed to dangle if one of
the textures is finalized, but that's fine because we always check both
textures' links to each other before we consider the pointer valid.

2 years agoCosmetics: Unset baseline too
Matthias Clasen [Mon, 1 May 2023 20:15:11 +0000 (16:15 -0400)]
Cosmetics: Unset baseline too

We set width and height to 0 when unrealizing
a widget. No reason to let the baseline value
linger.

2 years agoMerge branch 'better-switch-docs' into 'main'
Matthias Clasen [Mon, 1 May 2023 20:03:44 +0000 (20:03 +0000)]
Merge branch 'better-switch-docs' into 'main'

switch: Expand the docs

See merge request GNOME/gtk!5903

2 years agoswitch: Expand the docs
Matthias Clasen [Mon, 1 May 2023 19:15:25 +0000 (15:15 -0400)]
switch: Expand the docs

Add more text and explanation around active vs state,
since people seem easily confused by it.