~eliasnaur/gio

Mailing list for the Gio project for discussion and patches.

Send your message to ~eliasnaur/gio@lists.sr.ht. No account is required and you can post without being subscribed.

4 2

[PATCH] wayland: fix call in the initialization code

Denys Smirnov
Details
Message ID
<CACwxszYxfMim=kKjEakFEZo2a-Bv5du_Y5-Wxd1gmzs3J5HPrQ@mail.gmail.com>
DKIM signature
pass
Download raw message
The following changes since commit ea2ee1abcc23abc1c72dd7a9849f991af5b0817d:

  ui/app: fix example code in document (2019-08-29 17:49:27 +0200)

are available in the Git repository at:

  ssh://git@github.com/dennwc/gio.git wl_init

for you to fetch changes up to 6d27766aa0ec16c4f76fcb43417bd4cc22d0b563:

  wayland: fix call in the initialization code (2019-08-29 20:43:42 +0300)

----------------------------------------------------------------
Denys Smirnov (1):
      wayland: fix call in the initialization code

 ui/app/os_wayland.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/app/os_wayland.go b/ui/app/os_wayland.go
index 2954459..aec7a39 100644
--- a/ui/app/os_wayland.go
+++ b/ui/app/os_wayland.go
@@ -1119,7 +1119,7 @@ func waylandConnect() error {
        }
        C.gio_wl_registry_add_listener(reg)
        // Get globals.
-       C.wl_display_roundtrip(c.disp)
+       C.wl_display_dispatch(c.disp)
        // Get output configurations.
        C.wl_display_roundtrip(c.disp)
        if c.compositor == nil {
Details
Message ID
<BWMG5OTWHO7L.33137BZB65FLU@toolbox>
In-Reply-To
<CACwxszYxfMim=kKjEakFEZo2a-Bv5du_Y5-Wxd1gmzs3J5HPrQ@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
> diff --git a/ui/app/os_wayland.go b/ui/app/os_wayland.go
> index 2954459..aec7a39 100644
> --- a/ui/app/os_wayland.go
> +++ b/ui/app/os_wayland.go
> @@ -1119,7 +1119,7 @@ func waylandConnect() error {
>         }
>         C.gio_wl_registry_add_listener(reg)
>         // Get globals.
> -       C.wl_display_roundtrip(c.disp)
> +       C.wl_display_dispatch(c.disp)
>         // Get output configurations.
>         C.wl_display_roundtrip(c.disp)

I took another look at this code, and I don't think this change is correct. As
the comments say, we need one roundtrip to ensure that the global objects are
sent to us, and another to get all the output configurations. The
wl_display_dispatch variant only blocks until (at least) one event has been
received.

>         if c.compositor == nil {
Details
Message ID
<CACwxszaUPtppbPuEQW5Prhsj-z+PNOqx9-W9dss9jd+iTqwZfg@mail.gmail.com>
In-Reply-To
<BWMG5OTWHO7L.33137BZB65FLU@toolbox> (view parent)
DKIM signature
pass
Download raw message
Got it, will revert locally. Thanks for checking it!

Can you please make a few more comments here, e.g. point to callbacks
that receive those calls, or anything else that helps understand why
there are exactly 2 calls and not 1 or 3?


On Thu, 29 Aug 2019 at 21:55, Elias Naur <mail@eliasnaur.com> wrote:
>
> > diff --git a/ui/app/os_wayland.go b/ui/app/os_wayland.go
> > index 2954459..aec7a39 100644
> > --- a/ui/app/os_wayland.go
> > +++ b/ui/app/os_wayland.go
> > @@ -1119,7 +1119,7 @@ func waylandConnect() error {
> >         }
> >         C.gio_wl_registry_add_listener(reg)
> >         // Get globals.
> > -       C.wl_display_roundtrip(c.disp)
> > +       C.wl_display_dispatch(c.disp)
> >         // Get output configurations.
> >         C.wl_display_roundtrip(c.disp)
>
> I took another look at this code, and I don't think this change is correct. As
> the comments say, we need one roundtrip to ensure that the global objects are
> sent to us, and another to get all the output configurations. The
> wl_display_dispatch variant only blocks until (at least) one event has been
> received.
>
> >         if c.compositor == nil {



-- 
Best regards,
Denys Smirnov.
Details
Message ID
<BWMXPFROR2M0.1UBWHDPGF5ATW@testmac>
In-Reply-To
<CACwxszaUPtppbPuEQW5Prhsj-z+PNOqx9-W9dss9jd+iTqwZfg@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
On Fri Aug 30, 2019 at 1:19 AM Denys Smirnov wrote:
> 
> Can you please make a few more comments here, e.g. point to callbacks
> that receive those calls, or anything else that helps understand why
> there are exactly 2 calls and not 1 or 3?
> 

Expanded in

To git.sr.ht:~eliasnaur/gio
   ea2ee1a..110da80  master -> master
Details
Message ID
<CACwxszbak_7U_DVR=niAduMzBhidos7sqZtyti_YRXXFee8Bqg@mail.gmail.com>
In-Reply-To
<BWMXPFROR2M0.1UBWHDPGF5ATW@testmac> (view parent)
DKIM signature
pass
Download raw message
Awesome, thanks! It helps a lot.

On Fri, 30 Aug 2019 at 11:40, Elias Naur <mail@eliasnaur.com> wrote:
>
> On Fri Aug 30, 2019 at 1:19 AM Denys Smirnov wrote:
> >
> > Can you please make a few more comments here, e.g. point to callbacks
> > that receive those calls, or anything else that helps understand why
> > there are exactly 2 calls and not 1 or 3?
> >
>
> Expanded in
>
> To git.sr.ht:~eliasnaur/gio
>    ea2ee1a..110da80  master -> master



-- 
Best regards,
Denys Smirnov.