From: Kévin THIERRY Date: Mon, 12 May 2014 07:23:48 +0000 (+0200) Subject: Add Tizen patches for Weston X-Git-Tag: demo_release_0.1~132 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05360eab2205b445e24643d8d4acb5e5e4ef6670;p=scm%2Fbb%2Fmeta-tizen.git Add Tizen patches for Weston Signed-off-by: Kévin THIERRY --- diff --git a/recipes-graphics/wayland/weston/0001-Update-to-1.4.0.patch b/recipes-graphics/wayland/weston/0001-Update-to-1.4.0.patch new file mode 100644 index 0000000..b48e777 --- /dev/null +++ b/recipes-graphics/wayland/weston/0001-Update-to-1.4.0.patch @@ -0,0 +1,337 @@ +From 804c40d5e1d0f4a42db1cbc7d6cf0666b82c1e7d Mon Sep 17 00:00:00 2001 +From: Ossama Othman +Date: Wed, 12 Feb 2014 14:17:21 -0800 +Subject: [PATCH 01/10] Update to 1.4.0 + +Change-Id: I17dab833c810374f13cf79672690a09a92ef1fb7 +Signed-off-by: Ossama Othman +--- + .gbs.conf | 3 + + packaging/weston.changes | 104 +++++++++++++++++++++++++++++ + packaging/weston.manifest | 8 +++ + packaging/weston.spec | 164 ++++++++++++++++++++++++++++++++++++++++++++++ + packaging/weston.target | 5 ++ + 5 files changed, 284 insertions(+) + create mode 100644 .gbs.conf + create mode 100644 packaging/weston.changes + create mode 100644 packaging/weston.manifest + create mode 100644 packaging/weston.spec + create mode 100644 packaging/weston.target + +diff --git a/.gbs.conf b/.gbs.conf +new file mode 100644 +index 0000000..fa9fdc5 +--- /dev/null ++++ b/.gbs.conf +@@ -0,0 +1,3 @@ ++[general] ++upstream_branch = upstream ++upstream_tag = ${upstreamversion} +diff --git a/packaging/weston.changes b/packaging/weston.changes +new file mode 100644 +index 0000000..e2beff6 +--- /dev/null ++++ b/packaging/weston.changes +@@ -0,0 +1,104 @@ ++* Wed Feb 12 2014 Ossama Othman 1.4.0@d601bc0 ++- Update to 1.4.0 ++ ++* Tue Jan 21 2014 Ossama Othman accepted/tizen/generic/20140106.132549@36d486f ++- Clarified comment about weston-startup virtual package rationale. ++- weston-launch SMACK exec label is now set in weston systemd unit file. ++- [TIVI-2213] Moved IVI files to weston-ivi and ico-uxf-homescreen-sample-apps. ++ ++* Tue Dec 10 2013 Ossama Othman accepted/tizen/20131204.185237@e803629 ++- v2:Fix [PTREL-522] Weston local build failed for X-Free repo. ++ ++* Mon Dec 02 2013 Ossama Othman accepted/tizen/20131127.212429@21af2d3 ++- build failure fix (remove X dependencies) ++- This vfunc lets us read out a rectangle of pixels from the currently attached surface buffer. ++- Remove cairo-xcb dependency in spec file. ++ ++* Fri Nov 22 2013 Ossama Othman submit/tizen/20131122.063157@9f36b8a ++- Don't build xwayland and xwayland-test ++- Assign weston-launch to the User Smack domain. ++ ++* Wed Nov 06 2013 Ossama Othman 1.3.1@a6a11fb ++- Update to 1.3.1 ++ ++* Thu Oct 17 2013 Ossama Othman 1.3.0@95659c0 ++- Update to 1.3.0 ++ ++* Thu Oct 03 2013 Rusty Lynch accepted/tizen/20130925.220757@8c7ed3e ++- TIVI-1828: Make EFL apps use the wayland-based input method. ++- TIVI-1828: Install weekeyboard.xml app metadata file. ++- TIVI-1919: Associate the Giantec display with HDMI1 ++ ++* Wed Sep 25 2013 Ossama Othman accepted/tizen/20130925.103624@58d1a75 ++- Adding calibration values and bind HDMI output with touch screen of chelong monitor ++ ++* Mon Sep 23 2013 Ossama Othman accepted/tizen/20130918.214754@10eaa44 ++- TIVI-1726: Not add output->x/y when caculating the absolute value of touch postion. ++- We have the calibrator for touch and delete touch quirk ++ ++* Tue Sep 17 2013 Rusty Lynch submit/tizen/20130909.204211@5560428 ++- TIVI-1771: Fix browser metadata so homescreen can find its surface ++- Added DBUS_SESSION_BUS_ADDRESS in /etc/profile.d/weston.sh (Bug TIVI-1686 and other bugs related to dbus) ++ ++* Mon Sep 09 2013 Ossama Othman 1.2.2@59772da ++- Add support for device quirks, such as swapped axes. ++- Add Tizen IVI weston packaging files. ++- Update to 1.2.2 ++ ++* Wed Aug 28 2013 Ossama Othman submit/tizen/20130823.165548@163279b ++- evdev: Initliaze device->link so we can wl_list_remove() without crashing ++- Fix TIVI-1679 ++ ++* Thu Aug 22 2013 Ossama Othman 1.2.0@56c32bd ++- Update to 1.2.1 ++ ++* Thu Aug 01 2013 Ossama Othman submit/tizen/20130726.203035@2a224be ++- Add initial touch support to clients. ++ ++* Fri Jul 26 2013 Rusty Lynch submit/tizen/20130725.223721@872ba32 ++- Add calibration values for chelong display ++ ++* Thu Jul 25 2013 Rusty Lynch accepted/tizen/20130719.063456@cd5293b ++- TIVI-1086: Fix handling of touch device ++- Add a new clients subpackage ++ ++* Wed Jul 24 2013 Rusty Lynch accepted/tizen/20130719.063456@a7bec7a ++- Add a new clients subpackage ++ ++* Tue Jul 16 2013 Ossama Othman 1.2.0@1427ac4 ++- Update to 1.2.0 ++ ++* Thu Jun 27 2013 Rusty Lynch accepted/tizen/20130627.155212@597c6fc ++- TIVI-1063: Disable lockscreen ++ ++* Wed Jun 26 2013 Rusty Lynch submit/tizen/20130624.224834@a4a42d8 ++- Add tizen environment file ++ ++* Mon Jun 24 2013 Rusty Lynch submit/tizen/20130620.235949@109d186 ++- Add udev rule to quirk the touchscreen on Chelong ++- compositor-drm: Add quirk loading from udev ++- evdev: Add support for device quirks and implement axes swapping ++ ++* Thu Jun 20 2013 Rusty Lynch 1.1.1@f7089fb ++- weston-launch: Run weston in the user login shell ++- weston-launch: Don't exit on SIGTERM ++- Update to 1.1.1 ++ ++* Wed Jun 05 2013 Rusty Lynch 1.1.0@9d774db ++- Update to 1.1.0 ++ ++* Thu Apr 11 2013 Anas Nashif submit/trunk/20130411.235236@639026a ++- Also package devel sub-package for header files ++ ++* Thu Apr 11 2013 Anas Nashif 1.0.6@aa865ba ++- Update to 1.0.6 ++ ++* Wed Feb 13 2013 Anas Nashif 1.0.4@d32e140 ++- Update to 1.0.4 ++ ++* Mon Dec 17 2012 Anas Nashif 1.0.3@85b1093 ++- Update to 1.0.3 ++ ++* Fri Nov 30 2012 Anas Nashif 57b751b ++- Update to 1.0.2 ++ +diff --git a/packaging/weston.manifest b/packaging/weston.manifest +new file mode 100644 +index 0000000..da32097 +--- /dev/null ++++ b/packaging/weston.manifest +@@ -0,0 +1,8 @@ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/packaging/weston.spec b/packaging/weston.spec +new file mode 100644 +index 0000000..84d2cb8 +--- /dev/null ++++ b/packaging/weston.spec +@@ -0,0 +1,164 @@ ++%bcond_with wayland ++%bcond_with mobile ++%define _unitdir_user /usr/lib/systemd/user ++ ++%if %{with mobile} ++%define extra_config_options --disable-drm-compositor ++%endif ++ ++Name: weston ++Version: 1.4.0 ++Release: 0 ++Summary: Wayland Compositor Infrastructure ++License: MIT ++Group: Graphics & UI Framework/Wayland Window System ++Url: http://weston.freedesktop.org/ ++ ++#Git-Clone: git://anongit.freedesktop.org/wayland/weston ++#Git-Web: http://cgit.freedesktop.org/wayland/weston/ ++Source0: %name-%version.tar.xz ++Source1: weston.target ++Source1001: weston.manifest ++BuildRequires: autoconf >= 2.64, automake >= 1.11 ++BuildRequires: expat-devel ++BuildRequires: libjpeg-devel ++BuildRequires: libtool >= 2.2 ++BuildRequires: libvpx-devel ++BuildRequires: pam-devel ++BuildRequires: pkgconfig ++BuildRequires: xz ++BuildRequires: pkgconfig(cairo) ++BuildRequires: pkgconfig(cairo-egl) >= 1.11.3 ++BuildRequires: pkgconfig(egl) >= 7.10 ++BuildRequires: pkgconfig(gbm) ++BuildRequires: pkgconfig(gio-2.0) ++BuildRequires: pkgconfig(glesv2) ++BuildRequires: pkgconfig(glib-2.0) ++BuildRequires: pkgconfig(gobject-2.0) ++BuildRequires: pkgconfig(libdrm) >= 2.4.30 ++BuildRequires: pkgconfig(libffi) ++BuildRequires: pkgconfig(libsystemd-login) ++BuildRequires: pkgconfig(libudev) >= 136 ++BuildRequires: pkgconfig(mtdev) >= 1.1.0 ++BuildRequires: pkgconfig(pixman-1) ++BuildRequires: pkgconfig(poppler-glib) ++BuildRequires: pkgconfig(wayland-client) ++BuildRequires: pkgconfig(wayland-egl) ++BuildRequires: pkgconfig(wayland-server) ++BuildRequires: pkgconfig(xkbcommon) >= 0.3.0 ++Requires: weston-startup ++Requires(pre): /usr/sbin/groupadd ++ ++%if !%{with wayland} ++ExclusiveArch: ++%endif ++ ++ ++%description ++Weston is the reference implementation of a Wayland compositor, and a ++useful compositor in its own right. Weston has various backends that ++lets it run on Linux kernel modesetting and evdev input as well as ++under X11. Weston ships with a few example clients, from simple ++clients that demonstrate certain aspects of the protocol to more ++complete clients and a simplistic toolkit. There is also a quite ++capable terminal emulator (weston-terminal) and an toy/example ++desktop shell. Finally, weston also provides integration with the ++Xorg server and can pull X clients into the Wayland desktop and act ++as a X window manager. ++ ++ ++%package devel ++Summary: Development files for package %{name} ++Group: Graphics & UI Framework/Development ++%description devel ++This package provides header files and other developer releated files ++for package %{name}. ++ ++%package clients ++Summary: Sample clients for package %{name} ++Group: Graphics & UI Framework/Development ++%description clients ++This package provides a set of example wayland clients useful for ++validating the functionality of wayland with very little dependencies ++on other system components. ++ ++%prep ++%setup -q ++cp %{SOURCE1001} . ++ ++%build ++%autogen --disable-static --disable-setuid-install --enable-simple-clients --enable-clients --disable-libunwind --disable-xwayland --disable-xwayland-test --disable-x11-compositor --disable-rpi-compositor %{?extra_config_options:%extra_config_options} ++make %{?_smp_mflags} ++ ++%install ++%make_install ++ ++# install example clients ++install -m 755 clients/weston-simple-touch %{buildroot}%{_bindir} ++install -m 755 clients/weston-simple-shm %{buildroot}%{_bindir} ++install -m 755 clients/weston-simple-egl %{buildroot}%{_bindir} ++install -m 755 clients/weston-flower %{buildroot}%{_bindir} ++install -m 755 clients/weston-image %{buildroot}%{_bindir} ++install -m 755 clients/weston-cliptest %{buildroot}%{_bindir} ++install -m 755 clients/weston-dnd %{buildroot}%{_bindir} ++install -m 755 clients/weston-smoke %{buildroot}%{_bindir} ++install -m 755 clients/weston-resizor %{buildroot}%{_bindir} ++install -m 755 clients/weston-eventdemo %{buildroot}%{_bindir} ++install -m 755 clients/weston-clickdot %{buildroot}%{_bindir} ++install -m 755 clients/weston-transformed %{buildroot}%{_bindir} ++install -m 755 clients/weston-fullscreen %{buildroot}%{_bindir} ++install -m 755 clients/weston-calibrator %{buildroot}%{_bindir} ++ ++install -d %{buildroot}%{_unitdir_user} ++install -m 644 %{SOURCE1} %{buildroot}%{_unitdir_user}/weston.target ++# The weston.service unit file must be provided by the weston-startup ++# virtual package, i.e. "Provide: weston-startup". The weston-startup ++# virtual package requirement is intended to force Tizen profile ++# maintainers to add the necessary start-up script or systemd unit ++# file to start weston. Otherwise it becomes possible to install ++# weston without an automated means to start weston at boot, which may ++# lead to confusion. This approach allows startup related files to be ++# maintained outside of this weston package. ++ ++%pre ++getent group weston-launch >/dev/null || %{_sbindir}/groupadd -o -r weston-launch ++ ++%docs_package ++ ++%files ++%manifest %{name}.manifest ++%defattr(-,root,root) ++%license COPYING ++%_bindir/wcap-* ++%_bindir/weston ++%_bindir/weston-info ++%attr(4755,root,root) %{_bindir}/weston-launch ++%{_bindir}/weston-terminal ++%_libexecdir/weston-* ++%_libdir/weston ++%_datadir/weston ++%{_unitdir_user}/weston.target ++ ++%files devel ++%manifest %{name}.manifest ++%_includedir/weston/*.h ++%_libdir/pkgconfig/*.pc ++ ++%files clients ++%manifest %{name}.manifest ++%_bindir/weston-simple-touch ++%_bindir/weston-simple-shm ++%_bindir/weston-simple-egl ++%_bindir/weston-flower ++%_bindir/weston-image ++%_bindir/weston-cliptest ++%_bindir/weston-dnd ++%_bindir/weston-smoke ++%_bindir/weston-resizor ++%_bindir/weston-eventdemo ++%_bindir/weston-clickdot ++%_bindir/weston-transformed ++%_bindir/weston-fullscreen ++%_bindir/weston-calibrator ++ ++%changelog +diff --git a/packaging/weston.target b/packaging/weston.target +new file mode 100644 +index 0000000..2717047 +--- /dev/null ++++ b/packaging/weston.target +@@ -0,0 +1,5 @@ ++ ++[Unit] ++Description=Weston Compositor ++Requires=dbus.socket ++AllowIsolate=true +-- +1.8.1.4 + diff --git a/recipes-graphics/wayland/weston/0002-This-vfunc-lets-us-read-out-a-rectangle-of-pixels-fr.patch b/recipes-graphics/wayland/weston/0002-This-vfunc-lets-us-read-out-a-rectangle-of-pixels-fr.patch new file mode 100644 index 0000000..2601548 --- /dev/null +++ b/recipes-graphics/wayland/weston/0002-This-vfunc-lets-us-read-out-a-rectangle-of-pixels-fr.patch @@ -0,0 +1,115 @@ +From 13640d5c849085fa2b099c2d54e656eec8a1318f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= +Date: Wed, 29 Jan 2014 15:55:09 +0900 +Subject: [PATCH 02/10] This vfunc lets us read out a rectangle of pixels from + the currently attached surface buffer. + +Change-Id: Ia12d01fd0d157654602a2c46dd5874218252dd2f +--- + src/compositor.h | 3 +++ + src/gl-renderer.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 57 insertions(+) + +diff --git a/src/compositor.h b/src/compositor.h +index 22a485f..ace75da 100644 +--- a/src/compositor.h ++++ b/src/compositor.h +@@ -540,6 +540,9 @@ struct weston_renderer { + pixman_format_code_t format, void *pixels, + uint32_t x, uint32_t y, + uint32_t width, uint32_t height); ++ int (*read_surface_pixels)(struct weston_surface *es, ++ pixman_format_code_t format, void *pixels, ++ int x, int y, int width, int height); + void (*repaint_output)(struct weston_output *output, + pixman_region32_t *output_damage); + void (*flush_damage)(struct weston_surface *surface); +diff --git a/src/gl-renderer.c b/src/gl-renderer.c +index 0e5afbe..dca2e05 100644 +--- a/src/gl-renderer.c ++++ b/src/gl-renderer.c +@@ -106,6 +106,8 @@ struct gl_renderer { + EGLContext egl_context; + EGLConfig egl_config; + ++ GLuint fbo; ++ + struct wl_array vertices; + struct wl_array vtxcnt; + +@@ -585,6 +587,54 @@ out: + pixman_region32_fini(&repaint); + } + ++static int ++gl_renderer_read_surface_pixels(struct weston_surface *es, ++ pixman_format_code_t format, void *pixels, ++ int x, int y, int width, int height) ++{ ++ struct weston_buffer *buffer = es->buffer_ref.buffer; ++ struct weston_compositor *ec = es->compositor; ++ struct gl_renderer *gr = get_renderer(ec); ++ struct gl_surface_state *gs = get_surface_state(es); ++ GLenum gl_format; ++ int size; ++ struct wl_shm_buffer *shm_buffer = NULL; ++ ++ switch (format) { ++ case PIXMAN_a8r8g8b8: ++ gl_format = GL_BGRA_EXT; ++ break; ++ case PIXMAN_a8b8g8r8: ++ gl_format = GL_RGBA; ++ break; ++ default: ++ return -1; ++ } ++ ++ if (buffer) { ++ shm_buffer = wl_shm_buffer_get(buffer->resource); ++ } ++ if (shm_buffer) { ++ size = buffer->width * 4 * buffer->height; ++ memcpy(pixels, wl_shm_buffer_get_data(shm_buffer), size); ++ } else { ++ if (gr->fbo == 0) ++ glGenFramebuffers(1, &gr->fbo); ++ glBindFramebuffer(GL_FRAMEBUFFER, gr->fbo); ++ glFramebufferTexture2D(GL_FRAMEBUFFER, ++ GL_COLOR_ATTACHMENT0, ++ GL_TEXTURE_2D, ++ gs->textures[0], 0); ++ ++ glReadPixels(x, y, width, height, ++ gl_format, GL_UNSIGNED_BYTE, pixels); ++ ++ glBindFramebuffer(GL_FRAMEBUFFER, 0); ++ } ++ ++ return 0; ++} ++ + static void + repaint_views(struct weston_output *output, pixman_region32_t *damage) + { +@@ -1602,6 +1652,9 @@ gl_renderer_destroy(struct weston_compositor *ec) + + wl_signal_emit(&gr->destroy_signal, gr); + ++ if (gr->fbo) ++ glDeleteFramebuffers(1, &gr->fbo); ++ + if (gr->has_bind_display) + gr->unbind_display(gr->egl_display, ec->wl_display); + +@@ -1699,6 +1752,7 @@ gl_renderer_create(struct weston_compositor *ec, EGLNativeDisplayType display, + return -1; + + gr->base.read_pixels = gl_renderer_read_pixels; ++ gr->base.read_surface_pixels = gl_renderer_read_surface_pixels; + gr->base.repaint_output = gl_renderer_repaint_output; + gr->base.flush_damage = gl_renderer_flush_damage; + gr->base.attach = gl_renderer_attach; +-- +1.8.1.4 + diff --git a/recipes-graphics/wayland/weston/0003-compositor-implement-xdg_surface_set_minimized.patch b/recipes-graphics/wayland/weston/0003-compositor-implement-xdg_surface_set_minimized.patch new file mode 100644 index 0000000..7590c6a --- /dev/null +++ b/recipes-graphics/wayland/weston/0003-compositor-implement-xdg_surface_set_minimized.patch @@ -0,0 +1,132 @@ +From cb6dd95704b8dbf2344d0c5008e0739cf8740438 Mon Sep 17 00:00:00 2001 +From: Manuel Bachmann +Date: Wed, 26 Feb 2014 16:43:59 +0100 +Subject: [PATCH 03/10] compositor: implement xdg_surface_set_minimized() + +We now handle the client-side xdg_surface_set_minimized() +call, and eventually hide the target surface by moving it +to a dedicated layer. + +Bug-Tizen: TIVI-2792 +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53214 +Origin: http://lists.freedesktop.org/archives/wayland-devel/2014-February/013471.html + +Change-Id: I4894a9c384ecae8ef1d3f37b84d4d8eb1594a1a1 +Signed-off-by: Manuel Bachmann +--- + desktop-shell/shell.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++- + desktop-shell/shell.h | 2 ++ + 2 files changed, 65 insertions(+), 1 deletion(-) + +diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c +index c275543..b8cd32b 100644 +--- a/desktop-shell/shell.c ++++ b/desktop-shell/shell.c +@@ -2383,6 +2383,53 @@ unset_maximized(struct shell_surface *shsurf) + } + + static void ++set_minimized(struct weston_surface *surface, uint32_t is_true) ++{ ++ struct shell_surface *shsurf; ++ struct workspace *current_ws; ++ struct weston_seat *seat; ++ struct weston_surface *focus; ++ struct weston_view *view; ++ ++ view = get_default_view(surface); ++ if (!view) ++ return; ++ ++ assert(weston_surface_get_main_surface(view->surface) == view->surface); ++ ++ shsurf = get_shell_surface(surface); ++ current_ws = get_current_workspace(shsurf->shell); ++ ++ wl_list_remove(&view->layer_link); ++ /* hide or show, depending on the state */ ++ if (is_true) { ++ wl_list_insert(&shsurf->shell->minimized_layer.view_list, &view->layer_link); ++ ++ drop_focus_state(shsurf->shell, current_ws, view->surface); ++ wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) { ++ if (!seat->keyboard) ++ continue; ++ focus = weston_surface_get_main_surface(seat->keyboard->focus); ++ if (focus == view->surface) ++ weston_keyboard_set_focus(seat->keyboard, NULL); ++ } ++ } ++ else { ++ wl_list_insert(¤t_ws->layer.view_list, &view->layer_link); ++ ++ wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) { ++ if (!seat->keyboard) ++ continue; ++ activate(shsurf->shell, view->surface, seat); ++ } ++ } ++ ++ shell_surface_update_child_surface_layers(shsurf); ++ ++ weston_view_damage_below(view); ++} ++ ++static void + shell_surface_set_maximized(struct wl_client *client, + struct wl_resource *resource, + struct wl_resource *output_resource) +@@ -3251,6 +3298,19 @@ xdg_surface_unset_maximized(struct wl_client *client, + shsurf->client->send_configure(shsurf->surface, 0, width, height); + } + ++static void ++xdg_surface_set_minimized(struct wl_client *client, ++ struct wl_resource *resource) ++{ ++ struct shell_surface *shsurf = wl_resource_get_user_data(resource); ++ ++ if (shsurf->type != SHELL_SURFACE_TOPLEVEL) ++ return; ++ ++ /* apply compositor's own minimization logic (hide) */ ++ set_minimized(shsurf->surface, 1); ++} ++ + static const struct xdg_surface_interface xdg_surface_implementation = { + xdg_surface_destroy, + xdg_surface_set_transient_for, +@@ -3264,7 +3324,7 @@ static const struct xdg_surface_interface xdg_surface_implementation = { + xdg_surface_unset_fullscreen, + xdg_surface_set_maximized, + xdg_surface_unset_maximized, +- NULL /* set_minimized */ ++ xdg_surface_set_minimized + }; + + static void +@@ -5673,6 +5733,8 @@ module_init(struct weston_compositor *ec, + } + activate_workspace(shell, 0); + ++ weston_layer_init(&shell->minimized_layer, NULL); ++ + wl_list_init(&shell->workspaces.anim_sticky_list); + wl_list_init(&shell->workspaces.animation.link); + shell->workspaces.animation.frame = animate_workspace_change_frame; +diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h +index dbb2854..e89fc9c 100644 +--- a/desktop-shell/shell.h ++++ b/desktop-shell/shell.h +@@ -183,6 +183,8 @@ struct desktop_shell { + enum animation_type startup_animation_type; + enum animation_type focus_animation_type; + ++ struct weston_layer minimized_layer; ++ + struct wl_listener output_create_listener; + struct wl_list output_list; + +-- +1.8.1.4 + diff --git a/recipes-graphics/wayland/weston/0004-compositor-use-Mod-Tab-to-show-raise-minimized-surfa.patch b/recipes-graphics/wayland/weston/0004-compositor-use-Mod-Tab-to-show-raise-minimized-surfa.patch new file mode 100644 index 0000000..0537d47 --- /dev/null +++ b/recipes-graphics/wayland/weston/0004-compositor-use-Mod-Tab-to-show-raise-minimized-surfa.patch @@ -0,0 +1,80 @@ +From 8b5c42d8c95bf4b3f25ad767e0eb15b6b2c6710e Mon Sep 17 00:00:00 2001 +From: Manuel Bachmann +Date: Wed, 26 Feb 2014 17:11:22 +0100 +Subject: [PATCH 04/10] compositor: use Mod-Tab to show/raise minimized + surfaces + +Temporarily show minimized surfaces when switching between +surfaces with the keyboard. If the final selected one was +minimized, it will be restored. + +Bug-Tizen: TIVI-2792 +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53214 +Origin: http://lists.freedesktop.org/archives/wayland-devel/2014-February/013471.html + +Change-Id: I895f8d42bd89827b1a857f07bd20c5d62bc7a63a +Signed-off-by: Manuel Bachmann +--- + desktop-shell/shell.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c +index b8cd32b..2790a2a 100644 +--- a/desktop-shell/shell.c ++++ b/desktop-shell/shell.c +@@ -5085,6 +5085,7 @@ struct switcher { + struct weston_surface *current; + struct wl_listener listener; + struct weston_keyboard_grab grab; ++ struct wl_array minimized_array; + }; + + static void +@@ -5095,6 +5096,16 @@ switcher_next(struct switcher *switcher) + struct shell_surface *shsurf; + struct workspace *ws = get_current_workspace(switcher->shell); + ++ /* temporary re-display minimized surfaces */ ++ struct weston_view *tmp; ++ struct weston_view **minimized; ++ wl_list_for_each_safe(view, tmp, &switcher->shell->minimized_layer.view_list, layer_link) { ++ wl_list_remove(&view->layer_link); ++ wl_list_insert(&ws->layer.view_list, &view->layer_link); ++ minimized = wl_array_add(&switcher->minimized_array, sizeof *minimized); ++ *minimized = view; ++ } ++ + wl_list_for_each(view, &ws->layer.view_list, layer_link) { + shsurf = get_shell_surface(view->surface); + if (shsurf && +@@ -5166,6 +5177,19 @@ switcher_destroy(struct switcher *switcher) + weston_keyboard_end_grab(keyboard); + if (keyboard->input_method_resource) + keyboard->grab = &keyboard->input_method_grab; ++ ++ /* re-hide surfaces that were temporary shown during the switch */ ++ struct weston_view **minimized; ++ wl_array_for_each(minimized, &switcher->minimized_array) { ++ /* with the exception of the current selected */ ++ if ((*minimized)->surface != switcher->current) { ++ wl_list_remove(&(*minimized)->layer_link); ++ wl_list_insert(&switcher->shell->minimized_layer.view_list, &(*minimized)->layer_link); ++ weston_view_damage_below(*minimized); ++ } ++ } ++ wl_array_release(&switcher->minimized_array); ++ + free(switcher); + } + +@@ -5218,6 +5242,7 @@ switcher_binding(struct weston_seat *seat, uint32_t time, uint32_t key, + switcher->current = NULL; + switcher->listener.notify = switcher_handle_surface_destroy; + wl_list_init(&switcher->listener.link); ++ wl_array_init(&switcher->minimized_array); + + restore_all_output_modes(shell->compositor); + lower_fullscreen_layer(switcher->shell); +-- +1.8.1.4 + diff --git a/recipes-graphics/wayland/weston/0005-toytoolkit-totally-switch-to-xdg-shell-protocol.patch b/recipes-graphics/wayland/weston/0005-toytoolkit-totally-switch-to-xdg-shell-protocol.patch new file mode 100644 index 0000000..3305456 --- /dev/null +++ b/recipes-graphics/wayland/weston/0005-toytoolkit-totally-switch-to-xdg-shell-protocol.patch @@ -0,0 +1,640 @@ +From 12578261ae9027f89ebfcfcc326e2757c253e4a2 Mon Sep 17 00:00:00 2001 +From: Manuel Bachmann +Date: Wed, 26 Feb 2014 17:59:19 +0100 +Subject: [PATCH 05/10] toytoolkit: totally switch to xdg-shell protocol + +Totally switch toytoolkit to xdg-shell instead of wl_shell, +so each state (maximization, minimization...) is correctly +handled. + +Bug-Tizen: TIVI-2792 +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53214 + +Change-Id: I68175a8a40709a6558bed9111ce2c61654d21e6a +Signed-off-by: Manuel Bachmann +--- + clients/Makefile.am | 8 +- + clients/fullscreen.c | 9 -- + clients/transformed.c | 2 - + clients/window.c | 255 ++++++++++++++++++++++++++--------------------- + clients/window.h | 3 + + desktop-shell/shell.c | 11 +- + packaging/weston.changes | 6 ++ + 7 files changed, 167 insertions(+), 127 deletions(-) + +diff --git a/clients/Makefile.am b/clients/Makefile.am +index 4f8d4a6..6052503 100644 +--- a/clients/Makefile.am ++++ b/clients/Makefile.am +@@ -91,7 +91,9 @@ libtoytoolkit_la_SOURCES = \ + scaler-protocol.c \ + scaler-client-protocol.h \ + workspaces-protocol.c \ +- workspaces-client-protocol.h ++ workspaces-client-protocol.h \ ++ xdg-shell-protocol.c \ ++ xdg-shell-client-protocol.h + + libtoytoolkit_la_LIBADD = \ + $(CLIENT_LIBS) \ +@@ -218,7 +220,9 @@ BUILT_SOURCES = \ + scaler-client-protocol.h \ + scaler-protocol.c \ + workspaces-client-protocol.h \ +- workspaces-protocol.c ++ workspaces-protocol.c \ ++ xdg-shell-client-protocol.h \ ++ xdg-shell-protocol.c + + CLEANFILES = $(BUILT_SOURCES) + endif +diff --git a/clients/fullscreen.c b/clients/fullscreen.c +index 034a352..0f49cbb 100644 +--- a/clients/fullscreen.c ++++ b/clients/fullscreen.c +@@ -222,13 +222,6 @@ key_handler(struct window *window, struct input *input, uint32_t time, + fullscreen->width, fullscreen->height); + break; + +- case XKB_KEY_m: +- fullscreen->fullscreen_method = (fullscreen->fullscreen_method + 1) % 4; +- window_set_fullscreen_method(fullscreen->window, +- fullscreen->fullscreen_method); +- window_schedule_redraw(window); +- break; +- + case XKB_KEY_f: + fullscreen->fullscreen ^= 1; + window_set_fullscreen(window, fullscreen->fullscreen); +@@ -338,8 +331,6 @@ int main(int argc, char *argv[]) + window_add_widget(fullscreen.window, &fullscreen); + + window_set_title(fullscreen.window, "Fullscreen"); +- window_set_fullscreen_method(fullscreen.window, +- fullscreen.fullscreen_method); + + widget_set_transparent(fullscreen.widget, 0); + widget_set_default_cursor(fullscreen.widget, CURSOR_LEFT_PTR); +diff --git a/clients/transformed.c b/clients/transformed.c +index bbc1dc0..e4b55ea 100644 +--- a/clients/transformed.c ++++ b/clients/transformed.c +@@ -286,8 +286,6 @@ int main(int argc, char *argv[]) + window_add_widget(transformed.window, &transformed); + + window_set_title(transformed.window, "Transformed"); +- window_set_fullscreen_method(transformed.window, +- transformed.fullscreen_method); + + widget_set_transparent(transformed.widget, 0); + widget_set_default_cursor(transformed.widget, CURSOR_BLANK); +diff --git a/clients/window.c b/clients/window.c +index d8d79d0..c8287e2 100644 +--- a/clients/window.c ++++ b/clients/window.c +@@ -68,6 +68,7 @@ typedef void *EGLContext; + #include "text-cursor-position-client-protocol.h" + #include "workspaces-client-protocol.h" + #include "../shared/os-compatibility.h" ++#include "xdg-shell-client-protocol.h" + + #include "window.h" + +@@ -85,11 +86,11 @@ struct display { + struct wl_registry *registry; + struct wl_compositor *compositor; + struct wl_subcompositor *subcompositor; +- struct wl_shell *shell; + struct wl_shm *shm; + struct wl_data_device_manager *data_device_manager; + struct text_cursor_position *text_cursor_position; + struct workspace_manager *workspace_manager; ++ struct xdg_shell *xdg_shell; + EGLDisplay dpy; + EGLConfig argb_config; + EGLContext argb_ctx; +@@ -251,7 +252,8 @@ struct window { + window_output_handler_t output_handler; + + struct surface *main_surface; +- struct wl_shell_surface *shell_surface; ++ struct xdg_surface *xdg_surface; ++ struct xdg_popup *xdg_popup; + + struct window_frame *frame; + +@@ -1375,11 +1377,8 @@ window_flush(struct window *window) + { + struct surface *surface; + +- if (window->type == TYPE_NONE) { ++ if (window->type == TYPE_NONE) + window->type = TYPE_TOPLEVEL; +- if (window->shell_surface) +- wl_shell_surface_set_toplevel(window->shell_surface); +- } + + wl_list_for_each(surface, &window->subsurface_list, link) { + if (surface == window->main_surface) +@@ -1552,8 +1551,10 @@ window_destroy(struct window *window) + if (window->frame) + window_frame_destroy(window->frame); + +- if (window->shell_surface) +- wl_shell_surface_destroy(window->shell_surface); ++ if (window->xdg_surface) ++ xdg_surface_destroy(window->xdg_surface); ++ if (window->xdg_popup) ++ xdg_popup_destroy(window->xdg_popup); + + surface_destroy(window->main_surface); + +@@ -2294,13 +2295,7 @@ frame_menu_func(struct window *window, + struct display *display; + + switch (index) { +- case 0: /* close */ +- if (window->close_handler) +- window->close_handler(window->user_data); +- else +- display_exit(window->display); +- break; +- case 1: /* move to workspace above */ ++ case 0: /* move to workspace above */ + display = window->display; + if (display->workspace > 0) + workspace_manager_move_surface( +@@ -2308,7 +2303,7 @@ frame_menu_func(struct window *window, + window->main_surface->surface, + display->workspace - 1); + break; +- case 2: /* move to workspace below */ ++ case 1: /* move to workspace below */ + display = window->display; + if (display->workspace < display->workspace_count - 1) + workspace_manager_move_surface( +@@ -2316,7 +2311,7 @@ frame_menu_func(struct window *window, + window->main_surface->surface, + display->workspace + 1); + break; +- case 3: /* fullscreen */ ++ case 2: /* fullscreen */ + /* we don't have a way to get out of fullscreen for now */ + if (window->fullscreen_handler) + window->fullscreen_handler(window, window->user_data); +@@ -2332,7 +2327,6 @@ window_show_frame_menu(struct window *window, + int count; + + static const char *entries[] = { +- "Close", + "Move to workspace above", "Move to workspace below", + "Fullscreen" + }; +@@ -2398,8 +2392,10 @@ frame_handle_status(struct window_frame *frame, struct input *input, + if (status & FRAME_STATUS_REPAINT) + widget_schedule_redraw(frame->widget); + +- if (status & FRAME_STATUS_MINIMIZE) +- fprintf(stderr,"Minimize stub\n"); ++ if (status & FRAME_STATUS_MINIMIZE) { ++ window_set_minimized(window); ++ frame_status_clear(frame->frame, FRAME_STATUS_MINIMIZE); ++ } + + if (status & FRAME_STATUS_MENU) { + window_show_frame_menu(window, input, time); +@@ -2419,23 +2415,23 @@ frame_handle_status(struct window_frame *frame, struct input *input, + return; + } + +- if ((status & FRAME_STATUS_MOVE) && window->shell_surface) { ++ if ((status & FRAME_STATUS_MOVE) && window->xdg_surface) { + input_ungrab(input); +- wl_shell_surface_move(window->shell_surface, +- input_get_seat(input), +- window->display->serial); ++ xdg_surface_move(window->xdg_surface, ++ input_get_seat(input), ++ window->display->serial); + + frame_status_clear(frame->frame, FRAME_STATUS_MOVE); + } + +- if ((status & FRAME_STATUS_RESIZE) && window->shell_surface) { ++ if ((status & FRAME_STATUS_RESIZE) && window->xdg_surface) { + input_ungrab(input); + + window->resizing = 1; +- wl_shell_surface_resize(window->shell_surface, +- input_get_seat(input), +- window->display->serial, +- location); ++ xdg_surface_resize(window->xdg_surface, ++ input_get_seat(input), ++ window->display->serial, ++ location); + + frame_status_clear(frame->frame, FRAME_STATUS_RESIZE); + } +@@ -3668,10 +3664,10 @@ input_receive_selection_data_to_fd(struct input *input, + void + window_move(struct window *window, struct input *input, uint32_t serial) + { +- if (!window->shell_surface) ++ if (!window->xdg_surface) + return; + +- wl_shell_surface_move(window->shell_surface, input->seat, serial); ++ xdg_surface_move(window->xdg_surface, input->seat, serial); + } + + static void +@@ -3880,15 +3876,15 @@ widget_schedule_resize(struct widget *widget, int32_t width, int32_t height) + } + + static void +-handle_ping(void *data, struct wl_shell_surface *shell_surface, +- uint32_t serial) ++handle_surface_ping(void *data, struct xdg_surface *xdg_surface, ++ uint32_t serial) + { +- wl_shell_surface_pong(shell_surface, serial); ++ xdg_surface_pong(xdg_surface, serial); + } + + static void +-handle_configure(void *data, struct wl_shell_surface *shell_surface, +- uint32_t edges, int32_t width, int32_t height) ++handle_surface_configure(void *data, struct xdg_surface *xdg_surface, ++ uint32_t edges, int32_t width, int32_t height) + { + struct window *window = data; + +@@ -3897,35 +3893,55 @@ handle_configure(void *data, struct wl_shell_surface *shell_surface, + } + + static void +-menu_destroy(struct menu *menu) ++handle_surface_request_set_fullscreen(void *data, struct xdg_surface *xdg_surface) + { +- widget_destroy(menu->widget); +- window_destroy(menu->window); +- frame_destroy(menu->frame); +- free(menu); + } + + static void +-handle_popup_done(void *data, struct wl_shell_surface *shell_surface) ++handle_surface_request_unset_fullscreen(void *data, struct xdg_surface *xdg_surface) + { +- struct window *window = data; +- struct menu *menu = window->main_surface->widget->user_data; ++} + +- /* FIXME: Need more context in this event, at least the input +- * device. Or just use wl_callback. And this really needs to +- * be a window vfunc that the menu can set. And we need the +- * time. */ ++static void ++handle_surface_request_set_maximized(void *data, struct xdg_surface *xdg_surface) ++{ ++} + +- input_ungrab(menu->input); +- menu_destroy(menu); ++static void ++handle_surface_request_unset_maximized(void *data, struct xdg_surface *xdg_surface) ++{ ++} ++ ++static void ++handle_surface_focused_set(void *data, struct xdg_surface *xdg_surface) ++{ ++} ++ ++static void ++handle_surface_focused_unset(void *data, struct xdg_surface *xdg_surface) ++{ + } + +-static const struct wl_shell_surface_listener shell_surface_listener = { +- handle_ping, +- handle_configure, +- handle_popup_done ++static const struct xdg_surface_listener xdg_surface_listener = { ++ handle_surface_ping, ++ handle_surface_configure, ++ handle_surface_request_set_fullscreen, ++ handle_surface_request_unset_fullscreen, ++ handle_surface_request_set_maximized, ++ handle_surface_request_unset_maximized, ++ handle_surface_focused_set, ++ handle_surface_focused_unset + }; + ++static void ++menu_destroy(struct menu *menu) ++{ ++ widget_destroy(menu->widget); ++ window_destroy(menu->window); ++ frame_destroy(menu->frame); ++ free(menu); ++} ++ + void + window_get_allocation(struct window *window, + struct rectangle *allocation) +@@ -4125,7 +4141,7 @@ window_defer_redraw_until_configure(struct window* window) + void + window_set_fullscreen(struct window *window, int fullscreen) + { +- if (!window->display->shell) ++ if (!window->xdg_surface) + return; + + if ((window->type == TYPE_FULLSCREEN) == fullscreen) +@@ -4133,35 +4149,20 @@ window_set_fullscreen(struct window *window, int fullscreen) + + if (fullscreen) { + window->saved_type = window->type; +- if (window->type == TYPE_TOPLEVEL) { +- window->saved_allocation = window->main_surface->allocation; +- } + window->type = TYPE_FULLSCREEN; +- wl_shell_surface_set_fullscreen(window->shell_surface, +- window->fullscreen_method, +- 0, NULL); ++ xdg_surface_set_fullscreen(window->xdg_surface); + window_defer_redraw_until_configure (window); + } else { + if (window->saved_type == TYPE_MAXIMIZED) { + window_set_maximized(window, 1); + } else { + window->type = TYPE_TOPLEVEL; +- wl_shell_surface_set_toplevel(window->shell_surface); +- window_schedule_resize(window, +- window->saved_allocation.width, +- window->saved_allocation.height); ++ xdg_surface_unset_fullscreen(window->xdg_surface); + } + + } + } + +-void +-window_set_fullscreen_method(struct window *window, +- enum wl_shell_surface_fullscreen_method method) +-{ +- window->fullscreen_method = method; +-} +- + int + window_is_maximized(struct window *window) + { +@@ -4171,31 +4172,34 @@ window_is_maximized(struct window *window) + void + window_set_maximized(struct window *window, int maximized) + { +- if (!window->display->shell) ++ if (!window->xdg_surface) + return; + + if ((window->type == TYPE_MAXIMIZED) == maximized) + return; + + if (window->type == TYPE_TOPLEVEL) { +- window->saved_allocation = window->main_surface->allocation; +- wl_shell_surface_set_maximized(window->shell_surface, NULL); +- window->type = TYPE_MAXIMIZED; +- window_defer_redraw_until_configure(window); +- } else if (window->type == TYPE_FULLSCREEN) { +- wl_shell_surface_set_maximized(window->shell_surface, NULL); ++ xdg_surface_set_maximized(window->xdg_surface); + window->type = TYPE_MAXIMIZED; + window_defer_redraw_until_configure(window); +- } else { +- wl_shell_surface_set_toplevel(window->shell_surface); ++ } else if (window->type == TYPE_MAXIMIZED) { ++ xdg_surface_unset_maximized(window->xdg_surface); + window->type = TYPE_TOPLEVEL; +- window_schedule_resize(window, +- window->saved_allocation.width, +- window->saved_allocation.height); ++ window_defer_redraw_until_configure(window); + } + } + + void ++window_set_minimized(struct window *window) ++{ ++ if (!window->xdg_surface) ++ return; ++ ++ xdg_surface_set_minimized(window->xdg_surface); ++ window_defer_redraw_until_configure(window); ++} ++ ++void + window_set_user_data(struct window *window, void *data) + { + window->user_data = data; +@@ -4263,8 +4267,8 @@ window_set_title(struct window *window, const char *title) + frame_set_title(window->frame->frame, title); + widget_schedule_redraw(window->frame->widget); + } +- if (window->shell_surface) +- wl_shell_surface_set_title(window->shell_surface, title); ++ if (window->xdg_surface) ++ xdg_surface_set_title(window->xdg_surface, title); + } + + const char * +@@ -4389,11 +4393,11 @@ window_create_internal(struct display *display, int type) + surface = surface_create(window); + window->main_surface = surface; + +- if (type != TYPE_CUSTOM && display->shell) { +- window->shell_surface = +- wl_shell_get_shell_surface(display->shell, +- surface->surface); +- fail_on_null(window->shell_surface); ++ if (type != TYPE_CUSTOM && type != TYPE_MENU && display->xdg_shell) { ++ window->xdg_surface = ++ xdg_shell_get_xdg_surface(display->xdg_shell, ++ surface->surface); ++ fail_on_null(window->xdg_surface); + } + + window->type = type; +@@ -4414,10 +4418,10 @@ window_create_internal(struct display *display, int type) + wl_list_insert(display->window_list.prev, &window->link); + wl_list_init(&window->redraw_task.link); + +- if (window->shell_surface) { +- wl_shell_surface_set_user_data(window->shell_surface, window); +- wl_shell_surface_add_listener(window->shell_surface, +- &shell_surface_listener, window); ++ if (window->xdg_surface) { ++ xdg_surface_set_user_data(window->xdg_surface, window); ++ xdg_surface_add_listener(window->xdg_surface, ++ &xdg_surface_listener, window); + } + + wl_list_init (&window->window_output_list); +@@ -4445,14 +4449,10 @@ window_create_transient(struct display *display, struct window *parent, + + window = window_create_internal(parent->display, TYPE_TRANSIENT); + +- window->x = x; +- window->y = y; +- +- if (display->shell) +- wl_shell_surface_set_transient( +- window->shell_surface, +- parent->main_surface->surface, +- window->x, window->y, flags); ++ if (display->xdg_shell) ++ xdg_surface_set_transient_for( ++ window->xdg_surface, ++ parent->main_surface->surface); + + return window; + } +@@ -4567,6 +4567,27 @@ menu_redraw_handler(struct widget *widget, void *data) + cairo_destroy(cr); + } + ++static void ++handle_popup_ping(void *data, struct xdg_popup *xdg_popup, uint32_t serial) ++{ ++ xdg_popup_pong(xdg_popup, serial); ++} ++ ++static void ++handle_popup_popup_done(void *data, struct xdg_popup *xdg_popup, uint32_t serial) ++{ ++ struct window *window = data; ++ struct menu *menu = window->main_surface->widget->user_data; ++ ++ input_ungrab(menu->input); ++ menu_destroy(menu); ++} ++ ++static const struct xdg_popup_listener xdg_popup_listener = { ++ handle_popup_ping, ++ handle_popup_popup_done ++}; ++ + void + window_show_menu(struct display *display, + struct input *input, uint32_t time, struct window *parent, +@@ -4621,10 +4642,19 @@ window_show_menu(struct display *display, + frame_height(menu->frame)); + + frame_interior(menu->frame, &ix, &iy, NULL, NULL); +- wl_shell_surface_set_popup(window->shell_surface, input->seat, +- display_get_serial(window->display), +- parent->main_surface->surface, +- window->x - ix, window->y - iy, 0); ++ window->xdg_popup = xdg_shell_get_xdg_popup(display->xdg_shell, ++ window->main_surface->surface, ++ parent->main_surface->surface, ++ input->seat, ++ display_get_serial(window->display), ++ window->x - ix, ++ window->y - iy, ++ 0); ++ fail_on_null(window->xdg_popup); ++ ++ xdg_popup_set_user_data(window->xdg_popup, window); ++ xdg_popup_add_listener(window->xdg_popup, ++ &xdg_popup_listener, window); + } + + void +@@ -4996,9 +5026,10 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t id, + } else if (strcmp(interface, "wl_seat") == 0) { + d->seat_version = version; + display_add_input(d, id); +- } else if (strcmp(interface, "wl_shell") == 0) { +- d->shell = wl_registry_bind(registry, +- id, &wl_shell_interface, 1); ++ } else if (strcmp(interface, "xdg_shell") == 0) { ++ d->xdg_shell = wl_registry_bind(registry, ++ id, &xdg_shell_interface, 1); ++ xdg_shell_use_unstable_version(d->xdg_shell, XDG_SHELL_VERSION_CURRENT); + } else if (strcmp(interface, "wl_shm") == 0) { + d->shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); + wl_shm_add_listener(d->shm, &shm_listener, d); +@@ -5312,8 +5343,8 @@ display_destroy(struct display *display) + if (display->subcompositor) + wl_subcompositor_destroy(display->subcompositor); + +- if (display->shell) +- wl_shell_destroy(display->shell); ++ if (display->xdg_shell) ++ xdg_shell_destroy(display->xdg_shell); + + if (display->shm) + wl_shm_destroy(display->shm); +diff --git a/clients/window.h b/clients/window.h +index dec133f..54b848b 100644 +--- a/clients/window.h ++++ b/clients/window.h +@@ -381,6 +381,9 @@ void + window_set_maximized(struct window *window, int maximized); + + void ++window_set_minimized(struct window *window); ++ ++void + window_set_user_data(struct window *window, void *data); + + void * +diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c +index 2790a2a..962dde0 100644 +--- a/desktop-shell/shell.c ++++ b/desktop-shell/shell.c +@@ -2492,7 +2492,7 @@ set_surface_type(struct shell_surface *shsurf) + + switch (shsurf->type) { + case SHELL_SURFACE_TOPLEVEL: +- if (shsurf->state.maximized || shsurf->state.fullscreen) { ++ if (shsurf->state.fullscreen) { + set_full_output(shsurf); + } else if (shsurf->state.relative && pev) { + weston_view_set_position(shsurf->view, +@@ -3266,8 +3266,15 @@ xdg_surface_set_maximized(struct wl_client *client, + if (shsurf->type != SHELL_SURFACE_TOPLEVEL) + return; + +- if (!shsurf->next_state.maximized) ++ if (!shsurf->next_state.maximized) { ++ shsurf->saved_x = shsurf->view->geometry.x; ++ shsurf->saved_y = shsurf->view->geometry.y; ++ shsurf->saved_width = shsurf->surface->width; ++ shsurf->saved_height = shsurf->surface->height; ++ shsurf->saved_size_valid = true; ++ shsurf->saved_position_valid = true; + set_maximized(shsurf, NULL); ++ } + } + + static void +diff --git a/packaging/weston.changes b/packaging/weston.changes +index e2beff6..6a35d43 100644 +--- a/packaging/weston.changes ++++ b/packaging/weston.changes +@@ -1,3 +1,9 @@ ++* Wed Mar 05 2014 Ossama Othman accepted/tizen/mobile/20140227.071827@0aaa2e4 ++- toytoolkit: totally switch to xdg-shell protocol ++- compositor: use Mod-Tab to show/raise minimized surfaces ++- compositor: implement xdg_surface_set_minimized() ++- This vfunc lets us read out a rectangle of pixels from the currently attached surface buffer. ++ + * Wed Feb 12 2014 Ossama Othman 1.4.0@d601bc0 + - Update to 1.4.0 + +-- +1.8.1.4 + diff --git a/recipes-graphics/wayland/weston/0006-packaging-add-weston-editor-weston-subsurfaces-clien.patch b/recipes-graphics/wayland/weston/0006-packaging-add-weston-editor-weston-subsurfaces-clien.patch new file mode 100644 index 0000000..c81f7fc --- /dev/null +++ b/recipes-graphics/wayland/weston/0006-packaging-add-weston-editor-weston-subsurfaces-clien.patch @@ -0,0 +1,56 @@ +From c4be9bb5d281a7dad9fc409cde43cab349a369b0 Mon Sep 17 00:00:00 2001 +From: Manuel Bachmann +Date: Thu, 6 Mar 2014 12:22:25 +0100 +Subject: [PATCH 06/10] packaging: add weston-editor & weston-subsurfaces + clients. + +The editor client has virtual keyboard API, and subsurfaces +the new subsurfaces API. + +Change-Id: I41bb14bb673a1c3bf9d6b063ec038885e9d94621 +Signed-off-by: Manuel Bachmann +--- + packaging/weston.spec | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/packaging/weston.spec b/packaging/weston.spec +index 84d2cb8..aeb57af 100644 +--- a/packaging/weston.spec ++++ b/packaging/weston.spec +@@ -40,6 +40,7 @@ BuildRequires: pkgconfig(libffi) + BuildRequires: pkgconfig(libsystemd-login) + BuildRequires: pkgconfig(libudev) >= 136 + BuildRequires: pkgconfig(mtdev) >= 1.1.0 ++BuildRequires: pkgconfig(pangocairo) + BuildRequires: pkgconfig(pixman-1) + BuildRequires: pkgconfig(poppler-glib) + BuildRequires: pkgconfig(wayland-client) +@@ -101,10 +102,12 @@ install -m 755 clients/weston-flower %{buildroot}%{_bindir} + install -m 755 clients/weston-image %{buildroot}%{_bindir} + install -m 755 clients/weston-cliptest %{buildroot}%{_bindir} + install -m 755 clients/weston-dnd %{buildroot}%{_bindir} ++install -m 755 clients/weston-editor %{buildroot}%{_bindir} + install -m 755 clients/weston-smoke %{buildroot}%{_bindir} + install -m 755 clients/weston-resizor %{buildroot}%{_bindir} + install -m 755 clients/weston-eventdemo %{buildroot}%{_bindir} + install -m 755 clients/weston-clickdot %{buildroot}%{_bindir} ++install -m 755 clients/weston-subsurfaces %{buildroot}%{_bindir} + install -m 755 clients/weston-transformed %{buildroot}%{_bindir} + install -m 755 clients/weston-fullscreen %{buildroot}%{_bindir} + install -m 755 clients/weston-calibrator %{buildroot}%{_bindir} +@@ -153,10 +156,12 @@ getent group weston-launch >/dev/null || %{_sbindir}/groupadd -o -r weston-launc + %_bindir/weston-image + %_bindir/weston-cliptest + %_bindir/weston-dnd ++%_bindir/weston-editor + %_bindir/weston-smoke + %_bindir/weston-resizor + %_bindir/weston-eventdemo + %_bindir/weston-clickdot ++%_bindir/weston-subsurfaces + %_bindir/weston-transformed + %_bindir/weston-fullscreen + %_bindir/weston-calibrator +-- +1.8.1.4 + diff --git a/recipes-graphics/wayland/weston/0007-shell-position-input-panel-layer-above-fullscreen-la.patch b/recipes-graphics/wayland/weston/0007-shell-position-input-panel-layer-above-fullscreen-la.patch new file mode 100644 index 0000000..18e869f --- /dev/null +++ b/recipes-graphics/wayland/weston/0007-shell-position-input-panel-layer-above-fullscreen-la.patch @@ -0,0 +1,91 @@ +From d74310237df6e88f6978f5b57b3924e8b4514f37 Mon Sep 17 00:00:00 2001 +From: Manuel Bachmann +Date: Fri, 7 Mar 2014 17:49:07 +0100 +Subject: [PATCH 07/10] shell: position input panel layer above fullscreen + layer + +When a client calls the input panel (weston-keyboard e.g.) +and then goes fullscreen, the panel will not be hidden +anymore. + +Bug-Tizen: TIVI-2228 +Origin: http://lists.freedesktop.org/archives/wayland-devel/2014-March/013523.html + +Change-Id: Ia8bb924a824e1356c28b4bcaf34a7697be6e59c2 +Signed-off-by: Manuel Bachmann +--- + desktop-shell/input-panel.c | 2 +- + desktop-shell/shell.c | 17 +++++++++-------- + packaging/weston.changes | 4 ++++ + 3 files changed, 14 insertions(+), 9 deletions(-) + +diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c +index c08a403..12fe686 100644 +--- a/desktop-shell/input-panel.c ++++ b/desktop-shell/input-panel.c +@@ -63,7 +63,7 @@ show_input_panels(struct wl_listener *listener, void *data) + shell->showing_input_panels = true; + + if (!shell->locked) +- wl_list_insert(&shell->panel_layer.link, ++ wl_list_insert(&shell->compositor->cursor_layer.link, + &shell->input_panel_layer.link); + + wl_list_for_each_safe(ipsurf, next, +diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c +index 962dde0..8cd4401 100644 +--- a/desktop-shell/shell.c ++++ b/desktop-shell/shell.c +@@ -84,9 +84,9 @@ struct ping_timer { + * in the following order (top-most first): + * • Lock layer (only ever displayed on its own) + * • Cursor layer ++ * • Input panel layer + * • Fullscreen layer + * • Panel layer +- * • Input panel layer + * • Workspace layers + * • Background layer + * +@@ -3800,18 +3800,19 @@ resume_desktop(struct desktop_shell *shell) + terminate_screensaver(shell); + + wl_list_remove(&shell->lock_layer.link); +- wl_list_insert(&shell->compositor->cursor_layer.link, +- &shell->fullscreen_layer.link); +- wl_list_insert(&shell->fullscreen_layer.link, +- &shell->panel_layer.link); + if (shell->showing_input_panels) { +- wl_list_insert(&shell->panel_layer.link, ++ wl_list_insert(&shell->compositor->cursor_layer.link, + &shell->input_panel_layer.link); + wl_list_insert(&shell->input_panel_layer.link, +- &ws->layer.link); ++ &shell->fullscreen_layer.link); + } else { +- wl_list_insert(&shell->panel_layer.link, &ws->layer.link); ++ wl_list_insert(&shell->compositor->cursor_layer.link, ++ &shell->fullscreen_layer.link); + } ++ wl_list_insert(&shell->fullscreen_layer.link, ++ &shell->panel_layer.link); ++ wl_list_insert(&shell->panel_layer.link, ++ &ws->layer.link), + + restore_focus_state(shell, get_current_workspace(shell)); + +diff --git a/packaging/weston.changes b/packaging/weston.changes +index 6a35d43..df6408d 100644 +--- a/packaging/weston.changes ++++ b/packaging/weston.changes +@@ -1,3 +1,7 @@ ++* Fri Mar 07 2014 Ossama Othman accepted/tizen/mobile/20140306.215156@0a8cc4e ++- shell: position input panel layer above fullscreen layer ++- packaging: add weston-editor & weston-subsurfaces clients. ++ + * Wed Mar 05 2014 Ossama Othman accepted/tizen/mobile/20140227.071827@0aaa2e4 + - toytoolkit: totally switch to xdg-shell protocol + - compositor: use Mod-Tab to show/raise minimized surfaces +-- +1.8.1.4 + diff --git a/recipes-graphics/wayland/weston/0008-shell-make-panel-optional-panel-false-in-weston.ini.patch b/recipes-graphics/wayland/weston/0008-shell-make-panel-optional-panel-false-in-weston.ini.patch new file mode 100644 index 0000000..4a78650 --- /dev/null +++ b/recipes-graphics/wayland/weston/0008-shell-make-panel-optional-panel-false-in-weston.ini.patch @@ -0,0 +1,95 @@ +From 5bbfde4c9d19b17391a9a3e0d1dbc24a55bee496 Mon Sep 17 00:00:00 2001 +From: Manuel Bachmann +Date: Mon, 7 Apr 2014 15:43:51 +0200 +Subject: [PATCH 08/10] shell: make panel optional ("panel=false" in + weston.ini) + +Change-Id: I6b2e9ee24f623c4b05f3cd675a90007bf708b09b +Signed-off-by: Manuel Bachmann +--- + clients/desktop-shell.c | 27 ++++++++++++++++++--------- + 1 file changed, 18 insertions(+), 9 deletions(-) + +diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c +index a0c6b6d..ad67ad2 100644 +--- a/clients/desktop-shell.c ++++ b/clients/desktop-shell.c +@@ -62,6 +62,7 @@ struct desktop { + + struct weston_config *config; + int locking; ++ int panel; + + enum cursor_type grab_cursor; + +@@ -171,8 +172,10 @@ is_desktop_painted(struct desktop *desktop) + struct output *output; + + wl_list_for_each(output, &desktop->outputs, link) { +- if (output->panel && !output->panel->painted) +- return 0; ++ if (desktop->panel) { ++ if (output->panel && !output->panel->painted) ++ return 0; ++ } + if (output->background && !output->background->painted) + return 0; + } +@@ -1127,7 +1130,8 @@ static void + output_destroy(struct output *output) + { + background_destroy(output->background); +- panel_destroy(output->panel); ++ if (output->panel) ++ panel_destroy(output->panel); + wl_output_destroy(output->output); + wl_list_remove(&output->link); + +@@ -1157,7 +1161,8 @@ output_handle_geometry(void *data, + { + struct output *output = data; + +- window_set_buffer_transform(output->panel->window, transform); ++ if (output->panel) ++ window_set_buffer_transform(output->panel->window, transform); + window_set_buffer_transform(output->background->window, transform); + } + +@@ -1184,7 +1189,8 @@ output_handle_scale(void *data, + { + struct output *output = data; + +- window_set_buffer_scale(output->panel->window, scale); ++ if (output->panel) ++ window_set_buffer_scale(output->panel->window, scale); + window_set_buffer_scale(output->background->window, scale); + } + +@@ -1200,10 +1206,12 @@ output_init(struct output *output, struct desktop *desktop) + { + struct wl_surface *surface; + +- output->panel = panel_create(desktop); +- surface = window_get_wl_surface(output->panel->window); +- desktop_shell_set_panel(desktop->shell, +- output->output, surface); ++ if (desktop->panel) { ++ output->panel = panel_create(desktop); ++ surface = window_get_wl_surface(output->panel->window); ++ desktop_shell_set_panel(desktop->shell, ++ output->output, surface); ++ } + + output->background = background_create(desktop); + surface = window_get_wl_surface(output->background->window); +@@ -1316,6 +1324,7 @@ int main(int argc, char *argv[]) + desktop.config = weston_config_parse("weston.ini"); + s = weston_config_get_section(desktop.config, "shell", NULL, NULL); + weston_config_section_get_bool(s, "locking", &desktop.locking, 1); ++ weston_config_section_get_bool(s, "panel", &desktop.panel, 1); + + desktop.display = display_create(&argc, argv); + if (desktop.display == NULL) { +-- +1.8.1.4 + diff --git a/recipes-graphics/wayland/weston/0009-shell-1.4.0-Hack-to-allow-selecting-a-default-output.patch b/recipes-graphics/wayland/weston/0009-shell-1.4.0-Hack-to-allow-selecting-a-default-output.patch new file mode 100644 index 0000000..4bba1b6 --- /dev/null +++ b/recipes-graphics/wayland/weston/0009-shell-1.4.0-Hack-to-allow-selecting-a-default-output.patch @@ -0,0 +1,184 @@ +From 9aab809f91fd839fda0a7b8999efdfeafdab793d Mon Sep 17 00:00:00 2001 +From: Stephane Desneux +Date: Fri, 11 Apr 2014 22:09:19 +0200 +Subject: [PATCH 09/10] shell 1.4.0: Hack to allow selecting a default output + +Ported patch from Rafael Antognolli + +Use default_output=1 inside an output section on weston.ini to make it +the default one. Any newly created maximized or fullscreen window, that +does not specify its output, will default to use that one. + +Change-Id: I8b888d1de6c5e76e89e9b61b35ffc3401ac86100 +Signed-off-by: Stephane Desneux +--- + desktop-shell/shell.c | 2 ++ + src/compositor-drm.c | 13 +++++++++---- + src/compositor-x11.c | 16 ++++++++++++---- + src/compositor.h | 3 +++ + 4 files changed, 26 insertions(+), 8 deletions(-) + +diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c +index 8cd4401..57c2710 100644 +--- a/desktop-shell/shell.c ++++ b/desktop-shell/shell.c +@@ -471,6 +471,8 @@ shell_configuration(struct desktop_shell *shell) + struct weston_output * + get_default_output(struct weston_compositor *compositor) + { ++ if (compositor->default_output) ++ return compositor->default_output; + return container_of(compositor->output_list.next, + struct weston_output, link); + } +diff --git a/src/compositor-drm.c b/src/compositor-drm.c +index 154e15e..933a91d 100644 +--- a/src/compositor-drm.c ++++ b/src/compositor-drm.c +@@ -1166,10 +1166,10 @@ choose_mode (struct drm_output *output, struct weston_mode *target_mode) + wl_list_for_each(mode, &output->base.mode_list, base.link) { + if (mode->mode_info.hdisplay == target_mode->width && + mode->mode_info.vdisplay == target_mode->height) { +- if (mode->mode_info.vrefresh == target_mode->refresh || ++ if (mode->mode_info.vrefresh == target_mode->refresh || + target_mode->refresh == 0) { + return mode; +- } else if (!tmp_mode) ++ } else if (!tmp_mode) + tmp_mode = mode; + } + } +@@ -1870,6 +1870,7 @@ create_output_for_connector(struct drm_compositor *ec, + const char *type_name; + enum output_config config; + uint32_t transform; ++ int default_output; + + i = find_crtc_for_connector(ec, resources, connector); + if (i < 0) { +@@ -1918,6 +1919,8 @@ create_output_for_connector(struct drm_compositor *ec, + weston_config_section_get_string(section, "transform", &s, "normal"); + transform = parse_transform(s, output->base.name); + free(s); ++ weston_config_section_get_int(section, "default_output", ++ &default_output, 0); + + weston_config_section_get_string(section, "seat", &s, ""); + setup_output_seat_constraint(ec, &output->base, s); +@@ -2035,6 +2038,8 @@ create_output_for_connector(struct drm_compositor *ec, + } + + wl_list_insert(ec->base.output_list.prev, &output->base.link); ++ if (default_output) ++ ec->base.default_output = &output->base; + + find_and_parse_output_edid(ec, output, connector); + if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS) +@@ -2286,7 +2291,7 @@ update_outputs(struct drm_compositor *ec, struct udev_device *drm_device) + } + } + +- /* FIXME: handle zero outputs, without terminating */ ++ /* FIXME: handle zero outputs, without terminating */ + if (ec->connector_allocator == 0) + wl_display_terminate(ec->base.wl_display); + } +@@ -2380,7 +2385,7 @@ drm_compositor_set_modes(struct drm_compositor *compositor) + if (ret < 0) { + weston_log( + "failed to set mode %dx%d for output at %d,%d: %m\n", +- drm_mode->base.width, drm_mode->base.height, ++ drm_mode->base.width, drm_mode->base.height, + output->base.x, output->base.y); + } + } +diff --git a/src/compositor-x11.c b/src/compositor-x11.c +index 6b5eb64..b742d00 100644 +--- a/src/compositor-x11.c ++++ b/src/compositor-x11.c +@@ -505,7 +505,7 @@ x11_output_set_wm_protocols(struct x11_compositor *c, + xcb_atom_t list[1]; + + list[0] = c->atom.wm_delete_window; +- xcb_change_property (c->conn, ++ xcb_change_property (c->conn, + XCB_PROP_MODE_REPLACE, + output->window, + c->atom.wm_protocols, +@@ -751,7 +751,8 @@ static struct x11_output * + x11_compositor_create_output(struct x11_compositor *c, int x, int y, + int width, int height, int fullscreen, + int no_input, char *configured_name, +- uint32_t transform, int32_t scale) ++ uint32_t transform, int32_t scale, ++ int default_output) + { + static const char name[] = "Weston Compositor"; + static const char class[] = "weston-1\0Weston Compositor"; +@@ -899,6 +900,8 @@ x11_compositor_create_output(struct x11_compositor *c, int x, int y, + wl_event_loop_add_timer(loop, finish_frame_handler, output); + + wl_list_insert(c->base.output_list.prev, &output->base.link); ++ if (default_output) ++ c->base.default_output = &output->base; + + weston_log("x11 output %dx%d, window id %d\n", + width, height, output->window); +@@ -1482,6 +1485,7 @@ x11_compositor_create(struct wl_display *display, + const char *section_name; + char *name, *t, *mode; + uint32_t transform; ++ int default_output; + + weston_log("initializing x11 backend\n"); + +@@ -1567,11 +1571,14 @@ x11_compositor_create(struct wl_display *display, + "transform", &t, "normal"); + transform = parse_transform(t, name); + free(t); ++ weston_config_section_get_int(section, "default_output", ++ &default_output, 0); + + output = x11_compositor_create_output(c, x, 0, + width, height, + fullscreen, no_input, +- name, transform, scale); ++ name, transform, scale, ++ default_output); + free(name); + if (output == NULL) + goto err_x11_input; +@@ -1586,7 +1593,8 @@ x11_compositor_create(struct wl_display *display, + for (i = output_count; i < count; i++) { + output = x11_compositor_create_output(c, x, 0, width, height, + fullscreen, no_input, NULL, +- WL_OUTPUT_TRANSFORM_NORMAL, 1); ++ WL_OUTPUT_TRANSFORM_NORMAL, 1, ++ default_output); + if (output == NULL) + goto err_x11_input; + x = pixman_region32_extents(&output->base.region)->x2; +diff --git a/src/compositor.h b/src/compositor.h +index ace75da..297a4ec 100644 +--- a/src/compositor.h ++++ b/src/compositor.h +@@ -198,6 +198,7 @@ struct weston_output { + int move_x, move_y; + uint32_t frame_time; + int disable_planes; ++ uint32_t default_output; + int destroying; + + char *make, *model, *serial_number; +@@ -604,6 +605,8 @@ struct weston_compositor { + struct wl_list axis_binding_list; + struct wl_list debug_binding_list; + ++ struct weston_output *default_output; ++ + uint32_t state; + struct wl_event_source *idle_source; + uint32_t idle_inhibit; +-- +1.8.1.4 + diff --git a/recipes-graphics/wayland/weston/0010-allow-to-start-weston-with-system-user.patch b/recipes-graphics/wayland/weston/0010-allow-to-start-weston-with-system-user.patch new file mode 100644 index 0000000..4f355ca --- /dev/null +++ b/recipes-graphics/wayland/weston/0010-allow-to-start-weston-with-system-user.patch @@ -0,0 +1,41 @@ +From 5d81c84830847a7f9b6120329239720c35fd80e1 Mon Sep 17 00:00:00 2001 +From: Stephane Desneux +Date: Mon, 14 Apr 2014 20:44:40 +0200 +Subject: [PATCH 10/10] allow to start weston with system user + +the check to allow only root user had been replaced +by a check to see if effective uid is equal or less than 499 + +499 is the actual value in login.defs for SYS_UID_MAX + +Change-Id: Ic2b96661df0c939e7f6e066f0bed1d8f7e26bd8f +Signed-off-by: Stephane Desneux +--- + src/launcher-util.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/launcher-util.c b/src/launcher-util.c +index 1b63458..47d6eda 100644 +--- a/src/launcher-util.c ++++ b/src/launcher-util.c +@@ -160,7 +160,7 @@ weston_launcher_open(struct weston_launcher *launcher, + msg.msg_iovlen = 1; + msg.msg_control = control; + msg.msg_controllen = sizeof control; +- ++ + do { + len = recvmsg(launcher->fd, &msg, MSG_CMSG_CLOEXEC); + } while (len < 0 && errno == EINTR); +@@ -404,7 +404,7 @@ weston_launcher_connect(struct weston_compositor *compositor, int tty, + seat_id, tty); + if (r < 0) { + launcher->logind = NULL; +- if (geteuid() == 0) { ++ if (geteuid() <= 499) { /* 499 = SYS_UID_MAX in login.defs, but it should be parsed */ + if (setup_tty(launcher, tty) == -1) { + free(launcher); + return NULL; +-- +1.8.1.4 + diff --git a/recipes-graphics/wayland/weston_1.4.0.bbappend b/recipes-graphics/wayland/weston_1.4.0.bbappend new file mode 100644 index 0000000..c714681 --- /dev/null +++ b/recipes-graphics/wayland/weston_1.4.0.bbappend @@ -0,0 +1,10 @@ +SRC_URI += "file://0001-Update-to-1.4.0.patch \ + file://0002-This-vfunc-lets-us-read-out-a-rectangle-of-pixels-fr.patch \ + file://0003-compositor-implement-xdg_surface_set_minimized.patch \ + file://0004-compositor-use-Mod-Tab-to-show-raise-minimized-surfa.patch \ + file://0005-toytoolkit-totally-switch-to-xdg-shell-protocol.patch \ + file://0006-packaging-add-weston-editor-weston-subsurfaces-clien.patch \ + file://0007-shell-position-input-panel-layer-above-fullscreen-la.patch \ + file://0008-shell-make-panel-optional-panel-false-in-weston.ini.patch \ + file://0009-shell-1.4.0-Hack-to-allow-selecting-a-default-output.patch \ + file://0010-allow-to-start-weston-with-system-user.patch"