Open
Conversation
Stack.Layout and Flex.Layout caused a lot of heap allocations / escapes. The reason was that scratch space for dims and call and was inside Stack/FlexChild. child.call.Add(gtx.Ops) confused the go escape analysis and caused the entired children slice to escape to the heap, including all widgets in it. This caused a lot of heap allocations. Now the scratch space is separate from children, and for cases len(children) <= 32, we will allocate the scratch space on the stack. For cases len(children) > 32, only the scratch space gets allocated from the heap, during append. Signed-off-by: vsariola <5684185+vsariola@users.noreply.github.com>
Signed-off-by: Marc <marc.leroy@samantree.com> Signed-off-by: Elias Naur <mail@eliasnaur.com>
The Windows Pointer API (https://learn.microsoft.com/en-us/windows/win32/api/_inputmsg/) was used to allow the detection of events when interacting with touch screens. This also opens the gates for supporting other types of input devices (e.g. pens and touchpads). Mouse events are now part of the pointer events (primary events trigger WM_POINTER<DOWN|UP>, whereas secondary ones vanilla WM_POINTERUPDATE, and cancellations WM_POINTERCAPTURECHANGED). A fourth and fifth button (usually found in modern mice) has also been added for completeness, though their integration in other OS-es shall be the objective of future patches. Signed-off-by: Marc <marc.leroy@samantree.com> Signed-off-by: Elias Naur <mail@eliasnaur.com>
Currently build fails as go.mod uses go 1.23.8 which doesn't have strings.SplitSeq. Note: strings.SplitSeq was introduced in go 1.24. Signed-off-by: Miles Alan <m@milesalan.com>
Fixes: https://todo.sr.ht/~eliasnaur/gio/654 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu> Signed-off-by: Elias Naur <mail@eliasnaur.com>
The normal vector size and direction depend on the input point and the sign of the unit value provided. Fixes: https://todo.sr.ht/~eliasnaur/gio/576 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
There are two max window size settings on macOS, `contentMaxSize` and `maxFullScreenContentSize`. Set the latter to avoid a window being resized larger than its maximum in full screen mode. Signed-off-by: Elias Naur <mail@eliasnaur.com>
According to @kkeybbs, pressing the maximize button on Windows only resizes the window up to its maximum bounds. That means we can leave the button available, and only hide it when the window has a fixed size. Signed-off-by: Elias Naur <mail@eliasnaur.com>
Fixes: https://todo.sr.ht/~eliasnaur/gio/656 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Cancel events affect the entire gesture and as such all active pointers. References: https://todo.sr.ht/~eliasnaur/gio/657 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This is a breaking change, users that need the old behavior can implement it using the existing API. Fixes: https://todo.sr.ht/~eliasnaur/gio/511 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Avoids unnecessary eglMakeCurrent and thread locking calls to enhance performance. Fixes: https://todo.sr.ht/~eliasnaur/gio/658 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Reduces ambiguity by introducing AffineId() for representing identity transformation matrices. References: https://todo.sr.ht/~eliasnaur/gio/655 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
References: https://todo.sr.ht/~eliasnaur/gio/655 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
References: https://todo.sr.ht/~eliasnaur/gio/655 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu> Signed-off-by: Elias Naur <mail@eliasnaur.com>
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
After moving the pen, the next action should update the bounds for the start position. References: https://todo.sr.ht/~eliasnaur/gio/451 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu> Signed-off-by: Elias Naur <mail@eliasnaur.com>
Fixes: https://todo.sr.ht/~eliasnaur/gio/534 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu> Signed-off-by: Elias Naur <mail@eliasnaur.com>
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu> Signed-off-by: Elias Naur <mail@eliasnaur.com>
Fixes the edge case where a zero point would be normalized to NaN. Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
This fixes the cases where the unit length matches the hypotenuse. Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Fixes the 1px overlap of curve quads. Without this patch the rendered quads were skewed vertically and were 2 pixels shorter in height. The NorthWest pixels were moved to the SouthWest instead of NorthWest and the SouthEast pixels were moved to the NorthEast instead of SouthEast. References: https://todo.sr.ht/~eliasnaur/gio/339 Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu> Signed-off-by: Elias Naur <mail@eliasnaur.com>
Using cgo.Handle allows us to pass a reference to a Go function through the GCD API for running main thread code, saving a goroutine and a channel. Signed-off-by: Elias Naur <mail@eliasnaur.com>
Inspired by the discussion at golang.org/issue/70089, this change makes our particular NSApplicationDelegate implementation optional. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This reverts commit 3e601e7 because it results in a blank window on Android. Signed-off-by: Elias Naur <mail@eliasnaur.com> Fixes: https://todo.sr.ht/~eliasnaur/gio/671
When Gio is embedded (such as on Android and iOS), we pretend that the Go library is the main program by running Go main on the main thread. To avoid deadlock, `app.Main` returns immediately to relinquish control of the main thread. This behaviour is suprising (what if something else runs after `app.Main`?) and more importantly is not compatible with app global events received by the main goroutine. Something had to give, and this change starts a new goroutine for calling Go's main. Signed-off-by: inkeliz <inkeliz@inkeliz.com> Signed-off-by: Elias Naur <mail@eliasnaur.com>
Signed-off-by: inkeliz <inkeliz@inkeliz.com> Signed-off-by: Elias Naur <mail@eliasnaur.com>
We're about to send messages between multiple instances of the same program, and we need something to distinguish Gio programs. Use the app ID. Signed-off-by: inkeliz <inkeliz@inkeliz.com> Signed-off-by: Elias Naur <mail@eliasnaur.com>
Also replace calls to the deprecated StringToUTF16Ptr syscall. Signed-off-by: inkeliz <inkeliz@inkeliz.com> Signed-off-by: Elias Naur <mail@eliasnaur.com>
Now, it's possible to launch one Gio app using a custom URI scheme, such as `gio://some/data`.
This feature is supported on Android, iOS, macOS and Windows, issuing a new transfer.URLEvent,
containing the URL launched. If the program is already open, one transfer.URLEvent will be
sent to the current app.
Limitations:
On Windows, if the program listen to schemes (compiled with `-schemes`), then just a single
instance of the app can be open. In other words, just a single `myprogram.exe` can
be active.
Security:
Deeplinking have the same level of security of clipboard. Any other software can send such
information and read the content, without any restriction. That should not be used to transfer
sensible data, and can't be fully trusted.
Setup/Compiling:
In order to set the custom scheme, you need to use the new `-schemes` flag in `gogio`, using
as `-schemes gio` will listen to `gio://`.
If you are not using gogio you need to defined some values, which varies for each OS:
macOS/iOS - You need to define the following Properly List:
```
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>yourCustomScheme</string>
</array>
</dict>
</array>
```
Windows - You need to compiling using -X argument:
```
-ldflags="-X "gioui.org/app.schemesURI=yourCustomScheme" -H=windowsgui"
```
Android - You need to add IntentFilter in GioActivity:
```
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:scheme="yourCustomScheme"></data>
</intent-filter>
```
That assumes that you still using GioActivity and GioAppDelegate, otherwise more
changes are required.
Events are routed to a new app.Events, which are not linked to a specific window.
Signed-off-by: inkeliz <inkeliz@inkeliz.com>
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Document that DataDir is not available before main. References: https://todo.sr.ht/~eliasnaur/gio/229 Signed-off-by: CoyAce <AkeyCoy@gmail.com> Signed-off-by: Elias Naur <mail@eliasnaur.com>
This reverts commit 36a2fa3. Reason is that text rendering broke on some Android devices[0]. [0] https://lists.sr.ht/~eliasnaur/gio/%3CPH7PR02MB1003858FA1B27C8A53BE96815DDA1A@PH7PR02MB10038.namprd02.prod.outlook.com%3E Signed-off-by: Elias Naur <mail@eliasnaur.com>
5b124da to
e8d63ad
Compare
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Fixes: https://todo.sr.ht/~eliasnaur/gio/679 Signed-off-by: CoyAce <AkeyCoy@gmail.com> Signed-off-by: Elias Naur <mail@eliasnaur.com>
Microphone permissions enables the Android permissions RECORD_AUDIO Signed-off-by: CoyAce <AkeyCoy@gmail.com>
since dataDir() must call after main(), it's redundant to use channel to send path Signed-off-by: CoyAce <AkeyCoy@gmail.com> Signed-off-by: Elias Naur <mail@eliasnaur.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.