Re: [PATCH] logind: delay wakeup until DRM-device is resumed

2013-12-05 Thread David Herrmann
Hi

On Tue, Dec 3, 2013 at 10:42 PM, Kristian Høgsberg  wrote:
> On Sat, Nov 30, 2013 at 2:25 AM, David Herrmann  wrote:
>> The logind API was designed to allow any kind of devices and any number of
>> devices. It has no idea of "main DRM device" or similar. However, the
>> weston DRM backend was designed with a single DRM device as master.
>> Therefore, we wake it up unconditionally on session-wakeup. But this may
>> fail with logind as a session may be awake, but not all devices have been
>> resumed, yet.
>>
>> Therefore, we change the weston-logind backend to deal with this case
>> correctly. Instead of waking up the compositor on session-wakeup, we wait
>> for the main DRM device to wake up. Once we get the event, we notify the
>> compositor.
>>
>> For sleep, we reverse this logic. On *any* of the following events we
>> tell the compositor to go to sleep:
>>  - Session gets inactive
>>  - DRM device gets inactive
>>  - DRM device is removed
>> This guarantees, that weston is only active if *both*, the session and the
>> main DRM device are awake/active.
>>
>> Note that we could actually rely solely on the DRM-device Pause/Resume
>> events from logind and drop all the Active-Prop-Changed handling. logind
>> guarantees proper ordering of both. However, in case we ever change weston
>> to support multiple GPUs, we need the per-device notification. Thus, keep
>> the code. This also makes weston more fail-safe in case logind fails to
>> send the PauseDevice event (for whatever reason..).
>
> This explains the intermittent pageflip failures I was seeing.  The
> patch makes sense and makes VT switching work almost reliably.  The
> one missing thing is that occasionally my pointer doesn't work.  It
> looks like it remains locked by the X driver, and since it's only my
> touchpad (keyboard always works) I'm guessing it's a
> xf86-input-synaptics problem.  It happens with weston-launch too, but
> it doesn't look like a race. I can reproduce with just VT switching
> from X to a VT and running evtest.  That is, the device remains locked
> long enough for me to type evtest, select the device and then see the
> "Device is grabbed..." message.  It doesn't get ungrabbed until I VT
> switch back to X and then back to the VT.
>
> At this point I'm calling it a synaptics bug and merging your patch.

You can set: Option "GrabEventDevice" "no"
in the synaptics xorg config, btw. I tried reading through the
synaptics code but couldn't find anything related to that bug. Hmm..
but I'm not really familiar with the xinput drivers code base..

Thanks for merging! Now everything should be in-place of the logind
work. A bunch of changes for CONFIG_VT=n will be needed, but I'm
working on that.
David
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston] introduces a setting to give permission to any client to do screenshots

2013-12-05 Thread Pekka Paalanen
On Wed,  4 Dec 2013 17:38:23 +0100
Sebastian Wick  wrote:

> This patch adds a screenshooter section with the "restrict-access"
> setting which is on by default and is the current behavior of weston.
> When turning it off, all clients can use the screenshooter protocol.
> This makes screen capturing for clients easier because they don't
> have to be started by weston.
> ---
>  man/weston.ini.man  | 6 ++
>  src/screenshooter.c | 8 +++-
>  weston.ini.in   | 3 +++
>  3 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/man/weston.ini.man b/man/weston.ini.man
> index 6be90bf..b94ac3d 100644
> --- a/man/weston.ini.man
> +++ b/man/weston.ini.man
> @@ -408,6 +408,12 @@ The terminal shell (string). Sets the $TERM
> variable. sets the path to the xserver to run (string).
>  .RE
>  .RE
> +.SH "SCREENSHOOTER SECTION"
> +.TP 7
> +.BI "restrict-access=" true
> +only allow authenticated clients to take screenshots (boolean).
> +.RE
> +.RE
>  .SH "SEE ALSO"
>  .BR weston (1),
>  .BR weston-launch (1),
> diff --git a/src/screenshooter.c b/src/screenshooter.c
> index 0c657bc..65b6c09 100644
> --- a/src/screenshooter.c
> +++ b/src/screenshooter.c
> @@ -224,11 +224,17 @@ bind_shooter(struct wl_client *client,
>  {
>   struct screenshooter *shooter = data;
>   struct wl_resource *resource;
> + struct weston_config_section *section;
> + int restrict_access;
>  
>   resource = wl_resource_create(client,
> &screenshooter_interface, 1,
> id); 
> - if (client != shooter->client) {
> + section = weston_config_get_section(shooter->ec->config,
> "screenshooter", NULL, NULL);
> + weston_config_section_get_bool(section,
> + "restrict-access", &restrict_access,
> 1); +
> + if (restrict_access && client != shooter->client) {
>   wl_resource_post_error(resource,
> WL_DISPLAY_ERROR_INVALID_OBJECT, "screenshooter failed: permission
> denied"); wl_resource_destroy(resource);
> diff --git a/weston.ini.in b/weston.ini.in
> index 5181a9e..bc32567 100644
> --- a/weston.ini.in
> +++ b/weston.ini.in
> @@ -65,3 +65,6 @@ path=@libexecdir@/weston-keyboard
>  #constant_accel_factor = 50
>  #min_accel_factor = 0.16
>  #max_accel_factor = 1.0
> +
> +#[screenshooter]
> +#restrict-access=false

This looks ok to me.

Thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] Add a weston_surface_set_size function

2013-12-05 Thread Pekka Paalanen
On Wed,  4 Dec 2013 20:32:03 -0600
Jason Ekstrand  wrote:

> Surfaces that are created by clients get their size automatically
> updated by the attach/commit.  Surfaces created directly by shells
> (such as black surfaces) sometimes need to be manually resized.  This
> function allows you to do that while being somewhat less messy than
> messing with the internals of weston_surface manually.
> 
> Signed-off-by: Jason Ekstrand 
> ---
>  desktop-shell/shell.c |  9 +++--
>  src/compositor.c  | 15 +++
>  src/compositor.h  |  4 
>  3 files changed, 18 insertions(+), 10 deletions(-)
> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index de54e37..56e0338 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -504,8 +504,7 @@ create_focus_surface(struct weston_compositor *ec,
>   fsurf->view = weston_view_create (surface);
>   fsurf->view->output = output;
>  
> - surface->width = output->width;
> - surface->height = output->height;
> + weston_surface_set_size(surface, output->width,
> output->height); weston_view_set_position(fsurf->view, output->x,
> output->y); weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1.0);
>   pixman_region32_fini(&surface->opaque);
> @@ -2452,8 +2451,7 @@ create_black_surface(struct weston_compositor
> *ec, pixman_region32_fini(&surface->input);
>   pixman_region32_init_rect(&surface->input, 0, 0, w, h);
>  
> - surface->width = w;
> - surface->height = h;
> + weston_surface_set_size(surface, w, y);
>   weston_view_set_position(view, x, y);
>  
>   return view;
> @@ -4585,8 +4583,7 @@ shell_fade_create_surface(struct desktop_shell
> *shell) return NULL;
>   }
>  
> - surface->width = 8192;
> - surface->height = 8192;
> + weston_surface_set_size(surface, 8192, 8192);
>   weston_view_set_position(view, 0, 0);
>   weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1.0);
>   wl_list_insert(&compositor->fade_layer.view_list,
> diff --git a/src/compositor.c b/src/compositor.c
> index 8f4bdef..97c42b3 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -1133,8 +1133,7 @@ weston_surface_is_mapped(struct weston_surface
> *surface) }
>  
>  static void
> -weston_surface_set_size(struct weston_surface *surface,
> - int32_t width, int32_t height)
> +surface_set_size(struct weston_surface *surface, int32_t width,
> int32_t height) {
>   struct weston_view *view;
>  
> @@ -1148,13 +1147,21 @@ weston_surface_set_size(struct weston_surface
> *surface, weston_view_geometry_dirty(view);
>  }
>  
> +WL_EXPORT void
> +weston_surface_set_size(struct weston_surface *surface,
> + int32_t width, int32_t height)
> +{
> + assert(!surface->resource);
> + surface_set_size(surface, width, height);
> +}
> +
>  static void
>  weston_surface_set_size_from_buffer(struct weston_surface *surface)
>  {
>   int32_t width, height;
>  
>   if (!surface->buffer_ref.buffer) {
> - weston_surface_set_size(surface, 0, 0);
> + surface_set_size(surface, 0, 0);
>   return;
>   }
>  
> @@ -1174,7 +1181,7 @@ weston_surface_set_size_from_buffer(struct
> weston_surface *surface) 
>   width = width / surface->buffer_viewport.scale;
>   height = height / surface->buffer_viewport.scale;
> - weston_surface_set_size(surface, width, height);
> + surface_set_size(surface, width, height);
>  }
>  
>  WL_EXPORT uint32_t
> diff --git a/src/compositor.h b/src/compositor.h
> index 6bd637e..9f89d00 100644
> --- a/src/compositor.h
> +++ b/src/compositor.h
> @@ -1138,6 +1138,10 @@ weston_view_schedule_repaint(struct
> weston_view *view); int
>  weston_surface_is_mapped(struct weston_surface *surface);
>  
> +WL_EXPORT void
> +weston_surface_set_size(struct weston_surface *surface,
> + int32_t width, int32_t height);
> +
>  void
>  weston_surface_schedule_repaint(struct weston_surface *surface);
>  

Looking good!

Thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[Weston] RDP backend state

2013-12-05 Thread Manuel BACHMANN
Hi folks,

I tried to build the Weston 1.3.1 RDP backend using latest FreeRDP master,
and I managed to get it to compile using the following trivial patch :

http://pastebin.com/XGz4xYaE

It basically runs, and I can connect to it with :
rdesktop -4 -b 

However, it renders only a black screen, and server-side I get the
following messages :

unable to checkDescriptor for 
failed to initialize EGL
EGL does not seem to work, falling back to software rendering and wl_shm

(my EGL doesn't work, so it may be normal)
I noticed I can run clients, though, and they keep running until I kill
them or weston hangs. So it looks more like a rendering issue.

Does someone know how to make it work, or if it's supposed to ? Is it
linked the error messages ?

Thanks

-- 
Regards,

*Manuel BACHMANN*
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [Weston] RDP backend state

2013-12-05 Thread Michael Hanselmann
On 05.12.2013 15:14, Manuel BACHMANN wrote:
> However, it renders only a black screen, and server-side I get the 
> following messages :
> 
> unable to checkDescriptor for  failed to initialize EGL EGL does
> not seem to work, falling back to software rendering and wl_shm
> 
> (my EGL doesn't work, so it may be normal) I noticed I can run
> clients, though, and they keep running until I kill them or weston
> hangs. So it looks more like a rendering issue.
> 
> Does someone know how to make it work, or if it's supposed to ? Is
> it linked the error messages ?

I filed this bug a couple of days ago:
. With some more
code hacks I managed to get an image once, but the server would crash as
soon as an input event arrived. There seem to be some severe issue with
the code as-is, but I didn't have time to read into it in more detail.
At least I can confirm your issue report.

Michael



signature.asc
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [Weston] RDP backend state

2013-12-05 Thread Manuel BACHMANN
Hi Michael,

Thanks for link ! I tried messing with the code too, and even directly in
FreeRDP, but it rapidly went out of control so I stopped...

I found some referencs that it worked back in April-May :
http://lists.freedesktop.org/archives/wayland-bugs/2013-July/001784.html(Weston
1.1 ?) so it may be related to functionality breaks in both Weston
and FreeRDP.

If you managed got an image, then maybe the "checkDescriptor" message isn't
relevant. I'll dig into this.

Regards,

Manuel

2013/12/5 Michael Hanselmann 

> On 05.12.2013 15:14, Manuel BACHMANN wrote:
> > However, it renders only a black screen, and server-side I get the
> > following messages :
> >
> > unable to checkDescriptor for  failed to initialize EGL EGL does
> > not seem to work, falling back to software rendering and wl_shm
> >
> > (my EGL doesn't work, so it may be normal) I noticed I can run
> > clients, though, and they keep running until I kill them or weston
> > hangs. So it looks more like a rendering issue.
> >
> > Does someone know how to make it work, or if it's supposed to ? Is
> > it linked the error messages ?
>
> I filed this bug a couple of days ago:
> . With some more
> code hacks I managed to get an image once, but the server would crash as
> soon as an input event arrived. There seem to be some severe issue with
> the code as-is, but I didn't have time to read into it in more detail.
> At least I can confirm your issue report.
>
> Michael
>
>


-- 
Cordialement,










*Manuel BACHMANN Intervenant Tizen EUROGICIEL Ingénierie Groupe EUROGICIEL
- La 1ère SSAP Technopole PIBS Le Prisme Place Albert Einstein CP 1 56038
VANNES www.eurogiciel.fr *
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 0/3] Test static functions

2013-12-05 Thread Marek Ch
Hi,

I did similar thing like is in Weston for testing static functions. Also, I 
wrote
few wl_buffer unit tests.
I appreaciate any comments :)

P. S.: based on mailing here:
http://lists.freedesktop.org/archives/wayland-devel/2013-November/012299.html


Thanks,
Marek Ch


Marek Ch (3):
  wayland-private: add define for testing static functions
  wayland-private: move struct wl_buffer into wayland-private.h
  tests: add tests for wl_buffer_*

 src/connection.c  |  18 +---
 src/wayland-private.h |  24 +
 tests/Makefile.am |  12 ++-
 tests/buffer-test.c   | 247 ++
 4 files changed, 286 insertions(+), 15 deletions(-)
 create mode 100644 tests/buffer-test.c

-- 
1.8.4.2

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 1/3] wayland-private: add define for testing static functions

2013-12-05 Thread Marek Ch
Just like in Weston tests. This macro expands to WL_EXPORT
when being compiled in tests and to 'static' keyword otherwise.
---
 src/wayland-private.h | 7 +++
 tests/Makefile.am | 5 -
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/wayland-private.h b/src/wayland-private.h
index 67e8783..850d571 100644
--- a/src/wayland-private.h
+++ b/src/wayland-private.h
@@ -31,6 +31,13 @@
 
 #include "wayland-util.h"
 
+/* allow test private functions */
+#ifdef UNIT_TEST
+#define WL_PRIVATE WL_EXPORT
+#else
+#define WL_PRIVATE static
+#endif
+
 #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
 
 #define container_of(ptr, type, member) ({ \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9c673ae..4552159 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -45,7 +45,10 @@ os_wrappers_test_SOURCES =   \
$(test_runner_src)
 
 AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
-AM_CFLAGS = $(GCC_CFLAGS) $(FFI_CFLAGS)
+AM_CFLAGS =\
+   $(GCC_CFLAGS)   \
+   $(FFI_CFLAGS)   \
+   -DUNIT_TEST
 LDADD = $(top_builddir)/src/libwayland-util.la \
$(top_builddir)/src/libwayland-client.la \
$(top_builddir)/src/libwayland-server.la \
-- 
1.8.4.2

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 2/3] wayland-private: move struct wl_buffer into wayland-private.h

2013-12-05 Thread Marek Ch
So that it can be used in tests
---
 src/connection.c  | 8 
 src/wayland-private.h | 7 +++
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 1d8b61b..c85c669 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -43,14 +43,6 @@
 #include "wayland-os.h"
 
 #define DIV_ROUNDUP(n, a) ( ((n) + ((a) - 1)) / (a) )
-
-struct wl_buffer {
-   char data[4096];
-   uint32_t head, tail;
-};
-
-#define MASK(i) ((i) & 4095)
-
 #define MAX_FDS_OUT28
 #define CLEN   (CMSG_LEN(MAX_FDS_OUT * sizeof(int32_t)))
 
diff --git a/src/wayland-private.h b/src/wayland-private.h
index 850d571..251e841 100644
--- a/src/wayland-private.h
+++ b/src/wayland-private.h
@@ -92,6 +92,13 @@ struct wl_proxy;
 int wl_interface_equal(const struct wl_interface *iface1,
   const struct wl_interface *iface2);
 
+struct wl_buffer {
+   char data[4096];
+   uint32_t head, tail;
+};
+
+#define MASK(i) ((i) & 4095)
+
 struct wl_connection *wl_connection_create(int fd);
 void wl_connection_destroy(struct wl_connection *connection);
 void wl_connection_copy(struct wl_connection *connection, void *data, size_t 
size);
-- 
1.8.4.2

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH 3/3] tests: add tests for wl_buffer_*

2013-12-05 Thread Marek Ch
Tests for wl_buffer_* functions from connection.c
---
 src/connection.c  |  10 +-
 src/wayland-private.h |  10 ++
 tests/Makefile.am |   7 +-
 tests/buffer-test.c   | 247 ++
 4 files changed, 268 insertions(+), 6 deletions(-)
 create mode 100644 tests/buffer-test.c

diff --git a/src/connection.c b/src/connection.c
index c85c669..55f6fae 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -53,7 +53,7 @@ struct wl_connection {
int want_flush;
 };
 
-static void
+WL_PRIVATE void
 wl_buffer_put(struct wl_buffer *b, const void *data, size_t count)
 {
uint32_t head, size;
@@ -70,7 +70,7 @@ wl_buffer_put(struct wl_buffer *b, const void *data, size_t 
count)
b->head += count;
 }
 
-static void
+WL_PRIVATE void
 wl_buffer_put_iov(struct wl_buffer *b, struct iovec *iov, int *count)
 {
uint32_t head, tail;
@@ -94,7 +94,7 @@ wl_buffer_put_iov(struct wl_buffer *b, struct iovec *iov, int 
*count)
}
 }
 
-static void
+WL_PRIVATE void
 wl_buffer_get_iov(struct wl_buffer *b, struct iovec *iov, int *count)
 {
uint32_t head, tail;
@@ -118,7 +118,7 @@ wl_buffer_get_iov(struct wl_buffer *b, struct iovec *iov, 
int *count)
}
 }
 
-static void
+WL_PRIVATE void
 wl_buffer_copy(struct wl_buffer *b, void *data, size_t count)
 {
uint32_t tail, size;
@@ -133,7 +133,7 @@ wl_buffer_copy(struct wl_buffer *b, void *data, size_t 
count)
}
 }
 
-static uint32_t
+WL_PRIVATE uint32_t
 wl_buffer_size(struct wl_buffer *b)
 {
return b->head - b->tail;
diff --git a/src/wayland-private.h b/src/wayland-private.h
index 251e841..70d338b 100644
--- a/src/wayland-private.h
+++ b/src/wayland-private.h
@@ -99,6 +99,16 @@ struct wl_buffer {
 
 #define MASK(i) ((i) & 4095)
 
+#ifdef UNIT_TEST
+struct iovec;
+
+void wl_buffer_put(struct wl_buffer *b, const void *data, size_t count);
+void wl_buffer_put_iov(struct wl_buffer *b, struct iovec *iov, int *count);
+void wl_buffer_get_iov(struct wl_buffer *b, struct iovec *iov, int *count);
+void wl_buffer_copy(struct wl_buffer *b, void *data, size_t count);
+uint32_t wl_buffer_size(struct wl_buffer *b);
+#endif /* UNIT_TEST */
+
 struct wl_connection *wl_connection_create(int fd);
 void wl_connection_destroy(struct wl_connection *connection);
 void wl_connection_copy(struct wl_connection *connection, void *data, size_t 
size);
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4552159..56c3644 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -12,7 +12,8 @@ TESTS =   \
socket-test \
queue-test  \
signal-test \
-   resources-test
+   resources-test  \
+   buffer-test
 
 check_PROGRAMS =   \
$(TESTS)\
@@ -36,6 +37,10 @@ socket_test_SOURCES = socket-test.c $(test_runner_src)
 queue_test_SOURCES = queue-test.c $(test_runner_src)
 signal_test_SOURCES = signal-test.c $(test_runner_src)
 resources_test_SOURCES = resources-test.c $(test_runner_src)
+buffer_test_SOURCES =  \
+   buffer-test.c   \
+   $(top_srcdir)/src/connection.c  \
+   $(test_runner_src)
 
 fixed_benchmark_SOURCES = fixed-benchmark.c
 
diff --git a/tests/buffer-test.c b/tests/buffer-test.c
new file mode 100644
index 000..c454870
--- /dev/null
+++ b/tests/buffer-test.c
@@ -0,0 +1,247 @@
+#include 
+#include 
+#include 
+#include 
+#include "test-runner.h"
+#include "wayland-private.h"
+#include 
+#include 
+
+/* Assert with formated output */
+#define assertf(cond, ...) 
\
+   do {
\
+   if (!(cond)) {  
\
+   fprintf(stderr, "%s (%s: %d): Assertion %s failed!",
\
+   __FUNCTION__, __FILE__, __LINE__, 
#cond);\
+   fprintf(stderr, " " __VA_ARGS__);   
\
+   putc('\n', stderr); 
\
+   abort();
\
+   }   
\
+   } while (0)
+
+
+static const char data[] = "abcdefghijklmnopqrstuvwxyz";
+
+static int
+fill_buffer(struct wl_buffer *b)
+{
+   int i;
+   for (i = 1; i * (sizeof data) <= sizeof b->data; i++) {
+   wl_buffer_put(b, data, sizeof data);
+
+   assert(b->tail == 0);
+   assertf(b->head == i * (sizeof data),
+   "head is %u instead of %lu", b->head, i * (sizeof 
data));
+   assertf(wl_buffer_size(b) == i * sizeof data,
+   "wl_buffer

Re: [Weston] RDP backend state

2013-12-05 Thread Hardening

Le 05/12/2013 15:14, Manuel BACHMANN a écrit :

Hi folks,

I tried to build the Weston 1.3.1 RDP backend using latest FreeRDP
master, and I managed to get it to compile using the following trivial
patch :

http://pastebin.com/XGz4xYaE


FreeRdp API for remoteFx has changed on master (so your patch is correct 
for compiling against the development version of FreeRdp). However 
branch 1.1 (which aims to be the next stable) have the prototype that is 
used in weston now.
We must add some #if to use the correct prototype, sorry that's on my 
TODO list for month.




It basically runs, and I can connect to it with :
rdesktop -4 -b 

However, it renders only a black screen, and server-side I get the
following messages :

unable to checkDescriptor for 
failed to initialize EGL
EGL does not seem to work, falling back to software rendering and wl_shm

(my EGL doesn't work, so it may be normal)
I noticed I can run clients, though, and they keep running until I kill
them or weston hangs. So it looks more like a rendering issue.

Does someone know how to make it work, or if it's supposed to ? Is it
linked the error messages ?


I didn't test recently but in my last tries rdesktop wasn't very good 
with the server-side part of FreeRdp. There's clearly an issue if 
rdesktop and weston runs on the same host: during security negociation 
rdesktop does nasty things and FreeRdp is too strict. It should work 
better when the too are on different hosts.


Even if you pass the security handshake, AFAICT rdesktop does not 
support surface command which is required for the current implementation 
of the FreeRdp compositor. This may be not required in the future, as 
FreeRdp master has now support for sending updates via bitmapUpdate.


So the best is to use xfreerdp as client.

Regards.

--
website: http://www.hardening-consulting.com/
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [Weston] RDP backend state

2013-12-05 Thread Manuel BACHMANN
Hello Hardening,

Thanks, very nice to know you're still around and following these issues !

> However branch 1.1 (which aims to be the next stable) have the prototype
that is used in weston now.

OK ; I tried to build with 1.1beta before and had a lot more errors and API
breaks... so I guess you'll have some work to do ^^.

> It should work better when the too are on different hosts.

Thanks, will try that !

> rdesktop does not support surface command which is required for the
current implementation of the FreeRdp compositor

OK, so my "-b" flag was basically useless. To be fair, I tried with
xfreerdp too, but not on different hosts. I'll try again this evening.

Regards,
Tarnyko


2013/12/5 Hardening 

> Le 05/12/2013 15:14, Manuel BACHMANN a écrit :
>
>  Hi folks,
>>
>> I tried to build the Weston 1.3.1 RDP backend using latest FreeRDP
>> master, and I managed to get it to compile using the following trivial
>> patch :
>>
>> http://pastebin.com/XGz4xYaE
>>
>
> FreeRdp API for remoteFx has changed on master (so your patch is correct
> for compiling against the development version of FreeRdp). However branch
> 1.1 (which aims to be the next stable) have the prototype that is used in
> weston now.
> We must add some #if to use the correct prototype, sorry that's on my TODO
> list for month.
>
>
>
>> It basically runs, and I can connect to it with :
>> rdesktop -4 -b 
>>
>> However, it renders only a black screen, and server-side I get the
>> following messages :
>>
>> unable to checkDescriptor for 
>> failed to initialize EGL
>> EGL does not seem to work, falling back to software rendering and wl_shm
>>
>> (my EGL doesn't work, so it may be normal)
>> I noticed I can run clients, though, and they keep running until I kill
>> them or weston hangs. So it looks more like a rendering issue.
>>
>> Does someone know how to make it work, or if it's supposed to ? Is it
>> linked the error messages ?
>>
>
> I didn't test recently but in my last tries rdesktop wasn't very good with
> the server-side part of FreeRdp. There's clearly an issue if rdesktop and
> weston runs on the same host: during security negociation rdesktop does
> nasty things and FreeRdp is too strict. It should work better when the too
> are on different hosts.
>
> Even if you pass the security handshake, AFAICT rdesktop does not support
> surface command which is required for the current implementation of the
> FreeRdp compositor. This may be not required in the future, as FreeRdp
> master has now support for sending updates via bitmapUpdate.
>
> So the best is to use xfreerdp as client.
>
> Regards.
>
> --
> website: http://www.hardening-consulting.com/
>



-- 
Cordialement,










*Manuel BACHMANN Intervenant Tizen EUROGICIEL Ingénierie Groupe EUROGICIEL
- La 1ère SSAP Technopole PIBS Le Prisme Place Albert Einstein CP 1 56038
VANNES www.eurogiciel.fr *
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH] wayland-private: comment wl_buffer functions

2013-12-05 Thread Marek Ch
Add doc comment to wl_buffer_* functions
---
 src/wayland-private.h | 41 +
 1 file changed, 41 insertions(+)

diff --git a/src/wayland-private.h b/src/wayland-private.h
index 70d338b..83398ed 100644
--- a/src/wayland-private.h
+++ b/src/wayland-private.h
@@ -102,10 +102,51 @@ struct wl_buffer {
 #ifdef UNIT_TEST
 struct iovec;
 
+/**
+ * Put data into buffer
+ *
+ * @b: wl_buffer
+ * @data: pointer to the data to be stored
+ * @count: size of the data in bytes
+ */
 void wl_buffer_put(struct wl_buffer *b, const void *data, size_t count);
+
+/**
+ * Set iovec field to point to free space in wl_buffer so that
+ * readv() operation can be used consequently.
+ *
+ * @b: wl_buffer
+ * @iov: iovec structure to be filled
+ * @count: how many iovec structures were set (max. 2)
+ * NOTE: this function only fills iovec structure, does not set head and tail
+ */
 void wl_buffer_put_iov(struct wl_buffer *b, struct iovec *iov, int *count);
+
+/**
+ * Create iovec structure from wl_buffer.
+ * (Fill iovec so that it points to the data in wl_buffer).
+ *
+ * @b: wl_buffer
+ * @iov: iovec to be filled
+ * @count: number of iovec structures that were used (max. 2)
+ */
 void wl_buffer_get_iov(struct wl_buffer *b, struct iovec *iov, int *count);
+
+/**
+ * Copy data from wl_buffer
+ *
+ * @b: wl_buffer
+ * @data: where to copy the data from buffer
+ * @count: size in bytes
+ * NOTE: this function only copies data, do not set head and tail
+ */
 void wl_buffer_copy(struct wl_buffer *b, void *data, size_t count);
+
+/**
+ * Get size of data in wl_buffer
+ *
+ * @b: wl_buffer
+ */
 uint32_t wl_buffer_size(struct wl_buffer *b);
 #endif /* UNIT_TEST */
 
-- 
1.8.4.2

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH] comment wl_buffer function

2013-12-05 Thread Marek Ch
While writing the tests I also added doc comments, but forget to
commit it.
Maybe it will be useful for somebody who will be trying to read
the code later.
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH] Add wl_dmabuf protocol

2013-12-05 Thread benjamin . gaignard
From: Benjamin Gaignard 

It allow to use a dmabuf file descriptor in a wayland protocol.
To make as generic as possible it is up to the server to call
wl_dmabuf_send_format() and/or wl_dmabuf_send_capabilities() to signal
it capabilities.

Signed-off-by: Benjamin Gaignard 
---
 protocol/Makefile.am|6 +-
 protocol/wayland-dmabuf.xml |  134 +
 src/Makefile.am |   12 +-
 src/wayland-dmabuf.c|  275 +++
 src/wayland-dmabuf.h|  134 +
 5 files changed, 557 insertions(+), 4 deletions(-)
 create mode 100644 protocol/wayland-dmabuf.xml
 create mode 100644 src/wayland-dmabuf.c
 create mode 100644 src/wayland-dmabuf.h

diff --git a/protocol/Makefile.am b/protocol/Makefile.am
index e8b6290..8c9499f 100644
--- a/protocol/Makefile.am
+++ b/protocol/Makefile.am
@@ -1,4 +1,4 @@
-dist_pkgdata_DATA = wayland.xml wayland.dtd
+dist_pkgdata_DATA = wayland.xml wayland-dmabuf.xml wayland.dtd
 
 if HAVE_XMLLINT
 .PHONY: validate
@@ -6,9 +6,9 @@ if HAVE_XMLLINT
 .%.xml.valid: %.xml
$(AM_V_GEN)$(XMLLINT) --noout --dtdvalid $(srcdir)/wayland.dtd $^ > $@
 
-validate: .wayland.xml.valid
+validate: .wayland.xml.valid .wayland-dmabuf.xml.valid
 
 all-local: validate
 
-CLEANFILES = .wayland.xml.valid
+CLEANFILES = .wayland.xml.valid .wayland-dmabuf.xml.valid
 endif
diff --git a/protocol/wayland-dmabuf.xml b/protocol/wayland-dmabuf.xml
new file mode 100644
index 000..b3b7ded
--- /dev/null
+++ b/protocol/wayland-dmabuf.xml
@@ -0,0 +1,134 @@
+
+
+
+  
+Copyright © 2008-2011 Kristian Høgsberg
+Copyright © 2010-2011 Intel Corporation
+
+Permission to use, copy, modify, distribute, and sell this
+software and its documentation for any purpose is hereby granted
+without fee, provided that\n 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.
+  
+
+  
+  
+
+   
+   
+
+
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+
+   
+  
+
+
+
+  
+Bitmask of capabilities.
+  
+  
+
+
+
+  
+
+  
+
+
diff --git a/src/Makefile.am b/src/Makefile.am
index 15f44a5..b3c414c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,8 +4,11 @@ noinst_LTLIBRARIES = libwayland-util.la
 include_HEADERS =  \
wayland-util.h  \
wayland-server-protocol.h   \
+   wayland-dmabuf-server-protocol.h\
wayland-server.h\
+   wayland-dmabuf.h\
wayland-client-protocol.h   \
+   wayland-dmabuf-client-protocol.h\
wayland-client.h\
wayland-egl.h   \
wayland-version.h
@@ -22,14 +25,17 @@ libwayland_server_la_LIBADD = $(FFI_LIBS) 
libwayland-util.la -lrt -lm
 libwayland_server_la_LDFLAGS = -version-info 1:0:1
 libwayland_server_la_SOURCES = \
wayland-protocol.c  \
+   wayland-dmabuf-protocol.c   \
wayland-server.c\
wayland-shm.c   \
+   wayland-dmabuf.c\
event-loop.c
 
 libwayland_client_la_LIBADD = $(FFI_LIBS) libwayland-util.la -lrt -lm
 libwayland_client_la_LDFLAGS = -version-info 2:0:2
 libwayland_client_la_SOURCES = \
wayland-protocol

[PATCH weston] tests: Test whether a simple EGL main loop uses too many buffers

2013-12-05 Thread Neil Roberts
Hi,

Here is a rebased version of the patch. The old one didn't apply
cleanly anymore because of some changes in tests/Makefile.am

I think there is some confusion about why it ends up using 3 buffers
and I also keep getting in a muddle about it. I'll try to describe
what I think is happening here.

The client has a loop like this:

while (1) {
draw_something();
eglSwapBuffers();
}

It begins its first frame. In draw_something it will call get_back_bo
which will allocate a buffer because there are currently no buffers.
It will then call eglSwapBuffers which will install a frame callback
and give the buffer to the compositor. As this is the first buffer,
the compositor won't send a release event yet.

The client will now start rendering its second frame. It will call
get_back_bo which will detect that the first buffer is still locked so
it will allocate a second buffer. It will then call eglSwapBuffers
which will cause it to block for the frame callback. There is still no
release event so this won't cause any buffers to be unlocked. Once the
frame callback is received it will commit the second buffer. The
compositor only needs to keep hold of one buffer so it will
immediately queue a release event. (It could alternatively immediately
post the event here but that doesn't actually fix the problem.) After
the commit the client will install a frame callback. This will
guarantee that the release event will be flushed to the client
eventually.

Now the client will start rendering its third frame. The release event
may or may not have been received in the client's socket buffer
depending on the timing. It doesn't actually matter though and the bug
will be triggered either way. The first thing it does while rendering
is call get_back_bo. The first thing get_back_bo does is dispatch any
pending events in its queue. However this doesn't do anything for the
release event because nothing has read from the socket yet so it is
still only sitting the socket's buffer. At this point the client
hasn't seen any release events yet so it will think both buffers are
still locked and it will allocate a third buffer. Eventually the
client will finish rendering to this third buffer and it will call
eglSwapBuffers. At this point the client will block on the frame
callback which will end up reading from the socket and dispatching the
release event, but it is too late.

When the client calls get_back_bo for its fourth frame it will have
seen one release event so it will reuse the first buffer. It will
continue like this cycling between three buffers.

I hope that makes sense!

Regards,
- Neil

--- >8 --- (use git am --scissors to automatically chop here)

This adds a test that tries to simulate a simple game loop that would
be like this:

while (1) {
draw_something();
eglSwapBuffers();
}

In this case the test is relying on eglSwapBuffers to throttle to a
sensible frame rate.

The test then verifies that only 2 EGL buffers are used. This is done
via a new request and event in the wayland-test protocol.

Currently this causes 3 buffers to be created because the release
event generated by the swap buffers is not processed by Mesa until it
blocks for the frame complete event in the next swap buffers call, but
that is too late.

This can be fixed in Mesa by issuing a sync request after the swap
buffers and blocking on it before deciding whether to allocate a new
buffer.
---
 configure.ac  |   7 +++
 protocol/wayland-test.xml |   7 +++
 tests/Makefile.am |  15 -
 tests/buffer-count-test.c | 128 ++
 tests/weston-test-client-helper.c |  22 ++-
 tests/weston-test-client-helper.h |   4 ++
 tests/weston-test.c   |  51 ++-
 7 files changed, 231 insertions(+), 3 deletions(-)
 create mode 100644 tests/buffer-count-test.c

diff --git a/configure.ac b/configure.ac
index 86940d5..6e57c25 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,10 +61,17 @@ COMPOSITOR_MODULES="wayland-server >= 1.3.90 pixman-1"
 
 AC_ARG_ENABLE(egl, [  --disable-egl],,
   enable_egl=yes)
+AC_ARG_ENABLE(egl-tests, [  --enable-egl-tests],,
+  enable_egl_tests=yes)
 AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
+AM_CONDITIONAL(ENABLE_EGL_TESTS, test x$enable_egl = xyes -a 
x$enable_egl_tests = xyes)
 if test x$enable_egl = xyes; then
AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
PKG_CHECK_MODULES(EGL, [egl >= 7.10 glesv2])
+
+if test x$enable_egl_tests = xyes; then
+  PKG_CHECK_MODULES([EGL_TESTS], [egl >= 7.10 glesv2 wayland-client 
wayland-egl])
+fi
 fi
 
 AC_ARG_ENABLE(xkbcommon,
diff --git a/protocol/wayland-test.xml b/protocol/wayland-test.xml
index 2993f08..18b6625 100644
--- a/protocol/wayland-test.xml
+++ b/protocol/wayland-test.xml
@@ -51,5 +51,12 @@
   
   
 
+
+  
+
+
+  
+
   
 

Re: [PATCH v2] shell: Add missing break to a case statement inside set_surface_type.

2013-12-05 Thread Kristian Høgsberg
On Wed, Dec 04, 2013 at 06:37:16PM -0200, Rafael Antognolli wrote:
> This should fix the surface not going back to its original position
> after unsetting fullscreen or maximized states.

Thanks, committed.  This https://bugs.freedesktop.org/show_bug.cgi?id=72321
so I appended that to the commit message.

Kristian

> ---
>  desktop-shell/shell.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index de54e37..1b63430 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -2399,6 +2399,7 @@ set_surface_type(struct shell_surface *shsurf)
>pev->geometry.x + 
> shsurf->transient.x,
>pev->geometry.y + 
> shsurf->transient.y);
>   }
> + break;
>  
>   case SHELL_SURFACE_XWAYLAND:
>   weston_view_set_position(shsurf->view, shsurf->transient.x,
> -- 
> 1.8.3.1
> 
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH] shell: Set a surface as TOPLEVEL instead of the old surface types.

2013-12-05 Thread Rafael Antognolli
Since internally there's no more SHELL_SURFACE_FULLSCREEN and
SHELL_SURFACE_MAXIMIZED, the surface must be set to
SHELL_SURFACE_TOPLEVEL on the respective functions.

This fixes the bug when clients start already in fullscreen mode. In
that case, they aren't set first to toplevel, and then change to
fullscreen. They are set as fullscreen directly, not receiving the
SHELL_SURFACE_TOPLEVEL type on the set_fullscreen function.
---
 desktop-shell/shell.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 7c202ea..0b6a97c 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -2168,6 +2168,7 @@ shell_surface_set_transient(struct wl_client *client,
shell_surface_set_parent(shsurf, parent);
 
surface_clear_next_states(shsurf);
+   shsurf->next_type = SHELL_SURFACE_TOPLEVEL;
set_transient(shsurf, parent, x, y, flags);
 }
 
@@ -2242,6 +2243,7 @@ shell_surface_set_fullscreen(struct wl_client *client,
shell_surface_set_parent(shsurf, NULL);
 
surface_clear_next_states(shsurf);
+   shsurf->next_type = SHELL_SURFACE_TOPLEVEL;
shsurf->next_state.fullscreen = true;
shsurf->state_changed = true;
set_fullscreen(shsurf, method, framerate, output);
@@ -2340,6 +2342,7 @@ shell_surface_set_maximized(struct wl_client *client,
shell_surface_set_parent(shsurf, NULL);
 
surface_clear_next_states(shsurf);
+   shsurf->next_type = SHELL_SURFACE_TOPLEVEL;
shsurf->next_state.maximized = true;
shsurf->state_changed = true;
set_maximized(shsurf, output);
-- 
1.8.3.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH] shell: Don't try to switch to a NULL shell surface.

2013-12-05 Thread Rafael Antognolli
Fixes the crash from alt+tab when there's a fullscreen surface.
---
 desktop-shell/shell.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 0b6a97c..18b88f4 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -5174,6 +5174,8 @@ switcher_next(struct switcher *switcher)
 
wl_list_for_each(view, &ws->layer.view_list, layer_link) {
shsurf = get_shell_surface(view->surface);
+   if (!shsurf)
+   break;
switch (shsurf->type) {
case SHELL_SURFACE_TOPLEVEL:
if (shsurf->parent)
-- 
1.8.3.1

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] shell: Set a surface as TOPLEVEL instead of the old surface types.

2013-12-05 Thread Kristian Høgsberg
On Thu, Dec 05, 2013 at 06:53:17PM -0200, Rafael Antognolli wrote:
> Since internally there's no more SHELL_SURFACE_FULLSCREEN and
> SHELL_SURFACE_MAXIMIZED, the surface must be set to
> SHELL_SURFACE_TOPLEVEL on the respective functions.
> 
> This fixes the bug when clients start already in fullscreen mode. In
> that case, they aren't set first to toplevel, and then change to
> fullscreen. They are set as fullscreen directly, not receiving the
> SHELL_SURFACE_TOPLEVEL type on the set_fullscreen function.
> ---
>  desktop-shell/shell.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index 7c202ea..0b6a97c 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -2168,6 +2168,7 @@ shell_surface_set_transient(struct wl_client *client,
>   shell_surface_set_parent(shsurf, parent);
>  
>   surface_clear_next_states(shsurf);
> + shsurf->next_type = SHELL_SURFACE_TOPLEVEL;
>   set_transient(shsurf, parent, x, y, flags);

You tracked down the problem, but the fix isn't right.
set_transient() will do

shsurf->next_type = shsurf->type;

which overwrites SHELL_SURFACE_TOPLEVEL we just stored there.  I
edited the fix to just set SHELL_SURFACE_TOPLEVEL in set_transient().
Same for the two other cases.  Committed with those changes.

Kristian

>  }
>  
> @@ -2242,6 +2243,7 @@ shell_surface_set_fullscreen(struct wl_client *client,
>   shell_surface_set_parent(shsurf, NULL);
>  
>   surface_clear_next_states(shsurf);
> + shsurf->next_type = SHELL_SURFACE_TOPLEVEL;
>   shsurf->next_state.fullscreen = true;
>   shsurf->state_changed = true;
>   set_fullscreen(shsurf, method, framerate, output);
> @@ -2340,6 +2342,7 @@ shell_surface_set_maximized(struct wl_client *client,
>   shell_surface_set_parent(shsurf, NULL);
>  
>   surface_clear_next_states(shsurf);
> + shsurf->next_type = SHELL_SURFACE_TOPLEVEL;
>   shsurf->next_state.maximized = true;
>   shsurf->state_changed = true;
>   set_maximized(shsurf, output);
> -- 
> 1.8.3.1
> 
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] shell: Don't try to switch to a NULL shell surface.

2013-12-05 Thread Kristian Høgsberg
On Thu, Dec 05, 2013 at 07:01:21PM -0200, Rafael Antognolli wrote:
> Fixes the crash from alt+tab when there's a fullscreen surface.
> ---
>  desktop-shell/shell.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index 0b6a97c..18b88f4 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -5174,6 +5174,8 @@ switcher_next(struct switcher *switcher)
>  
>   wl_list_for_each(view, &ws->layer.view_list, layer_link) {
>   shsurf = get_shell_surface(view->surface);
> + if (!shsurf)
> + break;

This will break out of the loop.  We're trying to loop through all
surfaces to find the next one for alt tab so we need to keep going.
We can't continue, since we need to hit the is_black_surface() case
below.  I rewrote the switch() to just be:

if (shsurf &&
shsurf->type == SHELL_SURFACE_TOPLEVEL &&
shsurf->parent == NULL) {

since that's the only case we care about after removing all the other
surface types.

Kristian

>   switch (shsurf->type) {
>   case SHELL_SURFACE_TOPLEVEL:
>   if (shsurf->parent)
> -- 
> 1.8.3.1
> 
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel