From Denis Bernard to ~eliasnaur/gio-patches
Signed-off-by: Denis Bernard <db047h@gmail.com> --- app/internal/window/os_x11.go | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go index d820360..7f69b36 100644 --- a/app/internal/window/os_x11.go +++ b/app/internal/window/os_x11.go @@ -198,6 +198,19 @@ func (w *x11Window) destroy() { C.XCloseDisplay(w.x) } // atom is a wrapper around XInternAtom. Callers should cache the result[message trimmed]
From Denis Bernard to ~eliasnaur/gio-patches
On Tue, Nov 12, 2019 at 8:33 PM Elias Naur <mail@eliasnaur.com> wrote: > > > > > > > > +func (w *x11Window) atom(name string, onlyIfExists bool) C.Atom { > > > > + if a, ok := w.atoms[name]; ok { > > > > + return a > > > > + } > > > > + cname := C.CString(name) > > > > > > defer C.free immediately after this. > > > > I'd rather not do it here. atom() could be called in a hot code path, > > so if I can avoid a defer to C code... > >
From Denis Bernard to ~eliasnaur/gio-patches
On Tue, Nov 12, 2019 at 4:44 PM Elias Naur <mail@eliasnaur.com> wrote: > > On Tue Nov 12, 2019 at 3:52 PM Denis Bernard wrote: > > Signed-off-by: Denis Bernard <db047h@gmail.com> > > --- > > app/internal/window/os_x11.go | 35 ++++++++++++++++++++++++++++++++--- > > 1 file changed, 32 insertions(+), 3 deletions(-) > > > > diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go > > index d820360..7223199 100644 > > --- a/app/internal/window/os_x11.go > > +++ b/app/internal/window/os_x11.go > > @@ -62,6 +62,7 @@ type x11Window struct { > > x *C.Display
From Denis Bernard to ~eliasnaur/gio-patches
Signed-off-by: Denis Bernard <db047h@gmail.com> --- app/internal/window/os_x11.go | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go index d820360..7223199 100644 --- a/app/internal/window/os_x11.go +++ b/app/internal/window/os_x11.go @@ -62,6 +62,7 @@ type x11Window struct { x *C.Display xw C.Window atoms map[string]C.Atom[message trimmed]
From Denis Bernard to ~eliasnaur/gio-patches
Removed redundant XSelectInput and XChangeWindowAttributes as well as obsolete screen parameter in x11DetectUIScale. Signed-off-by: Denis Bernard <db047h@gmail.com> --- app/internal/window/os_x11.go | 38 ++++++++++++++--------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go index f82f17d..d820360 100644 --- a/app/internal/window/os_x11.go +++ b/app/internal/window/os_x11.go @@ -478,30 +478,26 @@ func newX11Window(gioWin Callbacks, opts *Options) error { return errors.New("x11: cannot connect to the X server") [message trimmed]
From Denis Bernard to ~eliasnaur/gio-patches
This is a general fix where keys with names differing from their UTF8 representation could not be sent as EditEvents. Signed-off-by: Denis Bernard <db047h@gmail.com> --- app/internal/window/os_x11.go | 55 ++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go index c694e20..90086d3 100644 --- a/app/internal/window/os_x11.go +++ b/app/internal/window/os_x11.go @@ -225,6 +225,8 @@ func (h *x11EventHandler) handleEvents() bool { lookup: [message trimmed]
From Denis Bernard to ~eliasnaur/gio-patches
This is a general fix where keys with names differing from their UTF8 representation could not be sent as EditEvents. Signed-off-by: Denis Bernard <db047h@gmail.com> --- app/internal/window/os_x11.go | 77 +++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go index c694e20..954f7ef 100644 --- a/app/internal/window/os_x11.go +++ b/app/internal/window/os_x11.go @@ -225,6 +225,8 @@ func (h *x11EventHandler) handleEvents() bool { lookup: [message trimmed]
From Denis Bernard to ~eliasnaur/gio-patches
Signed-off-by: Denis Bernard <db047h@gmail.com> --- app/internal/window/os_x11.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go index e176849..7b81a76 100644 --- a/app/internal/window/os_x11.go +++ b/app/internal/window/os_x11.go @@ -12,8 +12,6 @@ package window #include <X11/Xatom.h> #include <X11/Xutil.h> #include <X11/Xresource.h> #define GIO_FIELD_OFFSET(typ, field) const int gio_##typ##_##field##_off = offsetof(typ, field)[message trimmed]
From Denis Bernard to ~eliasnaur/gio-patches
Yep, did that but did not git add :( Resending, again.. On Thu, Nov 7, 2019 at 10:46 AM Elias Naur <mail@eliasnaur.com> wrote: > > Thank you, merged. Follow-up suggestion below. > > On Wed Nov 6, 2019 at 6:39 PM Denis Bernard wrote: > > Signed-off-by: Denis Bernard <db047h@gmail.com> > > --- > > app/internal/window/os_x11.go | 157 ++++++---------------------------- > > 1 file changed, 26 insertions(+), 131 deletions(-) > > > > diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go > > index d8d6ceb..e176849 100644
From Denis Bernard to ~eliasnaur/gio-patches
Signed-off-by: Denis Bernard <db047h@gmail.com> --- app/internal/window/os_x11.go | 157 ++++++---------------------------- 1 file changed, 26 insertions(+), 131 deletions(-) diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go index d8d6ceb..e176849 100644 --- a/app/internal/window/os_x11.go +++ b/app/internal/window/os_x11.go @@ -14,18 +14,6 @@ package window #include <X11/Xresource.h> #define GIO_FIELD_OFFSET(typ, field) const int gio_##typ##_##field##_off = offsetof(typ, field) GIO_FIELD_OFFSET(XClientMessageEvent, data); GIO_FIELD_OFFSET(XExposeEvent, count);[message trimmed]