.gitignore | 14 Makefile.am | 158 + clients/editor.c | 12 clients/ivi-shell-user-interface.c | 1310 +++++++++++++++ clients/presentation-shm.c | 870 ++++++++++ clients/simple-egl.c | 95 + clients/simple-shm.c | 82 clients/subsurfaces.c | 3 clients/weston-info.c | 81 clients/window.c | 109 + configure.ac | 34 data/COPYING | 28 data/background.png |binary data/fullscreen.png |binary data/home.png |binary data/icon_ivi_clickdot.png |binary data/icon_ivi_flower.png |binary data/icon_ivi_simple-egl.png |binary data/icon_ivi_simple-shm.png |binary data/icon_ivi_smoke.png |binary data/panel.png |binary data/random.png |binary data/sidebyside.png |binary data/tiling.png |binary debian/changelog | 7 debian/control | 4 desktop-shell/input-panel.c | 8 desktop-shell/shell.c | 285 ++- fullscreen-shell/fullscreen-shell.c | 13 ivi-shell/.gitignore | 1 ivi-shell/README | 79 ivi-shell/hmi-controller.c | 1737 +++++++++++++++++++++ ivi-shell/input-panel-ivi.c | 391 ++++ ivi-shell/ivi-layout-export.h | 777 +++++++++ ivi-shell/ivi-layout-private.h | 226 ++ ivi-shell/ivi-layout-transition.c | 859 ++++++++++ ivi-shell/ivi-layout.c | 2970 ++++++++++++++++++++++++++++++++++++ ivi-shell/ivi-shell.c | 429 +++++ ivi-shell/ivi-shell.h | 62 ivi-shell/weston.ini.in | 96 + man/weston.ini.man | 27 protocol/ivi-application.xml | 99 + protocol/ivi-hmi-controller.xml | 97 + protocol/presentation_timing.xml | 276 +++ protocol/xdg-shell.xml | 9 releasing.txt | 57 shared/cairo-util.c | 12 shared/cairo-util.h | 11 shared/frame.c | 49 src/bindings.c | 47 src/clipboard.c | 5 src/cms-colord.c | 22 src/cms-helper.c | 2 src/compositor-drm.c | 162 + src/compositor-fbdev.c | 36 src/compositor-headless.c | 91 - src/compositor-rdp.c | 19 src/compositor-rpi.c | 110 - src/compositor-wayland.c | 37 src/compositor-x11.c | 84 - src/compositor.c | 703 +++++++- src/compositor.h | 95 - src/data-device.c | 48 src/evdev-touchpad.c | 800 --------- src/evdev.c | 755 --------- src/evdev.h | 137 - src/filter.c | 337 ---- src/filter.h | 66 src/gl-renderer.c | 96 - src/input.c | 48 src/launcher-util.c | 22 src/launcher-util.h | 2 src/libinput-device.c | 85 - src/logind-util.c | 94 - src/logind-util.h | 4 src/pixman-renderer.c | 11 src/rpi-renderer.c | 20 src/screenshooter.c | 35 src/text-backend.c | 38 src/timeline-object.h | 52 src/timeline.c | 294 +++ src/timeline.h | 62 src/udev-input.h | 34 src/udev-seat.c | 417 ----- src/udev-seat.h | 57 src/vaapi-recorder.c | 4 src/weston-launch.c | 11 src/weston.desktop | 5 tests/bad-buffer-test.c | 3 tests/buffer-count-test.c | 10 tests/button-test.c | 1 tests/event-test.c | 2 tests/keyboard-test.c | 2 tests/presentation-test.c | 238 ++ tests/roles-test.c | 139 + tests/setbacklight.c | 2 tests/subsurface-test.c | 2 tests/surface-test.c | 3 tests/text-test.c | 2 tests/vertex-clip-test.c | 3 tests/weston-test-client-helper.c | 17 tests/weston-test-client-helper.h | 13 tests/weston-test-runner.c | 11 tests/weston-test-runner.h | 4 tests/weston-test.c | 2 tests/weston-tests-env | 1 tests/xwayland-test.c | 173 -- xwayland/selection.c | 7 xwayland/window-manager.c | 168 +- xwayland/xwayland.h | 3 110 files changed, 13608 insertions(+), 3522 deletions(-)
New commits: commit db16de82498efefd7e81c95c52988d49c53db367 Author: Timo Aaltonen <tjaal...@debian.org> Date: Tue Feb 10 19:51:24 2015 +0200 control: Bump libinput and libwayland-dev build-deps. diff --git a/debian/changelog b/debian/changelog index 901b2ab..82b13c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ weston (1.6.93-1) UNRELEASED; urgency=medium * New upstream release. + * control: Bump libinput and libwayland-dev build-deps. -- Timo Aaltonen <tjaal...@debian.org> Tue, 10 Feb 2015 19:47:34 +0200 diff --git a/debian/control b/debian/control index 6f52626..9de4b83 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Build-Depends: libegl1-mesa-dev (>= 9.0~), libegl1-mesa-drivers (>= 9.0~), libgles2-mesa-dev (>= 9.0~), - libwayland-dev (>= 1.5.91), + libwayland-dev (>= 1.6.93), libxcb1-dev, libxcb-composite0-dev, libxcb-xfixes0-dev, @@ -39,7 +39,7 @@ Build-Depends: libpam0g-dev, libvpx-dev, libsystemd-login-dev, - libinput-dev (>= 0.6.0), + libinput-dev (>= 0.8.0), Standards-Version: 3.9.6 Homepage: http://wayland.freedesktop.org/ Vcs-Git: git://anonscm.debian.org/pkg-xorg/wayland/weston commit 57cf651d896464e48b8e4e27e5154c2ed83e2e6f Author: Timo Aaltonen <tjaal...@debian.org> Date: Tue Feb 10 19:48:10 2015 +0200 update the changelog diff --git a/debian/changelog b/debian/changelog index c44c268..901b2ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +weston (1.6.93-1) UNRELEASED; urgency=medium + + * New upstream release. + + -- Timo Aaltonen <tjaal...@debian.org> Tue, 10 Feb 2015 19:47:34 +0200 + weston (1.6.1-1) experimental; urgency=medium * New upstream bugfix release: commit 82d19aabc87a3040edb96c0bda0ef27c4edb26b8 Author: Bryce Harrington <br...@osg.samsung.com> Date: Fri Feb 6 18:03:43 2015 -0800 configure.ac bump to version 1.6.93 for the rc2 release. diff --git a/configure.ac b/configure.ac index ec7739d..1db9f79 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ m4_define([weston_major_version], [1]) m4_define([weston_minor_version], [6]) -m4_define([weston_micro_version], [92]) +m4_define([weston_micro_version], [93]) m4_define([weston_version], [weston_major_version.weston_minor_version.weston_micro_version]) @@ -59,7 +59,7 @@ AC_CHECK_HEADERS([execinfo.h]) AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate]) -COMPOSITOR_MODULES="wayland-server >= 1.6.92 pixman-1 >= 0.25.2" +COMPOSITOR_MODULES="wayland-server >= 1.6.93 pixman-1 >= 0.25.2" AC_ARG_ENABLE(egl, [ --disable-egl],, enable_egl=yes) @@ -292,7 +292,7 @@ AC_SUBST(JPEG_LIBS) PKG_CHECK_MODULES(CAIRO, [cairo]) -PKG_CHECK_MODULES(TEST_CLIENT, [wayland-client >= 1.6.92]) +PKG_CHECK_MODULES(TEST_CLIENT, [wayland-client >= 1.6.93]) AC_ARG_ENABLE(simple-clients, AS_HELP_STRING([--disable-simple-clients], commit 044f79d4890a59c474ca2da53ddf6ff6c0b2f0c6 Author: Bryce Harrington <br...@osg.samsung.com> Date: Fri Feb 6 18:01:33 2015 -0800 releasing: Tweak docs to better match actual workflow diff --git a/releasing.txt b/releasing.txt index ce94ed2..b704725 100644 --- a/releasing.txt +++ b/releasing.txt @@ -1,14 +1,19 @@ To make a release of Weston and/or Wayland, follow these steps. - 0. Update the first three lines of configure.ac to the intended + 0. Verify the test suites and codebase checks pass. All of the + tests pass should either pass or skip. + + $ make check + + 1. Update the first three lines of configure.ac to the intended version, commit. Also note that Weston includes versioned dependencies on 'wayland-server' and 'wayland-client' in - configure.ac which typically need updated as well. + configure.ac which typically need updated as well. Then commit + your changes: - 1. Verify the test suites and codebase checks pass. (All of the - tests pass should pass except for xwayland, which can be flaky.) - - $ make check + $ git status + $ git commit configure.ac -m "configure.ac: bump to version x.y.z for the xxx release" + $ git push 2. Run the release.sh script to generate the tarballs, sign and upload them, and generate a release announcement template. commit bf48e21fa18df9d2c917b8577633107e4b1681de Author: Jonas Ådahl <jad...@gmail.com> Date: Fri Feb 6 10:15:28 2015 +0800 desktop-shell: Fail if get_xdg_surface is called on an xdg_surface If a client calls xdg_shell.get_xdg_surface on a surface that is already an xdg_surface would, prior to this patch, succeed, but cause weston to crash later when trying to configure. This patch instead sends a role error to the client complaining that it already is an xdg_surface. Note that .._set_role() only fails when changing roles, not when setting the same role twice. The same is done for xdg_popup. Signed-off-by: Jonas Ådahl <jad...@gmail.com> Reviewed-by: Daniel Stone <dani...@collabora.com> Reviewed-by: Bryce Harrington <br...@osg.samsung.com> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 26cadb6..f28fc10 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -3978,6 +3978,14 @@ xdg_get_xdg_surface(struct wl_client *client, struct desktop_shell *shell = sc->shell; struct shell_surface *shsurf; + shsurf = get_shell_surface(surface); + if (shsurf && shell_surface_is_xdg_surface(shsurf)) { + wl_resource_post_error(resource, XDG_SHELL_ERROR_ROLE, + "This wl_surface is already an " + "xdg_surface"); + return; + } + if (weston_surface_set_role(surface, "xdg_surface", resource, XDG_SHELL_ERROR_ROLE) < 0) return; @@ -4071,6 +4079,14 @@ xdg_get_xdg_popup(struct wl_client *client, struct weston_surface *parent; struct shell_seat *seat; + shsurf = get_shell_surface(surface); + if (shsurf && shell_surface_is_xdg_popup(shsurf)) { + wl_resource_post_error(resource, XDG_SHELL_ERROR_ROLE, + "This wl_surface is already an " + "xdg_popup"); + return; + } + if (weston_surface_set_role(surface, "xdg_popup", resource, XDG_SHELL_ERROR_ROLE) < 0) return; commit f10e06c77aee1c27e5f11f02e5ae6e1ae7fd36a5 Author: Derek Foreman <der...@osg.samsung.com> Date: Tue Feb 3 11:05:10 2015 -0600 xwm: remove the create surface listener in weston_wm_destroy Failing to remove this can result in a crash when the signal is sent after the window manager is destroyed. Signed-off-by: Derek Foreman <der...@osg.samsung.com> Reviewed-By: Giulio Camuffo <giuliocamu...@gmail.com> diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 07c2ef3..ec3dab9 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -2229,6 +2229,7 @@ weston_wm_destroy(struct weston_wm *wm) wl_list_remove(&wm->activate_listener.link); wl_list_remove(&wm->kill_listener.link); wl_list_remove(&wm->transform_listener.link); + wl_list_remove(&wm->create_surface_listener.link); free(wm); } commit 82cc25b986669abf0a516eac0db936c5cd1e916b Author: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Date: Fri Feb 6 16:08:52 2015 +0900 ivi-shell: SEGV occurs when multi touch happens in transition of application launching. This is because cancel callback is mistakenly set to weston_touch_grab_interface. To fix this issue, add a callback, touch_move_workspace_grab_frame and set it to the weston_touch_grab_interface like desktop-shell. Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanib...@xddp.denso.co.jp> Reviewed-by: Daniel Stone <dani...@collabora.com> Reviewed-by: Bryce Harrington <br...@osg.samsung.com> diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 36a1b56..2d15e06 100644 --- a/ivi-shell/hmi-controller.c +++ b/ivi-shell/hmi-controller.c @@ -1389,6 +1389,11 @@ pointer_move_workspace_grab_cancel(struct weston_pointer_grab *grab) } static void +touch_move_workspace_grab_frame(struct weston_touch_grab *grab) +{ +} + +static void touch_move_workspace_grab_cancel(struct weston_touch_grab *grab) { struct touch_grab *tg = (struct touch_grab *)grab; @@ -1408,6 +1413,7 @@ static const struct weston_touch_grab_interface touch_move_grab_workspace_interf touch_nope_grab_down, touch_move_workspace_grab_up, touch_move_grab_motion, + touch_move_workspace_grab_frame, touch_move_workspace_grab_cancel }; commit 7b9efcbcbf3d8916160b39dfc2c28ee1c309e4ff Author: Daniel Stone <dani...@collabora.com> Date: Thu Feb 5 15:31:10 2015 +0000 Update .gitignore Add autotools remnants, as well as more comprehensive vim swapfiles, Sublime Text configuration, and git format-patch output. Signed-off-by: Daniel Stone <dani...@collabora.com> Reviewed-by: Derek Foreman <der...@osg.samsung.com> diff --git a/.gitignore b/.gitignore index 2aaeac9..aa24f9a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,10 @@ *.pc *.so *.swp +.*.sw? +.sw? +*.sublime-project +*.sublime-workspace *.trs *~ ctags @@ -16,14 +20,20 @@ cscope.out /aclocal.m4 /autom4te.cache /build-aux/ +/config.guess /config.h /config.h.in /config.log /config.mk /config.status +/config.sub /configure +/depcomp +/install-sh /libtool +/ltmain.sh /logs +/missing /stamp-h1 /test-driver /weston.ini @@ -33,6 +43,8 @@ TAGS protocol/.*.valid protocol/*.[ch] +00*.patch + weston-calibrator weston-clickdot weston-cliptest commit d540f4bb76359988cdc54b12d7ae4268a07375fa Author: Derek Foreman <der...@osg.samsung.com> Date: Tue Jan 27 16:26:49 2015 -0600 compositor-x11: Move the x11 window close to an idle handler The input loop is actually dispatched in the middle of the frame repaint. When the X11 event results in closing the compositor, this can cause the current output to be destroyed just prior to trying to process animations on it. We fix this by handling the window close event in an idle callback. NOTE: this requires a patch for wayland that moves the idle handler dispatch to after epoll_wait in the event loop processing. Closes bug: https://bugs.freedesktop.org/show_bug.cgi?id=81314 Signed-off-by: Derek Foreman <der...@osg.samsung.com> Reviewed-by: Daniel Stone <dani...@collabora.com> diff --git a/src/compositor-x11.c b/src/compositor-x11.c index 2792251..aa1e519 100644 --- a/src/compositor-x11.c +++ b/src/compositor-x11.c @@ -117,6 +117,11 @@ struct x11_output { int32_t scale; }; +struct window_delete_data { + struct x11_compositor *compositor; + xcb_window_t window; +}; + struct gl_renderer_interface *gl_renderer; static struct xkb_keymap * @@ -941,6 +946,14 @@ x11_compositor_delete_window(struct x11_compositor *c, xcb_window_t window) wl_display_terminate(c->base.wl_display); } +static void delete_cb(void *data) +{ + struct window_delete_data *wd = data; + + x11_compositor_delete_window(wd->compositor, wd->window); + free(wd); +} + #ifdef HAVE_XCB_XKB static void update_xkb_state(struct x11_compositor *c, xcb_xkb_state_notify_event_t *state) @@ -1284,8 +1297,23 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data) client_message = (xcb_client_message_event_t *) event; atom = client_message->data.data32[0]; window = client_message->window; - if (atom == c->atom.wm_delete_window) - x11_compositor_delete_window(c, window); + if (atom == c->atom.wm_delete_window) { + struct wl_event_loop *loop; + struct window_delete_data *data = malloc(sizeof *data); + + /* if malloc failed we should at least try to + * delete the window, even if it may result in + * a crash. + */ + if (!data) { + x11_compositor_delete_window(c, window); + break; + } + data->compositor = c; + data->window = window; + loop = wl_display_get_event_loop(c->base.wl_display); + wl_event_loop_add_idle(loop, delete_cb, data); + } break; case XCB_FOCUS_IN: commit 3e4d4bdd94f6db154e77df72cc2da366cf72629f Author: Dima Ryazanov <d...@gmail.com> Date: Wed Feb 4 01:51:57 2015 -0800 Fix "Back", "Forward", and other special mouse buttons in the X11 compositor. They're off by 4 because of the scroll buttons. Signed-off-by: Dima Ryazanov <d...@gmail.com> Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/src/compositor-x11.c b/src/compositor-x11.c index 5863446..2792251 100644 --- a/src/compositor-x11.c +++ b/src/compositor-x11.c @@ -1017,8 +1017,8 @@ x11_compositor_deliver_button_event(struct x11_compositor *c, update_xkb_state_from_core(c, button_event->state); switch (button_event->detail) { - default: - button = button_event->detail + BTN_LEFT - 1; + case 1: + button = BTN_LEFT; break; case 2: button = BTN_MIDDLE; @@ -1056,6 +1056,9 @@ x11_compositor_deliver_button_event(struct x11_compositor *c, WL_POINTER_AXIS_HORIZONTAL_SCROLL, DEFAULT_AXIS_STEP_DISTANCE); return; + default: + button = button_event->detail + BTN_SIDE - 8; + break; } notify_button(&c->core_seat, commit 90d1ac8d491e97b0244aa19ba6fe0d2ac934b720 Author: Jonas Ådahl <jad...@gmail.com> Date: Fri Jan 30 12:23:00 2015 +0800 libinput: Only forward first and last press and release for a key Keyboard key events will be received from a device where a key has been pressed, even though an equivalent key has been pressed (same key code) on a device connected to the same seat. notify_key() expects to only be called as if there was only one keyboard device associated with the given seat, so to achieve this, ignore every event where forwarding it would result in multiple 'pressed' or 'released' notifications. Signed-off-by: Jonas Ådahl <jad...@gmail.com> Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net> Reviewed-by: Daniel Stone <dani...@collabora.com> Reviewed-by: Derek Foreman <der...@osg.samsung.com> diff --git a/src/libinput-device.c b/src/libinput-device.c index 5c5b9b9..567e5ea 100644 --- a/src/libinput-device.c +++ b/src/libinput-device.c @@ -59,6 +59,17 @@ handle_keyboard_key(struct libinput_device *libinput_device, { struct evdev_device *device = libinput_device_get_user_data(libinput_device); + int key_state = + libinput_event_keyboard_get_key_state(keyboard_event); + int seat_key_count = + libinput_event_keyboard_get_seat_key_count(keyboard_event); + + /* Ignore key events that are not seat wide state changes. */ + if ((key_state == LIBINPUT_KEY_STATE_PRESSED && + seat_key_count != 1) || + (key_state == LIBINPUT_KEY_STATE_RELEASED && + seat_key_count != 0)) + return; notify_key(device->seat, libinput_event_keyboard_get_time(keyboard_event), commit e90b9e9b5958d3e613d7e08f58321fc664084dde Author: Jonas Ådahl <jad...@gmail.com> Date: Fri Jan 30 12:22:59 2015 +0800 libinput: Only forward first and last press and release for a button Pointer button events will be received from a device where a button has been pressed, even though an equivalent button has been pressed (same button code) on a device connected to the same seat. notify_button() expects to only be called as if there was only one pointer device associated with the given seat, so to achieve this, ignore every event where forwarding it would result in multiple 'pressed' or 'released' notifications. Signed-off-by: Jonas Ådahl <jad...@gmail.com> Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net> Reviewed-by: Daniel Stone <dani...@collabora.com> diff --git a/src/libinput-device.c b/src/libinput-device.c index 3ce74b8..5c5b9b9 100644 --- a/src/libinput-device.c +++ b/src/libinput-device.c @@ -119,6 +119,17 @@ handle_pointer_button(struct libinput_device *libinput_device, { struct evdev_device *device = libinput_device_get_user_data(libinput_device); + int button_state = + libinput_event_pointer_get_button_state(pointer_event); + int seat_button_count = + libinput_event_pointer_get_seat_button_count(pointer_event); + + /* Ignore button events that are not seat wide state changes. */ + if ((button_state == LIBINPUT_BUTTON_STATE_PRESSED && + seat_button_count != 1) || + (button_state == LIBINPUT_BUTTON_STATE_RELEASED && + seat_button_count != 0)) + return; notify_button(device->seat, libinput_event_pointer_get_time(pointer_event), commit 6b4b24155fb3f6fbfc98f38ba3eb5f2f3115371f Author: Giulio Camuffo <giuliocamu...@gmail.com> Date: Thu Jan 29 19:06:49 2015 +0200 xwm: support maximizing xwayland windows This patch adds the maximize button to the window frame for the windows which set the MWM_DECOR_MAXIMIZE hint, and it wires it with the shell via a new method in weston_shell_interface. Additionally, it also listens for the wm hints coming from the client, but it doesn't support maximizing a window only vertically or horizontally. The window will be maximized only when both directions are maximized. Reviewed-by: Daniel Stone <dani...@collabora.com> Reviewed-by: Bryce Harrington <br...@osg.samsung.com> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 742a710..26cadb6 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -3000,6 +3000,51 @@ shell_interface_set_fullscreen(struct shell_surface *shsurf, set_fullscreen(shsurf, method, framerate, output); } +static struct weston_output * +get_focused_output(struct weston_compositor *compositor) +{ + struct weston_seat *seat; + struct weston_output *output = NULL; + + wl_list_for_each(seat, &compositor->seat_list, link) { + /* Priority has touch focus, then pointer and + * then keyboard focus. We should probably have + * three for loops and check frist for touch, + * then for pointer, etc. but unless somebody has some + * objections, I think this is sufficient. */ + if (seat->touch && seat->touch->focus) + output = seat->touch->focus->output; + else if (seat->pointer && seat->pointer->focus) + output = seat->pointer->focus->output; + else if (seat->keyboard && seat->keyboard->focus) + output = seat->keyboard->focus->output; + + if (output) + break; + } + + return output; +} + +static void +shell_interface_set_maximized(struct shell_surface *shsurf) +{ + struct weston_output *output; + + surface_clear_next_states(shsurf); + shsurf->next_state.maximized = true; + shsurf->state_changed = true; + shsurf->type = SHELL_SURFACE_TOPLEVEL; + + if (!weston_surface_is_mapped(shsurf->surface)) + output = get_focused_output(shsurf->surface->compositor); + else + output = shsurf->surface->output; + + shell_surface_set_output(shsurf, output); + send_configure_for_surface(shsurf); +} + static int shell_interface_move(struct shell_surface *shsurf, struct weston_seat *ws) { @@ -3605,32 +3650,6 @@ get_primary_view(void *shell, struct shell_surface *shsurf) return shsurf->view; } -static struct weston_output * -get_focused_output(struct weston_compositor *compositor) -{ - struct weston_seat *seat; - struct weston_output *output = NULL; - - wl_list_for_each(seat, &compositor->seat_list, link) { - /* Priority has touch focus, then pointer and - * then keyboard focus. We should probably have - * three for loops and check frist for touch, - * then for pointer, etc. but unless somebody has some - * objections, I think this is sufficient. */ - if (seat->touch && seat->touch->focus) - output = seat->touch->focus->output; - else if (seat->pointer && seat->pointer->focus) - output = seat->pointer->focus->output; - else if (seat->keyboard && seat->keyboard->focus) - output = seat->keyboard->focus->output; - - if (output) - break; - } - - return output; -} - static void shell_get_shell_surface(struct wl_client *client, struct wl_resource *resource, @@ -6633,6 +6652,7 @@ module_init(struct weston_compositor *ec, ec->shell_interface.resize = surface_resize; ec->shell_interface.set_title = set_title; ec->shell_interface.set_window_geometry = set_window_geometry; + ec->shell_interface.set_maximized = shell_interface_set_maximized; weston_layer_init(&shell->fullscreen_layer, &ec->cursor_layer.link); weston_layer_init(&shell->panel_layer, &shell->fullscreen_layer.link); diff --git a/src/compositor.h b/src/compositor.h index aa87ec0..5c0ea74 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -121,6 +121,7 @@ struct weston_shell_interface { void (*set_window_geometry)(struct shell_surface *shsurf, int32_t x, int32_t y, int32_t width, int32_t height); + void (*set_maximized)(struct shell_surface *shsurf); }; struct weston_animation { diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 4d3611f..07c2ef3 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -144,6 +144,8 @@ struct weston_wm_window { int fullscreen; int has_alpha; int delete_window; + int maximized_vert; + int maximized_horz; struct wm_size_hints size_hints; struct motif_wm_hints motif_hints; struct wl_list link; @@ -472,6 +474,10 @@ weston_wm_window_read_properties(struct weston_wm_window *window) for (i = 0; i < reply->value_len; i++) if (atom[i] == wm->atom.net_wm_state_fullscreen) window->fullscreen = 1; + if (atom[i] == wm->atom.net_wm_state_maximized_vert) + window->maximized_vert = 1; + if (atom[i] == wm->atom.net_wm_state_maximized_horz) + window->maximized_horz = 1; break; case TYPE_MOTIF_WM_HINTS: memcpy(&window->motif_hints, @@ -479,7 +485,7 @@ weston_wm_window_read_properties(struct weston_wm_window *window) sizeof window->motif_hints); if (window->motif_hints.flags & MWM_HINTS_DECORATIONS) window->decorate = - window->motif_hints.decorations > 0; + window->motif_hints.decorations; break; default: break; @@ -789,12 +795,16 @@ static void weston_wm_window_set_net_wm_state(struct weston_wm_window *window) { struct weston_wm *wm = window->wm; - uint32_t property[1]; + uint32_t property[3]; int i; i = 0; if (window->fullscreen) property[i++] = wm->atom.net_wm_state_fullscreen; + if (window->maximized_vert) + property[i++] = wm->atom.net_wm_state_maximized_vert; + if (window->maximized_horz) + property[i++] = wm->atom.net_wm_state_maximized_horz; xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, @@ -811,10 +821,14 @@ weston_wm_window_create_frame(struct weston_wm_window *window) struct weston_wm *wm = window->wm; uint32_t values[3]; int x, y, width, height; + int buttons = FRAME_BUTTON_CLOSE; + + if (window->decorate & MWM_DECOR_MAXIMIZE) + buttons |= FRAME_BUTTON_MAXIMIZE; window->frame = frame_create(window->wm->theme, window->width, window->height, - FRAME_BUTTON_CLOSE, window->name); + buttons, window->name); frame_resize_inside(window->frame, window->width, window->height); weston_wm_window_get_frame_size(window, &width, &height); @@ -1332,6 +1346,28 @@ static void weston_wm_window_configure(void *data); static void +weston_wm_window_set_toplevel(struct weston_wm_window *window) +{ + struct weston_shell_interface *shell_interface = + &window->wm->server->compositor->shell_interface; + + shell_interface->set_toplevel(window->shsurf); + window->width = window->saved_width; + window->height = window->saved_height; + if (window->frame) + frame_resize_inside(window->frame, + window->width, + window->height); + weston_wm_window_configure(window); +} + +static inline bool +weston_wm_window_is_maximized(struct weston_wm_window *window) +{ + return window->maximized_horz && window->maximized_vert; +} + +static void weston_wm_window_handle_state(struct weston_wm_window *window, xcb_client_message_event_t *client_message) { @@ -1339,6 +1375,7 @@ weston_wm_window_handle_state(struct weston_wm_window *window, struct weston_shell_interface *shell_interface = &wm->server->compositor->shell_interface; uint32_t action, property; + int maximized = weston_wm_window_is_maximized(window); action = client_message->data.data32[0]; property = client_message->data.data32[1]; @@ -1356,15 +1393,26 @@ weston_wm_window_handle_state(struct weston_wm_window *window, 0, NULL); } else { if (window->shsurf) - shell_interface->set_toplevel(window->shsurf); - - window->width = window->saved_width; - window->height = window->saved_height; - if (window->frame) - frame_resize_inside(window->frame, - window->width, - window->height); - weston_wm_window_configure(window); + weston_wm_window_set_toplevel(window); + } + } else { + if (property == wm->atom.net_wm_state_maximized_vert && + update_state(action, &window->maximized_vert)) + weston_wm_window_set_net_wm_state(window); + if (property == wm->atom.net_wm_state_maximized_horz && + update_state(action, &window->maximized_horz)) + weston_wm_window_set_net_wm_state(window); + + if (maximized != weston_wm_window_is_maximized(window)) { + if (weston_wm_window_is_maximized(window)) { + window->saved_width = window->width; + window->saved_height = window->height; + + if (window->shsurf) + shell_interface->set_maximized(window->shsurf); + } else if (window->shsurf) { + weston_wm_window_set_toplevel(window); + } } } } @@ -1696,6 +1744,19 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event) weston_wm_window_close(window, button->time); frame_status_clear(window->frame, FRAME_STATUS_CLOSE); } + + if (frame_status(window->frame) & FRAME_STATUS_MAXIMIZE) { + window->maximized_horz = !window->maximized_horz; + window->maximized_vert = !window->maximized_vert; + if (weston_wm_window_is_maximized(window)) { + window->saved_width = window->width; + window->saved_height = window->height; + shell_interface->set_maximized(window->shsurf); + } else { + weston_wm_window_set_toplevel(window); + } + frame_status_clear(window->frame, FRAME_STATUS_MAXIMIZE); + } } static void @@ -1884,6 +1945,8 @@ weston_wm_get_resources(struct weston_wm *wm) { "_NET_WM_PID", F(atom.net_wm_pid) }, { "_NET_WM_ICON", F(atom.net_wm_icon) }, { "_NET_WM_STATE", F(atom.net_wm_state) }, + { "_NET_WM_STATE_MAXIMIZED_VERT", F(atom.net_wm_state_maximized_vert) }, + { "_NET_WM_STATE_MAXIMIZED_HORZ", F(atom.net_wm_state_maximized_horz) }, { "_NET_WM_STATE_FULLSCREEN", F(atom.net_wm_state_fullscreen) }, { "_NET_WM_USER_TIME", F(atom.net_wm_user_time) }, { "_NET_WM_ICON_NAME", F(atom.net_wm_icon_name) }, @@ -2061,7 +2124,7 @@ weston_wm_create(struct weston_xserver *wxs, int fd) struct wl_event_loop *loop; xcb_screen_iterator_t s; uint32_t values[1]; - xcb_atom_t supported[3]; + xcb_atom_t supported[5]; wm = zalloc(sizeof *wm); if (wm == NULL) @@ -2112,6 +2175,8 @@ weston_wm_create(struct weston_xserver *wxs, int fd) supported[0] = wm->atom.net_wm_moveresize; supported[1] = wm->atom.net_wm_state; supported[2] = wm->atom.net_wm_state_fullscreen; + supported[3] = wm->atom.net_wm_state_maximized_vert; + supported[4] = wm->atom.net_wm_state_maximized_horz; xcb_change_property(wm->conn, XCB_PROP_MODE_REPLACE, wm->screen->root, @@ -2389,6 +2454,8 @@ xserver_map_shell_surface(struct weston_wm_window *window, parent->surface, window->x - parent->x, window->y - parent->y, flags); + } else if (weston_wm_window_is_maximized(window)) { + shell_interface->set_maximized(window->shsurf); } else { if (weston_wm_window_type_inactive(window)) { shell_interface->set_xwayland(window->shsurf, diff --git a/xwayland/xwayland.h b/xwayland/xwayland.h index b42110b..54cbf6d 100644 --- a/xwayland/xwayland.h +++ b/xwayland/xwayland.h @@ -102,6 +102,8 @@ struct weston_wm { xcb_atom_t net_wm_pid; xcb_atom_t net_wm_icon; xcb_atom_t net_wm_state; + xcb_atom_t net_wm_state_maximized_vert; + xcb_atom_t net_wm_state_maximized_horz; xcb_atom_t net_wm_state_fullscreen; xcb_atom_t net_wm_user_time; xcb_atom_t net_wm_icon_name; commit 8aeeac827f37fb070f08fecbe18743820bc70437 Author: Derek Foreman <der...@osg.samsung.com> Date: Fri Jan 30 13:24:36 2015 -0600 desktop-shell: Remove unnecessary type casts Remove a few instances of casting weston_seat to weston_seat. Signed-off-by: Derek Foreman <der...@osg.samsung.com> Reviewed-by: Jon A. Cruz <j...@osg.samsung.com> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 456763d..742a710 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -4515,7 +4515,7 @@ move_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void *dat shsurf->state.maximized) return; - surface_move(shsurf, (struct weston_seat *) seat, 0); + surface_move(shsurf, seat, 0); } static void @@ -4585,7 +4585,7 @@ touch_move_binding(struct weston_seat *seat, uint32_t time, void *data) shsurf->state.maximized) return; - surface_touch_move(shsurf, (struct weston_seat *) seat); + surface_touch_move(shsurf, seat); } static void @@ -4630,7 +4630,7 @@ resize_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void *d else edges |= WL_SHELL_SURFACE_RESIZE_BOTTOM; - surface_resize(shsurf, (struct weston_seat *) seat, edges); + surface_resize(shsurf, seat, edges); -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/e1yleyu-0005od...@moszumanska.debian.org