summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* compositor-drm: Add support for Tegra Jetson TK1baserock/weston-1.6.93/tegraJames Thomas2015-02-091-3/+93
| | | | Update configure.ac to add check for libdrm_tegra
* compositor-drm: Add new gbm struct to allow for a separate gbm deviceJames Thomas2015-02-091-18/+25
| | | | | This is needed for devices like tegra jetson where the gbm device is not the same as the drm device
* compositor-x11: Move the x11 window close to an idle handlerDerek Foreman2015-02-041-2/+30
| | | | | | | | | | | | | | | | | 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 <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* Fix "Back", "Forward", and other special mouse buttons in the X11 compositor.Dima Ryazanov2015-02-041-2/+5
| | | | | | | They're off by 4 because of the scroll buttons. Signed-off-by: Dima Ryazanov <dima@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
* libinput: Only forward first and last press and release for a keyJonas Ådahl2015-02-041-0/+11
| | | | | | | | | | | | | | | 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 <jadahl@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* libinput: Only forward first and last press and release for a buttonJonas Ådahl2015-02-041-0/+11
| | | | | | | | | | | | | | 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 <jadahl@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniels@collabora.com>
* xwm: support maximizing xwayland windowsGiulio Camuffo2015-02-021-0/+1
| | | | | | | | | | | | 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 <daniels@collabora.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* screenshooter: remove useless castDerek Foreman2015-02-021-2/+1
| | | | Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* Revert "compositor-x11: Move the x11 event handler to the display loop"Bryce Harrington2015-01-271-3/+1
| | | | | | This reverts commit 6deb09ef8a72164947cdfa5f2414e292c7672c9c. (Derek says he has an improved version in the works.)
* compositor-x11: Move the x11 event handler to the display loopDerek Foreman2015-01-271-1/+3
| | | | | | | | | | | | | While it conceptually makes sense to put the x11 event handler in the compositor "input" loop, 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. Closes bug: https://bugs.freedesktop.org/show_bug.cgi?id=81314 Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* Fix mutex hang in colord on output removalOlivier Fourdan2015-01-201-8/+4
| | | | | | | | | | | | | | | Using the x11 output (maybe with others as well), weston would hang when closing the output if the colord plugin is enabled. The hang occurs in mutex lock in the output notifier handler because the given GMutex value is incorrect. This is because of a cast error, the type of container should be "cms_output" and not "cms_colord". Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Richard Hughes <richard@hughsie.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* build: install a login manager session entryLubomir Rintel2015-01-201-0/+5
| | | | | This makes it possible to run Weston session from GDM (and possibly other login managers).
* zoom: Check the value of level before using it.Carlos Olmedo Escobar2015-01-201-1/+2
| | | | | | | | Check the value of level before dividing 1 by it. Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* compositor, drm: set per-surface Presentation feedback flagsPekka Paalanen2015-01-203-7/+52
| | | | | | | | | | | | | | | | | PRESENTATION_FEEDBACK_KIND_ZERO_COPY is a flag that needs to be set for each surface separately. Some surfaces may be zero-copy (as defined by Presentation feedback) while some are not. A complication with Weston is that a surface may have multiple views on screen. All copies (views) of the surface are required to be zero-copy for the ZERO_COPY flag to be set. Backends set per-view feedback flags during the assing_planes hook, and then Weston core collects the flags from all views of a surface. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com> Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
* compositor: set presentation.presented flagsPekka Paalanen2015-01-209-21/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change weston_output_finish_frame() signature so that backends are required to set the flags, that will be reported on the Presentation 'presented' event. This is meant for output-wide feedback flags. Flags that vary per wl_surface are subject for the following patch. All start_repaint_loop functions use the special private flag PRESENTATION_FEEDBACK_INVALID to mark, that this call of weston_output_finish_frame() cannot trigger the 'presented' event. If it does, we now hit an assert, and should then investigate why a fake update triggered Presentation feedback. DRM: Page flip is always vsync'd, and always gets the completion timestamp from the kernel which should correspond well to hardware. Completion is triggered by the kernel/hardware. Vblank handler is only used with the broken planes path, therefore do not report VSYNC, because we cannot guarantee all the planes updated at the same time. We cannot set the INVALID, because it would abort the compositor if the broken planes path was ever used. This is a hack that will get fixed with nuclear pageflip support in the future. fbdev: No vsync, update done by copy, no completion event from hardware, and completion time is totally fake. headless: No real output to update. RDP: Guessing that maybe no vsync, fake time, and copy make sense (pixels sent over network). Also no event that the pixels have been shown? RPI: Presumably Dispmanx updates are vsync'd. We get a completion event from the driver, but need to read the clock ourselves, so the completion time is somewhat unreliable. Zero-copy flag not implemented though it would be theoretically possible with EGL clients (zero-copy is a per-surface flag anyway, so in this patch). Wayland: No information how the host compositor is doing updates, so make a safe guess without assuming vsync or hardware completion event. While we do get some timestamp from the host compositor, it is not the completion time. Would need to hook to the Presentation extension of the host compositor to get more accurate flags. X11: No idea about vsync, completion event, or copying. Also the timestamp is a fake. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com> Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com> Acked-by: Mario Kleiner <mario.kleiner.de@gmail.com>
* compositor-drm: use drm_output in drm_output_*() func argsPekka Paalanen2015-01-201-28/+26
| | | | | | | | | | | | | | | | | When a function is named drm_output_FOO(), you'd expect it to take a struct drm_output * as an argument. Convert drm_output_prepare_scanout_view(), drm_output_prepare_overlay_view(), drm_output_prepare_cursor_view() from weston_output to drm_output. Additionally convert drm_sprite_crtc_supported() from weston_output to drm_output. This change makes drm_assign_planes() to operate on drm_output terms, which makes further changes a tiny bit easier. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com> Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
* logind: fix PropertiesChanged parserDavid Herrmann2015-01-161-28/+28
| | | | | | | | | | | | | | | The current parser directly reads a BOOLEAN on the PropertiesChanged signal for 'Active' properties. However, all property-values are packed in a VARIANT, otherwise, we wouldn't know the type. Fix the parser to recurse into the variant before reading the boolean. To avoid such bugs in the future, we extract the 'Active' parser into a helper function parse_active(), which is then shared between the PropertiesChanged and Get handlers. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
* logind: forward Active=true changes for non-DRM backendsDavid Herrmann2015-01-167-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Logind sends us a notification whenever the Active attribute of our session changes. However, due to the way compositor-drm.c relies on the master DRM device to be synced with the session, we used to delay Active=true handling until the DRM device was up, too. See: commit aedc7732ebd9bc7b4f51ee247ea857ffec6260a7 Author: David Herrmann <dh.herrmann@gmail.com> Date: Sat Nov 30 11:25:45 2013 +0100 logind: delay wakeup until DRM-device is resumed However, the other compositor backends do not use DRM, so logind-util will never get notified about any DRM device. Therefore, we have to forward the Active=true change immediately. This commit fixes logind-util to take sync_drm as argument. If it is true, we do DRM-device synchronisation, otherwise we don't. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86889 Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
* launcher: use SIGRTMIN to not conflict with xwaylandDavid Herrmann2015-01-161-3/+15
| | | | | | | | | | | | | xwayland uses SIGUSR1 as startup notification. Make sure to use SIGRTMIN for VT handling to avoid conflicts. A bonus is SIGRT* signals can be queued multiple times, so we will be able to correctly track them and will no longer lose signals (which wouldn't really matter, but is confusing in logs). Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
* logind: use SIGRTMIN to not conflict with xwaylandDavid Herrmann2015-01-161-10/+18
| | | | | | | | | | | | | xwayland uses SIGUSR1 as startup notification. Make sure to use SIGRTMIN and SIGRTMIN+1 for VT handling. A bonus is SIGRT* signals can be queued multiple times, so we will be able to correctly track them and will no longer lose signals (which wouldn't really matter, but is confusing in logs). Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
* libinput-device: use the discrete axis value for wheel eventsPeter Hutterer2015-01-151-4/+40
| | | | | | | | | | | libinput < 0.8 sent wheel click events with value 10. Since 0.8 the value is the angle of the click in degrees but it now provides the click count as separate value. To keep backwards-compat with existing clients, we just send multiples of the click count. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* libinput-device: use the new merged scroll eventsPeter Hutterer2015-01-151-5/+20
| | | | | | | | libinput now provides a single event for scroll events. Extract the axes from that event and split them into the wl events. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* input: Add comment explaining why pointer isn't freed when device is removedDerek Foreman2015-01-081-0/+5
| | | | | | | | | When the last pointer is removed from a seat, the pointer struct is intentionally kept. This has some interesting side effects, so I've documented it here so people like me don't errantly assume it's a bug. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* compositor-x11: Fix some shutdown crashesDerek Foreman2014-12-191-2/+14
| | | | | | | | | | | | | The assertion in x11_compositor_find_output() can trigger during normal shutdown, for example, when moving the mouse while hitting a hotkey to close the weston window. Instead we can remove the assert(), return NULL, and discard events we can't find a destination output for. v2 Signed-off-by: Derek Foreman <derekf@osg.samsung.com> v1 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* text: Don't crash if a seat has no keyboardDerek Foreman2014-12-161-6/+10
| | | | | | | | | | A keyboard might not be present in a seat, so check that before dereferencing keyboard related pointers. Also, use the keyboard pointer we set to shorten the code a little bit. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
* input: swallow the key press event when running a compositor key bindingGiulio Camuffo2014-12-151-1/+4
| | | | Reviewed-by: Daniel Stone <daniel.stone@collabora.com>
* text: Use bool for input_panel_visibleDerek Foreman2014-12-151-3/+4
| | | | Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* text: Remove unused linked list from input_method_contextDerek Foreman2014-12-151-2/+0
| | | | Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* text: Fix coding styleDerek Foreman2014-12-151-4/+7
| | | | | | Put the return type on a separate line in function declarations. Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* compositor: Propagate errors from module_initOndřej Majerech2014-12-151-2/+4
| | | | | | | | | | | load_modules currently ignores errors signalled by both weston_load_module and module_init, and instead always returns 0. Its return value appears to be checked in callers, so we most likely want to propagate any errors. Signed-off-by: Ondřej Majerech <majerech.o@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* clipboard: set fd member of clipboard_sourceMarek Chalupa2014-12-121-0/+1
| | | | | | | | | | The fd member of clipboard_source structure was not set but was used in close(). v2. don't do unnecessary changes Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* screenshooter: fix various memory handlingMarek Chalupa2014-12-121-8/+17
| | | | | | | | | | | There were unchecked malloc and no free for this memory. Also simplify error handling in one function. v2. remove check if memory is NULL, according to man pages, free(NULL) is a no-op Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor: Implement JSON-timeline loggingPekka Paalanen2014-12-085-0/+453
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logging is activated and deactivated with the debug key binding 't'. When activated, it creates a new log file, where it records the events. The log file contains events and detailed object information entries in JSON format, and is meant to be parsed in sequence from beginning to the end. The emitted events are mostly related to the output repaint cycle, like when repaint begins, is submitted to GPU, and when it completes on a vblank. This is recorded per-output. Also some per-surface events are recorded, including when surface damage is flushed. To reduce the log size, events refer to objects like outputs and surfaces by id numbers. Detailed object information is emitted only as needed: on the first object occurrence, and afterwards only if weston_timeline_object::force_refresh asks for it. The detailed information for surfaces includes the string returned by weston_surface::get_label. Therefore it is important to set weston_timeline_object::force_refresh = 1 whenever the string would change, so that the new details get recorded. A rudimentary parser and SVG generator can be found at: https://github.com/ppaalanen/wesgr The timeline logs can answer questions including: - How does the compositor repaint cycle work timing-wise? - When was the vblank deadline missed? - What is the latency from surface commit to showing the new content on screen? - How long does it take to process the scenegraph? v2: weston_surface::get_description renamed to get_label. v3: reafctor a bit into fprint_quoted_string(). Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor: add weston_surface_set_label_func()Pekka Paalanen2014-12-084-0/+51
| | | | | | | | | | | | | | | | | | | | When printing out logs from Weston's actions, mainly for debugging, it can be very difficult to identify the different surfaces. Inspecting the configure function pointer is not useful, as the configure functions may live in modules. Add vfunc get_label to weston_surface, which will produce a short, human-readable description of the surface, which allows identifying it better, rather than just looking at the surface size, for instance. Set the label function from most parts of Weston, to identify cursors and drag icons, and panels, backgrounds, screensavers and lock surfaces, and the desktop shell's application surfaces. v2: renamed 'description' to 'label', so we get weston_surface_set_label_func(). Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* fbdev: Remove unnecessary semicolonnerdopolis2014-12-031-1/+1
| | | | [daniels: removed extraneous changes]
* input: send focus events to the focused client when running a key bindingGiulio Camuffo2014-12-012-5/+21
| | | | | | | | When running a key binding we don't send the key press to the client via the wl_keyboard.key event. Instead, send a wl_keyboard.leave/enter pair so that the client knows the actual state of the keyboard. Reviewed-by: Daniel Stone <daniel@fooishbar.org>
* rpi-renderer: don't pass a box to pixman_region32_contains_point()Derek Foreman2014-12-011-2/+1
| | | | | | | We don't care which box contained the point, so don't pass one in. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* Use zalloc instead of calloc(1, ...)Bryce Harrington2014-11-2811-46/+53
| | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
* Setting members to 0/NULL after a zalloc or calloc is redundantBryce Harrington2014-11-284-19/+0
| | | | | | | | | | calloc (and zalloc) set the allocated memory to 0, so there's really no need to do it manually. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com> [Pekka: dropped the src/evdev.c hunk.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Use zalloc rather than malloc and manually setting members to 0Bryce Harrington2014-11-282-9/+5
| | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* input: Use slightly less obscure logic in evdev_notify_keyboard_focus()Derek Foreman2014-11-272-1/+2
| | | | | | | | | | | | While the test is actually correct (for non-negative numbers), it's not at all clear and seems to be an accidental order of operations mistake. Also, add an assert() to make sure this number is never negative. Closes bug 86346 - https://bugs.freedesktop.org/show_bug.cgi?id=86346 Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
* compositor: Drop legacy backends in favor of libinputPeter Hutterer2014-11-2611-2603/+3
| | | | Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* input: don't run the key bindings on focus inGiulio Camuffo2014-11-241-6/+0
| | | | | | | When getting the focus we get the list of pressed keys, but we are not supposed to run the key binding on them. Reviewed-by: Daniel Stone <daniel@fooishbar.org>
* compositor: Document options for headless compositorBryce Harrington2014-11-211-0/+10
| | | | | | | Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> [Pekka: s/Wayland surface/memory surface/, and say default renderer.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor-headless: add support for transforms set on command lineDerek Foreman2014-11-211-10/+16
| | | | | | | | We now allow --transform with the headless compositor, however it still doesn't parse anything out of weston.ini Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor-headless: allow rendering with pixmanDerek Foreman2014-11-211-4/+53
| | | | | | | Allow the headless backend to render into an off screen buffer with pixman. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor: Add idle timeout option to weston.iniFrederic Plourde2014-11-211-1/+5
| | | | | | | | | | | | | | Weston's idle timeout can already be set via the '-i' command-line option, but this patch lets users specify it also via weston.ini. Note that the command-line option takes precedence over the .ini, should the option be set by both. This patch also Updates weston.ini man page with idle-timeout bits https://bugs.freedesktop.org/show_bug.cgi?id=83921 Signed-off-by: Frederic Plourde <frederic.plourde@collabora.co.uk> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* gl-renderer: compress pixman bands to simplify geometryDerek Foreman2014-11-211-3/+64
| | | | | | | | | | | Pixman uses y-x banded rectangles to represent regions. We use these y-x banded rectangles to generate triangle fans, resulting in more geometry than strictly necessary to draw the screen. This patch combines the bands to reduce geometry for complex scenes. Acked-by: "Jasper St. Pierre" <jstpierre@mecheye.net> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* backends: refactor transform string parsingDerek Foreman2014-11-196-112/+60
| | | | | | | Most of the backends do their own parsing of transform strings, so let's put that all in the same place (compositor.c/h) Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Revert "input: don't send to clients key events eaten by bindings"Pekka Paalanen2014-11-193-55/+22
| | | | | | | | | | | | This reverts commit 5c11fc6fb7d9b1bccd50fc982c0798c9e09a2a04. According to two input specialists, this was the wrong way: http://lists.freedesktop.org/archives/wayland-devel/2014-November/018287.html Cc: Peter Hutterer <peter.hutterer@who-t.net> Cc: Daniel Stone <daniel@fooishbar.org> Cc: Giulio Camuffo <giuliocamuffo@gmail.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>