On Xephyr, when fitst entering x11Window.loop(), syscall.Ppoll would
block forever while XPending() would still return a non zero value.
This commit refactors the loop so that XPending() gets called first,
then fallback to waiting in ppoll if there are no pending draw events.
This has the added benefit of reducing the number of calls to ppoll when
receiving a lot of events.
Signed-off-by: Denis Bernard <db047h@gmail.com>
Discovered by the builders, yay:
+ gogio -target android ./kitchen
gogio: go build -ldflags=-w -s -buildmode=c-shared -o /tmp/gogio-485830478/jni/arm64-v8a/libgio.so ./kitchen failed: go build gioui.org/app/internal/window: invalid flag in #cgo LDFLAGS: -Werror
(https://builds.sr.ht/~eliasnaur/job/101366)
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Using the module import syntax "@import UIKit" results in a complaint
from the compiler:
> warning: use of '@import' in framework header is discouraged,
> including this header requires -fmodules [-Watimport-in-framework-header]
Use the regular #include syntax instead.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
The `gogio` tool adds the `-fmodules -fobjc-arc` flags to the Cgo
C flags. Unfortunately, that masks problems where Cgo packages
accidentally didn't have the flags in their #cgo directives such
as package log.
Move the flags so they're only explicitly mentioned when `gogio`
invokes the host compiler to build the `main.m` shim.
Fix package log to include the missing flags.
While we're here, silence OpenGL ES deprecation warnings on iOS, just
as we do for macOS. The warnings are normally not visible because
the gogio tool suppress output from the go tool.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This driver still lacks fling support and dp/sp configuration.
By default, linux builds will try to use the Wayland driver then
fallback to X11 if it fails. Drivers can be disabled by using either the
nowayland or nox11 build tags.
Signed-off-by: Denis Bernard <db047h@gmail.com>
Some versions of eglplatform.h don't support the MESA_EGL_NO_X11_HEADER
define for cross-platform definitions of the EGL types. Remove the
define and use an explicit cast instead.
Fixes gio#46
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Systems that only support ES 2 are unlikely to have the required
extensions available. But we'll get a better exit error in that case.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
With public ImageOp fields there was no way to mark an image.Image as modified.
Replace them with NewImageOp that always make a copy, and use the opportunity
to ensure the copy is ready to upload to a GPU texture.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
It wasn't used, and it's not clear that it is useful at all in its current
form. For example, a single control with multiple handler keys (say, one for
scrolling and one for clicking) will only receive priority Foremost for one of
them.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
First, let the handlers know they're dropping with a cancel event.
Second, reset the grab flag of dropped handlers.
Fixes issues when drag-scrolling and then clicking and another with two nested
drag gestures where the grab flag is kept for the second handler even after it
is pushed out by the first handler grabbing.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Packages that provide support for external events such as pointer, key and
system are only the beginning. Future packages are expected for clipboard
access, drag and drop, gps positions and so on.
To keep the number of top-level packages under control, move such I/O packages
to the new `io` directory.
The `system` package name was the previous solution to keeping the number of
top-level packages under control: I named it `system` instead of the narrower
`profile` because I expected to put all the less common events into it, turning
`system` into a "package util" smell.
With `io`, package system can be renamed to `profile`.
Signed-off-by: Elias Naur <mail@eliasnaur.com>