From Jeff Williams to ~eliasnaur/gio
Hi Chris, If you try profiling the program while it's idle, where does it show the CPU is being consumed? https://go.dev/blog/pprof On Mon, May 16, 2022 at 12:58 PM Chris McGee <newton688@gmail.com> wrote: > > Hi All, > > I'm seeing significant CPU consumption in my application even when it's > idle. Top reports that it uses CPU but my printf's indicate that > there's nothing happening in the main loop at the time and the window
From Jeff Williams to ~eliasnaur/gio
Hi, I noticed a slightly odd behaviour in key.Press. To capture the user pressing and releasing the Ctrl key itself (not as a modifier), I would assume I could use the filter: Ctrl However on Windows I must instead use: Ctrl-Ctrl|Ctrl The reason being that the key being pressed is detected as Ctrl, then the modifiers are computed and Ctrl is detected as a modifier. Thus to
From Jeff Williams to ~eliasnaur/gio-patches
> > Thank you. One comment below. Tests for the fixed panics would be nice. > Sure, I'll try and write tests for it. > > @@ -1218,6 +1218,9 @@ func (e *Editor) SetCaret(start, end int) { > > func (e *Editor) makeValidCaret(positions ...*combinedPos) { > > // Jump through some hoops to order the offsets given to offsetToScreenPos, > > // but still be able to update them correctly with the results thereof. > > + if e.lines == nil { > > + return > > + }
From Jeff Williams to ~eliasnaur/gio-patches
> > to follow Go guidelines, I think this should be named > var errNoSuchFont > > or > var errNoMatchingFont > Okay, I'll change it to `errNoSuchFont`.
From Jeff Williams to ~eliasnaur/gio-patches
This fix prevents a segmentation violation when a text.Cache doesn't contain a font that is requested during layout. It also makes the Cache fallback to returning any font from the Cache if a particular font is not found. Signed-off-by: Jeff Williams <kanobe@gmail.com> --- text/shaper.go | 12 ++++++++++++ widget/editor.go | 3 +++ 2 files changed, 15 insertions(+) diff --git a/text/shaper.go b/text/shaper.go index 59020e07..d5d7ecdb 100644 --- a/text/shaper.go [message trimmed]
From Jeff Williams to ~eliasnaur/gio-patches
This fix prevents a segmentation violation when a text.Cache doesn't contain a font that is requested during layout. It also makes the Cache fallback to returning any font from the Cache if a particular font is not found. Signed-off-by: Jeff Williams <kanobe@gmail.com> --- text/shaper.go | 18 ++++++++++++++++++ widget/editor.go | 3 +++ 2 files changed, 21 insertions(+) diff --git a/text/shaper.go b/text/shaper.go index 59020e07..b41a32d8 100644 --- a/text/shaper.go [message trimmed]
From Jeff Williams to ~eliasnaur/gio-patches
This fix prevents a segmentation violation when a text.Cache doesn't contain a font that is requested during layout. It also makes the Cache fallback to returning any font from the Cache if a particular font is not found. Signed-off-by: Jeff Williams <kanobe@gmail.com> --- text/shaper.go | 13 +++++++++++++ widget/editor.go | 3 +++ 2 files changed, 16 insertions(+) diff --git a/text/shaper.go b/text/shaper.go index 59020e07..e1534f5a 100644 --- a/text/shaper.go [message trimmed]
From Jeff Williams to ~eliasnaur/gio-patches
This change causes modifier keys (Control, Shift, Alt, Super) to be sent to the application as key.Event events. These will still continue to be used as modifiers for other key and pointer events as they are today. This commit also adds a minor cleanup to use constants for function keys in the OS-specific keypress handling functions. Signed-off-by: Jeff Williams <kanobe@gmail.com> --- app/internal/xkb/xkb_unix.go | 32 ++++++++++++++++++++------------ app/os_android.go | 8 ++++++++ app/os_js.go | 35 +++++++++++++++++++++++++++++++++-- app/os_macos.go | 24 ++++++++++++------------ app/os_windows.go | 33 +++++++++++++++++++++------------ [message trimmed]
From Jeff Williams to ~eliasnaur/gio-patches
> > Thank you. Almost there, please revert a change noted below and avoid capitalizing > patch subject: > > app: send keypress events... > Sure, will do. > > This change will subtly break if we ever decide to change NameF*. >
From Jeff Williams to ~eliasnaur/gio-patches
This change causes modifier keys (Control, Shift, Alt, Super) to be sent to the application as key.Event events. These will still continue to be used as modifiers for other key and pointer events as they are today. This commit also adds a minor cleanup to use constants for function keys in the OS-specific keypress handling functions. Signed-off-by: Jeff Williams <kanobe@gmail.com> --- app/internal/xkb/xkb_unix.go | 32 ++++++++++++++++++++------------ app/os_android.go | 8 ++++++++ app/os_js.go | 11 ++++++++++- app/os_macos.go | 24 ++++++++++++------------ app/os_windows.go | 33 +++++++++++++++++++++------------ [message trimmed]