Re: Comment on global shortcuts security
On Tue, 25 Sep 2012 18:07:51 +0200 Piotr Rak piotr@gmail.com wrote: Hi, 2012/9/25 Pekka Paalanen ppaala...@gmail.com: Hi Piotr, it sounds like you make a fundamental assumption on something, that makes global shortcuts insecure, and so you set out to solve these problems. What is it that you assume? What is the root of the problems? What are the problems you are trying to solve? I should have state this more clearly, but the problem is - how to do global shortcuts in application in secure way. The issue was raised during XDC. Video of talk can be watched online http://www.youtube.com/watch?v=hJpiJii44oofeature=relmfu - discussion about wayland input handling starts around 23:30s. Those are my thoughts/comments after watching it, on one questions that was left open there. Sorry, but I just couldn't understand anything you wrote. Hope that explaination is sufficient. Ok, thank you for the pointer. :-) I'll listen that through when I find a suitable time. My first thought would of course be to define protocol extensions on case-by-case basis: mixer controls, playback controls, etc, and allow only one client to subscribe to an interface at a time, per seat. Anything outside of those would be server configuration for misc hotkeys. But I guess these were already raised in the talks, so I really better listen to those first. Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: Comment on global shortcuts security
El dt 25 de 09 de 2012 a les 11:15 -0400, en/na Kristian Høgsberg va escriure: On Mon, Sep 24, 2012 at 04:53:20PM -0700, Bill Spitzak wrote: Keystrokes should be sent to the application first. Only if the application refuses them should they be considered global shortcuts. No. Could you elaborate a little bit the logic leading to this decission, please? Daniel. ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston] Require mouse release on top of frame button to trigger action
As common UI convention, allows action to be avoided by dragging outside the button after mouse press. --- clients/window.c | 32 1 file changed, 32 insertions(+) diff --git a/clients/window.c b/clients/window.c index c5bccdc..f3b61de 100644 --- a/clients/window.c +++ b/clients/window.c @@ -1498,6 +1498,7 @@ frame_button_button_handler(struct widget *widget, { struct frame_button *frame_button = data; struct window *window = widget-window; + int was_pressed = (frame_button-state == FRAME_BUTTON_ACTIVE); if (button != BTN_LEFT) return; @@ -1516,6 +1517,9 @@ frame_button_button_handler(struct widget *widget, break; } + if (!was_pressed) + return; + switch (frame_button-type) { case FRAME_BUTTON_CLOSE: if (window-close_handler) @@ -1536,6 +1540,33 @@ frame_button_button_handler(struct widget *widget, } } +static int +frame_button_motion_handler(struct widget *widget, +struct input *input, uint32_t time, +float x, float y, void *data) +{ + struct frame_button *frame_button = data; + enum frame_button_pointer previous_button_state = frame_button-state; + + /* only track state for a pressed button */ + if (input-grab != widget) + return CURSOR_LEFT_PTR; + + if (x widget-allocation.x + x (widget-allocation.x + widget-allocation.width) + y widget-allocation.y + y (widget-allocation.y + widget-allocation.height)) { + frame_button-state = FRAME_BUTTON_ACTIVE; + } else { + frame_button-state = FRAME_BUTTON_DEFAULT; + } + + if (frame_button-state != previous_button_state) + widget_schedule_redraw(frame_button-widget); + + return CURSOR_LEFT_PTR; +} + static void frame_button_redraw_handler(struct widget *widget, void *data) { @@ -1612,6 +1643,7 @@ frame_button_create(struct frame *frame, void *data, enum frame_button_action ty widget_set_enter_handler(frame_button-widget, frame_button_enter_handler); widget_set_leave_handler(frame_button-widget, frame_button_leave_handler); widget_set_button_handler(frame_button-widget, frame_button_button_handler); + widget_set_motion_handler(frame_button-widget, frame_button_motion_handler); return frame_button-widget; } -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH v3] shell: Fix crash when an input panel is hiding
From: Jan Arne Petersen jpeter...@openismus.com Set the geometry.dirty on the input panel surface before calling weston_surface_update_transform, so that the surface gets an output assigned. --- src/shell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shell.c b/src/shell.c index 2afa1b3..e2715d6 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2763,6 +2763,7 @@ show_input_panels(struct wl_listener *listener, void *data) ws = surface-surface; wl_list_insert(shell-input_panel_layer.surface_list, ws-layer_link); + ws-geometry.dirty = 1; weston_surface_update_transform(ws); weston_surface_damage(ws); weston_slide_run(ws, ws-geometry.height, 0, NULL, NULL); -- 1.7.11.4 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH wayland] man: fix compilation without xsltproc
We really shouldn't add the man-pages when HAVE_XSLTPROC is not true so move it into the if-clause. But declare the automake-variables outside of the if-clause to avoid automake complaints. Signed-off-by: David Herrmann dh.herrm...@googlemail.com --- doc/man/Makefile.am | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 7d00b06..a6a5072 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -9,16 +9,18 @@ MANPAGES = \ MANPAGES_ALIASES = \ wl_display_connect_to_fd.3 -wl_display_connect_to_fd.3: wl_display_connect.3 - XML_FILES = \ ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,$(MANPAGES) -CLEANFILES = $(MANPAGES) $(MANPAGES_ALIASES) -EXTRA_DIST = $(MANPAGES) $(MANPAGES_ALIASES) $(XML_FILES) -man_MANS = $(MANPAGES) $(MANPAGES_ALIASES) +CLEANFILES = +EXTRA_DIST = +man_MANS = if HAVE_XSLTPROC +CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES) +EXTRA_DIST += $(MANPAGES) $(MANPAGES_ALIASES) $(XML_FILES) +man_MANS += $(MANPAGES) $(MANPAGES_ALIASES) + XSLTPROC_FLAGS = \ --stringparam man.authors.section.enabled 0 \ --stringparam man.copyright.section.enabled 0 \ @@ -42,4 +44,6 @@ XSLTPROC_PROCESS_MAN = \ %.7: %.xml $(XSLTPROC_PROCESS_MAN) +wl_display_connect_to_fd.3: wl_display_connect.3 + endif # HAVE_XSLTPROC -- 1.7.12.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH web] Remove obsolete build flag for drm
--enable-nouveau-experimental-api been long gone. --- building.html |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/building.html b/building.html index b5884a7..e8e1e39 100644 --- a/building.html +++ b/building.html @@ -78,7 +78,7 @@ dependencies are development packages of xcb-dri2 and xcb-xfixes./p pre$ git clone git://anongit.freedesktop.org/git/mesa/drm $ cd drm -$ ./autogen.sh --prefix=$WLD --enable-nouveau-experimental-api +$ ./autogen.sh --prefix=$WLD $ make amp;amp; make install $ git clone git://anongit.freedesktop.org/mesa/mesa -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston] Require mouse release on top of frame button to trigger action
On Wed, Sep 26, 2012 at 03:05:45PM +0300, Pekka Vuorela wrote: As common UI convention, allows action to be avoided by dragging outside the button after mouse press. That works better, thanks. Kristian --- clients/window.c | 32 1 file changed, 32 insertions(+) diff --git a/clients/window.c b/clients/window.c index c5bccdc..f3b61de 100644 --- a/clients/window.c +++ b/clients/window.c @@ -1498,6 +1498,7 @@ frame_button_button_handler(struct widget *widget, { struct frame_button *frame_button = data; struct window *window = widget-window; + int was_pressed = (frame_button-state == FRAME_BUTTON_ACTIVE); if (button != BTN_LEFT) return; @@ -1516,6 +1517,9 @@ frame_button_button_handler(struct widget *widget, break; } + if (!was_pressed) + return; + switch (frame_button-type) { case FRAME_BUTTON_CLOSE: if (window-close_handler) @@ -1536,6 +1540,33 @@ frame_button_button_handler(struct widget *widget, } } +static int +frame_button_motion_handler(struct widget *widget, +struct input *input, uint32_t time, +float x, float y, void *data) +{ + struct frame_button *frame_button = data; + enum frame_button_pointer previous_button_state = frame_button-state; + + /* only track state for a pressed button */ + if (input-grab != widget) + return CURSOR_LEFT_PTR; + + if (x widget-allocation.x + x (widget-allocation.x + widget-allocation.width) + y widget-allocation.y + y (widget-allocation.y + widget-allocation.height)) { + frame_button-state = FRAME_BUTTON_ACTIVE; + } else { + frame_button-state = FRAME_BUTTON_DEFAULT; + } + + if (frame_button-state != previous_button_state) + widget_schedule_redraw(frame_button-widget); + + return CURSOR_LEFT_PTR; +} + static void frame_button_redraw_handler(struct widget *widget, void *data) { @@ -1612,6 +1643,7 @@ frame_button_create(struct frame *frame, void *data, enum frame_button_action ty widget_set_enter_handler(frame_button-widget, frame_button_enter_handler); widget_set_leave_handler(frame_button-widget, frame_button_leave_handler); widget_set_button_handler(frame_button-widget, frame_button_button_handler); + widget_set_motion_handler(frame_button-widget, frame_button_motion_handler); return frame_button-widget; } -- 1.7.9.5 ___ 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 v3] shell: Fix crash when an input panel is hiding
On Wed, Sep 26, 2012 at 02:39:45PM +0200, Jan Arne Petersen wrote: From: Jan Arne Petersen jpeter...@openismus.com Set the geometry.dirty on the input panel surface before calling weston_surface_update_transform, so that the surface gets an output assigned. Ah, that looks like the right fix. I think we should set geometry.dirty in weston_surface_unmap() though. Kristian --- src/shell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shell.c b/src/shell.c index 2afa1b3..e2715d6 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2763,6 +2763,7 @@ show_input_panels(struct wl_listener *listener, void *data) ws = surface-surface; wl_list_insert(shell-input_panel_layer.surface_list, ws-layer_link); + ws-geometry.dirty = 1; weston_surface_update_transform(ws); weston_surface_damage(ws); weston_slide_run(ws, ws-geometry.height, 0, NULL, NULL); -- 1.7.11.4 ___ 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 weston] compositor: Load shell plugin after option modules
On Wed, Sep 26, 2012 at 04:24:56PM +0300, Tiago Vignatti wrote: On 09/25/2012 06:19 PM, Kristian Høgsberg wrote: On Tue, Sep 25, 2012 at 05:54:40PM +0300, Tiago Vignatti wrote: BTW (a bit related with this) to solve part of the Bug 53679, the way we're using socketpair_cloexec to create the client socket and later get its credentials in wl_client_create is wrong; clients end up with the same pid, uid, etc as the compositor instead. Specifically xwayland and weston-desktop-shell are getting the wrong values. Oh, because we're still holding both ends when we create the client? Hehe, that's wonderful, nice find :) Hmm... do the credentials change after fork or after we close the socket in the parent... I'm not sure how things are supposed to work in that case, should be interesting to find out. we discussed this on IRC and it doesn't seem related with who's holding any end. returned credentials are those that were in effect at the time of the call to connect(2) or socketpair(2), that's what man 7 socket says about the SO_PEERCRED option. So I assume we cannot use it after fork, the way we're doing. Man page says also this options is specific to use with sockets created via socketpair, which is funny cause for us it's working with accept(). But I guess this is okay. No, it says: This is only possible for connected AF_UNIX stream sockets and AF_UNIX stream and datagram socket pairs created using socketpair(2); Maybe we should special-case the forking clients and get the return value from the fork() call, i.e the pid now? Yeah, I think that's the way to go... I'm just wondering if we should add a wl_client_set_credentials() or just work around it in weston... Kristian ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] man: fix compilation without xsltproc
On Wed, Sep 26, 2012 at 04:41:50PM +0200, David Herrmann wrote: We really shouldn't add the man-pages when HAVE_XSLTPROC is not true so move it into the if-clause. But declare the automake-variables outside of the if-clause to avoid automake complaints. Thanks, committed. Kristian Signed-off-by: David Herrmann dh.herrm...@googlemail.com --- doc/man/Makefile.am | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 7d00b06..a6a5072 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -9,16 +9,18 @@ MANPAGES = \ MANPAGES_ALIASES = \ wl_display_connect_to_fd.3 -wl_display_connect_to_fd.3: wl_display_connect.3 - XML_FILES = \ ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,$(MANPAGES) -CLEANFILES = $(MANPAGES) $(MANPAGES_ALIASES) -EXTRA_DIST = $(MANPAGES) $(MANPAGES_ALIASES) $(XML_FILES) -man_MANS = $(MANPAGES) $(MANPAGES_ALIASES) +CLEANFILES = +EXTRA_DIST = +man_MANS = if HAVE_XSLTPROC +CLEANFILES += $(MANPAGES) $(MANPAGES_ALIASES) +EXTRA_DIST += $(MANPAGES) $(MANPAGES_ALIASES) $(XML_FILES) +man_MANS += $(MANPAGES) $(MANPAGES_ALIASES) + XSLTPROC_FLAGS = \ --stringparam man.authors.section.enabled 0 \ --stringparam man.copyright.section.enabled 0 \ @@ -42,4 +44,6 @@ XSLTPROC_PROCESS_MAN = \ %.7: %.xml $(XSLTPROC_PROCESS_MAN) +wl_display_connect_to_fd.3: wl_display_connect.3 + endif # HAVE_XSLTPROC -- 1.7.12.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH web] Remove obsolete build flag for drm
On Wed, Sep 26, 2012 at 06:19:13PM +0300, Pekka Vuorela wrote: --enable-nouveau-experimental-api been long gone. Oops, true. Thanks. Kristian --- building.html |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/building.html b/building.html index b5884a7..e8e1e39 100644 --- a/building.html +++ b/building.html @@ -78,7 +78,7 @@ dependencies are development packages of xcb-dri2 and xcb-xfixes./p pre$ git clone git://anongit.freedesktop.org/git/mesa/drm $ cd drm -$ ./autogen.sh --prefix=$WLD --enable-nouveau-experimental-api +$ ./autogen.sh --prefix=$WLD $ make amp;amp; make install $ git clone git://anongit.freedesktop.org/mesa/mesa -- 1.7.9.5 ___ 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] tests: add button test
From: U. Artie Eoff ullysses.a.e...@intel.com Signed-off-by: U. Artie Eoff ullysses.a.e...@intel.com --- tests/Makefile.am | 4 +- tests/button-test.c | 136 tests/test-client.c | 18 ++- 3 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 tests/button-test.c diff --git a/tests/Makefile.am b/tests/Makefile.am index 60c73a1..fcf6674 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,7 @@ TESTS = surface-test.la client-test.la \ event-test.la text-test.la \ - surface-global-test.la + surface-global-test.la \ + button-test.la TESTS_ENVIRONMENT = $(SHELL) $(top_srcdir)/tests/weston-test @@ -22,6 +23,7 @@ surface_test_la_SOURCES = surface-test.c $(test_runner_src) client_test_la_SOURCES = client-test.c $(test_runner_src) event_test_la_SOURCES = event-test.c $(test_runner_src) text_test_la_SOURCES = text-test.c $(test_runner_src) +button_test_la_SOURCES = button-test.c $(test_runner_src) test_client_SOURCES = test-client.c test_client_LDADD = $(SIMPLE_CLIENT_LIBS) diff --git a/tests/button-test.c b/tests/button-test.c new file mode 100644 index 000..437291a --- /dev/null +++ b/tests/button-test.c @@ -0,0 +1,136 @@ +/* + * Copyright © 2012 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 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. + */ + +#include stdlib.h +#include stdio.h +#include sys/socket.h +#include assert.h +#include unistd.h +#include string.h +#include linux/input.h + +#include test-runner.h + +struct context { + struct weston_layer *layer; + struct weston_seat *seat; + struct weston_surface *surface; +}; + +static void +handle_button_up(struct test_client *); + +static void +handle_button_down(struct test_client *client) +{ + struct context *context = client-data; + uint32_t mask; + + assert(sscanf(client-buf, %u, mask) == 1); + + assert(mask == 1); + + notify_button(context-seat, 100, BTN_LEFT, + WL_POINTER_BUTTON_STATE_RELEASED); + + test_client_send(client, send-button-state\n); + client-handle = handle_button_up; +} + +static void +handle_button_up(struct test_client *client) +{ + struct context *context = client-data; + static int once = 0; + uint32_t mask; + + assert(sscanf(client-buf, %u, mask) == 1); + + assert(mask == 0); + + if (!once++) { + notify_button(context-seat, 100, BTN_LEFT, + WL_POINTER_BUTTON_STATE_PRESSED); + + test_client_send(client, send-button-state\n); + client-handle = handle_button_down; + } else { + test_client_send(client, bye\n); + client-handle = NULL; + } +} + +static void +handle_surface(struct test_client *client) +{ + uint32_t id; + struct context *context = client-data; + struct wl_resource *resource; + struct wl_list *seat_list; + + assert(sscanf(client-buf, surface %u, id) == 1); + fprintf(stderr, server: got surface id %u\n, id); + resource = wl_client_get_object(client-client, id); + assert(resource); + assert(strcmp(resource-object.interface-name, wl_surface) == 0); + + context-surface = (struct weston_surface *) resource; + weston_surface_set_color(context-surface, 0.0, 0.0, 0.0, 1.0); + + context-layer = malloc(sizeof *context-layer); + assert(context-layer); + weston_layer_init(context-layer, client-compositor-cursor_layer.link); + wl_list_insert(context-layer-surface_list, context-surface-layer_link); + + seat_list = client-compositor-seat_list; + assert(wl_list_length(seat_list) == 1); + context-seat = container_of(seat_list-next, struct weston_seat, link); + + client-compositor-focus = 1; /*