How to release the weston_buffer after weston_view is destroyed.

2018-07-28 Thread Sichem Zhou
Dear Weston devs:

Sorry for the bothering in when weston-5.0 is approaching, but I am stuck
in the project for three days I need some one's help very much.

I have a widget implementation of shell widgets that destroys the
weston_view
when pressed Esc. The widget is implemented in wayland EGL. Here is the
view_destroy code.

void
twshell_close_ui_surface(struct weston_surface *wd_surface)
{
struct weston_view *view, *next;
wd_surface->committed = NULL;
wd_surface->committed_private = NULL;
wl_list_for_each_safe(view, next, _surface->views, surface_link)
{
weston_view_destroy(view);
}
}

The weston_view is destroyed but the the buffer in the last commit was not
released and the done event was not sent to the widget. When I triggered
the event to show widget again, the client was stuck in EGLSwapbuffer. I
found out about this by using WAYLAND_DEBUG env variable, I hope to the
way to release the buffer after umapping the weston view. Thanks very much.

Regards,
Sichem
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH v8 wayland-protocols] text-input: Add v3 of the text-input protocol

2018-07-28 Thread Dorota Czaplejewicz
From: Carlos Garnacho 

This new protocol description is an evolution of v2.

- All pre-edit text styling is gone.
- Pre-edit cursor can span characters.
- No events regarding input panel (OSK) state nor covered rectangle.
  Compositors are still free to handle situations where the keyboard
  focus rectangle is covered by the input panel.
- No set_preferred_language request for clients.
- There is no event to send keysyms. Compositors can use wl_keyboard
  interface instead.
- All state is double-buffered, with specified defaults.
- The compositor can be notified about external changes to the state.
- The client can detect outdated requests.

Signed-off-by: Dorota Czaplejewicz 
Signed-off-by: Carlos Garnacho 
---
Hello all,

this new change stems from real experiences developing an implementation of 
text-input. Under Carlos' guidance, I've been developing support in GTK3, as 
well as wlroots [0]. There were lessons to be learned, and they are 
incorporated into this new patch revision.

The one significant change consists of adding a serial number to each state 
sent by the client. The input method (e.g. the compositor) will then update its 
beliefs about the text field state, and send new requests, along with the 
serial number. This allows the client to detect requests based on outdated 
states and handle them in a special way, i.e. ignore requests for permanent 
changes.

At the same time, the enable request becomes effective only after a commit, to 
allow the client to send a state bundle together with it.

The second important change regards passing set_surrounding_text metadata in 
the set_text_change_cause request. It's necessary for the input method to 
understand when the user stopped using it to back off. The change_cause 
enumeration could be extended in the future with causes such as "navigation", 
"typing", or "redaction" to achieve better granularity than a catchall "other".

Apart from these changes, some descriptions have been clarified, and 
circumstances were under which set_surrounding_text should be sent were spelled 
out.

I hope that you enjoy the read!

Regards,
Dorota Czaplejewicz

[0] https://gitlab.gnome.org/GNOME/gtk/merge_requests/272

 Makefile.am|   1 +
 unstable/text-input/text-input-unstable-v3.xml | 441 +
 2 files changed, 442 insertions(+)
 create mode 100644 unstable/text-input/text-input-unstable-v3.xml

diff --git a/Makefile.am b/Makefile.am
index 4b9a901..86d7ca9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,7 @@ unstable_protocols =
\
unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml  
\
unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml  
\
unstable/text-input/text-input-unstable-v1.xml  
\
+   unstable/text-input/text-input-unstable-v3.xml  
\
unstable/input-method/input-method-unstable-v1.xml  
\
unstable/xdg-shell/xdg-shell-unstable-v5.xml
\
unstable/xdg-shell/xdg-shell-unstable-v6.xml
\
diff --git a/unstable/text-input/text-input-unstable-v3.xml 
b/unstable/text-input/text-input-unstable-v3.xml
new file mode 100644
index 000..2e8b72f
--- /dev/null
+++ b/unstable/text-input/text-input-unstable-v3.xml
@@ -0,0 +1,441 @@
+
+
+
+  
+Copyright © 2012, 2013 Intel Corporation
+Copyright © 2015, 2016 Jan Arne Petersen
+Copyright © 2017, 2018 Red Hat, Inc.
+Copyright © 2018   Purism SPC
+
+Permission to use, copy, modify, distribute, and sell this
+software and its documentation for any purpose is hereby granted
+without fee, provided that the above copyright notice appear in
+all copies and that both that copyright notice and this permission
+notice appear in supporting documentation, and that the name of
+the copyright holders not be used in advertising or publicity
+pertaining to distribution of the software without specific,
+written prior permission.  The copyright holders make no
+representations about the suitability of this software for any
+purpose.  It is provided "as is" without express or implied
+warranty.
+
+THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
+  
+
+  
+
+  The zwp_text_input_v3 interface represents text input and input methods
+  associated with a seat. It provides enter/leave