Re: [PATCH wayland] connection: remove redundant assignment

2016-04-22 Thread Jonas Ådahl
On Fri, Apr 22, 2016 at 05:46:00PM +0200, Marek Chalupa wrote:
> the code is something like:
> 
>   if (object == NULL && ...) {
>   object = NULL;
>   return;
>   }
> 
> first, the object is already NULL, second, the assignment has no effect
> since we return from the function right away
> 
> Signed-off-by: Marek Chalupa 

Pushed with Eric's and my RB:

   7085064..85b80f5  master -> master

Jonas

> ---
>  src/connection.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/connection.c b/src/connection.c
> index c0e322f..747229e 100644
> --- a/src/connection.c
> +++ b/src/connection.c
> @@ -838,7 +838,6 @@ wl_closure_lookup_objects(struct wl_closure *closure, 
> struct wl_map *objects)
>   } else if (object == NULL && id != 0) {
>   wl_log("unknown object (%u), message %s(%s)\n",
>  id, message->name, message->signature);
> - object = NULL;
>   errno = EINVAL;
>   return -1;
>   }
> -- 
> 2.5.5
> 
> ___
> 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 v1] refactor configuration API of rdp-backend

2016-04-22 Thread Hardening
Le 22/04/2016 17:05, Benoit Gschwind a écrit :
> Implement a "well" defined API to configure the rdp backend.
> Following according to discution about libweston API.
> ---
> v1:
>  - Fix the patch log
> v0:
>   - Nothing particular.
> 
> Signed-off-by: Benoit Gschwind 
> 
>  Makefile.am  |  1 +
>  src/compositor-rdp.c | 71 
> +---
>  src/compositor-rdp.h | 54 +++
>  src/main.c   | 56 +++--
>  4 files changed, 137 insertions(+), 45 deletions(-)
>  create mode 100644 src/compositor-rdp.h
> 
> diff --git a/Makefile.am b/Makefile.am
> index c042c68..a4dcd57 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -73,6 +73,7 @@ weston_SOURCES =\
>   src/compositor.c\
>   src/compositor.h\
>   src/compositor-headless.h   \
> + src/compositor-rdp.h\
>   src/input.c \
>   src/data-device.c   \
>   src/screenshooter.c \
> diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
> index 773b6b5..2860556 100644
> --- a/src/compositor-rdp.c
> +++ b/src/compositor-rdp.c
> @@ -67,23 +67,13 @@
>  
>  #include "shared/helpers.h"
>  #include "compositor.h"
> +#include "compositor-rdp.h"
>  #include "pixman-renderer.h"
>  
>  #define MAX_FREERDP_FDS 32
>  #define DEFAULT_AXIS_STEP_DISTANCE 10
>  #define RDP_MODE_FREQ 60 * 1000
>  
> -struct rdp_backend_config {
> - int width;
> - int height;
> - char *bind_address;
> - int port;
> - char *rdp_key;
> - char *server_cert;
> - char *server_key;
> - int env_socket;
> - int no_clients_resize;
> -};
>  
>  struct rdp_output;
>  
> @@ -138,20 +128,6 @@ struct rdp_peer_context {
>  typedef struct rdp_peer_context RdpPeerContext;
>  
>  static void
> -rdp_backend_config_init(struct rdp_backend_config *config)
> -{
> - config->width = 640;
> - config->height = 480;
> - config->bind_address = NULL;
> - config->port = 3389;
> - config->rdp_key = NULL;
> - config->server_cert = NULL;
> - config->server_key = NULL;
> - config->env_socket = 0;
> - config->no_clients_resize = 0;
> -}
> -
> -static void
>  rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, 
> freerdp_peer *peer)
>  {
>   int width, height, nrects, i;
> @@ -1195,8 +1171,7 @@ rdp_incoming_peer(freerdp_listener *instance, 
> freerdp_peer *client)
>  
>  static struct rdp_backend *
>  rdp_backend_create(struct weston_compositor *compositor,
> -struct rdp_backend_config *config,
> -int *argc, char *argv[], struct weston_config *wconfig)
> +struct weston_rdp_backend_config *config)
>  {
>   struct rdp_backend *b;
>   char *fd_str;
> @@ -1274,39 +1249,49 @@ err_free_strings:
>   return NULL;
>  }
>  
> +static void
> +config_init_to_defaults(struct weston_rdp_backend_config *config)
> +{
> + config->width = 640;
> + config->height = 480;
> + config->bind_address = NULL;
> + config->port = 3389;
> + config->rdp_key = NULL;
> + config->server_cert = NULL;
> + config->server_key = NULL;
> + config->env_socket = 0;
> + config->no_clients_resize = 0;
> +}
> +
>  WL_EXPORT int
>  backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
>struct weston_config *wconfig,
>struct weston_backend_config *config_base)
>  {
>   struct rdp_backend *b;
> - struct rdp_backend_config config;
> - rdp_backend_config_init();
> + struct weston_rdp_backend_config config = {{ 0, }};
>   int major, minor, revision;
>  
>   freerdp_get_version(, , );
>   weston_log("using FreeRDP version %d.%d.%d\n", major, minor, revision);
>  
> - const struct weston_option rdp_options[] = {
> - { WESTON_OPTION_BOOLEAN, "env-socket", 0, _socket },
> - { WESTON_OPTION_INTEGER, "width", 0,  },
> - { WESTON_OPTION_INTEGER, "height", 0,  },
> - { WESTON_OPTION_STRING,  "address", 0, _address },
> - { WESTON_OPTION_INTEGER, "port", 0,  },
> - { WESTON_OPTION_BOOLEAN, "no-clients-resize", 0, 
> _clients_resize },
> - { WESTON_OPTION_STRING,  "rdp4-key", 0, _key },
> - { WESTON_OPTION_STRING,  "rdp-tls-cert", 0, _cert 
> },
> - { WESTON_OPTION_STRING,  "rdp-tls-key", 0, _key }
> - };
> -
> - parse_options(rdp_options, ARRAY_LENGTH(rdp_options), argc, argv);
> + if (config_base == NULL ||
> + config_base->struct_version != WESTON_RDP_BACKEND_CONFIG_VERSION ||
> + config_base->struct_size > sizeof(struct 
> weston_rdp_backend_config)) {
> + weston_log("RDP backend config structure 

Re: [PATCH 5/5] desktop shell: resize background and panel when an output switches mode

2016-04-22 Thread Hardening
Le 22/04/2016 16:18, Pekka Paalanen a écrit :
> On Fri, 22 Apr 2016 15:19:06 +0200
> David Fort  wrote:
> 
>> When an output permanently switches mode, the desktop shell must be notified 
>> so
>> that the misc components can resize to the new size of the output. This 
>> patch also
>> fixes the coodinates of "other" outputs when the resize occurs.
>>
>> Signed-off-by: David Fort 
>> ---
>>  desktop-shell/shell.c | 34 ++
>>  desktop-shell/shell.h |  1 +
>>  src/compositor.c  | 33 ++---
>>  src/compositor.h  |  1 +
>>  4 files changed, 58 insertions(+), 11 deletions(-)
>>
>> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
>> index cd269a8..1c1c993 100644
>> --- a/desktop-shell/shell.c
>> +++ b/desktop-shell/shell.c
>> @@ -6368,11 +6368,43 @@ handle_output_destroy(struct wl_listener *listener, 
>> void *data)
>>  shell_for_each_layer(shell, shell_output_destroy_move_layer, output);
>>  
>>  wl_list_remove(_listener->destroy_listener.link);
>> +wl_list_remove(_listener->resized_listener.link);
>>  wl_list_remove(_listener->link);
>>  free(output_listener);
>>  }
>>  
>>  static void
>> +shell_output_resize_layer(struct desktop_shell *shell,
>> +struct weston_layer *layer,
>> +void *data)
>> +{
>> +struct weston_output *output = data;
>> +struct weston_view *view;
>> +
>> +wl_list_for_each(view, >view_list.link, layer_link.link) {
>> +if (view->output != output)
>> +continue;
>> +
>> +weston_desktop_shell_send_configure(shell->child.desktop_shell, 
>> 0,
>> +view->surface->resource,
>> +output->width,
>> +output->height);
> 
> Hi,
> 
> where do you check that the views you are handling are strictly only
> the wallpaper and panel surfaces created by the weston-desktop-shell
> client?
> 
> I have suspicion that this send call can use desktop_shell resource of
> one client with the wl_surface resource of a different client, which is
> illegal. Unfortunately, libwayland-server does not catch that, I
> believe. The result will be messages sent to clients referring random
> object ids that may not even be wl_surfaces.
> 
> I'm surprise this doesn't crash random clients - or does it?
> 
> Hmm... oh, I see. All the messages are sent to the weston-desktop-shell
> client, but rather than referring only the relevant wl_surfaces, they
> are sent for *all* mapped wl_surfaces also from other clients.
> 
> Are you sure weston-desktop-shell doesn't crash? The crash recovery may
> be fast enough that you can only see it in Weston's logs.
> 

It doesn't crash, but adding a breakpoint with the debugger it looks
like you're right and all surfaces are notified. I will change this.

>> +}
>> +}
>> +
>> +
>> +static void
>> +handle_output_resized(struct wl_listener *listener, void *data)
>> +{
>> +struct shell_output *output_listener =
>> +container_of(listener, struct shell_output, resized_listener);
>> +struct weston_output *output = output_listener->output;
>> +struct desktop_shell *shell = output_listener->shell;
>> +
>> +shell_for_each_layer(shell, shell_output_resize_layer, output);
>> +}
>> +
>> +static void
>>  create_shell_output(struct desktop_shell *shell,
>>  struct weston_output *output)
>>  {
>> @@ -6387,6 +6419,8 @@ create_shell_output(struct desktop_shell *shell,
>>  shell_output->destroy_listener.notify = handle_output_destroy;
>>  wl_signal_add(>destroy_signal,
>>_output->destroy_listener);
>> +shell_output->resized_listener.notify = handle_output_resized;
>> +wl_signal_add(>compositor->output_resized_signal, 
>> _output->resized_listener);
>>  wl_list_insert(shell->output_list.prev, _output->link);
>>  }
>>  
>> diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h
>> index b430fa2..5457923 100644
>> --- a/desktop-shell/shell.h
>> +++ b/desktop-shell/shell.h
>> @@ -112,6 +112,7 @@ struct shell_output {
>>  struct desktop_shell  *shell;
>>  struct weston_output  *output;
>>  struct exposay_output eoutput;
>> +struct wl_listenerresized_listener;
>>  struct wl_listenerdestroy_listener;
>>  struct wl_listlink;
>>  };
>> diff --git a/src/compositor.c b/src/compositor.c
>> index 5500197..a747945 100644
>> --- a/src/compositor.c
>> +++ b/src/compositor.c
>> @@ -143,6 +143,11 @@ static void weston_mode_switch_finish(struct 
>> weston_output *output,
>>  }
>>  }
>>  
>> +
>> +static void
>> +weston_compositor_resize_output(struct weston_compositor *compositor,
>> +struct weston_output *resized_output, int 
>> delta_width);
>> +
>>  WL_EXPORT int
>>  weston_output_mode_set_native(struct 

[PATCH] clients/nested: fix undefined reference to xzalloc

2016-04-22 Thread U. Artie Eoff
Include shared/xalloc.h in clients/nested.c to fix
compilation error: undefined reference to `xzalloc'

Signed-off-by: U. Artie Eoff 
---
 clients/nested.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clients/nested.c b/clients/nested.c
index e78f08c396f4..72aab151a071 100644
--- a/clients/nested.c
+++ b/clients/nested.c
@@ -47,6 +47,7 @@
 #include 
 
 #include "shared/helpers.h"
+#include "shared/xalloc.h"
 #include "window.h"
 
 #ifndef EGL_WL_create_wayland_buffer_from_image
-- 
2.1.0

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


Re: [PATCH v2 wayland-protocols] Add pad support to the tablet protocol

2016-04-22 Thread Jason Gerecke
On Thu, Apr 21, 2016 at 7:02 PM, Peter Hutterer
 wrote:
> On Thu, Apr 21, 2016 at 05:46:24PM -0700, Jason Gerecke wrote:
>> On Mon, Apr 18, 2016 at 10:00 PM, Peter Hutterer
>>  wrote:
>> > From: Carlos Garnacho 
>> >
>> > The pad's interface is similar to the tool interface, a client is notified 
>> > of
>> > the pad after the tablet_added event.
>> >
>> > The pad has three functionalities: buttons, rings and strips.
>> > Buttons are fairly straightforward, rings and strips are separate 
>> > interfaces
>> > with a pointer-axis-like source/value/frame events.
>> > The two interfaces are effectively identical but for the actual value they
>> > send (degrees vs normalized position).
>> >
>> > Specific to the pad device is the set_feedback request which enables a 
>> > client
>> > to set a user-defined string to display for an OSD on the current mappings.
>> > This request is available for buttons, rings and strips.
>> >
>> > Finally, the pad supports "modes", effectively sets of button/ring/strip
>> > configurations.
>> >
>> > Signed-off-by: Carlos Garnacho 
>> > Signed-off-by: Peter Hutterer 
>> > ---
>> > Changes to v1:
>> > - typos fixed
>> >
>> >  unstable/tablet/tablet-unstable-v1.xml | 423 
>> > -
>> >  1 file changed, 421 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/unstable/tablet/tablet-unstable-v1.xml 
>> > b/unstable/tablet/tablet-unstable-v1.xml
>> > index 907126c..36b9ae8 100644
>> > --- a/unstable/tablet/tablet-unstable-v1.xml
>> > +++ b/unstable/tablet/tablet-unstable-v1.xml
>> > @@ -115,7 +115,7 @@
>> >  interface version number is reset.
>> >
>> >
>> > -  
>> > +  
>> >  
>> >An object that provides access to the graphics tablets available on 
>> > this
>> >system. All tablets are associated with a seat, to get access to the
>> > @@ -139,7 +139,7 @@
>> >  
>> >
>> >
>> > -  
>> > +  
>> >  
>> >An object that provides access to the graphics tablets available on 
>> > this
>> >seat. After binding to this interface, the compositor sends a set of
>> > @@ -172,6 +172,23 @@
>> >
>> >> > summary="the newly added tablet tool"/>
>> >  
>> > +
>> > +
>> > +
>> > +
>> > +  
>> > +   This event is sent whenever a new pad is known to the system. 
>> > Typically,
>> > +   pads are physically attached to tablets and a pad_added event is
>> > +   sent immediately after the wp_tablet_seat.tablet_added.
>> > +   However, some standalone pad devices logically attach to tablets at
>> > +   runtime, the client must wait for wp_tablet_pad.enter to know the
>> > +   tablet a pad is attached to.
>> > +
>>
>> If a compositor wanted to support "bare" pad devices, I'm assuming
>> they'd have to fake one or more wp_tablet objects for that use,
>> correct?
>
> yeah, I think so. but there is the question of what a standalone pad (I
> assume you're talking about the EKR) would do in a wacom/tablet context?
> and whether the EKR would just be better off as a buttonset device when it's
> not connected to a tablet.
>

Ah, I had forgotten about that. Exposing it (yeah, talking about the
EKR) as a buttonset when there's no tablet to connect to seems
reasonable as well, but I wonder if clients really care to support
both interfaces and (somehow) synchronize preferences between
pad-as-a-buttonset and pad-as-a-tablet. That's probably my general
discomfort with pad-as-a-tablet showing again though...

>> > +
>> > +  
>> > +   Source information for ring events.
>> > +
>> > +   This event does not occur on its own. It is sent before a
>> > +   wp_tablet_pad_ring.frame event and carries the source information
>> > +   for all events within that frame.
>> > +
>> > +   The source specifies how this event was generated. If the source is
>> > +   wp_tablet_pad_ring.source.finger, a wp_tablet_pad_ring.stop event
>> > +   will be sent when the user lifts the finger off the device.
>> > +
>> > +   This event is optional. If the source is unknown for an 
>> > interaction,
>> > +   no event is sent.
>> > +  
>> > +  
>> > +
>> > +
>> > +
>> > +  
>> > +   Sent whenever the angle on a ring changes.
>> > +
>> > +   The angle is provided in 0.01 of a degree clockwise from the 
>> > logical
>> > +   north of the ring in the pad's current rotation.
>> > +  
>> > +  
>>
>> I assume this will be updated to use the "fixed" type (along with pen
>> tilt and rotation) in a subsequent patch?
>
> yes, I want to merge the change to doubles as v2 since it's an ABI break,
> but it's such low impact that merging this as v1 is better, IMO
>
>> > +
>> > +  
>> > +   Indicates the end of a set of events that logically belong 
>> > together.
>> > +   A client is expected to accumulate the data in 

Re: [RFC libinput] Import buttonset interface

2016-04-22 Thread PrasannaKumar Muralidharan
> fwiw, it's very frowned upon to take someone else's patch, rebase it and
> then send it on as your own when it has very little changes. Please keep
> original authorship while it makes sense and add the author as co-author
> where substantial changes have been made.

I definitely did not intend to claim this as my patch. I will set the
correct author when I send the patch again with modifications.

> tbh, I'm not quite sure what to review here though, without a backend
> implementation this is quite theoretical. I'm assuming you just want a
> quick review to make sure nothing obvious got lost in the rebase?
> If so, yes, looks ok, thanks.

Yes. This is one of things I wanted to understand.

> There are a couple of questions that arose from the
> wacom tablet button switch, specifically:
> * what use do the linux/input.h button codes have in the buttonset
>   interface? We will run similar issues with the evdev button code ranges as
>   we did with the pad, where the button code is meaningless.
> * the various axes are nice to have, but without a user I'm hesitant to
>   merge them - we'll need to know how they could be used first

I am dealing is similar to rotary encoder, buttonset interface is the
required for it. I am not aware of the issue mentioned above. I would
prefer to have some guidance on what should be changed or removed. The
main objective of the patch sent is exactly this - I wanted to know
what I have to do to get the buttonset interface merged.

> * ring and strip are absolute, they are wacom-only axes and until we get a
>   device that needs either, we should leave them out.

Will remove them.

> * the seat button count should be removed, it doesn't make sense for a
>   buttonset device
> * get_(x|y)* does not need an axis argument, I struggle to think of a device
>   that has two x or y axes on the same event node.
>
> Other than that I still think that the general approach with numbered axes
> and axis types makes sense.

Okay. Will change accordingly.

>> This change is compile tested.
>
> That's not a confidence-inspiring statement... :)

Agreed. I will follow up with dial input support and will have a
proper working version by then.

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


Re: [PATCH wayland] connection: remove redundant assignment

2016-04-22 Thread Eric Engestrom
On Fri, Apr 22, 2016 at 05:46:00PM +0200, Marek Chalupa wrote:
> the code is something like:
> 

Maybe add:
struct wl_object *object;
to your abridged version to clearly show that it's a local object?

>   if (object == NULL && ...) {
>   object = NULL;
>   return;
>   }
> 
> first, the object is already NULL, second, the assignment has no effect
> since we return from the function right away
> 
> Signed-off-by: Marek Chalupa 

Either way, it's
Reviewed-by: Eric Engestrom 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH wayland] connection: remove redundant assignment

2016-04-22 Thread Marek Chalupa
the code is something like:

  if (object == NULL && ...) {
  object = NULL;
  return;
  }

first, the object is already NULL, second, the assignment has no effect
since we return from the function right away

Signed-off-by: Marek Chalupa 
---
 src/connection.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/connection.c b/src/connection.c
index c0e322f..747229e 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -838,7 +838,6 @@ wl_closure_lookup_objects(struct wl_closure *closure, 
struct wl_map *objects)
} else if (object == NULL && id != 0) {
wl_log("unknown object (%u), message %s(%s)\n",
   id, message->name, message->signature);
-   object = NULL;
errno = EINVAL;
return -1;
}
-- 
2.5.5

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


Re: [PATCH 3/5] rdp: fix presentation for the RDP compositor

2016-04-22 Thread Hardening
Le 22/04/2016 15:55, Pekka Paalanen a écrit :
> On Fri, 22 Apr 2016 15:19:04 +0200
> David Fort  wrote:
> 
>> Set an update delay that is a multiple of the output frequency, or we may do
>> incorrect weston_output_finish_frame calls.
>> ---
>>  src/compositor-rdp.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
>> index 9274674..4cbc1c3 100644
>> --- a/src/compositor-rdp.c
>> +++ b/src/compositor-rdp.c
>> @@ -378,7 +378,7 @@ rdp_output_repaint(struct weston_output *output_base, 
>> pixman_region32_t *damage)
>>  pixman_region32_subtract(>primary_plane.damage,
>>   >primary_plane.damage, damage);
>>  
>> -wl_event_source_timer_update(output->finish_frame_timer, 16);
>> +wl_event_source_timer_update(output->finish_frame_timer, 10);
>>  return 0;
>>  }
>>  
> 
> Hi,
> 
> I'm worried that there are more things wrong. This does not look like a
> fix, it just improves the odds of not failing if any.
> 
> So, you have a 100 Hz output update frequency on RDP?
> 

I think you're right, the frequency is supposed to be 60Hz (as announced
in the output settings), unfortunately 6 is a multiple of both 10
and 16 so that's how you said, it just hides the real bug. I'll have a
deeper look.

Best regards

-- 
David FORT
website: http://www.hardening-consulting.com/

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


[PATCH v1] refactor configuration API of rdp-backend

2016-04-22 Thread Benoit Gschwind
Implement a "well" defined API to configure the rdp backend.
Following according to discution about libweston API.
---
v1:
 - Fix the patch log
v0:
  - Nothing particular.

Signed-off-by: Benoit Gschwind 

 Makefile.am  |  1 +
 src/compositor-rdp.c | 71 +---
 src/compositor-rdp.h | 54 +++
 src/main.c   | 56 +++--
 4 files changed, 137 insertions(+), 45 deletions(-)
 create mode 100644 src/compositor-rdp.h

diff --git a/Makefile.am b/Makefile.am
index c042c68..a4dcd57 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,6 +73,7 @@ weston_SOURCES =  \
src/compositor.c\
src/compositor.h\
src/compositor-headless.h   \
+   src/compositor-rdp.h\
src/input.c \
src/data-device.c   \
src/screenshooter.c \
diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
index 773b6b5..2860556 100644
--- a/src/compositor-rdp.c
+++ b/src/compositor-rdp.c
@@ -67,23 +67,13 @@
 
 #include "shared/helpers.h"
 #include "compositor.h"
+#include "compositor-rdp.h"
 #include "pixman-renderer.h"
 
 #define MAX_FREERDP_FDS 32
 #define DEFAULT_AXIS_STEP_DISTANCE 10
 #define RDP_MODE_FREQ 60 * 1000
 
-struct rdp_backend_config {
-   int width;
-   int height;
-   char *bind_address;
-   int port;
-   char *rdp_key;
-   char *server_cert;
-   char *server_key;
-   int env_socket;
-   int no_clients_resize;
-};
 
 struct rdp_output;
 
@@ -138,20 +128,6 @@ struct rdp_peer_context {
 typedef struct rdp_peer_context RdpPeerContext;
 
 static void
-rdp_backend_config_init(struct rdp_backend_config *config)
-{
-   config->width = 640;
-   config->height = 480;
-   config->bind_address = NULL;
-   config->port = 3389;
-   config->rdp_key = NULL;
-   config->server_cert = NULL;
-   config->server_key = NULL;
-   config->env_socket = 0;
-   config->no_clients_resize = 0;
-}
-
-static void
 rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, 
freerdp_peer *peer)
 {
int width, height, nrects, i;
@@ -1195,8 +1171,7 @@ rdp_incoming_peer(freerdp_listener *instance, 
freerdp_peer *client)
 
 static struct rdp_backend *
 rdp_backend_create(struct weston_compositor *compositor,
-  struct rdp_backend_config *config,
-  int *argc, char *argv[], struct weston_config *wconfig)
+  struct weston_rdp_backend_config *config)
 {
struct rdp_backend *b;
char *fd_str;
@@ -1274,39 +1249,49 @@ err_free_strings:
return NULL;
 }
 
+static void
+config_init_to_defaults(struct weston_rdp_backend_config *config)
+{
+   config->width = 640;
+   config->height = 480;
+   config->bind_address = NULL;
+   config->port = 3389;
+   config->rdp_key = NULL;
+   config->server_cert = NULL;
+   config->server_key = NULL;
+   config->env_socket = 0;
+   config->no_clients_resize = 0;
+}
+
 WL_EXPORT int
 backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
 struct weston_config *wconfig,
 struct weston_backend_config *config_base)
 {
struct rdp_backend *b;
-   struct rdp_backend_config config;
-   rdp_backend_config_init();
+   struct weston_rdp_backend_config config = {{ 0, }};
int major, minor, revision;
 
freerdp_get_version(, , );
weston_log("using FreeRDP version %d.%d.%d\n", major, minor, revision);
 
-   const struct weston_option rdp_options[] = {
-   { WESTON_OPTION_BOOLEAN, "env-socket", 0, _socket },
-   { WESTON_OPTION_INTEGER, "width", 0,  },
-   { WESTON_OPTION_INTEGER, "height", 0,  },
-   { WESTON_OPTION_STRING,  "address", 0, _address },
-   { WESTON_OPTION_INTEGER, "port", 0,  },
-   { WESTON_OPTION_BOOLEAN, "no-clients-resize", 0, 
_clients_resize },
-   { WESTON_OPTION_STRING,  "rdp4-key", 0, _key },
-   { WESTON_OPTION_STRING,  "rdp-tls-cert", 0, _cert 
},
-   { WESTON_OPTION_STRING,  "rdp-tls-key", 0, _key }
-   };
-
-   parse_options(rdp_options, ARRAY_LENGTH(rdp_options), argc, argv);
+   if (config_base == NULL ||
+   config_base->struct_version != WESTON_RDP_BACKEND_CONFIG_VERSION ||
+   config_base->struct_size > sizeof(struct 
weston_rdp_backend_config)) {
+   weston_log("RDP backend config structure is invalid\n");
+   return -1;
+   }
+
+   config_init_to_defaults();
+   memcpy(, config_base, config_base->struct_size);
+
if (!config.rdp_key && (!config.server_cert || 

[PATCH] refactor configuration API of wayland-backend

2016-04-22 Thread Benoit Gschwind
Implement a "well" defined API to configure the wayland backend.
Following according to discution about libweston API.
---
V0:
 - Nothing particular.

Signed-off-by: Benoit Gschwind 

 Makefile.am  |  1 +
 src/compositor-rdp.c | 71 +---
 src/compositor-rdp.h | 54 +++
 src/main.c   | 56 +++--
 4 files changed, 137 insertions(+), 45 deletions(-)
 create mode 100644 src/compositor-rdp.h

diff --git a/Makefile.am b/Makefile.am
index c042c68..a4dcd57 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,6 +73,7 @@ weston_SOURCES =  \
src/compositor.c\
src/compositor.h\
src/compositor-headless.h   \
+   src/compositor-rdp.h\
src/input.c \
src/data-device.c   \
src/screenshooter.c \
diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
index 773b6b5..2860556 100644
--- a/src/compositor-rdp.c
+++ b/src/compositor-rdp.c
@@ -67,23 +67,13 @@
 
 #include "shared/helpers.h"
 #include "compositor.h"
+#include "compositor-rdp.h"
 #include "pixman-renderer.h"
 
 #define MAX_FREERDP_FDS 32
 #define DEFAULT_AXIS_STEP_DISTANCE 10
 #define RDP_MODE_FREQ 60 * 1000
 
-struct rdp_backend_config {
-   int width;
-   int height;
-   char *bind_address;
-   int port;
-   char *rdp_key;
-   char *server_cert;
-   char *server_key;
-   int env_socket;
-   int no_clients_resize;
-};
 
 struct rdp_output;
 
@@ -138,20 +128,6 @@ struct rdp_peer_context {
 typedef struct rdp_peer_context RdpPeerContext;
 
 static void
-rdp_backend_config_init(struct rdp_backend_config *config)
-{
-   config->width = 640;
-   config->height = 480;
-   config->bind_address = NULL;
-   config->port = 3389;
-   config->rdp_key = NULL;
-   config->server_cert = NULL;
-   config->server_key = NULL;
-   config->env_socket = 0;
-   config->no_clients_resize = 0;
-}
-
-static void
 rdp_peer_refresh_rfx(pixman_region32_t *damage, pixman_image_t *image, 
freerdp_peer *peer)
 {
int width, height, nrects, i;
@@ -1195,8 +1171,7 @@ rdp_incoming_peer(freerdp_listener *instance, 
freerdp_peer *client)
 
 static struct rdp_backend *
 rdp_backend_create(struct weston_compositor *compositor,
-  struct rdp_backend_config *config,
-  int *argc, char *argv[], struct weston_config *wconfig)
+  struct weston_rdp_backend_config *config)
 {
struct rdp_backend *b;
char *fd_str;
@@ -1274,39 +1249,49 @@ err_free_strings:
return NULL;
 }
 
+static void
+config_init_to_defaults(struct weston_rdp_backend_config *config)
+{
+   config->width = 640;
+   config->height = 480;
+   config->bind_address = NULL;
+   config->port = 3389;
+   config->rdp_key = NULL;
+   config->server_cert = NULL;
+   config->server_key = NULL;
+   config->env_socket = 0;
+   config->no_clients_resize = 0;
+}
+
 WL_EXPORT int
 backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
 struct weston_config *wconfig,
 struct weston_backend_config *config_base)
 {
struct rdp_backend *b;
-   struct rdp_backend_config config;
-   rdp_backend_config_init();
+   struct weston_rdp_backend_config config = {{ 0, }};
int major, minor, revision;
 
freerdp_get_version(, , );
weston_log("using FreeRDP version %d.%d.%d\n", major, minor, revision);
 
-   const struct weston_option rdp_options[] = {
-   { WESTON_OPTION_BOOLEAN, "env-socket", 0, _socket },
-   { WESTON_OPTION_INTEGER, "width", 0,  },
-   { WESTON_OPTION_INTEGER, "height", 0,  },
-   { WESTON_OPTION_STRING,  "address", 0, _address },
-   { WESTON_OPTION_INTEGER, "port", 0,  },
-   { WESTON_OPTION_BOOLEAN, "no-clients-resize", 0, 
_clients_resize },
-   { WESTON_OPTION_STRING,  "rdp4-key", 0, _key },
-   { WESTON_OPTION_STRING,  "rdp-tls-cert", 0, _cert 
},
-   { WESTON_OPTION_STRING,  "rdp-tls-key", 0, _key }
-   };
-
-   parse_options(rdp_options, ARRAY_LENGTH(rdp_options), argc, argv);
+   if (config_base == NULL ||
+   config_base->struct_version != WESTON_RDP_BACKEND_CONFIG_VERSION ||
+   config_base->struct_size > sizeof(struct 
weston_rdp_backend_config)) {
+   weston_log("RDP backend config structure is invalid\n");
+   return -1;
+   }
+
+   config_init_to_defaults();
+   memcpy(, config_base, config_base->struct_size);
+
if (!config.rdp_key && (!config.server_cert || !config.server_key)) 

Re: [PATCH weston] build: actually use CLOCK_GETTIME_LIBS for libzunitc

2016-04-22 Thread Pekka Paalanen
On Fri, 22 Apr 2016 10:54:35 -0300
Gustavo Zacarias  wrote:

> The fix/check in 34d59859 is incomplete.
> 
> Signed-off-by: Gustavo Zacarias 
> ---
>  Makefile.am | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index c042c68..41f0789 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1054,7 +1054,8 @@ libzunitc_la_CFLAGS = \
>   -I$(top_srcdir)/tools/zunitc/inc
>  
>  libzunitc_la_LIBADD = \
> - libshared.la
> + libshared.la \
> + $(CLOCK_GETTIME_LIBS)
>  
>  if ENABLE_JUNIT_XML
>  libzunitc_la_CFLAGS += \

Pushed:
   34d5985..57c83f6  master -> master


Thanks,
pq


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


Re: [PATCH 5/5] desktop shell: resize background and panel when an output switches mode

2016-04-22 Thread Pekka Paalanen
On Fri, 22 Apr 2016 15:19:06 +0200
David Fort  wrote:

> When an output permanently switches mode, the desktop shell must be notified 
> so
> that the misc components can resize to the new size of the output. This patch 
> also
> fixes the coodinates of "other" outputs when the resize occurs.
> 
> Signed-off-by: David Fort 
> ---
>  desktop-shell/shell.c | 34 ++
>  desktop-shell/shell.h |  1 +
>  src/compositor.c  | 33 ++---
>  src/compositor.h  |  1 +
>  4 files changed, 58 insertions(+), 11 deletions(-)
> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index cd269a8..1c1c993 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -6368,11 +6368,43 @@ handle_output_destroy(struct wl_listener *listener, 
> void *data)
>   shell_for_each_layer(shell, shell_output_destroy_move_layer, output);
>  
>   wl_list_remove(_listener->destroy_listener.link);
> + wl_list_remove(_listener->resized_listener.link);
>   wl_list_remove(_listener->link);
>   free(output_listener);
>  }
>  
>  static void
> +shell_output_resize_layer(struct desktop_shell *shell,
> + struct weston_layer *layer,
> + void *data)
> +{
> + struct weston_output *output = data;
> + struct weston_view *view;
> +
> + wl_list_for_each(view, >view_list.link, layer_link.link) {
> + if (view->output != output)
> + continue;
> +
> + weston_desktop_shell_send_configure(shell->child.desktop_shell, 
> 0,
> + view->surface->resource,
> + output->width,
> + output->height);

Hi,

where do you check that the views you are handling are strictly only
the wallpaper and panel surfaces created by the weston-desktop-shell
client?

I have suspicion that this send call can use desktop_shell resource of
one client with the wl_surface resource of a different client, which is
illegal. Unfortunately, libwayland-server does not catch that, I
believe. The result will be messages sent to clients referring random
object ids that may not even be wl_surfaces.

I'm surprise this doesn't crash random clients - or does it?

Hmm... oh, I see. All the messages are sent to the weston-desktop-shell
client, but rather than referring only the relevant wl_surfaces, they
are sent for *all* mapped wl_surfaces also from other clients.

Are you sure weston-desktop-shell doesn't crash? The crash recovery may
be fast enough that you can only see it in Weston's logs.

> + }
> +}
> +
> +
> +static void
> +handle_output_resized(struct wl_listener *listener, void *data)
> +{
> + struct shell_output *output_listener =
> + container_of(listener, struct shell_output, resized_listener);
> + struct weston_output *output = output_listener->output;
> + struct desktop_shell *shell = output_listener->shell;
> +
> + shell_for_each_layer(shell, shell_output_resize_layer, output);
> +}
> +
> +static void
>  create_shell_output(struct desktop_shell *shell,
>   struct weston_output *output)
>  {
> @@ -6387,6 +6419,8 @@ create_shell_output(struct desktop_shell *shell,
>   shell_output->destroy_listener.notify = handle_output_destroy;
>   wl_signal_add(>destroy_signal,
> _output->destroy_listener);
> + shell_output->resized_listener.notify = handle_output_resized;
> + wl_signal_add(>compositor->output_resized_signal, 
> _output->resized_listener);
>   wl_list_insert(shell->output_list.prev, _output->link);
>  }
>  
> diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h
> index b430fa2..5457923 100644
> --- a/desktop-shell/shell.h
> +++ b/desktop-shell/shell.h
> @@ -112,6 +112,7 @@ struct shell_output {
>   struct desktop_shell  *shell;
>   struct weston_output  *output;
>   struct exposay_output eoutput;
> + struct wl_listenerresized_listener;
>   struct wl_listenerdestroy_listener;
>   struct wl_listlink;
>  };
> diff --git a/src/compositor.c b/src/compositor.c
> index 5500197..a747945 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -143,6 +143,11 @@ static void weston_mode_switch_finish(struct 
> weston_output *output,
>   }
>  }
>  
> +
> +static void
> +weston_compositor_resize_output(struct weston_compositor *compositor,
> + struct weston_output *resized_output, int 
> delta_width);
> +
>  WL_EXPORT int
>  weston_output_mode_set_native(struct weston_output *output,
> struct weston_mode *mode,
> @@ -150,6 +155,7 @@ weston_output_mode_set_native(struct weston_output 
> *output,
>  {
>   int ret;
>   int mode_changed = 0, scale_changed = 0;
> + struct weston_mode *old_mode;
>  
>   if (!output->switch_mode)

Re: [PATCH 3/5] rdp: fix presentation for the RDP compositor

2016-04-22 Thread Pekka Paalanen
On Fri, 22 Apr 2016 15:19:04 +0200
David Fort  wrote:

> Set an update delay that is a multiple of the output frequency, or we may do
> incorrect weston_output_finish_frame calls.
> ---
>  src/compositor-rdp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
> index 9274674..4cbc1c3 100644
> --- a/src/compositor-rdp.c
> +++ b/src/compositor-rdp.c
> @@ -378,7 +378,7 @@ rdp_output_repaint(struct weston_output *output_base, 
> pixman_region32_t *damage)
>   pixman_region32_subtract(>primary_plane.damage,
>>primary_plane.damage, damage);
>  
> - wl_event_source_timer_update(output->finish_frame_timer, 16);
> + wl_event_source_timer_update(output->finish_frame_timer, 10);
>   return 0;
>  }
>  

Hi,

I'm worried that there are more things wrong. This does not look like a
fix, it just improves the odds of not failing if any.

So, you have a 100 Hz output update frequency on RDP?

What actually determines the frequency if not exactly the timer you
change here?

In any case, patches 1-4 are:
Acked-by: Pekka Paalanen 


Thanks,
pq


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


[PATCH weston] build: actually use CLOCK_GETTIME_LIBS for libzunitc

2016-04-22 Thread Gustavo Zacarias
The fix/check in 34d59859 is incomplete.

Signed-off-by: Gustavo Zacarias 
---
 Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index c042c68..41f0789 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1054,7 +1054,8 @@ libzunitc_la_CFLAGS = \
-I$(top_srcdir)/tools/zunitc/inc
 
 libzunitc_la_LIBADD = \
-   libshared.la
+   libshared.la \
+   $(CLOCK_GETTIME_LIBS)
 
 if ENABLE_JUNIT_XML
 libzunitc_la_CFLAGS += \
-- 
2.7.3

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


Re: [PATCH weston] build: actually use CLOCK_GETTIME_LIBS for zuctest

2016-04-22 Thread Gustavo Zacarias

On 22/04/16 10:32, Pekka Paalanen wrote:


Hi,

I see
tools/zunitc/src/zunitc_impl.c:1145:clock_gettime(TARGET_TIMER, );
tools/zunitc/src/zunitc_impl.c:1160:clock_gettime(TARGET_TIMER, );
indeed.

But would the addition not belong to libzunitc_la_LIBADD instead?


Hi.
Indeed, shame on me.
I've change the status of this patch in patchwork and sent a revised one.
Thanks.
Regards.

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


Re: [PATCH weston] build: Add (and use) an AC_SEARCH_LIBS wrapper

2016-04-22 Thread Pekka Paalanen
On Fri, 22 Apr 2016 12:14:16 +0200
Quentin Glidic  wrote:

> From: Quentin Glidic 
> 

Hi Quentin,

you should explain here why we need this. Not for me, it's for
posterity, anyone searching about why on earth did we add this
stuff. :-)

> Signed-off-by: Quentin Glidic 
> ---
> 
> Not too much Autotools- or m4-foo needed here.
> 
> Please note the behaviour difference from AC_CHECK_LIB/AC_SEARCH_LIBS:
> we call action-if-found if the function is available directly, just
> in case some crazy libc has jpeg support. :-)
> 
> CCed Gustavo Zacarias so he can test it still works as expected for him.
> 
>  configure.ac | 18 +-
>  m4/weston.m4 | 37 +
>  2 files changed, 42 insertions(+), 13 deletions(-)
>  create mode 100644 m4/weston.m4
> 
> diff --git a/configure.ac b/configure.ac
> index 670200c..4199616 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -42,14 +42,10 @@ AC_ARG_VAR([WESTON_SHELL_CLIENT],
>  
>  PKG_PROG_PKG_CONFIG()
>  
> -AC_CHECK_FUNC([dlopen], [],
> -  AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
> -AC_SUBST(DLOPEN_LIBS)
> +WESTON_SEARCH_LIBS([DLOPEN], [dl], [dlopen])
>  
>  # In old glibc versions (< 2.17) clock_gettime() is in librt
> -AC_SEARCH_LIBS([clock_gettime], [rt],
> - [CLOCK_GETTIME_LIBS="-lrt"])
> -AC_SUBST([CLOCK_GETTIME_LIBS])
> +WESTON_SEARCH_LIBS([CLOCK_GETTIME], [rt], [clock_gettime])

This change causes -lrt to be rightfully dropped from CLOCK_GETTIME on
my system. I'm not sure why it was there to begin with.

>  
>  AC_CHECK_DECL(SFD_CLOEXEC,[],
> [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
> @@ -303,12 +299,10 @@ AC_ARG_WITH([jpeg],
>  AS_HELP_STRING([--without-jpeg],
> [Use jpeglib for JPEG decoding support 
> [default=auto]]))
>  AS_IF([test "x$with_jpeg" != "xno"],
> -  [AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], [have_jpeglib=yes], 
> [have_jpeglib=no])],
> +  [WESTON_SEARCH_LIBS([JPEG], [jpeg], [jpeg_CreateDecompress], 
> [have_jpeglib=yes], [have_jpeglib=no])],
>[have_jpeglib=no])
>  AS_IF([test "x$have_jpeglib" = "xyes"],
> -  [JPEG_LIBS="-ljpeg"
> -   AC_SUBST([JPEG_LIBS])
> -   AC_DEFINE([HAVE_JPEG], [1], [Have jpeglib])],
> +  [AC_DEFINE([HAVE_JPEG], [1], [Have jpeglib])],
>[AS_IF([test "x$with_jpeg" = "xyes"],
>   [AC_MSG_ERROR([JPEG support explicitly requested, but jpeglib 
> couldn't be found])])])
>  
> @@ -418,12 +412,10 @@ AS_IF([test "x$enable_resize_optimization" = "xyes"],
>  AC_ARG_ENABLE(weston-launch, [  --enable-weston-launch],, 
> enable_weston_launch=yes)
>  AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
>  if test x$enable_weston_launch == xyes; then
> -  AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
> +  WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], 
> [have_pam=no])
>if test x$have_pam == xno; then
>  AC_ERROR([weston-launch requires pam])
>fi
> -  PAM_LIBS=-lpam
> -  AC_SUBST(PAM_LIBS)
>  fi
>  
>  AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
> diff --git a/m4/weston.m4 b/m4/weston.m4
> new file mode 100644
> index 000..636f9fb
> --- /dev/null
> +++ b/m4/weston.m4
> @@ -0,0 +1,37 @@
> +dnl
> +dnl Copyright © 2016 Quentin “Sardem FF7” Glidic
> +dnl
> +dnl Permission is hereby granted, free of charge, to any person obtaining a
> +dnl copy of this software and associated documentation files (the 
> "Software"),
> +dnl to deal in the Software without restriction, including without limitation
> +dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
> +dnl and/or sell copies of the Software, and to permit persons to whom the
> +dnl Software is furnished to do so, subject to the following conditions:
> +dnl
> +dnl The above copyright notice and this permission notice (including the next
> +dnl paragraph) shall be included in all copies or substantial portions of the
> +dnl Software.
> +dnl
> +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
> OR
> +dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> +dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
> OTHER
> +dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> +dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> +dnl DEALINGS IN THE SOFTWARE.
> +dnl
> +
> +dnl WESTON_SEARCH_LIBS(PREFIX, search-libs, function, [action-if-found], 
> [action-if-not-found], [other-libraries])
> +dnl WESTON_SEARCH_LIBS is a wrapper around AC_SEARCH_LIBS with a little 
> difference:
> +dnl action-if-found is called even if no library is required
> +AC_DEFUN([WESTON_SEARCH_LIBS], [
> + 

Re: [PATCH weston] build: actually use CLOCK_GETTIME_LIBS for zuctest

2016-04-22 Thread Pekka Paalanen
On Fri, 22 Apr 2016 10:13:40 -0300
Gustavo Zacarias  wrote:

> The fix/check in 34d59859 is incomplete.
> 
> Signed-off-by: Gustavo Zacarias 
> ---
>  Makefile.am | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index c042c68..ae34c02 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1333,7 +1333,8 @@ noinst_PROGRAMS += zuctest$(EXEEXT)
>  
>  zuctest_LDADD =  \
>   libzunitc.la\
> - libzunitcmain.la
> + libzunitcmain.la\
> + $(CLOCK_GETTIME_LIBS)
>  
>  zuctest_CFLAGS = \
>   $(AM_CFLAGS)\

Hi,

I see
tools/zunitc/src/zunitc_impl.c:1145:clock_gettime(TARGET_TIMER, );
tools/zunitc/src/zunitc_impl.c:1160:clock_gettime(TARGET_TIMER, );
indeed.

But would the addition not belong to libzunitc_la_LIBADD instead?


Thanks,
pq


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


[PATCH v1] refactor configuration API of wayland-backend

2016-04-22 Thread Benoit Gschwind
Implement a "well" defined API to configure the wayland backend. Following
according to discution about libweston API.
---
v1:
  - Take care of weston coding style
  - Mimic the old configuration behaviour
  - Front declaration of variable
  - Static allocation of configuration structure
  - Using single zalloc for the output list allocation
v0:
  - Initial draft

Signed-off-by: Benoit Gschwind 

 Makefile.am  |   1 +
 src/compositor-wayland.c | 202 +---
 src/compositor-wayland.h |  65 +++
 src/main.c   | 212 ++-
 4 files changed, 335 insertions(+), 145 deletions(-)
 create mode 100644 src/compositor-wayland.h

diff --git a/Makefile.am b/Makefile.am
index c042c68..e94ffa1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,6 +73,7 @@ weston_SOURCES =  \
src/compositor.c\
src/compositor.h\
src/compositor-headless.h   \
+   src/compositor-wayland.h\
src/input.c \
src/data-device.c   \
src/screenshooter.c \
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index 9d1a251..db6456e 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -40,6 +40,7 @@
 #include 
 
 #include "compositor.h"
+#include "compositor-wayland.h"
 #include "gl-renderer.h"
 #include "pixman-renderer.h"
 #include "shared/helpers.h"
@@ -79,6 +80,7 @@ struct wayland_backend {
struct wl_cursor *cursor;
 
struct wl_list input_list;
+
 };
 
 struct wayland_output {
@@ -1091,65 +1093,6 @@ err_name:
 }
 
 static struct wayland_output *
-wayland_output_create_for_config(struct wayland_backend *b,
-struct weston_config_section *config_section,
-int option_width, int option_height,
-int option_scale, int32_t x, int32_t y)
-{
-   struct wayland_output *output;
-   char *mode, *t, *name, *str;
-   int width, height, scale;
-   uint32_t transform;
-   unsigned int slen;
-
-   weston_config_section_get_string(config_section, "name", , NULL);
-   if (name) {
-   slen = strlen(name);
-   slen += strlen(WINDOW_TITLE " - ");
-   str = malloc(slen + 1);
-   if (str)
-   snprintf(str, slen + 1, WINDOW_TITLE " - %s", name);
-   free(name);
-   name = str;
-   }
-   if (!name)
-   name = strdup(WINDOW_TITLE);
-
-   weston_config_section_get_string(config_section,
-"mode", , "1024x600");
-   if (sscanf(mode, "%dx%d", , ) != 2) {
-   weston_log("Invalid mode \"%s\" for output %s\n",
-  mode, name);
-   width = 1024;
-   height = 640;
-   }
-   free(mode);
-
-   if (option_width)
-   width = option_width;
-   if (option_height)
-   height = option_height;
-
-   weston_config_section_get_int(config_section, "scale", , 1);
-
-   if (option_scale)
-   scale = option_scale;
-
-   weston_config_section_get_string(config_section,
-"transform", , "normal");
-   if (weston_parse_transform(t, ) < 0)
-   weston_log("Invalid transform \"%s\" for output %s\n",
-  t, name);
-   free(t);
-
-   output = wayland_output_create(b, x, y, width, height, name, 0,
-  transform, scale);
-   free(name);
-
-   return output;
-}
-
-static struct wayland_output *
 wayland_output_create_for_parent_output(struct wayland_backend *b,
struct wayland_parent_output *poutput)
 {
@@ -2167,25 +2110,18 @@ static const char *left_ptrs[] = {
 };
 
 static void
-create_cursor(struct wayland_backend *b, struct weston_config *config)
+create_cursor(struct wayland_backend *b,
+   struct weston_wayland_backend_config *config)
 {
-   struct weston_config_section *s;
-   int size;
-   char *theme = NULL;
unsigned int i;
 
-   s = weston_config_get_section(config, "shell", NULL, NULL);
-   weston_config_section_get_string(s, "cursor-theme", , NULL);
-   weston_config_section_get_int(s, "cursor-size", , 32);
-
-   b->cursor_theme = wl_cursor_theme_load(theme, size, b->parent.shm);
+   b->cursor_theme = wl_cursor_theme_load(config->cursor_theme,
+   config->cursor_size, b->parent.shm);
if (!b->cursor_theme) {
fprintf(stderr, "could not load cursor theme\n");
return;
}
 
- 

Re: [PATCH 1/5] rdp: allow to compile against FreeRDP 2.0

2016-04-22 Thread Hardening
Le 22/04/2016 15:19, David Fort a écrit :
> FreeRDP 2.0 is about to be released, this allows to compile against this 
> version.
> 
> Signed-off-by: David Fort 
> ---
>  configure.ac |  8 +++-
>  src/compositor-rdp.c | 23 ---
>  2 files changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 670200c..9c70b2e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -242,12 +242,18 @@ AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR],
> [test x$enable_rdp_compositor = xyes])
>  if test x$enable_rdp_compositor = xyes; then
>AC_DEFINE([BUILD_RDP_COMPOSITOR], [1], [Build the RDP compositor])
> -  PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0])
> +  PKG_CHECK_MODULES(FreeRDP, [freerdp >= 1.1.0],
> +[RDP_COMPOSITOR_CFLAGS=$FreeRDP_CFLAGS; 
> RDP_COMPOSITOR_LIBS=$FreeRDP_LIBS;],
> +[PKG_CHECK_MODULES(FreeRDP2, [freerdp2 >= 
> 2.0.0],[RDP_COMPOSITOR_CFLAGS=$FreeRDP2_CFLAGS; 
> RDP_COMPOSITOR_LIBS=$FreeRDP2_LIBS;])]
> +  )
>  
>SAVED_CPPFLAGS="$CPPFLAGS"
>CPPFLAGS="$CPPFLAGS $RDP_COMPOSITOR_CFLAGS"
>AC_CHECK_HEADERS([freerdp/version.h])
>CPPFLAGS="$SAVED_CPPFLAGS"
> +
> +  AC_SUBST(RDP_COMPOSITOR_CFLAGS)
> +  AC_SUBST(RDP_COMPOSITOR_LIBS)
>  fi
>  
>  AC_ARG_ENABLE([screen-sharing], [  --enable-screen-sharing],,
> diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
> index 773b6b5..0649bee 100644
> --- a/src/compositor-rdp.c
> +++ b/src/compositor-rdp.c
> @@ -42,15 +42,24 @@
>  #define FREERDP_VERSION_NUMBER ((FREERDP_VERSION_MAJOR * 0x1) + \
>   (FREERDP_VERSION_MINOR * 0x100) + FREERDP_VERSION_REVISION)
>  
> +
>  #if FREERDP_VERSION_NUMBER >= 0x10201
>  #define HAVE_SKIP_COMPRESSION
>  #endif
>  
>  #if FREERDP_VERSION_NUMBER < 0x10202
> -#define FREERDP_CB_RET_TYPE void
> -#define FREERDP_CB_RETURN(V) return
> +#define FREERDP_CB_RET_TYPE void
> +#define FREERDP_CB_RETURN(V) return
> +#define NSC_RESET(C, W, H)
> +#define RFX_RESET(C, W, H) do { rfx_context_reset(C); C->width = W; 
> C->height = H; } while(0)
> +#else
> +#if FREERDP_VERSION_MAJOR >= 2
> +#define NSC_RESET(C, W, H) nsc_context_reset(C, W, H)
> +#define RFX_RESET(C, W, H) rfx_context_reset(C, W, H)
>  #else
> -#define HAVE_NSC_RESET
> +#define NSC_RESET(C, W, H) do { nsc_context_reset(C); C->width = W; 
> C->height = H; } while(0)
> +#define RFX_RESET(C, W, H) do { rfx_context_reset(C); C->width = W; 
> C->height = H; } while(0)
> +#endif
>  #define FREERDP_CB_RET_TYPE BOOL
>  #define FREERDP_CB_RETURN(V) return TRUE
>  #endif
> @@ -819,6 +828,7 @@ xf_peer_activate(freerdp_peer* client)
>   struct xkb_context *xkbContext;
>   struct xkb_rule_names xkbRuleNames;
>   struct xkb_keymap *keymap;
> + struct weston_output *weston_output;
>   int i;
>   pixman_box32_t box;
>   pixman_region32_t damage;
> @@ -867,10 +877,9 @@ xf_peer_activate(freerdp_peer* client)
>   }
>   }
>  
> - rfx_context_reset(peerCtx->rfx_context);
> -#ifdef HAVE_NSC_RESET
> - nsc_context_reset(peerCtx->nsc_context);
> -#endif
> + weston_output = >base;
> + RFX_RESET(peerCtx->rfx_context, weston_output->width, 
> weston_output->height);
> + NSC_RESET(peerCtx->nsc_context, weston_output->width, 
> weston_output->height);
>  
>   if (peersItem->flags & RDP_PEER_ACTIVATED)
>   return TRUE;
> 


I forgot to specify that this one superseeds
https://patchwork.freedesktop.org/patch/76168/.

Best regards.

-- 
David FORT
website: http://www.hardening-consulting.com/

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


[PATCH 3/5] rdp: fix presentation for the RDP compositor

2016-04-22 Thread David Fort
Set an update delay that is a multiple of the output frequency, or we may do
incorrect weston_output_finish_frame calls.
---
 src/compositor-rdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
index 9274674..4cbc1c3 100644
--- a/src/compositor-rdp.c
+++ b/src/compositor-rdp.c
@@ -378,7 +378,7 @@ rdp_output_repaint(struct weston_output *output_base, 
pixman_region32_t *damage)
pixman_region32_subtract(>primary_plane.damage,
 >primary_plane.damage, damage);
 
-   wl_event_source_timer_update(output->finish_frame_timer, 16);
+   wl_event_source_timer_update(output->finish_frame_timer, 10);
return 0;
 }
 
-- 
1.9.1

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


[PATCH 2/5] rdp: don't release the seat until it is safe

2016-04-22 Thread David Fort
Releasing a seat is not safe, so let's just announce it without keyboard
and mouse until this is fixed. Without this patch we just can't reconnect on
the RDP compositor as it crashes.

Signed-off-by: David Fort 
---
 src/compositor-rdp.c | 32 +++-
 1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
index 0649bee..9274674 100644
--- a/src/compositor-rdp.c
+++ b/src/compositor-rdp.c
@@ -119,7 +119,7 @@ enum peer_item_flags {
 struct rdp_peers_item {
int flags;
freerdp_peer *peer;
-   struct weston_seat seat;
+   struct weston_seat *seat;
 
struct wl_list link;
 };
@@ -647,9 +647,9 @@ rdp_peer_context_free(freerdp_peer* client, RdpPeerContext* 
context)
}
 
if (context->item.flags & RDP_PEER_ACTIVATED) {
-   weston_seat_release_keyboard(>item.seat);
-   weston_seat_release_pointer(>item.seat);
-   weston_seat_release(>item.seat);
+   weston_seat_release_keyboard(context->item.seat);
+   weston_seat_release_pointer(context->item.seat);
+   /*weston_seat_release(context->item.seat);*/
}
 
Stream_Free(context->encode_stream, TRUE);
@@ -918,9 +918,15 @@ xf_peer_activate(freerdp_peer* client)
else
snprintf(seat_name, sizeof(seat_name), "RDP peer @%s", 
settings->ClientAddress);
 
-   weston_seat_init(>seat, b->compositor, seat_name);
-   weston_seat_init_keyboard(>seat, keymap);
-   weston_seat_init_pointer(>seat);
+   peersItem->seat = zalloc(sizeof(*peersItem->seat));
+   if (!peersItem->seat) {
+   weston_log("unable to create a weston_seat\n");
+   return FALSE;
+   }
+
+   weston_seat_init(peersItem->seat, b->compositor, seat_name);
+   weston_seat_init_keyboard(peersItem->seat, keymap);
+   weston_seat_init_pointer(peersItem->seat);
 
peersItem->flags |= RDP_PEER_ACTIVATED;
 
@@ -959,7 +965,7 @@ xf_mouseEvent(rdpInput *input, UINT16 flags, UINT16 x, 
UINT16 y)
if (flags & PTR_FLAGS_MOVE) {
output = peerContext->rdpBackend->output;
if (x < output->base.width && y < output->base.height) {
-   notify_motion_absolute(>item.seat, 
weston_compositor_get_time(),
+   notify_motion_absolute(peerContext->item.seat, 
weston_compositor_get_time(),
x, y);
need_frame = true;
}
@@ -973,7 +979,7 @@ xf_mouseEvent(rdpInput *input, UINT16 flags, UINT16 x, 
UINT16 y)
button = BTN_MIDDLE;
 
if (button) {
-   notify_button(>item.seat, 
weston_compositor_get_time(), button,
+   notify_button(peerContext->item.seat, 
weston_compositor_get_time(), button,
(flags & PTR_FLAGS_DOWN) ? 
WL_POINTER_BUTTON_STATE_PRESSED : WL_POINTER_BUTTON_STATE_RELEASED
);
need_frame = true;
@@ -998,13 +1004,13 @@ xf_mouseEvent(rdpInput *input, UINT16 flags, UINT16 x, 
UINT16 y)
weston_event.discrete = (int)value;
weston_event.has_discrete = true;
 
-   notify_axis(>item.seat, 
weston_compositor_get_time(),
+   notify_axis(peerContext->item.seat, 
weston_compositor_get_time(),
_event);
need_frame = true;
}
 
if (need_frame)
-   notify_pointer_frame(>item.seat);
+   notify_pointer_frame(peerContext->item.seat);
 
FREERDP_CB_RETURN(TRUE);
 }
@@ -1017,7 +1023,7 @@ xf_extendedMouseEvent(rdpInput *input, UINT16 flags, 
UINT16 x, UINT16 y)
 
output = peerContext->rdpBackend->output;
if (x < output->base.width && y < output->base.height) {
-   notify_motion_absolute(>item.seat, 
weston_compositor_get_time(),
+   notify_motion_absolute(peerContext->item.seat, 
weston_compositor_get_time(),
x, y);
}
 
@@ -1080,7 +1086,7 @@ xf_input_keyboard_event(rdpInput *input, UINT16 flags, 
UINT16 code)
 
/*weston_log("code=%x ext=%d vk_code=%x scan_code=%x\n", code, 
(flags & KBD_FLAGS_EXTENDED) ? 1 : 0,
vk_code, scan_code);*/
-   notify_key(>item.seat, 
weston_compositor_get_time(),
+   notify_key(peerContext->item.seat, weston_compositor_get_time(),
scan_code - 8, keyState, 
STATE_UPDATE_AUTOMATIC);
}
 
-- 
1.9.1

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


[PATCH 5/5] desktop shell: resize background and panel when an output switches mode

2016-04-22 Thread David Fort
When an output permanently switches mode, the desktop shell must be notified so
that the misc components can resize to the new size of the output. This patch 
also
fixes the coodinates of "other" outputs when the resize occurs.

Signed-off-by: David Fort 
---
 desktop-shell/shell.c | 34 ++
 desktop-shell/shell.h |  1 +
 src/compositor.c  | 33 ++---
 src/compositor.h  |  1 +
 4 files changed, 58 insertions(+), 11 deletions(-)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index cd269a8..1c1c993 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -6368,11 +6368,43 @@ handle_output_destroy(struct wl_listener *listener, 
void *data)
shell_for_each_layer(shell, shell_output_destroy_move_layer, output);
 
wl_list_remove(_listener->destroy_listener.link);
+   wl_list_remove(_listener->resized_listener.link);
wl_list_remove(_listener->link);
free(output_listener);
 }
 
 static void
+shell_output_resize_layer(struct desktop_shell *shell,
+   struct weston_layer *layer,
+   void *data)
+{
+   struct weston_output *output = data;
+   struct weston_view *view;
+
+   wl_list_for_each(view, >view_list.link, layer_link.link) {
+   if (view->output != output)
+   continue;
+
+   weston_desktop_shell_send_configure(shell->child.desktop_shell, 
0,
+   view->surface->resource,
+   output->width,
+   output->height);
+   }
+}
+
+
+static void
+handle_output_resized(struct wl_listener *listener, void *data)
+{
+   struct shell_output *output_listener =
+   container_of(listener, struct shell_output, resized_listener);
+   struct weston_output *output = output_listener->output;
+   struct desktop_shell *shell = output_listener->shell;
+
+   shell_for_each_layer(shell, shell_output_resize_layer, output);
+}
+
+static void
 create_shell_output(struct desktop_shell *shell,
struct weston_output *output)
 {
@@ -6387,6 +6419,8 @@ create_shell_output(struct desktop_shell *shell,
shell_output->destroy_listener.notify = handle_output_destroy;
wl_signal_add(>destroy_signal,
  _output->destroy_listener);
+   shell_output->resized_listener.notify = handle_output_resized;
+   wl_signal_add(>compositor->output_resized_signal, 
_output->resized_listener);
wl_list_insert(shell->output_list.prev, _output->link);
 }
 
diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h
index b430fa2..5457923 100644
--- a/desktop-shell/shell.h
+++ b/desktop-shell/shell.h
@@ -112,6 +112,7 @@ struct shell_output {
struct desktop_shell  *shell;
struct weston_output  *output;
struct exposay_output eoutput;
+   struct wl_listenerresized_listener;
struct wl_listenerdestroy_listener;
struct wl_listlink;
 };
diff --git a/src/compositor.c b/src/compositor.c
index 5500197..a747945 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -143,6 +143,11 @@ static void weston_mode_switch_finish(struct weston_output 
*output,
}
 }
 
+
+static void
+weston_compositor_resize_output(struct weston_compositor *compositor,
+   struct weston_output *resized_output, int 
delta_width);
+
 WL_EXPORT int
 weston_output_mode_set_native(struct weston_output *output,
  struct weston_mode *mode,
@@ -150,6 +155,7 @@ weston_output_mode_set_native(struct weston_output *output,
 {
int ret;
int mode_changed = 0, scale_changed = 0;
+   struct weston_mode *old_mode;
 
if (!output->switch_mode)
return -1;
@@ -165,11 +171,16 @@ weston_output_mode_set_native(struct weston_output 
*output,
}
}
 
+   old_mode = output->native_mode;
output->native_mode = mode;
output->native_scale = scale;
 
weston_mode_switch_finish(output, mode_changed, scale_changed);
 
+   if (old_mode && (old_mode->width != mode->width))
+   weston_compositor_resize_output(output->compositor, output, 
mode->width - old_mode->width);
+
+   wl_signal_emit(>compositor->output_resized_signal, output);
return 0;
 }
 
@@ -4047,23 +4058,22 @@ bind_output(struct wl_client *client,
wl_output_send_done(resource);
 }
 
-/* Move other outputs when one is removed so the space remains contiguos. */
+/* Move other outputs when one is resized so the space remains contiguous. */
 static void
-weston_compositor_remove_output(struct weston_compositor *compositor,
-   struct weston_output *remove_output)
+weston_compositor_resize_output(struct weston_compositor *compositor,
+ 

[PATCH 1/5] rdp: allow to compile against FreeRDP 2.0

2016-04-22 Thread David Fort
FreeRDP 2.0 is about to be released, this allows to compile against this 
version.

Signed-off-by: David Fort 
---
 configure.ac |  8 +++-
 src/compositor-rdp.c | 23 ---
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 670200c..9c70b2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -242,12 +242,18 @@ AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR],
[test x$enable_rdp_compositor = xyes])
 if test x$enable_rdp_compositor = xyes; then
   AC_DEFINE([BUILD_RDP_COMPOSITOR], [1], [Build the RDP compositor])
-  PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0])
+  PKG_CHECK_MODULES(FreeRDP, [freerdp >= 1.1.0],
+[RDP_COMPOSITOR_CFLAGS=$FreeRDP_CFLAGS; 
RDP_COMPOSITOR_LIBS=$FreeRDP_LIBS;],
+[PKG_CHECK_MODULES(FreeRDP2, [freerdp2 >= 
2.0.0],[RDP_COMPOSITOR_CFLAGS=$FreeRDP2_CFLAGS; 
RDP_COMPOSITOR_LIBS=$FreeRDP2_LIBS;])]
+  )
 
   SAVED_CPPFLAGS="$CPPFLAGS"
   CPPFLAGS="$CPPFLAGS $RDP_COMPOSITOR_CFLAGS"
   AC_CHECK_HEADERS([freerdp/version.h])
   CPPFLAGS="$SAVED_CPPFLAGS"
+
+  AC_SUBST(RDP_COMPOSITOR_CFLAGS)
+  AC_SUBST(RDP_COMPOSITOR_LIBS)
 fi
 
 AC_ARG_ENABLE([screen-sharing], [  --enable-screen-sharing],,
diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
index 773b6b5..0649bee 100644
--- a/src/compositor-rdp.c
+++ b/src/compositor-rdp.c
@@ -42,15 +42,24 @@
 #define FREERDP_VERSION_NUMBER ((FREERDP_VERSION_MAJOR * 0x1) + \
(FREERDP_VERSION_MINOR * 0x100) + FREERDP_VERSION_REVISION)
 
+
 #if FREERDP_VERSION_NUMBER >= 0x10201
 #define HAVE_SKIP_COMPRESSION
 #endif
 
 #if FREERDP_VERSION_NUMBER < 0x10202
-#define FREERDP_CB_RET_TYPE void
-#define FREERDP_CB_RETURN(V) return
+#  define FREERDP_CB_RET_TYPE void
+#  define FREERDP_CB_RETURN(V) return
+#  define NSC_RESET(C, W, H)
+#  define RFX_RESET(C, W, H) do { rfx_context_reset(C); C->width = W; 
C->height = H; } while(0)
+#else
+#if FREERDP_VERSION_MAJOR >= 2
+#  define NSC_RESET(C, W, H) nsc_context_reset(C, W, H)
+#  define RFX_RESET(C, W, H) rfx_context_reset(C, W, H)
 #else
-#define HAVE_NSC_RESET
+#  define NSC_RESET(C, W, H) do { nsc_context_reset(C); C->width = W; 
C->height = H; } while(0)
+#  define RFX_RESET(C, W, H) do { rfx_context_reset(C); C->width = W; 
C->height = H; } while(0)
+#endif
 #define FREERDP_CB_RET_TYPE BOOL
 #define FREERDP_CB_RETURN(V) return TRUE
 #endif
@@ -819,6 +828,7 @@ xf_peer_activate(freerdp_peer* client)
struct xkb_context *xkbContext;
struct xkb_rule_names xkbRuleNames;
struct xkb_keymap *keymap;
+   struct weston_output *weston_output;
int i;
pixman_box32_t box;
pixman_region32_t damage;
@@ -867,10 +877,9 @@ xf_peer_activate(freerdp_peer* client)
}
}
 
-   rfx_context_reset(peerCtx->rfx_context);
-#ifdef HAVE_NSC_RESET
-   nsc_context_reset(peerCtx->nsc_context);
-#endif
+   weston_output = >base;
+   RFX_RESET(peerCtx->rfx_context, weston_output->width, 
weston_output->height);
+   NSC_RESET(peerCtx->nsc_context, weston_output->width, 
weston_output->height);
 
if (peersItem->flags & RDP_PEER_ACTIVATED)
return TRUE;
-- 
1.9.1

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


[PATCH 0/5] RDP compositor needs love

2016-04-22 Thread David Fort
This serie address some issues around the RDP compositor. Some are compilation 
fixes
against FreeRDP 2.0 (and now we search for FreeRDP 2.0 too). 
As seat releasing is still not safe, I'm proposing again the patch to _not_ 
release the seat 
in the RDP compositor (and so we can reconnect at the cost of leaking the 
seat). 
And finally there's a fix for output mode switching, and the panel and 
background 
not resizing when it happens. This bug is there since the beginning of the RDP 
compositor (looks
like it's the only one that actually changes output modes).

David Fort (5):
  rdp: allow to compile against FreeRDP 2.0
  rdp: don't release the seat until it is safe
  rdp: fix presentation for the RDP compositor
  rdp: Fix the ContextNew callback with recent FreeRDP versions
  desktop shell: resize background and panel when an output switches
mode

 configure.ac  |  8 +-
 desktop-shell/shell.c | 34 +++
 desktop-shell/shell.h |  1 +
 src/compositor-rdp.c  | 76 ---
 src/compositor.c  | 33 ++
 src/compositor.h  |  1 +
 6 files changed, 119 insertions(+), 34 deletions(-)

-- 
1.9.1

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


[PATCH 4/5] rdp: Fix the ContextNew callback with recent FreeRDP versions

2016-04-22 Thread David Fort
Since a quite long time FreeRDP expect the ContextNew callback to return TRUE
when it succeeds. Without this we have some arbitrary failures (most probably
when eax is 0 at the end of the function).

Signed-off-by: David Fort 
---
 src/compositor-rdp.c | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
index 4cbc1c3..7d2da83 100644
--- a/src/compositor-rdp.c
+++ b/src/compositor-rdp.c
@@ -611,7 +611,7 @@ int rdp_implant_listener(struct rdp_backend *b, 
freerdp_listener* instance)
 }
 
 
-static void
+static FREERDP_CB_RET_TYPE
 rdp_peer_context_new(freerdp_peer* client, RdpPeerContext* context)
 {
context->item.peer = client;
@@ -622,15 +622,32 @@ rdp_peer_context_new(freerdp_peer* client, 
RdpPeerContext* context)
 #else
context->rfx_context = rfx_context_new(TRUE);
 #endif
+   if (!context->rfx_context) {
+   FREERDP_CB_RETURN(FALSE);
+   }
+
context->rfx_context->mode = RLGR3;
context->rfx_context->width = client->settings->DesktopWidth;
context->rfx_context->height = client->settings->DesktopHeight;
rfx_context_set_pixel_format(context->rfx_context, 
RDP_PIXEL_FORMAT_B8G8R8A8);
 
context->nsc_context = nsc_context_new();
+   if (!context->nsc_context)
+   goto out_error_nsc;
+
nsc_context_set_pixel_format(context->nsc_context, 
RDP_PIXEL_FORMAT_B8G8R8A8);
 
context->encode_stream = Stream_New(NULL, 65536);
+   if (!context->encode_stream)
+   goto out_error_stream;
+
+   FREERDP_CB_RETURN(TRUE);
+
+out_error_nsc:
+   rfx_context_free(context->rfx_context);
+out_error_stream:
+   nsc_context_free(context->nsc_context);
+   FREERDP_CB_RETURN(FALSE);
 }
 
 static void
-- 
1.9.1

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


[PATCH weston] build: actually use CLOCK_GETTIME_LIBS for zuctest

2016-04-22 Thread Gustavo Zacarias
The fix/check in 34d59859 is incomplete.

Signed-off-by: Gustavo Zacarias 
---
 Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index c042c68..ae34c02 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1333,7 +1333,8 @@ noinst_PROGRAMS += zuctest$(EXEEXT)
 
 zuctest_LDADD =\
libzunitc.la\
-   libzunitcmain.la
+   libzunitcmain.la\
+   $(CLOCK_GETTIME_LIBS)
 
 zuctest_CFLAGS =   \
$(AM_CFLAGS)\
-- 
2.7.3

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


Re: [PATCH weston] build: Add (and use) an AC_SEARCH_LIBS wrapper

2016-04-22 Thread Gustavo Zacarias

On 22/04/16 07:14, Quentin Glidic wrote:


From: Quentin Glidic 

Signed-off-by: Quentin Glidic 


Tested-by: Gustavo Zacarias 

My previous patch was incomplete, it did the check and replaces 
instances of -lrt but didn't actually use it for zuctest, hence 
ultimately it didn't fix the problem, i'm sending a follow up.


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


Re: [PATCH weston] man: Clarify weston.ini scale option

2016-04-22 Thread Yong Bakos
On Apr 22, 2016, at 2:52 AM, Pekka Paalanen  wrote:
> 
> On Thu, 21 Apr 2016 13:49:18 -0700
> Bryce Harrington  wrote:
> 
>> On Thu, Apr 21, 2016 at 02:21:38PM -0500, Yong Bakos wrote:
>>> On Apr 21, 2016, at 2:15 PM, Bryce Harrington  wrote:
 
 On Thu, Apr 21, 2016 at 12:49:29PM -0500, Yong Bakos wrote:
> From: Yong Bakos 
> 
> Add explanations of scaling that are a bit more approachable for users.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=94824
> 
> Signed-off-by: Yong Bakos 
 
 Looks good,
 
 Reviewed-by: Bryce Harrington 
 
 Btw in changelogs when referring to bug tickets, a standard syntax is:
 
 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=94824
 
 if the patch is intended to close the bug report as fixed, as in this
 case.
>>> 
>>> Thanks - yeah, I /just/ noticed this after sending the patch while
>>> reviewing other bugzilla-related stuff. It's no problem if you'd like
>>> me to send a v2 with this change.
>> 
>> Nah, this is fine.  I just mention it for future reference since I know
>> you like to know about the conventions for doing stuff.
>> 
>> I think this patch is probably ready to land but holding off a bit in
>> case others have input to give.
>> 
>> Bryce
>>> yong
>>> 
>>> 
>>> 
 (Some bug trackers have watches on the vcs to notice this syntax and
 automatically close the bugs with a link to the commit.  I don't think
 we have bugzilla configured for doing this, but it's a good practice to
 follow nonetheless.)
 
 Bryce
 
> ---
> man/weston.ini.man | 17 +++--
> 1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/man/weston.ini.man b/man/weston.ini.man
> index 8cdc837..6fbeaf0 100644
> --- a/man/weston.ini.man
> +++ b/man/weston.ini.man
> @@ -389,15 +389,20 @@ be one of the following 8 strings:
> .RE
> .TP 7
> .BI "scale=" factor
> -An integer, 1 by default, typically configured as 2 when needed, denoting
> -the scale factor of the output. Applications that support it render at 
> the
> -appropriate scale. For other applications, weston will scale their output
> -by this factor.
> +The scaling multiplier applied to the entire output, in support of high
> +resolution ("HiDPI" or "retina") displays. Applications that do not 
> support high
> +resolution displays typically appear tiny and unreadable. Weston will 
> scale the
> +output of such applications by this multiplier, to make them readable.
> +Applications that do support their own output scaling can draw their 
> content in
> +high resolution, in which case they avoid compositor scaling. Weston 
> will not
> +scale the output of such applications, and they are not affected by this
> +multiplier.
> .RE
> .RS
> .PP
> -Use a value of 2 for outputs with high resolution. Such displays are 
> often
> -called "HiDPI" or "retina" displays.
> +An integer, 1 by default, typically configured as 2 or higher when 
> needed,
> +denoting the scale factor of the output. This scale factor corresponds 
> with
> +the pixel density of the display.
> 
> Hi,
> 
> I might say "This scale factor roughly corresponds", but either way:

Agreed, I'll fix in a v2. Perhaps 'roughly correlates with' is even better, 
since
'corresponds' infers a matching/similarity, and pixel density is often measured
as PPI rather than a density factor (scale != ppi).

Thanks for reviewing,
yong


> Reviewed-by: Pekka Paalanen 
> 
> 
> Thanks,
> pq


signature.asc
Description: Message signed with OpenPGP using GPGMail
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH v2 wayland-protocols] Add pad support to the tablet protocol

2016-04-22 Thread Carlos Garnacho
Hi!,

On Fri, Apr 22, 2016 at 4:02 AM, Peter Hutterer
 wrote:
> On Thu, Apr 21, 2016 at 05:46:24PM -0700, Jason Gerecke wrote:
>> On Mon, Apr 18, 2016 at 10:00 PM, Peter Hutterer
>>  wrote:
>> > From: Carlos Garnacho 
>> >
>> > The pad's interface is similar to the tool interface, a client is notified 
>> > of
>> > the pad after the tablet_added event.
>> >
>> > The pad has three functionalities: buttons, rings and strips.
>> > Buttons are fairly straightforward, rings and strips are separate 
>> > interfaces
>> > with a pointer-axis-like source/value/frame events.
>> > The two interfaces are effectively identical but for the actual value they
>> > send (degrees vs normalized position).
>> >
>> > Specific to the pad device is the set_feedback request which enables a 
>> > client
>> > to set a user-defined string to display for an OSD on the current mappings.
>> > This request is available for buttons, rings and strips.
>> >
>> > Finally, the pad supports "modes", effectively sets of button/ring/strip
>> > configurations.
>> >
>> > Signed-off-by: Carlos Garnacho 
>> > Signed-off-by: Peter Hutterer 
>> > ---
>> > Changes to v1:
>> > - typos fixed
>> >
>> >  unstable/tablet/tablet-unstable-v1.xml | 423 
>> > -
>> >  1 file changed, 421 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/unstable/tablet/tablet-unstable-v1.xml 
>> > b/unstable/tablet/tablet-unstable-v1.xml
>> > index 907126c..36b9ae8 100644
>> > --- a/unstable/tablet/tablet-unstable-v1.xml
>> > +++ b/unstable/tablet/tablet-unstable-v1.xml
>> > @@ -115,7 +115,7 @@
>> >  interface version number is reset.
>> >
>> >
>> > -  
>> > +  
>> >  
>> >An object that provides access to the graphics tablets available on 
>> > this
>> >system. All tablets are associated with a seat, to get access to the
>> > @@ -139,7 +139,7 @@
>> >  
>> >
>> >
>> > -  
>> > +  
>> >  
>> >An object that provides access to the graphics tablets available on 
>> > this
>> >seat. After binding to this interface, the compositor sends a set of
>> > @@ -172,6 +172,23 @@
>> >
>> >> > summary="the newly added tablet tool"/>
>> >  
>> > +
>> > +
>> > +
>> > +
>> > +  
>> > +   This event is sent whenever a new pad is known to the system. 
>> > Typically,
>> > +   pads are physically attached to tablets and a pad_added event is
>> > +   sent immediately after the wp_tablet_seat.tablet_added.
>> > +   However, some standalone pad devices logically attach to tablets at
>> > +   runtime, the client must wait for wp_tablet_pad.enter to know the
>> > +   tablet a pad is attached to.
>> > +
>>
>> If a compositor wanted to support "bare" pad devices, I'm assuming
>> they'd have to fake one or more wp_tablet objects for that use,
>> correct?
>
> yeah, I think so. but there is the question of what a standalone pad (I
> assume you're talking about the EKR) would do in a wacom/tablet context?
> and whether the EKR would just be better off as a buttonset device when it's
> not connected to a tablet.
>
>> > +
>> > +  
>> > +   Source information for ring events.
>> > +
>> > +   This event does not occur on its own. It is sent before a
>> > +   wp_tablet_pad_ring.frame event and carries the source information
>> > +   for all events within that frame.
>> > +
>> > +   The source specifies how this event was generated. If the source is
>> > +   wp_tablet_pad_ring.source.finger, a wp_tablet_pad_ring.stop event
>> > +   will be sent when the user lifts the finger off the device.
>> > +
>> > +   This event is optional. If the source is unknown for an 
>> > interaction,
>> > +   no event is sent.
>> > +  
>> > +  
>> > +
>> > +
>> > +
>> > +  
>> > +   Sent whenever the angle on a ring changes.
>> > +
>> > +   The angle is provided in 0.01 of a degree clockwise from the 
>> > logical
>> > +   north of the ring in the pad's current rotation.
>> > +  
>> > +  
>>
>> I assume this will be updated to use the "fixed" type (along with pen
>> tilt and rotation) in a subsequent patch?
>
> yes, I want to merge the change to doubles as v2 since it's an ABI break,
> but it's such low impact that merging this as v1 is better, IMO
>
>> > +
>> > +  
>> > +   Indicates the end of a set of events that logically belong 
>> > together.
>> > +   A client is expected to accumulate the data in all events within 
>> > the
>> > +   frame before proceeding.
>> > +
>> > +   All wp_tablet_pad_ring events before a wp_tablet_pad_ring.frame 
>> > event belong
>> > +   logically together. For example, on termination of a finger 
>> > interaction
>> > +   on a ring the compositor will send wp_tablet_pad_ring.source event,
>> > +   a wp_tablet_pad_ring.stop 

[PATCH weston] build: Add (and use) an AC_SEARCH_LIBS wrapper

2016-04-22 Thread Quentin Glidic
From: Quentin Glidic 

Signed-off-by: Quentin Glidic 
---

Not too much Autotools- or m4-foo needed here.

Please note the behaviour difference from AC_CHECK_LIB/AC_SEARCH_LIBS:
we call action-if-found if the function is available directly, just
in case some crazy libc has jpeg support. :-)

CCed Gustavo Zacarias so he can test it still works as expected for him.

 configure.ac | 18 +-
 m4/weston.m4 | 37 +
 2 files changed, 42 insertions(+), 13 deletions(-)
 create mode 100644 m4/weston.m4

diff --git a/configure.ac b/configure.ac
index 670200c..4199616 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,14 +42,10 @@ AC_ARG_VAR([WESTON_SHELL_CLIENT],
 
 PKG_PROG_PKG_CONFIG()
 
-AC_CHECK_FUNC([dlopen], [],
-  AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
-AC_SUBST(DLOPEN_LIBS)
+WESTON_SEARCH_LIBS([DLOPEN], [dl], [dlopen])
 
 # In old glibc versions (< 2.17) clock_gettime() is in librt
-AC_SEARCH_LIBS([clock_gettime], [rt],
- [CLOCK_GETTIME_LIBS="-lrt"])
-AC_SUBST([CLOCK_GETTIME_LIBS])
+WESTON_SEARCH_LIBS([CLOCK_GETTIME], [rt], [clock_gettime])
 
 AC_CHECK_DECL(SFD_CLOEXEC,[],
  [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
@@ -303,12 +299,10 @@ AC_ARG_WITH([jpeg],
 AS_HELP_STRING([--without-jpeg],
[Use jpeglib for JPEG decoding support 
[default=auto]]))
 AS_IF([test "x$with_jpeg" != "xno"],
-  [AC_CHECK_LIB([jpeg], [jpeg_CreateDecompress], [have_jpeglib=yes], 
[have_jpeglib=no])],
+  [WESTON_SEARCH_LIBS([JPEG], [jpeg], [jpeg_CreateDecompress], 
[have_jpeglib=yes], [have_jpeglib=no])],
   [have_jpeglib=no])
 AS_IF([test "x$have_jpeglib" = "xyes"],
-  [JPEG_LIBS="-ljpeg"
-   AC_SUBST([JPEG_LIBS])
-   AC_DEFINE([HAVE_JPEG], [1], [Have jpeglib])],
+  [AC_DEFINE([HAVE_JPEG], [1], [Have jpeglib])],
   [AS_IF([test "x$with_jpeg" = "xyes"],
  [AC_MSG_ERROR([JPEG support explicitly requested, but jpeglib 
couldn't be found])])])
 
@@ -418,12 +412,10 @@ AS_IF([test "x$enable_resize_optimization" = "xyes"],
 AC_ARG_ENABLE(weston-launch, [  --enable-weston-launch],, 
enable_weston_launch=yes)
 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
 if test x$enable_weston_launch == xyes; then
-  AC_CHECK_LIB([pam], [pam_open_session], [have_pam=yes], [have_pam=no])
+  WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], 
[have_pam=no])
   if test x$have_pam == xno; then
 AC_ERROR([weston-launch requires pam])
   fi
-  PAM_LIBS=-lpam
-  AC_SUBST(PAM_LIBS)
 fi
 
 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
diff --git a/m4/weston.m4 b/m4/weston.m4
new file mode 100644
index 000..636f9fb
--- /dev/null
+++ b/m4/weston.m4
@@ -0,0 +1,37 @@
+dnl
+dnl Copyright © 2016 Quentin “Sardem FF7” Glidic
+dnl
+dnl Permission is hereby granted, free of charge, to any person obtaining a
+dnl copy of this software and associated documentation files (the "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
+dnl
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
+dnl
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
+dnl
+
+dnl WESTON_SEARCH_LIBS(PREFIX, search-libs, function, [action-if-found], 
[action-if-not-found], [other-libraries])
+dnl WESTON_SEARCH_LIBS is a wrapper around AC_SEARCH_LIBS with a little 
difference:
+dnl action-if-found is called even if no library is required
+AC_DEFUN([WESTON_SEARCH_LIBS], [
+   weston_save_LIBS=${LIBS}
+   AC_SEARCH_LIBS([$3], [$2], [$4], [$5], [$6])
+   AS_CASE([${ac_cv_search_][$3][}],
+   ['none required'], [$4],
+   [no], [],
+   [$1][_LIBS=${ac_cv_search_][$3][}]
+   )
+   AC_SUBST([$1][_LIBS])
+   LIBS=${weston_save_LIBS}
+])
-- 
2.8.1

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


Re: [PATCH weston] build: add check for clock_gettime() in librt

2016-04-22 Thread Pekka Paalanen
On Thu, 21 Apr 2016 12:08:55 -0700
Bryce Harrington  wrote:

> On Thu, Apr 21, 2016 at 11:18:48AM -0300, Gustavo Zacarias wrote:
> > zuctest is another clock_gettime() user that fails to link against librt 
> > when
> > necessary.
> > 
> > Instead of adding another -lrt LDADD entry i've opted for the saner way and
> > converted the check to a configure test that will set CLOCK_GETTIME_LIBS
> > appropiately and replaced all instances of -lrt with it.
> > Built-tested against old and new glibc.
> > 
> > Signed-off-by: Gustavo Zacarias   
> 
> Reviewed-by: Bryce Harrington 
> > ---
> >  Makefile.am  | 15 ---
> >  configure.ac |  5 +
> >  2 files changed, 13 insertions(+), 7 deletions(-)

> > diff --git a/configure.ac b/configure.ac
> > index 447cf6b..670200c 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -46,6 +46,11 @@ AC_CHECK_FUNC([dlopen], [],
> >AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
> >  AC_SUBST(DLOPEN_LIBS)
> >  
> > +# In old glibc versions (< 2.17) clock_gettime() is in librt
> > +AC_SEARCH_LIBS([clock_gettime], [rt],
> > + [CLOCK_GETTIME_LIBS="-lrt"])
> > +AC_SUBST([CLOCK_GETTIME_LIBS])
> > +
> >  AC_CHECK_DECL(SFD_CLOEXEC,[],
> >   [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
> >   [[#include ]])

Pushed with my R-b:
   fd01ba0..34d5985  master -> master

However, I had a chat with Quentin in IRC, and this use of
AC_SEARCH_LIBS clobbers LIBS which we don't intend to use, yet AC
macros do use it.

We will be following up with patches to fix that and clean up some of
the existing LIBS issues.


Thanks,
pq


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


Re: [PATCH weston] man: Clarify weston.ini scale option

2016-04-22 Thread Pekka Paalanen
On Thu, 21 Apr 2016 13:49:18 -0700
Bryce Harrington  wrote:

> On Thu, Apr 21, 2016 at 02:21:38PM -0500, Yong Bakos wrote:
> > On Apr 21, 2016, at 2:15 PM, Bryce Harrington  
> > wrote:  
> > > 
> > > On Thu, Apr 21, 2016 at 12:49:29PM -0500, Yong Bakos wrote:  
> > >> From: Yong Bakos 
> > >> 
> > >> Add explanations of scaling that are a bit more approachable for users.
> > >> 
> > >> https://bugs.freedesktop.org/show_bug.cgi?id=94824
> > >> 
> > >> Signed-off-by: Yong Bakos   
> > > 
> > > Looks good,
> > > 
> > > Reviewed-by: Bryce Harrington 
> > > 
> > > Btw in changelogs when referring to bug tickets, a standard syntax is:
> > > 
> > >  Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=94824
> > > 
> > > if the patch is intended to close the bug report as fixed, as in this
> > > case.  
> > 
> > Thanks - yeah, I /just/ noticed this after sending the patch while
> > reviewing other bugzilla-related stuff. It's no problem if you'd like
> > me to send a v2 with this change.  
> 
> Nah, this is fine.  I just mention it for future reference since I know
> you like to know about the conventions for doing stuff.
> 
> I think this patch is probably ready to land but holding off a bit in
> case others have input to give.
> 
> Bryce
> > yong
> > 
> > 
> >   
> > > (Some bug trackers have watches on the vcs to notice this syntax and
> > > automatically close the bugs with a link to the commit.  I don't think
> > > we have bugzilla configured for doing this, but it's a good practice to
> > > follow nonetheless.)
> > > 
> > > Bryce
> > >   
> > >> ---
> > >> man/weston.ini.man | 17 +++--
> > >> 1 file changed, 11 insertions(+), 6 deletions(-)
> > >> 
> > >> diff --git a/man/weston.ini.man b/man/weston.ini.man
> > >> index 8cdc837..6fbeaf0 100644
> > >> --- a/man/weston.ini.man
> > >> +++ b/man/weston.ini.man
> > >> @@ -389,15 +389,20 @@ be one of the following 8 strings:
> > >> .RE
> > >> .TP 7
> > >> .BI "scale=" factor
> > >> -An integer, 1 by default, typically configured as 2 when needed, 
> > >> denoting
> > >> -the scale factor of the output. Applications that support it render at 
> > >> the
> > >> -appropriate scale. For other applications, weston will scale their 
> > >> output
> > >> -by this factor.
> > >> +The scaling multiplier applied to the entire output, in support of high
> > >> +resolution ("HiDPI" or "retina") displays. Applications that do not 
> > >> support high
> > >> +resolution displays typically appear tiny and unreadable. Weston will 
> > >> scale the
> > >> +output of such applications by this multiplier, to make them readable.
> > >> +Applications that do support their own output scaling can draw their 
> > >> content in
> > >> +high resolution, in which case they avoid compositor scaling. Weston 
> > >> will not
> > >> +scale the output of such applications, and they are not affected by this
> > >> +multiplier.
> > >> .RE
> > >> .RS
> > >> .PP
> > >> -Use a value of 2 for outputs with high resolution. Such displays are 
> > >> often
> > >> -called "HiDPI" or "retina" displays.
> > >> +An integer, 1 by default, typically configured as 2 or higher when 
> > >> needed,
> > >> +denoting the scale factor of the output. This scale factor corresponds 
> > >> with
> > >> +the pixel density of the display.

Hi,

I might say "This scale factor roughly corresponds", but either way:
Reviewed-by: Pekka Paalanen 


Thanks,
pq


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


Re: [PATCH weston] tests: check for NULL surface in keyboard and pointer handlers

2016-04-22 Thread Pekka Paalanen
On Thu, 21 Apr 2016 12:06:49 -0700
Bryce Harrington  wrote:

> On Thu, Apr 21, 2016 at 05:12:47PM +0300, Pekka Paalanen wrote:
> > From: Pekka Paalanen 
> > 
> > When a test destroys a wl_surface, it is still possible to get events
> > referring to the destroyed surface. The surface in such cases will be
> > NULL.
> > 
> > Handle NULL surface gracefully in keyboard and pointer enter/leave
> > handlers. Touch-down handler is already NULL-safe.
> > 
> > This fixes a SEGV in a test I am writing for wp_viewport.
> > 
> > Signed-off-by: Pekka Paalanen   
> 
> LGTM,
> Reviewed-by: Bryce Harrington 

Pushed:
   ed6014a..fd01ba0  master -> master


Thanks,
pq


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