Sam`s GDK-Mir Backend

Leslie Zhai xiangzhai83 at gmail.com
Thu Aug 22 04:57:14 UTC 2013


Hi Sam, gtk3-demo WORKED :)

But there is still some bug need to fix, such as Invalid rectangle region.

Leslie

> That looks like the fix I applied. Have you tried stepping through the 
> library to make sure it was conditionally compiled in?
>
>
> On Thu, Aug 22, 2013 at 11:34 AM, Leslie Zhai <xiangzhai83 at gmail.com 
> <mailto:xiangzhai83 at gmail.com>> wrote:
>
>     Hi Sam,
>
>     Did you fixed the gdkdisplaymanager without mir bug like this?
>
>     diff --git a/gdk/gdkdisplaymanager.c b/gdk/gdkdisplaymanager.c
>     index 075f507..84c07a4 100644
>     --- a/gdk/gdkdisplaymanager.c
>     +++ b/gdk/gdkdisplaymanager.c
>     @@ -60,6 +60,10 @@
>      #include "wayland/gdkprivate-wayland.h"
>      #endif
>
>     +#ifdef GDK_WINDOWING_MIR
>     +#include "mir/gdkprivate-mir.h"
>     +#endif
>     +
>      /**
>       * SECTION:gdkdisplaymanager
>       * @Short_description: Maintains a list of all open GdkDisplays
>     @@ -270,6 +274,9 @@ static GdkBackend gdk_backends[] = {
>      #ifdef GDK_WINDOWING_WAYLAND
>        { "wayland",  _gdk_wayland_display_open },
>      #endif
>     +#ifdef GDK_WINDOWING_MIR
>     +  { "mir",      _gdk_mir_display_open },
>     +#endif
>      #ifdef GDK_WINDOWING_X11
>        { "x11",      _gdk_x11_display_open },
>      #endif
>
>     I using GDK_BACKEND=mir GTK_CSD=1 ./gtk/examples/hello-world
>     But still (lt-hello-world:6443): Gtk-WARNING **: cannot open
>     display: :0
>
>     I built the gtk ./autogen.sh --enable-mir-backend
>     --disable-wayland-backend ...
>     Did you disable  the wayland backend? it is useless.
>
>     Leslie
>
>>     Hey Leslie,
>>
>>     I'm currently running it natively - you need to explicitly tell
>>     GDK to use the mir backend.
>>
>>     ./autogen.sh --enable-mir-backend ...
>>     GDK_BACKEND=mir GTK_CSD=1 ./gtk/examples/hello-world
>>
>>     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.
>>
>>     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.
>>
>>     Sam.
>>
>>
>>     On Thu, Aug 22, 2013 at 11:17 AM, Leslie Zhai
>>     <xiangzhai83 at gmail.com <mailto:xiangzhai83 at gmail.com>> wrote:
>>
>>         Hi Sam,
>>
>>         I came back to "just for fun open source project" from
>>         business development.
>>
>>         I running Mir natively described in doc/using_mir_on_pc.md
>>         <http://using_mir_on_pc.md>
>>
>>             $ sudo mir_demo_server
>>             <Ctrl+Alt+F2> - log in to VT 2
>>             $ sudo chmod 777 /tmp/mir_socket
>>             $ gtk/examples/hello-world
>>             <Ctrl+Alt+F1> - switch back to Mir
>>
>>         But (lt-hello-world:6443): Gtk-WARNING **: cannot open
>>         display: :0
>>
>>         So did you test the GDK Mir backend using Mir natively way?
>>         or whether directly using XMir?
>>
>>         Leslie
>>
>>>         Hey Leslie,
>>>
>>>         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.
>>>
>>>         https://github.com/smspillaz/gtk/commits/wip/mir
>>>
>>>         Anyways, its something to look at (or submit pull requests!)
>>>         if you want.
>>>
>>>         Thanks for doing the initial work on this.
>>>
>>>         Sam.
>>>
>>>
>>>         On Thu, Aug 8, 2013 at 7:32 PM, Leslie Zhai
>>>         <xiangzhai83 at gmail.com <mailto:xiangzhai83 at gmail.com>> wrote:
>>>
>>>             Hi Sam,
>>>
>>>             You are welcome :) OK, I will git push to
>>>             https://github.com/gnome/gtk
>>>
>>>>             Hi Leslie,
>>>>
>>>>             Excellent. What I'd suggest doing instead of creating a
>>>>             new repo is instead creating a fork of
>>>>             https://github.com/gnome/gtk so that changes will be
>>>>             tracked on head (and not on a divergent branch).
>>>>
>>>>             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.
>>>>
>>>>             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.
>>>>
>>>>             I'll look into it a bit more later tonight. Thanks :)
>>>>
>>>>             Sam.
>>>>
>>>>
>>>>             On Thu, Aug 8, 2013 at 2:14 PM, Leslie Zhai
>>>>             <xiangzhai83 at gmail.com <mailto:xiangzhai83 at gmail.com>>
>>>>             wrote:
>>>>
>>>>                 Hi Sam, github repos
>>>>                 https://github.com/xiangzhai/gtk-mir
>>>>                 May I know your github link :)
>>>>
>>>>
>>>>                     Sam,
>>>>
>>>>                     I paused due to there is no cursor nor device
>>>>                     in Mir concept, but Wayland has it.
>>>>                     I want to team up and work on this together :)
>>>>                     I can learn a lot of things from you and other
>>>>                     Linux geeks!
>>>>
>>>>                     1. yes, there is only cairo-gl, but we could
>>>>                     follow the Mir client examples about EGL
>>>>                     2. yes, we need to remove all Wayland code :)
>>>>                     3. ok, I will create the repos under my github
>>>>                     https://github.com/xiangzhai
>>>>
>>>>                         Hey Leslie,
>>>>
>>>>                         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).
>>>>
>>>>                         Were you still working on this. I was
>>>>                         wondering if you wanted to team up and work
>>>>                         on this together.
>>>>
>>>>                         Some open questions:
>>>>
>>>>                         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?)
>>>>                         2. There are some references to wayland
>>>>                         structs still in the code, I imagine these
>>>>                         should be removed
>>>>                         3. The code is hosted on launchpad. Would
>>>>                         it be easier to host it on github for
>>>>                         easier mergability back into upstream gdk?
>>>>
>>>>                         Sam.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>             -- 
>>>>             Sam Spilsbury
>>>
>>>
>>>
>>>
>>>         -- 
>>>         Sam Spilsbury
>>
>>
>>
>>
>>     -- 
>>     Sam Spilsbury
>
>
>
>
> -- 
> Sam Spilsbury

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/mir-devel/attachments/20130822/2180277c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMAG0817.jpg
Type: image/jpeg
Size: 1309900 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/mir-devel/attachments/20130822/2180277c/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMAG0818.jpg
Type: image/jpeg
Size: 1596247 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/mir-devel/attachments/20130822/2180277c/attachment-0004.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IMAG0821.jpg
Type: image/jpeg
Size: 1200314 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/mir-devel/attachments/20130822/2180277c/attachment-0005.jpg>


More information about the Mir-devel mailing list