Re: Java GUI support on Wayland

2016-09-26 Thread Erik De Rijcke
In case it's to anyone's interest. I've created a working javafx wayland
poc. Code is here: https://github.com/udevbe/wayland-javafx


On Mon, Aug 29, 2016 at 1:38 PM, Vinoth Kumar 
wrote:

> Hi Erik,
>
> Thanks a lot for the additional information. I have got some idea now.
>
> Regards,
> Vinoth
>
> On Mon, Aug 29, 2016 at 5:00 PM, Erik De Rijcke 
> wrote:
>
>> Hi Vinoth,
>>
>> I replied to your report on github. (btw I'm not jason ekstrand or
>> 'jekstrand' on github, but 'zubnix').
>>
>> To give some more context:
>> I started creating my own java wayland bindings after jason's work got
>> abandoned. (see https://github.com/udevbe/wayland-java-bindings ) and I
>> am currently working on creating a pure java wayland compositor (see
>> https://github.com/udevbe/westmalle ).
>>
>> As for JavaFX:
>> JavaFX does not work on wayland for now and will not any time soon
>> (ever?). (certainly not implemented by Oracle given their current
>> priorities...). I did however start working on a javafx port some time ago
>> but the worked stalled/stopped for now as I'm doing all this for free in my
>> spare time and currently have other spare time priorities :)
>>
>> As for the wayland java bindings:
>> The library only provides the ability to communicate using the wayland
>> protocol. You still need to implement a new backend for JavaFX (which in
>> turn makes use of the wayland java bindings library) to have it run on
>> wayland.
>>
>> I hope this clears some things up for you.
>>
>> kind regards,
>>
>> Erik
>>
>>
>> On Mon, Aug 29, 2016 at 1:06 PM, Olivier Fourdan 
>> wrote:
>>
>>> Hi,
>>>
>>> On 29 August 2016 at 13:01, Vinoth Kumar 
>>> wrote:
>>> > Using XWayland would mean using Xcode itself right? In that case, it
>>> may not
>>> > be feasible for me as our system has only wayland supported. Probably,
>>> I
>>>
>>> Yes, Xwayland is an Xserver.
>>>
>>> > have to give this: https://github.com/jekstrand/wayland-java
>>>
>>> I could be wrong, but I don't think this is a port of Java to Wayland,
>>> it's the Wayland API for Java, different thing.
>>>
>>> Cheers,
>>> Olivier
>>> ___
>>> wayland-devel mailing list
>>> wayland-devel@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
>>>
>>
>>
>
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] shared/platform: include weston-egl-ext.h only if ENABLE_EGL is defined

2016-09-26 Thread Pekka Paalanen
On Thu, 15 Sep 2016 13:01:49 +0200
Krzysztof Konopko  wrote:

> Including `weston-egl-ext.h` causes compilation failure for configurations
> with EGL disabled.
> 
> Verified with `--disable-egl`, `--disable-x11-compositor`
> and `--disable-drm-compositor`.
> 
> Signed-off-by: Krzysztof Konopko 
> ---
>  shared/platform.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/shared/platform.h b/shared/platform.h
> index 1eb96fd..30db1a6 100644
> --- a/shared/platform.h
> +++ b/shared/platform.h
> @@ -33,9 +33,9 @@
>  #include 
>  #include 
>  #include 
> -#endif
> 
>  #include "weston-egl-ext.h"
> +#endif
> 
>  #ifdef  __cplusplus
>  extern "C" {
> --
> 2.1.4

R-b me and pushed:
   4e2fa0a..e338ced  master -> master


Thanks,
pq


pgpocrVjjCf1u.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland v6] util: Document wl_list methods

2016-09-26 Thread Pekka Paalanen
On Thu, 22 Sep 2016 22:11:39 -0700
Bryce Harrington  wrote:

> On Thu, Sep 22, 2016 at 09:59:37PM -0500, Yong Bakos wrote:
> > From: Yong Bakos 
> > 
> > Add doxygen comment blocks to all wl_list methods.
> > 
> > Signed-off-by: Yong Bakos   
> 
> Reviewed-by: Bryce Harrington 
> 
> One extremely minor wording suggestion below only if you do another rev.
> But this all looks extremely good; will be nice to get the wl_list
> documentation shaped up, thanks.
> 
> Bryce
> 
> > ---
> > v6: Change description to doubly-linked list (pq)
> > v5: Change description to linked-list [err]
> > Clarify uses of `wl_list_init` (pq)
> > v4: Fix variable name in sample code. (pq)
> > Remove implemenetation details of pointer state. (pq)
> > Remove note about __typeof__ entirely.
> > - it's not helpful as a note or a code comment either
> > Change sample code indentation to just spaces. (pq)
> > Use _list suffix for list in sample code. (pq)
> > Use 'iterate' instead of enumerate, for consistency. (pq)
> > Note that only removing 'pos' is safe for *_safe methods. (pq, giucam)
> > v3: Standardize on term 'element', to match param names, tests, and other 
> > text.
> > Use 'relates' for macros (instead of 'memberof').
> > v2: Refine the writing for clarity.
> > Add dox for wl_list macros, omitted in v1.
> > Add notices for unsafe operations and invalid states (giucam, pq)
> >  src/wayland-util.h | 224 
> > +++--
> >  1 file changed, 184 insertions(+), 40 deletions(-)
> > 

> > +/**
> > + * Inserts all of the elements of one list into another, after the element
> > + * represented by \p list.
> > + *
> > + * \note This leaves \p other itself in an invalid state.  
> 
> Might read better if you take the word 'itself' out?
> 

Hi,

I made the change Bryce suggested and pushed the result:
   454df51..f7e1dcc  master -> master


Thanks,
pq


pgp8dMvnr1qCm.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] libweston-desktop: fix stale ping when a wl_shell_surface is destroyed

2016-09-26 Thread Giulio Camuffo
When sending a ping event to a surface using the wl_shell interface,
if that surface is destroyed before we receive the pong we will never
receive it, even if the client is actually responsive, since the
interface does not exist anymore. So when the surface if destroyed
pretend it's a pong and reset the ping state.
---

v2: put the logic in the wl_shell specific file instead of the common code

 libweston-desktop/client.c   | 10 +-
 libweston-desktop/internal.h |  4 +++-
 libweston-desktop/wl-shell.c | 42 ++--
 libweston-desktop/xdg-shell-v5.c |  2 +-
 libweston-desktop/xdg-shell-v6.c |  2 +-
 libweston-desktop/xwayland.c |  3 ++-
 6 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/libweston-desktop/client.c b/libweston-desktop/client.c
index 29c3c98..810b6ba 100644
--- a/libweston-desktop/client.c
+++ b/libweston-desktop/client.c
@@ -39,6 +39,7 @@ struct weston_desktop_client {
uint32_t ping_serial;
struct wl_event_source *ping_timer;
struct wl_signal destroy_signal;
+   void *user_data;
 };
 
 void
@@ -86,7 +87,7 @@ weston_desktop_client_create(struct weston_desktop *desktop,
 wl_dispatcher_func_t dispatcher,
 const struct wl_interface *interface,
 const void *implementation, uint32_t version,
-uint32_t id)
+uint32_t id, void *user_data)
 {
struct weston_desktop_client *client;
struct wl_display *display;
@@ -101,6 +102,7 @@ weston_desktop_client_create(struct weston_desktop *desktop,
 
client->desktop = desktop;
client->client = wl_client;
+   client->user_data = user_data;
 
wl_list_init(>surface_list);
wl_signal_init(>destroy_signal);
@@ -210,3 +212,9 @@ weston_desktop_client_pong(struct weston_desktop_client 
*client, uint32_t serial
wl_event_source_timer_update(client->ping_timer, 0);
client->ping_serial = 0;
 }
+
+void *
+weston_desktop_client_get_user_data(struct weston_desktop_client *client)
+{
+   return client->user_data;
+}
diff --git a/libweston-desktop/internal.h b/libweston-desktop/internal.h
index a9c974b..6f8b5aa 100644
--- a/libweston-desktop/internal.h
+++ b/libweston-desktop/internal.h
@@ -128,7 +128,7 @@ weston_desktop_client_create(struct weston_desktop *desktop,
 wl_dispatcher_func_t dispatcher,
 const struct wl_interface *interface,
 const void *implementation, uint32_t version,
-uint32_t id);
+uint32_t id, void *user_data);
 
 void
 weston_desktop_client_add_destroy_listener(struct weston_desktop_client 
*client,
@@ -143,6 +143,8 @@ weston_desktop_client_get_surface_list(struct 
weston_desktop_client *client);
 void
 weston_desktop_client_pong(struct weston_desktop_client *client,
   uint32_t serial);
+void *
+weston_desktop_client_get_user_data(struct weston_desktop_client *client);
 
 struct weston_desktop_surface *
 weston_desktop_surface_create(struct weston_desktop *desktop,
diff --git a/libweston-desktop/wl-shell.c b/libweston-desktop/wl-shell.c
index ded69f7..3a81f42 100644
--- a/libweston-desktop/wl-shell.c
+++ b/libweston-desktop/wl-shell.c
@@ -58,6 +58,11 @@ struct weston_desktop_wl_shell_surface {
enum weston_desktop_wl_shell_surface_state state;
 };
 
+struct wl_shell_client {
+   struct weston_desktop_wl_shell_surface *ping_surface;
+   uint32_t ping_serial;
+};
+
 static void
 weston_desktop_wl_shell_surface_set_size(struct weston_desktop_surface 
*dsurface,
 void *user_data,
@@ -109,7 +114,12 @@ weston_desktop_wl_shell_surface_ping(struct 
weston_desktop_surface *dsurface,
 uint32_t serial, void *user_data)
 {
struct weston_desktop_wl_shell_surface *surface = user_data;
+   struct weston_desktop_client *client =
+   weston_desktop_surface_get_client(dsurface);
+   struct wl_shell_client *wsc = 
weston_desktop_client_get_user_data(client);
 
+   wsc->ping_surface = surface;
+   wsc->ping_serial = serial;
wl_shell_surface_send_ping(surface->resource, serial);
 }
 
@@ -179,10 +189,29 @@ weston_desktop_wl_shell_change_state(struct 
weston_desktop_wl_shell_surface *sur
 }
 
 static void
+pong_client(struct weston_desktop_client *client, uint32_t serial)
+{
+   struct wl_shell_client *wsc = 
weston_desktop_client_get_user_data(client);
+
+   wsc->ping_surface = NULL;
+   wsc->ping_serial = 0;
+   weston_desktop_client_pong(client, serial);
+}
+
+static void
 weston_desktop_wl_shell_surface_destroy(struct weston_desktop_surface 
*dsurface,
void *user_data)
 {
struct weston_desktop_wl_shell_surface *surface