weston: Changes to 'debian-unstable'
clients/.gitignore | 4
clients/Makefile.am | 29
clients/desktop-shell.c | 352 ++++--
clients/editor.c | 534 ++++++----
clients/fullscreen.c | 356 ++++++
clients/keyboard.c | 443 +++++---
clients/nested-client.c | 361 ++++++
clients/nested.c | 622 +++++++++++
clients/simple-egl.c | 40
clients/subsurfaces.c | 792 +++++++++++++++
clients/tablet-shell.c | 8
clients/terminal.c | 76 +
clients/transformed.c | 124 +-
clients/view.c | 2
clients/weston-info.c | 13
clients/weston-simple-im.c | 178 +--
clients/window.c | 752 ++++++++++++--
clients/window.h | 35
configure.ac | 92 +
debian/changelog | 7
debian/control | 2
man/weston.ini.man | 30
protocol/Makefile.am | 2
protocol/desktop-shell.xml | 13
protocol/input-method.xml | 166 ++-
protocol/subsurface.xml | 244 ++++
protocol/text.xml | 320 +++---
shared/Makefile.am | 3
shared/cairo-util.c | 2
shared/config-parser.c | 399 +++++++
shared/config-parser.h | 40
shared/image-loader.c | 2
shared/matrix.c | 2
shared/option-parser.c | 2
shared/os-compatibility.c | 2
src/.gitignore | 4
src/Makefile.am | 42
src/animation.c | 77 +
src/bindings.c | 39
src/clipboard.c | 24
src/cms-colord.c | 556 ++++++++++
src/cms-helper.c | 132 ++
src/cms-helper.h | 70 +
src/cms-static.c | 114 ++
src/compositor-drm.c | 615 ++++++-----
src/compositor-fbdev.c | 49
src/compositor-headless.c | 20
src/compositor-rdp.c | 212 ++--
src/compositor-rpi.c | 913 +----------------
src/compositor-wayland.c | 22
src/compositor-x11.c | 352 +++---
src/compositor.c | 2207 ++++++++++++++++++------------------------
src/compositor.h | 410 +++++++
src/data-device.c | 629 +++++++++++
src/evdev-touchpad.c | 12
src/evdev.c | 4
src/filter.c | 2
src/gl-renderer.c | 384 ++++---
src/gl-renderer.h | 7
src/input.c | 1574 +++++++++++++++++++++++++++++
src/launcher-util.c | 2
src/libbacklight.c | 2
src/log.c | 39
src/noop-renderer.c | 4
src/pixman-renderer.c | 498 ++++++---
src/rpi-bcm-stubs.h | 39
src/rpi-renderer.c | 1376 ++++++++++++++++++++++++++
src/rpi-renderer.h | 48
src/screenshooter.c | 150 ++
src/shell.c | 1134 +++++++++++++--------
src/spring-tool.c | 64 +
src/tablet-shell.c | 92 -
src/text-backend.c | 542 +++++-----
src/tty.c | 2
src/udev-seat.c | 194 ++-
src/udev-seat.h | 20
src/weston-launch.c | 34
src/xwayland/Makefile.am | 2
src/xwayland/launcher.c | 14
src/xwayland/selection.c | 17
src/xwayland/window-manager.c | 350 ++++--
src/xwayland/xwayland.h | 2
src/zoom.c | 46
tests/.gitignore | 9
tests/Makefile.am | 54 -
tests/config-parser-test.c | 203 +++
tests/subsurface-test.c | 549 ++++++++++
tests/surface-global-test.c | 3
tests/surface-test.c | 3
tests/text-test.c | 120 +-
tests/weston-test.c | 32
wcap/README | 2
wcap/main.c | 66 +
weston.ini | 3
94 files changed, 15151 insertions(+), 5083 deletions(-)
New commits:
commit 00498eb7b9501b3687e925fa0da9cb9a0653bccd
Author: Sven Joachim <svenjoac@gmx.de>
Date: Sun Jul 14 19:09:36 2013 +0200
Bump libwayland-dev build-depends to (>= 1.2.0)
As of commit 2158a889a1b06140d32, earlier released versions are not
sufficient anymore.
diff --git a/debian/changelog b/debian/changelog
index 83cb7c2..bea4670 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
weston (1.2.0-1) UNRELEASED; urgency=low
* New upstream release.
+ * Bump libwayland-dev build-depends to (>= 1.2.0).
-- Sven Joachim <svenjoac@gmx.de> Sun, 14 Jul 2013 18:57:07 +0200
diff --git a/debian/control b/debian/control
index c6788c1..8757d56 100644
--- a/debian/control
+++ b/debian/control
@@ -18,7 +18,7 @@ Build-Depends:
libegl1-mesa-dev (>= 9.0~),
libegl1-mesa-drivers (>= 9.0~),
libgles2-mesa-dev (>= 9.0~),
- libwayland-dev (>= 0.85),
+ libwayland-dev (>= 1.2.0),
libxcb1-dev,
libxcb-xfixes0-dev,
libx11-xcb-dev,
commit a188773834ab2bc84fb4e0197fb96d35b1cbefc6
Author: Sven Joachim <svenjoac@gmx.de>
Date: Sun Jul 14 18:57:18 2013 +0200
New upstream release
diff --git a/debian/changelog b/debian/changelog
index 4c2af9b..83cb7c2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+weston (1.2.0-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Sven Joachim <svenjoac@gmx.de> Sun, 14 Jul 2013 18:57:07 +0200
+
weston (1.1.1-1) experimental; urgency=low
[ Timo Aaltonen ]
commit a684b5a3d59d5ff42c30e03fe75a857073fb3fd2
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Sat Jul 13 01:30:00 2013 -0400
Bump version to 1.2.0
diff --git a/configure.ac b/configure.ac
index 63f36a9..5b110e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
m4_define([weston_major_version], [1])
-m4_define([weston_minor_version], [1])
-m4_define([weston_micro_version], [91])
+m4_define([weston_minor_version], [2])
+m4_define([weston_micro_version], [0])
m4_define([weston_version],
[weston_major_version.weston_minor_version.weston_micro_version])
commit 5f087746ee00573fb8e067d3c25ec2b608e1ffe1
Author: Rob Bradford <rob@linux.intel.com>
Date: Thu Jul 11 19:41:27 2013 +0100
window: Disregard motion events outside our current surface dimensions
It is possible to receive a motion event that was generated by the
compositor based on a pick of a surface of old dimensions. This was
triggerable on toytoolkit clients when minimising. The new window
dimensions were propagated through the widget hierarchy before the event
was dispatched.
This issue was triggering a segfault due to the focussed widget being
lost as the client code tried to identify which widget should have the
focus using co-ordinates outside the dimensions of the surface.
https://bugs.freedesktop.org/show_bug.cgi?id=66795
diff --git a/clients/window.c b/clients/window.c
index 457479d..cbfe12f 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -2796,6 +2796,14 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer,
float sx = wl_fixed_to_double(sx_w);
float sy = wl_fixed_to_double(sy_w);
+ /* when making the window smaller - e.g. after a unmaximise we might
+ * still have a pending motion event that the compositor has picked
+ * based on the old surface dimensions
+ */
+ if (sx > window->main_surface->allocation.width ||
+ sy > window->main_surface->allocation.height)
+ return;
+
input->sx = sx;
input->sy = sy;
commit 7000283741394f7ccf01e9358e0d559a5007e4b7
Author: Rob Bradford <rob@linux.intel.com>
Date: Thu Jul 11 16:00:00 2013 +0100
editor: Support shift-left/right for selecting text
If the shift modifier is active then we don't make the cursor and the
anchor the same and as a result we develop a selection in the direction
that the arrow key gets pressed in.
https://bugs.freedesktop.org/show_bug.cgi?id=66802
diff --git a/clients/editor.c b/clients/editor.c
index 7e69403..1300ccf 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -1141,7 +1141,8 @@ key_handler(struct window *window,
new_char = utf8_prev_char(entry->text, entry->text + entry->cursor);
if (new_char != NULL) {
entry->cursor = new_char - entry->text;
- entry->anchor = entry->cursor;
+ if (!(input_get_modifiers(input) & MOD_SHIFT_MASK))
+ entry->anchor = entry->cursor;
widget_schedule_redraw(entry->widget);
}
break;
@@ -1151,7 +1152,8 @@ key_handler(struct window *window,
new_char = utf8_next_char(entry->text + entry->cursor);
if (new_char != NULL) {
entry->cursor = new_char - entry->text;
- entry->anchor = entry->cursor;
+ if (!(input_get_modifiers(input) & MOD_SHIFT_MASK))
+ entry->anchor = entry->cursor;
widget_schedule_redraw(entry->widget);
}
break;
commit bdeb5d224db4147596c0526a482cbce6e3334fba
Author: Rob Bradford <rob@linux.intel.com>
Date: Thu Jul 11 13:20:53 2013 +0100
shell: Respect output transformation for input panel surface
Rather than using the dimensions in the mode we can use the recently
added output width and height members which are updated to reflect any
output rotation.
https://bugs.freedesktop.org/show_bug.cgi?id=66798
diff --git a/src/shell.c b/src/shell.c
index 69345b0..7e98831 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -3732,7 +3732,6 @@ input_panel_configure(struct weston_surface *surface, int32_t sx, int32_t sy, in
{
struct input_panel_surface *ip_surface = surface->configure_private;
struct desktop_shell *shell = ip_surface->shell;
- struct weston_mode *mode;
float x, y;
uint32_t show_surface = 0;
@@ -3752,10 +3751,8 @@ input_panel_configure(struct weston_surface *surface, int32_t sx, int32_t sy, in
x = shell->text_input.surface->geometry.x + shell->text_input.cursor_rectangle.x2;
y = shell->text_input.surface->geometry.y + shell->text_input.cursor_rectangle.y2;
} else {
- mode = ip_surface->output->current;
-
- x = ip_surface->output->x + (mode->width - width) / 2;
- y = ip_surface->output->y + mode->height - height;
+ x = ip_surface->output->x + (ip_surface->output->width - width) / 2;
+ y = ip_surface->output->y + ip_surface->output->height - height;
}
weston_surface_configure(surface,
commit 3c9d96768859a7841d415df936dec9941d0f965c
Author: Rob Bradford <rob@linux.intel.com>
Date: Thu Jul 11 10:35:55 2013 +0100
window: Allow popup menu when the window is maximised
https://bugs.freedesktop.org/show_bug.cgi?id=66793
diff --git a/clients/window.c b/clients/window.c
index cff7102..457479d 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -2553,7 +2553,7 @@ frame_button_handler(struct widget *widget,
struct display *display = window->display;
int location;
- if (window->type != TYPE_TOPLEVEL)
+ if (state != WL_POINTER_BUTTON_STATE_PRESSED)
return;
location = theme_get_location(display->theme, input->sx, input->sy,
@@ -2563,7 +2563,7 @@ frame_button_handler(struct widget *widget,
THEME_FRAME_MAXIMIZED : 0);
if (window->display->shell && button == BTN_LEFT &&
- state == WL_POINTER_BUTTON_STATE_PRESSED) {
+ window->type == TYPE_TOPLEVEL) {
switch (location) {
case THEME_LOCATION_TITLEBAR:
if (!window->shell_surface)
@@ -2592,7 +2592,8 @@ frame_button_handler(struct widget *widget,
break;
}
} else if (button == BTN_RIGHT &&
- state == WL_POINTER_BUTTON_STATE_PRESSED) {
+ (window->type == TYPE_TOPLEVEL ||
+ window->type == TYPE_MAXIMIZED)) {
window_show_frame_menu(window, input, time);
}
}
commit 3cd1f860a0fddba217570522759e24fdd4ffcf9a
Author: Peng Wu <peng.e.wu@gmail.com>
Date: Thu Jul 11 15:19:53 2013 +0800
wcap: Fix README typo
diff --git a/wcap/README b/wcap/README
index 666a708..0994a1b 100644
--- a/wcap/README
+++ b/wcap/README
@@ -2,7 +2,7 @@ WCAP Tools
WCAP is the video capture format used by Weston (Weston CAPture).
It's a simple, lossless format, that encodes the difference between
-frames as run-length ecoded rectangles. It's a variable framerate
+frames as run-length encoded rectangles. It's a variable framerate
format, that only records new frames along with a timestamp when
something actually changes.
commit 9b78adfe9dbb43504ab3fd7af9dd340b4af21085
Author: Yanko Kaneti <yaneti@declera.com>
Date: Wed Jul 10 12:01:36 2013 -0400
configure.ac: Set automake conditional after testing for colord pkg
diff --git a/configure.ac b/configure.ac
index 063c7c9..63f36a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -321,7 +321,6 @@ AC_ARG_ENABLE(colord,
AS_HELP_STRING([--disable-colord],
[do not build colord CMS support]),,
enable_colord=auto)
-AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
if test "x$enable_colord" != "xno"; then
PKG_CHECK_MODULES(COLORD,
colord >= 0.1.27,
@@ -334,6 +333,7 @@ if test "x$enable_colord" != "xno"; then
enable_colord=yes
fi
fi
+AM_CONDITIONAL(ENABLE_COLORD, test "x$enable_colord" = "xyes")
AC_ARG_ENABLE(wcap-tools, [ --disable-wcap-tools],, enable_wcap_tools=yes)
AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
commit 46cb4a95134480eec24a1f3b456a9aa63cc0ce1b
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Tue Jul 9 19:51:54 2013 -0400
Bump versionto 1.1.91
diff --git a/configure.ac b/configure.ac
index 1f5014a..063c7c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
m4_define([weston_major_version], [1])
m4_define([weston_minor_version], [1])
-m4_define([weston_micro_version], [90])
+m4_define([weston_micro_version], [91])
m4_define([weston_version],
[weston_major_version.weston_minor_version.weston_micro_version])
commit b9a23f4fb867a1a50ff4f9c36f650ec3b0b0b2d8
Author: Peter Maatman <blackwolf12333@gmail.com>
Date: Sat Jul 6 20:55:54 2013 +0200
clients/editor.c: Draw cursor at correct verical position
With this patch, the editor cursor now moves up and down correctly
instead of having the top part stuck on the first line.
diff --git a/clients/editor.c b/clients/editor.c
index 5e8ae8e..7e69403 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -946,8 +946,8 @@ text_entry_draw_cursor(struct text_entry *entry, cairo_t *cr)
&cursor_pos, NULL);
cairo_set_line_width(cr, 1.0);
- cairo_move_to(cr, PANGO_PIXELS(cursor_pos.x), PANGO_PIXELS(extents.height) + 2);
- cairo_line_to(cr, PANGO_PIXELS(cursor_pos.x), - 2);
+ cairo_move_to(cr, PANGO_PIXELS(cursor_pos.x), PANGO_PIXELS(cursor_pos.y));
+ cairo_line_to(cr, PANGO_PIXELS(cursor_pos.x), PANGO_PIXELS(cursor_pos.y) + PANGO_PIXELS(cursor_pos.height));
cairo_stroke(cr);
}
commit 08c38d4bc5ef54b4cc67b3ab6dff6878293085ff
Author: Peter Maatman <blackwolf12333@gmail.com>
Date: Sat Jul 6 20:42:59 2013 +0200
clients/editor.c: Ignore ESC key
Otherwise, editor would print the "unknown UTF-8 glyph" boxes.
diff --git a/clients/editor.c b/clients/editor.c
index 3fb645b..5e8ae8e 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -1155,11 +1155,13 @@ key_handler(struct window *window,
widget_schedule_redraw(entry->widget);
}
break;
+ case XKB_KEY_Escape:
+ break;
default:
if (xkb_keysym_to_utf8(sym, text, sizeof(text)) <= 0)
break;
- text_entry_commit_and_reset(entry);
+ text_entry_commit_and_reset(entry);
text_entry_insert_at_cursor(entry, text, 0, 0);
break;
commit e1ad1d2498e49badd1de7cee21531e18a10a8e72
Author: Rob Bradford <rob@linux.intel.com>
Date: Tue Jul 9 12:12:50 2013 +0100
tablet-shell: Avoid infinite loop when unlocking
weston_compositor_wake will fire the signal that the unlock handler is
setup as the listener for. Instead lets change the state to HOME which
unlocks.
diff --git a/src/tablet-shell.c b/src/tablet-shell.c
index 192abc7..ca63b97 100644
--- a/src/tablet-shell.c
+++ b/src/tablet-shell.c
@@ -417,7 +417,7 @@ tablet_shell_unlock(struct wl_listener *listener, void *data)
struct tablet_shell *shell =
container_of(listener, struct tablet_shell, unlock_listener);
- weston_compositor_wake(shell->compositor);
+ tablet_shell_set_state(shell, STATE_HOME);
}
static void
commit 6cf9b01e8803c1ae6e46b9a4d56c2962b4197a3f
Author: Rob Bradford <rob@linux.intel.com>
Date: Tue Jul 9 12:12:49 2013 +0100
tablet-shell: Fix copy and paste error in unlock handler
The signal handler was using the wrong member to find the containing
structure of the unlock listener.
https://bugs.freedesktop.org/show_bug.cgi?id=57637
diff --git a/src/tablet-shell.c b/src/tablet-shell.c
index fdeb856..192abc7 100644
--- a/src/tablet-shell.c
+++ b/src/tablet-shell.c
@@ -415,7 +415,7 @@ static void
tablet_shell_unlock(struct wl_listener *listener, void *data)
{
struct tablet_shell *shell =
- container_of(listener, struct tablet_shell, lock_listener);
+ container_of(listener, struct tablet_shell, unlock_listener);
weston_compositor_wake(shell->compositor);
}
commit 919cddb0abc1a1611643d1ce7fcf6b94580c8d85
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Mon Jul 8 19:03:57 2013 -0400
Convert to wl_global_create/destroy()
diff --git a/clients/nested.c b/clients/nested.c
index 6aef9c8..a4e07f7 100644
--- a/clients/nested.c
+++ b/clients/nested.c
@@ -44,6 +44,8 @@
#include "window.h"
+#define MIN(x,y) (((x) < (y)) ? (x) : (y))
+
struct nested {
struct display *display;
struct window *window;
@@ -347,10 +349,10 @@ surface_frame(struct wl_client *client,
return;
}
- callback->resource =
- wl_client_add_object(client, &wl_callback_interface,
- NULL, id, callback);
- wl_resource_set_destructor(callback->resource, destroy_frame_callback);
+ callback->resource = wl_resource_create(client,
+ &wl_callback_interface, 1, id);
+ wl_resource_set_implementation(callback->resource, NULL, callback,
+ destroy_frame_callback);
wl_list_insert(nested->frame_callback_list.prev, &callback->link);
}
@@ -423,9 +425,11 @@ compositor_create_surface(struct wl_client *client,
display_release_window_surface(nested->display, nested->window);
surface->resource =
- wl_client_add_object(client, &wl_surface_interface,
- &surface_interface, id, surface);
- wl_resource_set_destructor(surface->resource, destroy_surface);
+ wl_resource_create(client, &wl_surface_interface, 1, id);
+
+ wl_resource_set_implementation(surface->resource,
+ &surface_interface, surface,
+ destroy_surface);
wl_list_insert(nested->surface_list.prev, &surface->link);
}
@@ -488,23 +492,27 @@ compositor_create_region(struct wl_client *client,
pixman_region32_init(®ion->region);
region->resource =
- wl_client_add_object(client, &wl_region_interface,
- ®ion_interface, id, region);
- wl_resource_set_destructor(region->resource, destroy_region);
+ wl_resource_create(client, &wl_region_interface, 1, id);
+ wl_resource_set_implementation(region->resource, ®ion_interface,
+ region, destroy_region);
}
static const struct wl_compositor_interface compositor_interface = {
compositor_create_surface,
compositor_create_region
};
+
static void
compositor_bind(struct wl_client *client,
void *data, uint32_t version, uint32_t id)
{
struct nested *nested = data;
+ struct wl_resource *resource;
- wl_client_add_object(client, &wl_compositor_interface,
- &compositor_interface, id, nested);
+ resource = wl_resource_create(client, &wl_compositor_interface,
+ MIN(version, 3), id);
+ wl_resource_set_implementation(resource, &compositor_interface,
+ nested, NULL);
}
static int
@@ -523,9 +531,9 @@ nested_init_compositor(struct nested *nested)
display_watch_fd(nested->display, fd,
EPOLLIN, &nested->child_task);
- if (!wl_display_add_global(nested->child_display,
- &wl_compositor_interface,
- nested, compositor_bind))
+ if (!wl_global_create(nested->child_display,
+ &wl_compositor_interface, 1,
+ nested, compositor_bind))
return -1;
wl_display_init_shm(nested->child_display);
diff --git a/src/compositor.c b/src/compositor.c
index 92d89a7..e9e1166 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2571,8 +2571,6 @@ bind_output(struct wl_client *client,
WL_EXPORT void
weston_output_destroy(struct weston_output *output)
{
- struct weston_compositor *c = output->compositor;
-
wl_signal_emit(&output->destroy_signal, output);
free(output->name);
@@ -2580,7 +2578,7 @@ weston_output_destroy(struct weston_output *output)
pixman_region32_fini(&output->previous_damage);
output->compositor->output_id_pool &= ~(1 << output->id);
- wl_display_remove_global(c->wl_display, output->global);
+ wl_global_destroy(output->global);
}
static void
@@ -2748,8 +2746,8 @@ weston_output_init(struct weston_output *output, struct weston_compositor *c,
output->compositor->output_id_pool |= 1 << output->id;
output->global =
- wl_display_add_global(c->wl_display, &wl_output_interface,
- output, bind_output);
+ wl_global_create(c->wl_display, &wl_output_interface, 2,
+ output, bind_output);
wl_signal_emit(&c->output_created_signal, output);
}
@@ -2828,12 +2826,12 @@ weston_compositor_init(struct weston_compositor *ec,
ec->output_id_pool = 0;
- if (!wl_display_add_global(display, &wl_compositor_interface,
- ec, compositor_bind))
+ if (!wl_global_create(display, &wl_compositor_interface, 3,
+ ec, compositor_bind))
return -1;
- if (!wl_display_add_global(display, &wl_subcompositor_interface,
- ec, bind_subcompositor))
+ if (!wl_global_create(display, &wl_subcompositor_interface, 1,
+ ec, bind_subcompositor))
return -1;
wl_list_init(&ec->surface_list);
diff --git a/src/data-device.c b/src/data-device.c
index 205fe79..c89379c 100644
--- a/src/data-device.c
+++ b/src/data-device.c
@@ -620,9 +620,9 @@ wl_data_device_set_keyboard_focus(struct weston_seat *seat)
WL_EXPORT int
wl_data_device_manager_init(struct wl_display *display)
{
- if (wl_display_add_global(display,
- &wl_data_device_manager_interface,
- NULL, bind_manager) == NULL)
+ if (wl_global_create(display,
+ &wl_data_device_manager_interface, 1,
+ NULL, bind_manager) == NULL)
return -1;
return 0;
diff --git a/src/input.c b/src/input.c
index 2519d9f..1887e7f 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1531,9 +1531,8 @@ weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec,
wl_list_init(&seat->drag_resource_list);
wl_signal_init(&seat->destroy_signal);
- seat->global =
- wl_display_add_global(ec->wl_display,
- &wl_seat_interface, seat, bind_seat);
+ seat->global = wl_global_create(ec->wl_display, &wl_seat_interface, 2,
+ seat, bind_seat);
seat->compositor = ec;
seat->modifier_state = 0;
@@ -1569,7 +1568,7 @@ weston_seat_release(struct weston_seat *seat)
free (seat->seat_name);
- wl_display_remove_global(seat->compositor->wl_display, seat->global);
+ wl_global_destroy(seat->global);
wl_signal_emit(&seat->destroy_signal, seat);
}
diff --git a/src/screenshooter.c b/src/screenshooter.c
index f236ca4..2b37071 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -559,7 +559,7 @@ screenshooter_destroy(struct wl_listener *listener, void *data)
struct screenshooter *shooter =
container_of(listener, struct screenshooter, destroy_listener);
- wl_display_remove_global(shooter->ec->wl_display, shooter->global);
+ wl_global_destroy(shooter->global);
free(shooter);
}
@@ -575,9 +575,9 @@ screenshooter_create(struct weston_compositor *ec)
shooter->ec = ec;
shooter->client = NULL;
- shooter->global = wl_display_add_global(ec->wl_display,
- &screenshooter_interface,
- shooter, bind_shooter);
+ shooter->global = wl_global_create(ec->wl_display,
+ &screenshooter_interface, 1,
+ shooter, bind_shooter);
weston_compositor_add_key_binding(ec, KEY_S, MODIFIER_SUPER,
screenshooter_binding, shooter);
weston_compositor_add_key_binding(ec, KEY_R, MODIFIER_SUPER,
diff --git a/src/shell.c b/src/shell.c
index e20004f..69345b0 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -4507,25 +4507,25 @@ module_init(struct weston_compositor *ec,
wl_list_init(&shell->workspaces.animation.link);
shell->workspaces.animation.frame = animate_workspace_change_frame;
- if (wl_display_add_global(ec->wl_display, &wl_shell_interface,
+ if (wl_global_create(ec->wl_display, &wl_shell_interface, 1,
shell, bind_shell) == NULL)
return -1;
- if (wl_display_add_global(ec->wl_display,
- &desktop_shell_interface,
- shell, bind_desktop_shell) == NULL)
+ if (wl_global_create(ec->wl_display,
+ &desktop_shell_interface, 2,
+ shell, bind_desktop_shell) == NULL)
return -1;
- if (wl_display_add_global(ec->wl_display, &screensaver_interface,
- shell, bind_screensaver) == NULL)
+ if (wl_global_create(ec->wl_display, &screensaver_interface, 1,
+ shell, bind_screensaver) == NULL)
return -1;
- if (wl_display_add_global(ec->wl_display, &wl_input_panel_interface,
+ if (wl_global_create(ec->wl_display, &wl_input_panel_interface, 1,
shell, bind_input_panel) == NULL)
return -1;
- if (wl_display_add_global(ec->wl_display, &workspace_manager_interface,
- shell, bind_workspace_manager) == NULL)
+ if (wl_global_create(ec->wl_display, &workspace_manager_interface, 1,
+ shell, bind_workspace_manager) == NULL)
return -1;
shell->child.deathstamp = weston_compositor_get_time();
diff --git a/src/tablet-shell.c b/src/tablet-shell.c
index 76a4010..fdeb856 100644
--- a/src/tablet-shell.c
+++ b/src/tablet-shell.c
@@ -542,8 +542,8 @@ module_init(struct weston_compositor *compositor,
wl_signal_add(&compositor->wake_signal, &shell->unlock_listener);
/* FIXME: This will make the object available to all clients. */
- wl_display_add_global(compositor->wl_display, &tablet_shell_interface,
- shell, bind_tablet_shell);
+ wl_global_create(compositor->wl_display, &tablet_shell_interface, 1,
+ shell, bind_tablet_shell);
loop = wl_display_get_event_loop(compositor->wl_display);
shell->long_press_source =
diff --git a/src/text-backend.c b/src/text-backend.c
index b7a1a40..3a1d68c 100644
--- a/src/text-backend.c
+++ b/src/text-backend.c
@@ -398,8 +398,7 @@ text_input_manager_notifier_destroy(struct wl_listener *listener, void *data)
struct text_input_manager *text_input_manager =
container_of(listener, struct text_input_manager, destroy_listener);
- wl_display_remove_global(text_input_manager->ec->wl_display,
- text_input_manager->text_input_manager_global);
+ wl_global_destroy(text_input_manager->text_input_manager_global);
free(text_input_manager);
}
@@ -414,9 +413,9 @@ text_input_manager_create(struct weston_compositor *ec)
text_input_manager->ec = ec;
text_input_manager->text_input_manager_global =
- wl_display_add_global(ec->wl_display,
- &wl_text_input_manager_interface,
- text_input_manager, bind_text_input_manager);
+ wl_global_create(ec->wl_display,
+ &wl_text_input_manager_interface, 1,
+ text_input_manager, bind_text_input_manager);
text_input_manager->destroy_listener.notify = text_input_manager_notifier_destroy;
wl_signal_add(&ec->destroy_signal, &text_input_manager->destroy_listener);
@@ -792,8 +791,7 @@ input_method_notifier_destroy(struct wl_listener *listener, void *data)
if (input_method->model)
deactivate_text_input(input_method->model, input_method);
- wl_display_remove_global(input_method->seat->compositor->wl_display,
- input_method->input_method_global);
+ wl_global_destroy(input_method->input_method_global);
free(input_method);
}
@@ -899,9 +897,8 @@ handle_seat_created(struct wl_listener *listener,
input_method->text_backend = text_backend;
input_method->input_method_global =
- wl_display_add_global(ec->wl_display,
- &wl_input_method_interface,
- input_method, bind_input_method);
+ wl_global_create(ec->wl_display, &wl_input_method_interface, 1,
+ input_method, bind_input_method);
input_method->destroy_listener.notify = input_method_notifier_destroy;
wl_signal_add(&seat->destroy_signal, &input_method->destroy_listener);
diff --git a/src/xwayland/launcher.c b/src/xwayland/launcher.c
index 32ec1ae..3228b53 100644
--- a/src/xwayland/launcher.c
+++ b/src/xwayland/launcher.c
@@ -376,7 +376,7 @@ module_init(struct weston_compositor *compositor,
WL_EVENT_READABLE,
weston_xserver_handle_event, wxs);
- wl_display_add_global(display, &xserver_interface, wxs, bind_xserver);
+ wl_global_create(display, &xserver_interface, 1, wxs, bind_xserver);
wxs->destroy_listener.notify = weston_xserver_destroy;
wl_signal_add(&compositor->destroy_signal, &wxs->destroy_listener);
diff --git a/src/zoom.c b/src/zoom.c
index 1dc8557..220b2b6 100644
--- a/src/zoom.c
+++ b/src/zoom.c
@@ -69,7 +69,7 @@ text_cursor_position_notifier_destroy(struct wl_listener *listener, void *data)
struct text_cursor_position *text_cursor_position =
container_of(listener, struct text_cursor_position, destroy_listener);
- wl_display_remove_global(text_cursor_position->ec->wl_display, text_cursor_position->global);
+ wl_global_destroy(text_cursor_position->global);
free(text_cursor_position);
}
@@ -84,11 +84,14 @@ text_cursor_position_notifier_create(struct weston_compositor *ec)
text_cursor_position->ec = ec;
- text_cursor_position->global = wl_display_add_global(ec->wl_display,
- &text_cursor_position_interface,
- text_cursor_position, bind_text_cursor_position);
+ text_cursor_position->global =
+ wl_global_create(ec->wl_display,
+ &text_cursor_position_interface, 1,
+ text_cursor_position,
+ bind_text_cursor_position);
- text_cursor_position->destroy_listener.notify = text_cursor_position_notifier_destroy;
+ text_cursor_position->destroy_listener.notify =
+ text_cursor_position_notifier_destroy;
wl_signal_add(&ec->destroy_signal, &text_cursor_position->destroy_listener);
}
diff --git a/tests/weston-test.c b/tests/weston-test.c
index 486cd6a..b625f42 100644
--- a/tests/weston-test.c
+++ b/tests/weston-test.c
@@ -240,8 +240,8 @@ module_init(struct weston_compositor *ec,
test->compositor = ec;
weston_layer_init(&test->layer, &ec->cursor_layer.link);
- if (wl_display_add_global(ec->wl_display, &wl_test_interface,
- test, bind_test) == NULL)
+ if (wl_global_create(ec->wl_display, &wl_test_interface, 1,
+ test, bind_test) == NULL)
return -1;
loop = wl_display_get_event_loop(ec->wl_display);
commit ac3a8b83fd900c8d38f808f1255e4b1d0ee50c5c
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Mon Jul 8 19:06:06 2013 -0400
tests: Fix warnings in config-parser-test
diff --git a/tests/config-parser-test.c b/tests/config-parser-test.c
index 12a8fbd..83e89ba 100644
--- a/tests/config-parser-test.c
+++ b/tests/config-parser-test.c
@@ -25,6 +25,7 @@
#include <string.h>
#include <assert.h>
#include <errno.h>
+#include <unistd.h>
#include "config-parser.h"
@@ -37,7 +38,7 @@ run_test(const char *text)
fd = mkstemp(file);
len = write(fd, text, strlen(text));
- assert(len == strlen(text));
+ assert(len == (int) strlen(text));
config = weston_config_parse(fd);
close(fd);
commit d2d70f2aeb370b0827e8c66fa9e7e2a26b1d6648
Author: Quentin Glidic <sardemff7+git@sardemff7.net>
Date: Tue Jul 9 00:06:24 2013 +0200
tests: Move config-parser.test to tests/
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
diff --git a/shared/Makefile.am b/shared/Makefile.am
index edef416..2fcff7b 100644
--- a/shared/Makefile.am
+++ b/shared/Makefile.am
@@ -30,14 +30,3 @@ libshared_cairo_la_SOURCES = \
image-loader.h \
cairo-util.c \
cairo-util.h
-
-TESTS = config-parser-test
-
-check_PROGRAMS = $(TESTS)
-
-config_parser_test_LDADD = $(COMPOSITOR_LIBS)
-config_parser_test_CFLAGS = $(COMPOSITOR_CFLAGS)
-config_parser_test_SOURCES = \
- config-parser.c \
- config-parser.h \
- config-parser-test.c
diff --git a/shared/config-parser-test.c b/shared/config-parser-test.c
deleted file mode 100644
index 12a8fbd..0000000
--- a/shared/config-parser-test.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright © 2013 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 <stdint.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-
-#include "config-parser.h"
-
-static struct weston_config *
-run_test(const char *text)
-{
- struct weston_config *config;
- char file[] = "/tmp/weston-config-parser-test-XXXXXX";
- int fd, len;
-
- fd = mkstemp(file);
- len = write(fd, text, strlen(text));
- assert(len == strlen(text));
-
- config = weston_config_parse(fd);
- close(fd);
- unlink(file);
-
- return config;
-}
-
-static const char t0[] =
- "# nothing in this file...\n";
-
-static const char t1[] =
- "# comment line here...\n"
- "\n"
- "[foo]\n"
- "a=b\n"
- "name= Roy Batty \n"
- "\n"
- "\n"
- "[bar]\n"
- "# more comments\n"
- "number=5252\n"
- "flag=false\n"
- "\n"
- "[stuff]\n"
- "flag= true \n"
- "\n"
Reply to: