<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Sam, gtk3-demo WORKED :)<br>
      <br>
      But there is still some bug need to fix, such as Invalid rectangle
      region.<br>
      <br>
      Leslie<br>
      <br>
    </div>
    <blockquote
cite="mid:CAL=SSHLhYFLpP2a+joWuVF5AauWa2y-BYC3FPBva=imb+Ei2fA@mail.gmail.com"
      type="cite">
      <div dir="ltr">That looks like the fix I applied. Have you tried
        stepping through the library to make sure it was conditionally
        compiled in?<br>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Thu, Aug 22, 2013 at 11:34 AM,
          Leslie Zhai <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:xiangzhai83@gmail.com" target="_blank">xiangzhai83@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>Hi Sam,<br>
                <br>
                Did you fixed the gdkdisplaymanager without mir bug like
                this?<br>
                <br>
                diff --git a/gdk/gdkdisplaymanager.c
                b/gdk/gdkdisplaymanager.c<br>
                index 075f507..84c07a4 100644<br>
                --- a/gdk/gdkdisplaymanager.c<br>
                +++ b/gdk/gdkdisplaymanager.c<br>
                @@ -60,6 +60,10 @@<br>
                 #include "wayland/gdkprivate-wayland.h"<br>
                 #endif<br>
                 <br>
                +#ifdef
                GDK_WINDOWING_MIR                                                   
                <br>
                +#include
                "mir/gdkprivate-mir.h"                                        
                <br>
                +#endif<br>
                +<br>
                 /**<br>
                  * SECTION:gdkdisplaymanager<br>
                  * @Short_description: Maintains a list of all open
                GdkDisplays<br>
                @@ -270,6 +274,9 @@ static GdkBackend gdk_backends[] = {<br>
                 #ifdef GDK_WINDOWING_WAYLAND<br>
                   { "wayland",  _gdk_wayland_display_open },<br>
                 #endif<br>
                +#ifdef
                GDK_WINDOWING_MIR                                                   
                <br>
                +  { "mir",      _gdk_mir_display_open
                },                                    <br>
                +#endif<br>
                 #ifdef GDK_WINDOWING_X11<br>
                   { "x11",      _gdk_x11_display_open },<br>
                 #endif<br>
                <br>
                I using GDK_BACKEND=mir GTK_CSD=1
                ./gtk/examples/hello-world<br>
                But still (lt-hello-world:6443): Gtk-WARNING **: cannot
                open display: :0<br>
                <br>
                I built the gtk ./autogen.sh --enable-mir-backend
                --disable-wayland-backend ...<br>
                Did you disable  the wayland backend? it is useless.<span
                  class="HOEnZb"><font color="#888888"><br>
                    <br>
                    Leslie<br>
                    <br>
                  </font></span></div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>
                        <div>
                          <div>
                            <div>
                              <div>Hey Leslie,<br>
                                <br>
                              </div>
                              I'm currently running it natively - you
                              need to explicitly tell GDK to use the mir
                              backend.<br>
                              <br>
                            </div>
                            ./autogen.sh --enable-mir-backend ...<br>
                          </div>
                          GDK_BACKEND=mir GTK_CSD=1
                          ./gtk/examples/hello-world<br>
                          <br>
                        </div>
                        There was a bug for a little bit where the
                        backend stub to pick the mir backend in
                        gdkdisplaymanager wasn't checked in to source
                        control, but I've fixed that now.<br>
                        <br>
                        I've (mostly) fixed the display lag problem.
                        Part of that is a fix to the mir compositor so
                        you'll need a recent (955+) revision of that.
                        There is still a condition where frame swaps can
                        get out of sync with input events which I'll
                        look into soon. <br>
                        <br>
                      </div>
                      Sam.<br>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote">On Thu, Aug 22, 2013 at
                        11:17 AM, Leslie Zhai <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:xiangzhai83@gmail.com"
                            target="_blank">xiangzhai83@gmail.com</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000">
                            <div>Hi Sam,<br>
                              <br>
                              I came back to "just for fun open source
                              project" from business development.<br>
                              <br>
                              I running Mir natively described in doc/<a
                                moz-do-not-send="true"
                                href="http://using_mir_on_pc.md"
                                target="_blank">using_mir_on_pc.md</a><br>
                              <br>
                                  $ sudo
                              mir_demo_server                                                     
                              <br>
                                  <Ctrl+Alt+F2> - log in to VT
                              2                                             
                              <br>
                                  $ sudo chmod 777
                              /tmp/mir_socket                                           
                              <br>
                                  $ gtk/examples/hello-world
                                                                    <br>
                                  <Ctrl+Alt+F1> - switch back to
                              Mir<br>
                              <br>
                              But (lt-hello-world:6443): Gtk-WARNING **:
                              cannot open display: :0<br>
                              <br>
                              So did you test the GDK Mir backend using
                              Mir natively way? or whether directly
                              using XMir?<span><font color="#888888"><br>
                                  <br>
                                  Leslie<br>
                                  <br>
                                </font></span></div>
                            <div>
                              <div>
                                <blockquote type="cite">
                                  <div dir="ltr">
                                    <div>
                                      <div>
                                        <div>Hey Leslie,<br>
                                          <br>
                                        </div>
                                        Just wanted to update you on
                                        this - I've got a very (basic)
                                        version of gtk+ up and running.
                                        Display, mouse and key events
                                        should work to a limited extent.
                                        There is no support for key
                                        modifiers or more complicated
                                        keys yet. I've also disabled
                                        support for crossing events as
                                        Mir seems to send
                                        mir_motion_event_hover_exit as
                                        soon as a mouse button is
                                        pressed, which tends to confuse
                                        the toolkit (as I've experienced
                                        in the past ...). I've also
                                        noticed that the display lags a
                                        bit behind the input - I suspect
                                        this is because frame clock
                                        support is also unimplemented,
                                        so we are probably doing a
                                        buffer swap at the wrong point
                                        in the paint cycle.<br>
                                        <br>
                                      </div>
                                      <div><a moz-do-not-send="true"
                                          href="https://github.com/smspillaz/gtk/commits/wip/mir"
                                          target="_blank">https://github.com/smspillaz/gtk/commits/wip/mir</a><br>
                                      </div>
                                      <div><br>
                                      </div>
                                      Anyways, its something to look at
                                      (or submit pull requests!) if you
                                      want.<br>
                                      <br>
                                    </div>
                                    <div>Thanks for doing the initial
                                      work on this.<br>
                                    </div>
                                    <div><br>
                                    </div>
                                    Sam.<br>
                                  </div>
                                  <div class="gmail_extra"><br>
                                    <br>
                                    <div class="gmail_quote">On Thu, Aug
                                      8, 2013 at 7:32 PM, Leslie Zhai <span
                                        dir="ltr"><<a
                                          moz-do-not-send="true"
                                          href="mailto:xiangzhai83@gmail.com"
                                          target="_blank">xiangzhai83@gmail.com</a>></span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote"
                                        style="margin:0 0 0
                                        .8ex;border-left:1px #ccc
                                        solid;padding-left:1ex">
                                        <div bgcolor="#FFFFFF"
                                          text="#000000">
                                          <div>Hi Sam,<br>
                                            <br>
                                            You are welcome :) OK, I
                                            will git push to <a
                                              moz-do-not-send="true"
                                              href="https://github.com/gnome/gtk"
                                              target="_blank">https://github.com/gnome/gtk</a><br>
                                            <br>
                                          </div>
                                          <div>
                                            <div>
                                              <blockquote type="cite">
                                                <div dir="ltr">
                                                  <div>
                                                    <div>
                                                      <div>
                                                        <div>Hi Leslie,<br>
                                                          <br>
                                                          Excellent.
                                                          What I'd
                                                          suggest doing
                                                          instead of
                                                          creating a new
                                                          repo is
                                                          instead
                                                          creating a
                                                          fork of <a
                                                          moz-do-not-send="true"
href="https://github.com/gnome/gtk" target="_blank">https://github.com/gnome/gtk</a>
                                                          so that
                                                          changes will
                                                          be tracked on
                                                          head (and not
                                                          on a divergent
                                                          branch).<br>
                                                        </div>
                                                        <br>
                                                      </div>
                                                      I haven't pushed
                                                      my changes
                                                      anywhere primarily
                                                      because there's
                                                      nothing
                                                      particularly
                                                      interesting  -
                                                      just gdk with a
                                                      copypasted wayland
                                                      backend with
                                                      s/wayland/mir at
                                                      the moment. It
                                                      might make sense
                                                      for me to work on
                                                      your branch
                                                      directly.<br>
                                                      <br>
                                                    </div>
                                                    As for cursor and
                                                    device support - I
                                                    don't think that
                                                    this is particularly
                                                    fatal to any kind of
                                                    Mir work. It should
                                                    be possible to just
                                                    function as though
                                                    there is only a
                                                    single input device
                                                    at the moment.
                                                    Cursor support can
                                                    probably also easily
                                                    be a no-op. I don't
                                                    think there is a
                                                    case in gdk for
                                                    retrieving the
                                                    cursor image from
                                                    the server.<br>
                                                    <br>
                                                  </div>
                                                  I'll look into it a
                                                  bit more later
                                                  tonight. Thanks :)<br>
                                                  <br>
                                                  Sam.<br>
                                                </div>
                                                <div class="gmail_extra"><br>
                                                  <br>
                                                  <div
                                                    class="gmail_quote">On
                                                    Thu, Aug 8, 2013 at
                                                    2:14 PM, Leslie Zhai
                                                    <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:xiangzhai83@gmail.com"
                                                        target="_blank">xiangzhai83@gmail.com</a>></span>
                                                    wrote:<br>
                                                    <blockquote
                                                      class="gmail_quote"
                                                      style="margin:0 0
                                                      0
                                                      .8ex;border-left:1px
                                                      #ccc
                                                      solid;padding-left:1ex">Hi
                                                      Sam, github repos
                                                      <a
                                                        moz-do-not-send="true"
href="https://github.com/xiangzhai/gtk-mir" target="_blank">https://github.com/xiangzhai/gtk-mir</a><br>
                                                      May I know your
                                                      github link :)
                                                      <div>
                                                        <div><br>
                                                          <br>
                                                          <blockquote
                                                          class="gmail_quote"
                                                          style="margin:0
                                                          0 0
                                                          .8ex;border-left:1px
                                                          #ccc
                                                          solid;padding-left:1ex">
                                                          Sam,<br>
                                                          <br>
                                                          I paused due
                                                          to there is no
                                                          cursor nor
                                                          device in Mir
                                                          concept, but
                                                          Wayland has
                                                          it.<br>
                                                          I want to team
                                                          up and work on
                                                          this together
                                                          :) I can learn
                                                          a lot of
                                                          things from
                                                          you and other
                                                          Linux geeks!<br>
                                                          <br>
                                                          1. yes, there
                                                          is only
                                                          cairo-gl, but
                                                          we could
                                                          follow the Mir
                                                          client
                                                          examples about
                                                          EGL<br>
                                                          2. yes, we
                                                          need to remove
                                                          all Wayland
                                                          code :)<br>
                                                          3. ok, I will
                                                          create the
                                                          repos under my
                                                          github <a
                                                          moz-do-not-send="true"
href="https://github.com/xiangzhai" target="_blank">https://github.com/xiangzhai</a><br>
                                                          <br>
                                                          <blockquote
                                                          class="gmail_quote"
                                                          style="margin:0
                                                          0 0
                                                          .8ex;border-left:1px
                                                          #ccc
                                                          solid;padding-left:1ex">
                                                          Hey Leslie,<br>
                                                          <br>
                                                          I saw on
                                                          mir-devel that
                                                          you were
                                                          hacking on a
                                                          mir gdk
                                                          backend. I
                                                          actually
                                                          started
                                                          looking into
                                                          this last
                                                          night and then
                                                          noticed just
                                                          now that
                                                          you've started
                                                          doing this.
                                                          (Actually, I
                                                          took the same
                                                          approach of
                                                          copypasting
                                                          the wayland
                                                          backend).<br>
                                                          <br>
                                                          Were you still
                                                          working on
                                                          this. I was
                                                          wondering if
                                                          you wanted to
                                                          team up and
                                                          work on this
                                                          together.<br>
                                                          <br>
                                                          Some open
                                                          questions:<br>
                                                          <br>
                                                          1. I've
                                                          noticed that
                                                          you're
                                                          creating an
                                                          EGL context on
                                                          the mir
                                                          surface as
                                                          soon as its
                                                          created. This
                                                          seems strange
                                                          to me as gdk
                                                          has no egl
                                                          rendering
                                                          backend
                                                          (asides from
                                                          perhaps
                                                          cairo-gl,
                                                          which is not
                                                          enabled by
                                                          default).
                                                          Would it be
                                                          easier to
                                                          software-backed
                                                          buffers for
                                                          this purpose
                                                          (similar to
                                                          wayland?)<br>
                                                          2. There are
                                                          some
                                                          references to
                                                          wayland
                                                          structs still
                                                          in the code, I
                                                          imagine these
                                                          should be
                                                          removed<br>
                                                          3. The code is
                                                          hosted on
                                                          launchpad.
                                                          Would it be
                                                          easier to host
                                                          it on github
                                                          for easier
                                                          mergability
                                                          back into
                                                          upstream gdk?<br>
                                                          <br>
                                                          Sam.<br>
                                                          <br>
                                                          </blockquote>
                                                          <br>
                                                          </blockquote>
                                                          <br>
                                                        </div>
                                                      </div>
                                                    </blockquote>
                                                  </div>
                                                  <br>
                                                  <br clear="all">
                                                  <br>
                                                  -- <br>
                                                  Sam Spilsbury </div>
                                              </blockquote>
                                              <br>
                                            </div>
                                          </div>
                                        </div>
                                      </blockquote>
                                    </div>
                                    <br>
                                    <br clear="all">
                                    <br>
                                    -- <br>
                                    Sam Spilsbury </div>
                                </blockquote>
                                <br>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <br>
                      -- <br>
                      Sam Spilsbury </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        Sam Spilsbury
      </div>
    </blockquote>
    <br>
  </body>
</html>