wayland-demos: Changes to 'upstream-experimental'
.gitignore | 3
COPYING | 48
Makefile.am | 11
README | 19
clients/.gitignore | 25
clients/Makefile.am | 152 +
clients/cairo-util.c | 264 --
clients/cairo-util.h | 37
clients/clickdot.c | 314 ++
clients/desktop-shell.c | 1008 +++++++++
clients/dnd.c | 532 ++---
clients/editor.c | 310 ++
clients/eventdemo.c | 161 -
clients/flower.c | 104
clients/gears.c | 174 +
clients/glmatrix.c | 1062 +++++++++
clients/image.c | 188 -
clients/keyboard.c | 213 ++
clients/matrix3.xpm | 692 ++++++
clients/resizor.c | 237 +-
clients/screenshot.c | 215 +-
clients/simple-client.c | 368 ---
clients/simple-egl.c | 522 ++++
clients/simple-shm.c | 343 +++
clients/simple-touch.c | 282 ++
clients/smoke.c | 105
clients/tablet-shell.c | 493 ++++
clients/terminal.c | 835 ++++---
clients/view.c | 86
clients/wayland-glib.c | 105
clients/wayland-glib.h | 32
clients/window.c | 4038 +++++++++++++++++++++++++++-----------
clients/window.h | 338 ++-
clients/wscreensaver-glue.c | 148 +
clients/wscreensaver-glue.h | 120 +
clients/wscreensaver.c | 344 +++
clients/wscreensaver.h | 61
compositor/.gitignore | 5
compositor/70-wayland.rules | 7
compositor/Makefile.am | 96
compositor/compositor-drm.c | 770 -------
compositor/compositor-openwfd.c | 614 -----
compositor/compositor-wayland.c | 547 -----
compositor/compositor-x11.c | 710 ------
compositor/compositor.c | 2014 ------------------
compositor/compositor.h | 364 ---
compositor/evdev.c | 242 --
compositor/image-loader.c | 176 -
compositor/meego-tablet-shell.c | 636 -----
compositor/screenshooter.c | 68
compositor/shell.c | 769 -------
compositor/switcher.c | 131 -
compositor/tty.c | 171 -
configure.ac | 200 +
data/COPYING | 5
data/Makefile.am | 31
data/border.png |binary
data/icon_window.png |binary
data/pattern.png |binary
data/sign_close.png |binary
data/sign_maximize.png |binary
data/sign_minimize.png |binary
data/terminal.png |binary
dev/null |binary
protocol/Makefile.am | 6
protocol/desktop-shell.xml | 119 +
protocol/meego-tablet.xml | 40
protocol/screenshooter.xml | 2
protocol/tablet-shell.xml | 40
protocol/text-cursor-position.xml | 11
protocol/text.xml | 52
protocol/xserver.xml | 18
shared/Makefile.am | 15
shared/cairo-util.c | 474 ++++
shared/cairo-util.h | 87
shared/config-parser.c | 184 +
shared/config-parser.h | 78
shared/image-loader.c | 404 +++
shared/option-parser.c | 82
shared/os-compatibility.c | 180 +
shared/os-compatibility.h | 54
src/.gitignore | 15
src/Makefile.am | 184 +
src/android-framebuffer.cpp | 93
src/android-framebuffer.h | 54
src/clipboard.c | 277 ++
src/compositor-android.c | 462 ++++
src/compositor-drm.c | 1958 ++++++++++++++++++
src/compositor-openwfd.c | 687 ++++++
src/compositor-wayland.c | 920 ++++++++
src/compositor-x11.c | 1145 ++++++++++
src/compositor.c | 3558 +++++++++++++++++++++++++++++++++
src/compositor.h | 770 +++++++
src/evdev-private.h | 115 +
src/evdev-touchpad.c | 538 +++++
src/evdev.c | 780 +++++++
src/evdev.h | 42
src/filter.c | 336 +++
src/filter.h | 65
src/launcher-util.c | 160 +
src/launcher-util.h | 35
src/libbacklight.c | 307 ++
src/libbacklight.h | 49
src/log.c | 114 +
src/log.h | 35
src/matrix.c | 250 ++
src/matrix.h | 64
src/screenshooter.c | 448 ++++
src/shell.c | 3376 +++++++++++++++++++++++++++++++
src/tablet-shell.c | 587 +++++
src/text-backend.c | 279 ++
src/tty.c | 291 ++
src/util.c | 507 ++++
src/weston-egl-ext.h | 56
src/weston-launch.c | 644 ++++++
src/weston-launch.h | 46
src/xwayland/Makefile.am | 30
src/xwayland/hash.c | 307 ++
src/xwayland/hash.h | 49
src/xwayland/launcher.c | 379 +++
src/xwayland/selection.c | 702 ++++++
src/xwayland/window-manager.c | 1648 +++++++++++++++
src/xwayland/xwayland.h | 154 +
src/zoom.c | 330 +++
tests/.gitignore | 4
tests/Makefile.am | 40
tests/client-test.c | 71
tests/event-test.c | 80
tests/matrix-test.c | 420 +++
tests/setbacklight.c | 191 +
tests/surface-test.c | 49
tests/test-client.c | 365 +++
tests/test-runner.c | 148 +
tests/test-runner.h | 42
tests/weston-test | 4
wcap/.gitignore | 3
wcap/Makefile.am | 9
wcap/README | 99
wcap/main.c | 252 ++
wcap/wcap-decode.c | 149 +
wcap/wcap-decode.h | 63
weston.ini | 34
142 files changed, 37621 insertions(+), 10639 deletions(-)
New commits:
commit e302b3ef77894cb9fd4113c873a5502efc9a8dd6
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Tue Jul 24 16:01:29 2012 -0400
Bump version to 0.95.0
diff --git a/configure.ac b/configure.ac
index 231a024..c35d987 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
AC_PREREQ([2.64])
AC_INIT([weston],
- [0.94.90],
+ [0.95.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=weston],
[weston],
[http://wayland.freedesktop.org/])
commit d1936b9e2b352e93ace1b3609740ce4902b33a9e
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Mon Jul 23 22:59:33 2012 -0400
desktop-shell: Break command lines into env vars, executable and arguments
We now support specifying environment variables and arguments in launchers
by saying
path=GDK_BACKEND=wayland gnome-terminal --full-screen
for example.
https://bugs.freedesktop.org/show_bug.cgi?id=47920
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 61599c3..082a30a 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -34,6 +34,7 @@
#include <sys/epoll.h>
#include <linux/input.h>
#include <libgen.h>
+#include <ctype.h>
#include <time.h>
#include <wayland-client.h>
@@ -90,8 +91,10 @@ struct panel_launcher {
struct panel *panel;
cairo_surface_t *icon;
int focused, pressed;
- const char *path;
+ char *path;
struct wl_list link;
+ struct wl_array envp;
+ struct wl_array argv;
};
struct panel_clock {
@@ -173,6 +176,7 @@ show_menu(struct panel *panel, struct input *input, uint32_t time)
static void
panel_launcher_activate(struct panel_launcher *widget)
{
+ char **argv;
pid_t pid;
pid = fork();
@@ -184,8 +188,9 @@ panel_launcher_activate(struct panel_launcher *widget)
if (pid)
return;
- if (execl(widget->path, widget->path, NULL) < 0) {
- fprintf(stderr, "execl '%s' failed: %m\n", widget->path);
+ argv = widget->argv.data;
+ if (execve(argv[0], argv, widget->envp.data) < 0) {
+ fprintf(stderr, "execl '%s' failed: %m\n", argv[0]);
exit(1);
}
}
@@ -469,11 +474,57 @@ static void
panel_add_launcher(struct panel *panel, const char *icon, const char *path)
{
struct panel_launcher *launcher;
+ char *start, *p, *eq, **ps;
+ int i, j, k;
launcher = malloc(sizeof *launcher);
memset(launcher, 0, sizeof *launcher);
launcher->icon = cairo_image_surface_create_from_png(icon);
launcher->path = strdup(path);
+
+ wl_array_init(&launcher->envp);
+ wl_array_init(&launcher->argv);
+ for (i = 0; __environ[i]; i++) {
+ ps = wl_array_add(&launcher->envp, sizeof *ps);
+ *ps = __environ[i];
+ }
+ j = 0;
+
+ start = launcher->path;
+ while (*start) {
+ for (p = start, eq = NULL; *p && !isspace(*p); p++)
+ if (*p == '=')
+ eq = p;
+
+ if (eq && j == 0) {
+ ps = launcher->envp.data;
+ for (k = 0; k < i; k++)
+ if (strncmp(ps[k], start, eq - start) == 0) {
+ ps[k] = start;
+ break;
+ }
+ if (k == i) {
+ ps = wl_array_add(&launcher->envp, sizeof *ps);
+ *ps = start;
+ i++;
+ }
+ } else {
+ ps = wl_array_add(&launcher->argv, sizeof *ps);
+ *ps = start;
+ j++;
+ }
+
+ while (*p && isspace(*p))
+ *p++ = '\0';
+
+ start = p;
+ }
+
+ ps = wl_array_add(&launcher->envp, sizeof *ps);
+ *ps = NULL;
+ ps = wl_array_add(&launcher->argv, sizeof *ps);
+ *ps = NULL;
+
launcher->panel = panel;
wl_list_insert(panel->launcher_list.prev, &launcher->link);
commit df0faf79834630d16235795202f4f4132b886505
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Mon Jul 23 22:00:21 2012 -0400
image: Add fullscreen support
diff --git a/clients/image.c b/clients/image.c
index 83ed231..711f0d8 100644
--- a/clients/image.c
+++ b/clients/image.c
@@ -43,6 +43,7 @@ struct image {
struct display *display;
char *filename;
cairo_surface_t *image;
+ int fullscreen;
};
static void
@@ -102,6 +103,15 @@ keyboard_focus_handler(struct window *window,
window_schedule_redraw(image->window);
}
+static void
+fullscreen_handler(struct window *window, void *data)
+{
+ struct image *image = data;
+
+ image->fullscreen ^= 1;
+ window_set_fullscreen(window, image->fullscreen);
+}
+
static struct image *
image_create(struct display *display, const char *filename)
{
@@ -129,6 +139,7 @@ image_create(struct display *display, const char *filename)
widget_set_redraw_handler(image->widget, redraw_handler);
window_set_keyboard_focus_handler(image->window,
keyboard_focus_handler);
+ window_set_fullscreen_handler(image->window, fullscreen_handler);
widget_schedule_resize(image->widget, 500, 400);
commit 67ace20f8ebc2088d560874c49eb79ca122b68da
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Mon Jul 23 21:56:31 2012 -0400
window.c: Add fullscreen handler to keep fullscreen state consistent
diff --git a/clients/terminal.c b/clients/terminal.c
index 7e7a9fb..dd35ceb 100644
--- a/clients/terminal.c
+++ b/clients/terminal.c
@@ -2057,6 +2057,15 @@ static const struct wl_data_source_listener data_source_listener = {
data_source_cancelled
};
+static void
+fullscreen_handler(struct window *window, void *data)
+{
+ struct terminal *terminal = data;
+
+ terminal->fullscreen ^= 1;
+ window_set_fullscreen(window, terminal->fullscreen);
+}
+
static int
handle_bound_key(struct terminal *terminal,
struct input *input, uint32_t sym, uint32_t time)
@@ -2115,13 +2124,6 @@ key_handler(struct window *window, struct input *input, uint32_t time,
return;
switch (sym) {
- case XKB_KEY_F11:
- if (state == WL_KEYBOARD_KEY_STATE_RELEASED)
- break;
- terminal->fullscreen ^= 1;
- window_set_fullscreen(window, terminal->fullscreen);
- break;
-
case XKB_KEY_BackSpace:
if (modifiers & MOD_ALT_MASK)
ch[len++] = 0x1b;
@@ -2457,6 +2459,8 @@ terminal_create(struct display *display, int fullscreen)
window_set_key_handler(terminal->window, key_handler);
window_set_keyboard_focus_handler(terminal->window,
keyboard_focus_handler);
+ window_set_fullscreen_handler(terminal->window, fullscreen_handler);
+
widget_set_redraw_handler(terminal->widget, redraw_handler);
widget_set_resize_handler(terminal->widget, resize_handler);
widget_set_button_handler(terminal->widget, button_handler);
diff --git a/clients/view.c b/clients/view.c
index ee861e4..b40a992 100644
--- a/clients/view.c
+++ b/clients/view.c
@@ -159,6 +159,15 @@ button_handler(struct widget *widget, struct input *input, uint32_t time,
}
static void
+fullscreen_handler(struct window *window, void *data)
+{
+ struct view *view = data;
+
+ view->fullscreen ^= 1;
+ window_set_fullscreen(window, view->fullscreen);
+}
+
+static void
key_handler(struct window *window, struct input *input, uint32_t time,
uint32_t key, uint32_t unicode,
enum wl_keyboard_key_state state, void *data)
@@ -169,10 +178,6 @@ key_handler(struct window *window, struct input *input, uint32_t time,
return;
switch (key) {
- case KEY_F11:
- view->fullscreen ^= 1;
- window_set_fullscreen(window, view->fullscreen);
- break;
case KEY_SPACE:
case KEY_PAGEDOWN:
case KEY_RIGHT:
@@ -238,6 +243,8 @@ view_create(struct display *display,
window_set_key_handler(view->window, key_handler);
window_set_keyboard_focus_handler(view->window,
keyboard_focus_handler);
+ window_set_fullscreen_handler(view->window, fullscreen_handler);
+
widget_set_button_handler(view->widget, button_handler);
widget_set_resize_handler(view->widget, resize_handler);
widget_set_redraw_handler(view->widget, redraw_handler);
diff --git a/clients/window.c b/clients/window.c
index d374ab9..186eed9 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -157,6 +157,7 @@ struct window {
window_data_handler_t data_handler;
window_drop_handler_t drop_handler;
window_close_handler_t close_handler;
+ window_fullscreen_handler_t fullscreen_handler;
struct frame *frame;
struct widget *widget;
@@ -1560,7 +1561,8 @@ frame_menu_func(struct window *window, int index, void *data)
break;
case 1: /* fullscreen */
/* we don't have a way to get out of fullscreen for now */
- window_set_fullscreen(window, 1);
+ if (window->fullscreen_handler)
+ window->fullscreen_handler(window, window->user_data);
break;
case 2: /* rotate */
case 3: /* scale */
@@ -1886,6 +1888,10 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard,
if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
window_set_maximized(window,
window->type != TYPE_MAXIMIZED);
+ } else if (sym == XKB_KEY_F11 &&
+ window->fullscreen_handler &&
+ state == WL_KEYBOARD_KEY_STATE_PRESSED) {
+ window->fullscreen_handler(window, window->user_data);
} else if (window->key_handler) {
(*window->key_handler)(window, input, time, key,
sym, state, window->user_data);
@@ -2837,6 +2843,13 @@ window_set_close_handler(struct window *window,
}
void
+window_set_fullscreen_handler(struct window *window,
+ window_fullscreen_handler_t handler)
+{
+ window->fullscreen_handler = handler;
+}
+
+void
window_set_title(struct window *window, const char *title)
{
free(window->title);
diff --git a/clients/window.h b/clients/window.h
index de38647..da18932 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -176,6 +176,7 @@ typedef void (*window_drop_handler_t)(struct window *window,
int32_t x, int32_t y, void *data);
typedef void (*window_close_handler_t)(struct window *window, void *data);
+typedef void (*window_fullscreen_handler_t)(struct window *window, void *data);
typedef void (*widget_resize_handler_t)(struct widget *widget,
int32_t width, int32_t height,
@@ -303,6 +304,9 @@ window_set_drop_handler(struct window *window,
void
window_set_close_handler(struct window *window,
window_close_handler_t handler);
+void
+window_set_fullscreen_handler(struct window *window,
+ window_fullscreen_handler_t handler);
void
window_set_title(struct window *window, const char *title);
commit 0fd49aa8862a3c634ee6a14da139b4e5d620c605
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Mon Jul 23 21:32:46 2012 -0400
dnd: Clip flowers to window content area
https://bugs.freedesktop.org/show_bug.cgi?id=52420
diff --git a/clients/dnd.c b/clients/dnd.c
index c38b94f..6f55e95 100644
--- a/clients/dnd.c
+++ b/clients/dnd.c
@@ -186,6 +186,9 @@ dnd_redraw_handler(struct widget *widget, void *data)
cairo_set_source_rgba(cr, 0, 0, 0, 0.8);
cairo_fill(cr);
+ cairo_rectangle(cr, allocation.x, allocation.y,
+ allocation.width, allocation.height);
+ cairo_clip(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
for (i = 0; i < ARRAY_LENGTH(dnd->items); i++) {
if (!dnd->items[i])
commit 72b0f8f2ecbec57ef8755755dd48ba41a8614e95
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Mon Jul 23 20:54:42 2012 -0400
Update src/weston-egl-ext.h
diff --git a/src/weston-egl-ext.h b/src/weston-egl-ext.h
index 100b9f1..8e132c0 100644
--- a/src/weston-egl-ext.h
+++ b/src/weston-egl-ext.h
@@ -33,16 +33,12 @@
#ifndef EGL_WL_bind_wayland_display
#define EGL_WL_bind_wayland_display 1
-#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
-#define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */
+#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */
+#define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */
-#define EGL_WAYLAND_BUFFER_COMPONENTS_WL 0x31D7 /* eglQueryWaylandBufferWL attribute */
-
-#define EGL_WAYLAND_BUFFER_RGB_WL 0x31D8
-#define EGL_WAYLAND_BUFFER_RGBA_WL 0x31D9
-#define EGL_WAYLAND_BUFFER_Y_U_V_WL 0x31Da
-#define EGL_WAYLAND_BUFFER_Y_UV_WL 0x31Db
-#define EGL_WAYLAND_BUFFER_Y_XUXV_WL 0x31Dc
+#define EGL_TEXTURE_Y_U_V_WL 0x31D7
+#define EGL_TEXTURE_Y_UV_WL 0x31D8
+#define EGL_TEXTURE_Y_XUXV_WL 0x31D9
struct wl_display;
struct wl_buffer;
commit 9d01a3e548f1aefffa49990b0199a0b2c453440f
Author: Daniel Stone <daniel@fooishbar.org>
Date: Mon Jul 23 19:54:59 2012 +0100
evdev: Release weston_seat with underlying evdev device
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
diff --git a/src/evdev.c b/src/evdev.c
index 74662b2..62f1bc1 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -774,7 +774,7 @@ evdev_input_destroy(struct weston_seat *seat_base)
evdev_remove_devices(seat_base);
evdev_disable_udev_monitor(&seat->base);
- wl_list_remove(&seat->base.link);
+ weston_seat_release(seat_base);
free(seat->seat_id);
free(seat);
}
commit 816c98edb024dea53ac14487f12d76999504c496
Author: Daniel Stone <daniel@fooishbar.org>
Date: Mon Jul 23 19:54:58 2012 +0100
Fix memory leak on compositor exit
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
diff --git a/src/compositor.c b/src/compositor.c
index 3f2828e..ed887a4 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3288,6 +3288,8 @@ weston_compositor_shutdown(struct weston_compositor *ec)
wl_array_release(&ec->indices);
wl_event_loop_destroy(ec->input_loop);
+
+ pixman_region32_fini(&ec->damage);
}
static int on_term_signal(int signal_number, void *data)
commit 53b6b04685a39a7dbd8d3d1b8a282d6d069ebd33
Author: Daniel Stone <daniel@fooishbar.org>
Date: Mon Jul 23 19:54:57 2012 +0100
evdev: Don't ignore multitouch touchscreens
Most touchscreen drivers provide ABS_X and BTN_TOUCH for legacy
single-touch emulation modes, but this isn't mandatory. Make sure we
don't ignore touchscreens with provide multitouch events with the new
API only.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
diff --git a/src/evdev.c b/src/evdev.c
index 3355192..74662b2 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -441,7 +441,7 @@ evdev_configure_device(struct evdev_input_device *device)
/* This rule tries to catch accelerometer devices and opt out. We may
* want to adjust the protocol later adding a proper event for dealing
* with accelerometers and implement here accordingly */
- if (has_abs && !has_key)
+ if (has_abs && !has_key && !device->is_mt)
return -1;
if ((device->caps &
commit 2327d1f490a5362e6b6199ca68b14d11e2f13408
Author: Scott Moreau <oreaus@gmail.com>
Date: Mon Jul 23 11:53:18 2012 -0600
wcap: Fix typo in usage output.
diff --git a/wcap/main.c b/wcap/main.c
index 3b671b0..9493304 100644
--- a/wcap/main.c
+++ b/wcap/main.c
@@ -154,7 +154,7 @@ usage(int exit_code)
"[--help] [--yuv4mpeg2] [--frame=<frame>] [--all] \n"
"\t[--rate=<num:denom>] <wcap file>\n\n"
"\t--help\t\t\tthis help text\n"
- "\t--yuv2mpeg4\t\tdump wcap file to stdout in yuv4mpeg format\n"
+ "\t--yuv4mpeg2\t\tdump wcap file to stdout in yuv4mpeg2 format\n"
"\t--frame=<frame>\t\twrite out the given frame number as png\n"
"\t--all\t\t\twrite all frames as pngs\n"
"\t--rate=<num:denom>\treplay frame rate for yuv4mpeg2,\n"
commit f32f096cd81ed472bac48354d916724e2e2329f8
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Mon Jul 23 11:10:20 2012 -0400
wcap: Clarify help message, don't dump yuv4mpeg2 to terminal
diff --git a/wcap/main.c b/wcap/main.c
index 466030e..3b671b0 100644
--- a/wcap/main.c
+++ b/wcap/main.c
@@ -150,11 +150,11 @@ output_yuv_frame(struct wcap_decoder *decoder)
static void
usage(int exit_code)
{
- fprintf(stderr, "usage: wcap-snapshot "
+ fprintf(stderr, "usage: wcap-decode "
"[--help] [--yuv4mpeg2] [--frame=<frame>] [--all] \n"
"\t[--rate=<num:denom>] <wcap file>\n\n"
"\t--help\t\t\tthis help text\n"
- "\t--yuv2mpeg4\t\tdump wcap file in yuv4mpeg format\n"
+ "\t--yuv2mpeg4\t\tdump wcap file to stdout in yuv4mpeg format\n"
"\t--frame=<frame>\t\twrite out the given frame number as png\n"
"\t--all\t\t\twrite all frames as pngs\n"
"\t--rate=<num:denom>\treplay frame rate for yuv4mpeg2,\n"
@@ -205,6 +205,15 @@ int main(int argc, char *argv[])
decoder = wcap_decoder_create(argv[1]);
+ if (yuv4mpeg2 && isatty(1)) {
+ fprintf(stderr, "Not dumping yuv4mpeg2 data to terminal. Pipe output to a file or a process.\n");
+ fprintf(stderr, "For example, to encode to webm, use something like\n\n");
+ fprintf(stderr, "\t$ wcap-decode --yuv4mpeg2 ../capture.wcap |\n"
+ "\t\tvpxenc --target-bitrate=1024 --best -t 4 -o foo.webm -\n\n");
+
+ exit(EXIT_FAILURE);
+ }
+
if (yuv4mpeg2) {
printf("YUV4MPEG2 C420jpeg W%d H%d F%d:%d Ip A0:0\n",
decoder->width, decoder->height, num, denom);
commit ec116022ecb4f26ed1629dfe3ad0341f38f45ac5
Author: Scott Moreau <oreaus@gmail.com>
Date: Sun Jul 22 18:23:52 2012 -0600
desktop-shell: Declare grab_cursor as enum cursor_type.
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index cf28246..61599c3 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -53,7 +53,7 @@ struct desktop {
struct window *grab_window;
struct widget *grab_widget;
- enum desktop_shell_cursor grab_cursor;
+ enum cursor_type grab_cursor;
};
struct surface {
commit 776a5637028e158e9b90ae7fdedb47138a9a529a
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Mon Jul 23 10:47:34 2012 -0400
wcap: Add GCC_CFLAGS and fix more compiler warnings
diff --git a/wcap/Makefile.am b/wcap/Makefile.am
index da0ba90..338208e 100644
--- a/wcap/Makefile.am
+++ b/wcap/Makefile.am
@@ -5,5 +5,5 @@ wcap_decode_SOURCES = \
wcap-decode.c \
wcap-decode.h
-wcap_decode_CFLAGS = $(WCAP_CFLAGS)
+wcap_decode_CFLAGS = $(GCC_CFLAGS) $(WCAP_CFLAGS)
wcap_decode_LDADD = $(WCAP_LIBS)
diff --git a/wcap/main.c b/wcap/main.c
index 09e0aa7..466030e 100644
--- a/wcap/main.c
+++ b/wcap/main.c
@@ -30,6 +30,7 @@
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
+#include <assert.h>
#include <cairo.h>
@@ -65,6 +66,8 @@ rgb_to_yuv(uint32_t format, uint32_t p, int *u, int *v)
g = (p >> 8) & 0xff;
b = (p >> 16) & 0xff;
break;
+ default:
+ assert(0);
}
y = (19595 * r + 38469 * g + 7472 * b) >> 16;
diff --git a/wcap/wcap-decode.c b/wcap/wcap-decode.c
index 3dc7e6d..f7cabe3 100644
--- a/wcap/wcap-decode.c
+++ b/wcap/wcap-decode.c
@@ -85,9 +85,7 @@ wcap_decoder_get_frame(struct wcap_decoder *decoder)
{
struct wcap_rectangle *rects;
struct wcap_frame_header *header;
- uint32_t *s;
uint32_t i;
- int width, height;
if (decoder->p == decoder->end)
return 0;
@@ -98,11 +96,8 @@ wcap_decoder_get_frame(struct wcap_decoder *decoder)
rects = (void *) (header + 1);
decoder->p = (uint32_t *) (rects + header->nrects);
- for (i = 0; i < header->nrects; i++) {
- width = rects[i].x2 - rects[i].x1;
- height = rects[i].y2 - rects[i].y1;
+ for (i = 0; i < header->nrects; i++)
wcap_decoder_decode_rectangle(decoder, &rects[i]);
- }
return 1;
}
commit 005d8cd9f7e99cc87dfde63016fdbccd54dfa660
Author: Scott Moreau <oreaus@gmail.com>
Date: Sun Jul 22 18:23:51 2012 -0600
wcap: Declare variable with same sign as convert_to_yv12() expects.
diff --git a/wcap/main.c b/wcap/main.c
index bdbc8cb..09e0aa7 100644
--- a/wcap/main.c
+++ b/wcap/main.c
@@ -132,7 +132,7 @@ convert_to_yv12(struct wcap_decoder *decoder, unsigned char *out)
static void
output_yuv_frame(struct wcap_decoder *decoder)
{
- static char *out;
+ static unsigned char *out;
int size;
size = decoder->width * decoder->height * 3 / 2;
commit 0e696478a9c498594dd285883cb3b8e8522f9640
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Sun Jul 22 15:49:57 2012 -0400
Handle new transform argument in wl_output.geometry event
diff --git a/clients/screenshot.c b/clients/screenshot.c
index 894c4aa..7395bf3 100644
--- a/clients/screenshot.c
+++ b/clients/screenshot.c
@@ -62,7 +62,8 @@ display_handle_geometry(void *data,
int physical_height,
int subpixel,
const char *make,
- const char *model)
+ const char *model,
+ int transform)
{
struct screenshooter_output *output;
diff --git a/clients/window.c b/clients/window.c
index ddad36e..d374ab9 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -3194,7 +3194,8 @@ display_handle_geometry(void *data,
int physical_height,
int subpixel,
const char *make,
- const char *model)
+ const char *model,
+ int transform)
{
struct output *output = data;
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index a0397ad..ee3def1 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -497,7 +497,8 @@ display_handle_geometry(void *data,
int physical_height,
int subpixel,
const char *make,
- const char *model)
+ const char *model,
+ int transform)
{
struct wayland_compositor *c = data;
diff --git a/src/compositor.c b/src/compositor.c
index d29df6a..3f2828e 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2781,7 +2781,8 @@ bind_output(struct wl_client *client,
output->mm_width,
output->mm_height,
output->subpixel,
- output->make, output->model);
+ output->make, output->model,
+ WL_OUTPUT_TRANSFORM_NORMAL);
wl_list_for_each (mode, &output->mode_list, link) {
wl_output_send_mode(resource,
commit c4063f310a35ec1fd51b039243caf5363dfb54f5
Author: Kristian Høgsberg <krh@bitplanet.net>
Date: Sun Jul 22 15:32:45 2012 -0400
xwm: Make override-redirect windows opaque
diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index 64290ec..e67cac1 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -742,7 +742,17 @@ weston_wm_window_schedule_repaint(struct weston_wm_window *window)
{
struct weston_wm *wm = window->wm;
- if (window->frame_id == XCB_WINDOW_NONE || window->repaint_source)
+ if (window->frame_id == XCB_WINDOW_NONE) {
+ if (window->surface != NULL) {
+ window->surface->opaque_rect[0] = 0.0;
+ window->surface->opaque_rect[1] = 1.0;
+ window->surface->opaque_rect[2] = 0.0;
+ window->surface->opaque_rect[3] = 1.0;
+ }
+ return;
+ }
+
+ if (window->repaint_source)
return;
window->repaint_source =
commit ce1baa80977c9c5cad4226a7cee0fa5129686e89
Author: Tiago Vignatti <tiago.vignatti@intel.com>
Date: Fri Jul 20 23:09:55 2012 +0300
xwm: use last focused window for guessing transient parent
On X the global absolute coordinates are sent in ConfigureNotify and transient
windows are mapped exactly on that position. On Wayland we don't have the
concept of global coordinates, and that's a problem for transient surfaces
without transient_for set because they rely on such hint for setting their
positioning.
So this solution is a workaround. It guesses a parent based on the last
focused window to determine the relative position of the transient surface.
This put transient windows of Chrome browser back to work.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index 405244b..64290ec 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -511,6 +511,8 @@ weston_wm_window_activate(struct wl_listener *listener, void *data)
if (wm->focus_window)
weston_wm_window_schedule_repaint(wm->focus_window);
wm->focus_window = window;
+ if (window)
+ wm->focus_latest = window;
if (wm->focus_window)
weston_wm_window_schedule_repaint(wm->focus_window);
}
@@ -1562,7 +1564,7 @@ xserver_map_shell_surface(struct weston_wm *wm,
&wm->server->compositor->shell_interface;
struct weston_wm_window *parent;
struct theme *t = window->wm->theme;
- int x = 0, y = 0;
+ int parent_id, x = 0, y = 0;
if (!shell_interface->create_shell_surface)
return;
@@ -1573,12 +1575,20 @@ xserver_map_shell_surface(struct weston_wm *wm,
&shell_client);
/* ICCCM 4.1.1 */
- if (!window->override_redirect || !window->transient_for) {
+ if (!window->override_redirect) {
shell_interface->set_toplevel(window->shsurf);
return;
}
- parent = hash_table_lookup(wm->window_hash, window->transient_for->id);
+ /* not all non-toplevel has transient_for set. So we need this
+ * workaround to guess a parent that will determine the relative
+ * position of the transient surface */
+ if (!window->transient_for)
+ parent_id = wm->focus_latest->id;
+ else
+ parent_id = window->transient_for->id;
+
+ parent = hash_table_lookup(wm->window_hash, parent_id);
/* non-decorated and non-toplevel windows, e.g. sub-menus */
if (!parent->decorate && parent->override_redirect) {
diff --git a/src/xwayland/xwayland.h b/src/xwayland/xwayland.h
index 7e1ea45..23c6a77 100644
--- a/src/xwayland/xwayland.h
+++ b/src/xwayland/xwayland.h
@@ -57,6 +57,7 @@ struct weston_wm {
struct weston_xserver *server;
xcb_window_t wm_window;
struct weston_wm_window *focus_window;
+ struct weston_wm_window *focus_latest;
struct theme *theme;
xcb_cursor_t *cursors;
int last_cursor;
commit e66fcee4359a5f60bdcf6a79c119ac114dc607d1
Author: Tiago Vignatti <tiago.vignatti@intel.com>
Date: Fri Jul 20 23:09:54 2012 +0300
xwm: Fix transient positioning
Commit eaee7841 took out the configure positioning of windows. This patch
brings it back and addresses also logic for resizing and sub-menus, that was
not covered on that commit.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index e81a229..405244b 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -459,6 +459,7 @@ weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *eve
xcb_configure_notify_event_t *configure_notify =
(xcb_configure_notify_event_t *) event;
struct weston_wm_window *window;
+ int x, y;
window = hash_table_lookup(wm->window_hash, configure_notify->window);
@@ -467,6 +468,14 @@ weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *eve
configure_notify->window,
configure_notify->x, configure_notify->y,
configure_notify->width, configure_notify->height);
+
+ /* resize falls here */
+ if (configure_notify->window != window->id)
+ return;
+
+ weston_wm_window_get_child_position(window, &x, &y);
+ window->x = configure_notify->x - x;
+ window->y = configure_notify->y - y;
}
static void
@@ -1553,6 +1562,7 @@ xserver_map_shell_surface(struct weston_wm *wm,
&wm->server->compositor->shell_interface;
struct weston_wm_window *parent;
struct theme *t = window->wm->theme;
+ int x = 0, y = 0;
if (!shell_interface->create_shell_surface)
return;
@@ -1569,9 +1579,16 @@ xserver_map_shell_surface(struct weston_wm *wm,
}
parent = hash_table_lookup(wm->window_hash, window->transient_for->id);
+
+ /* non-decorated and non-toplevel windows, e.g. sub-menus */
Reply to: