summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2014-01-02Properly free drm plane during creation of spritesChris Michael1-1/+1
If we fail to allocate space for a new drm_sprite, then we should properly call drmModeFreePlane (not free) to release the drm plane. Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-12-22Release pointer and keyboard with the seatHardening1-1/+4
This patch fixes seat releasing during a RDP disconnection. It does not fully fix https://bugs.freedesktop.org/show_bug.cgi?id=66830, but makes things better.
2013-12-22compositor: Destroy renderer in weston_compositor_shutdown()Ander Conselvan de Oliveira8-13/+3
Currently we destroy the renderer before the outputs are destroyed, but that sometimes leads to an error since a reference to the renderer is necessary in order to destroy a gl_renderer_output. Since destroying the renderer is common among all backends, just move that call into weston_compositor_shutdown() immediately after the outputs being destroyed.
2013-12-22pixman: Destroy pixman images when underlying buffer is destroyedLubomir Rintel1-1/+31
While the pixman image might be attached, the underlying buffer might be already gone under certain circumstances. This is easily reproduced by attempting to resize gnome-terminal on a fbdev backend. $ WAYLAND_DEBUG=1 strace -emunmap weston --backend=fbdev-backend.so ... [1524826.942] wl_shm@7.create_pool(new id wl_shm_pool@23, fd 40, 1563540) [1524827.315] wl_shm_pool@23.create_buffer(new id wl_buffer@24, 0, 759, 515, 3036, 0) ... [1524829.488] wl_surface@14.attach(wl_buffer@24, 0, 0) [1524829.766] wl_surface@14.set_buffer_scale(1) [1524829.904] wl_surface@14.damage(0, 0, 759, 515) [1524830.248] wl_surface@14.frame(new id wl_callback@25) [1524830.450] wl_surface@14.commit() ... [1524846.706] wl_shm@7.create_pool(new id wl_shm_pool@26, fd 40, 1545000) [1524847.215] wl_shm_pool@26.create_buffer(new id wl_buffer@27, 0, 750, 515, 3000, 0) [1524847.735] wl_buffer@24.destroy() [1524847.953] -> wl_display@1.delete_id(24) [1524848.144] wl_shm_pool@23.destroy() munmap(0xb5b2e000, 1563540) = 0 [1524849.021] -> wl_display@1.delete_id(23) [1524849.425] wl_surface@14.attach(wl_buffer@27, 0, 0) [1524849.730] wl_surface@14.set_buffer_scale(1) [1524849.821] wl_surface@14.damage(0, 0, 750, 515) <No commit yet, so drawing is attempted from older buffer that used to be attached to the surface, which happens to come from a destroyed pool, resulting it an invalid read from address 0xb5b2e000> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2013-12-19compositor: Clean up view output move and destroy listenersAnder Conselvan de Oliveira1-0/+6
Remove those listeners when the output is destroyed, otherwise they'll point to invalid data that may lead to corruption when assigning a new output for the view. -- This is possibly related to bug 72845. I didn't have enough equipment to try and reproduce it. https://bugs.freedesktop.org/show_bug.cgi?id=72845
2013-12-19compositor-x11: Set the name field on weston_outputsAnder Conselvan de Oliveira1-0/+4
That way log messages referencing the output are more informative.
2013-12-19screenshooter: Choose output to record from based on keyboard focusAnder Conselvan de Oliveira1-67/+29
Record from the output of the surface that has keyboard focus for the seat used to activate the recorder key binding. If there is no focused surface, record from the first one. Also, use the weston_transformed_region() to transform the damage region of the output into the coordinates expected by read_pixels(). https://bugs.freedesktop.org/show_bug.cgi?id=71401
2013-12-17compositor: Initialize output listener linksKristian Høgsberg1-0/+2
Make sure the links are initialized so we can safely remove the listeners in weston_view_unmap(). https://bugs.freedesktop.org/show_bug.cgi?id=72808
2013-12-17screenshooter: Record one extra frame when recording stopsAnder Conselvan de Oliveira1-2/+10
If the compositor hasn't been rendering for a while when the recording stops, the time difference between the last rendered frame and that moment won't be in the encoded video. Fix that by forcing one extra frame to be recorded when the user presses the recorder key binding. https://bugs.freedesktop.org/show_bug.cgi?id=71142
2013-12-16pixman-renderer: implement surface scaling and croppingJonny Lamb1-6/+24
The pixman renderer doesn't use the weston_surface_to_buffer* functions to alter coordinates depending on buffer transformation, buffer scaling, and surface scaler (wl_surface_scaler). pixman_transform_scale() is used instead to perform said transformations without having to modify each coordinate.
2013-12-16compositor: transform surface coordinates if a surface scaler is usedJonny Lamb2-8/+89
Implements wl_surface_scaler.set by setting desired src_{x,y,width,height} and dst_{width,height} values in the weston_buffer_viewport struct, then altering coordinates in weston_surface_to_buffer* functions if there is a scaler set for said surface.
2013-12-16compositor: add stub scaler resourcesJonny Lamb3-0/+109
This registers the wl_scaler global object and lets clients create wl_surface_scaler objects for surfaces. wl_surface_scaler.set is not implemented so this doesn't really do anything useful yet.
2013-12-16Add a weston_surface_set_size functionJason Ekstrand2-4/+15
Surfaces that are created by clients get their size automatically updated by the attach/commit. Surfaces created directly by shells (such as black surfaces) sometimes need to be manually resized. This function allows you to do that while being somewhat less messy than messing with the internals of weston_surface manually. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-12-16desktop-shell: Invalidate saved position when output is destroyedZhang, Xiong Y2-0/+9
If the saved position for a fullscreen or maximized output view is in an output that has been unplugged, the coordinates don't make sense anymore. In that case, invalidate them and use the initial position algorithm when changing them back to the basic state. Signed-off-by: Zhang, Xiong Y <xiong.y.zhang@intel.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-12-16compositor: Make pointers visible when an output is unpluggedAnder Conselvan de Oliveira3-12/+81
Previously, if a pointer was inside an output that was unplugged, it could potentialy end up outside any valid output forever. With this patch, the pointer is moved to the "closest" output to the pointer.
2013-12-16compositor: Don't repaint outputs being destroyedAnder Conselvan de Oliveira2-0/+6
Set a flag when an output is being destroyed and use that to avoid repainting. This allows functions that schedule an output repaint to be called when the output is being destroyed without causing the compositor to crash.
2013-12-16compositor: Ensure views are visible if their output was unpluggedZhang, Xiong Y2-2/+58
Use the output destroy signal to move the views in the event the output was unplugged. Signed-off-by: Zhang, Xiong Y <xiong.y.zhang@intel.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-12-16compositor: Move views when outputs are movedZhang, Xiong Y2-3/+75
Previously, when an output was moved due to another output being unplugged, the views on the first output would remain in the same position. This patch adds an output_move signal that the views listen too in order to repostion themselves in the event of an unplug. Signed-off-by: Zhang, Xiong Y <xiong.y.zhang@intel.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-12-16compositor-headless, compositor-rdp: Don't call weston_output_move()Ander Conselvan de Oliveira2-4/+0
The call to weston_output_move() when creating the output is unnecessary. That is already called by wesotn_output_init().
2013-12-16compositor: Move the logic of moving outputs into the coreZhang, Xiong Y3-25/+26
Instead of having the backends move the remaining outputs when one is destroyed, let the core compositor deal with that. Signed-off-by: Zhang, Xiong Y <xiong.y.zhang@intel.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2013-12-16compositor: Remove output from list in weston_output_destroy()Ander Conselvan de Oliveira5-4/+2
When destroying ouputs, they would sometimes be removed before the call to weston_output_destory() and sometimes after, depending on the backend. Now the output is remove withing that function so the behavior is standard across all backends.
2013-12-16compositor-x11: Only destroy one output when the close button is pressedAnder Conselvan de Oliveira1-1/+31
Instead of terminating the compositor, destroy the output whose close button was clicked and move the other outputs, as is done in the drm backend.
2013-12-16evdev: Drop joystick rejection heursticsKristian Høgsberg1-9/+0
We now no longer add joysticks at all. They show up as absolute motion devices without has_button, so we don't add them as a pointer. We may add a keyboard for the keyboard-style keys, but that's fine. With the previous commit, we no longer generate spurious absolute pointer motion for the abs axes. https://bugs.freedesktop.org/show_bug.cgi?id=71687
2013-12-16evdev: Reject absolute motion if we're not a pointer or a touch deviceKristian Høgsberg1-1/+1
Some joysticks have certain buttons that acts keyboard keys. As such, we'll reconize them as keyboards but not pointers. In that case, don't send pointer motion events when we get absolute joystick events.
2013-12-16evdev: Drop obsolete accelerometer reject ruleKristian Høgsberg1-13/+1
This rule triggers for devices with an ABS_X/Y evaluators and no keyboard or multitouch events. There is no way we would ever add such a device as a pointer, keyboard or touch device anyway. A pointer device requires has_button (in which case the !has_key condtion would fail); a keyboard device would also mean !has_key is false and a touch screen device implies that !device->is_mt is false.
2013-12-16evdev: Remove EVDEV_TOUCH and with it evdev_device->capsKristian Høgsberg2-16/+8
We now keep all the configuration intermediate results inside evdev_configure_device() and the result is device->seat_caps.
2013-12-16evdev: Use a has_keyboard flag instead of EVDEV_KEYBOARD bitKristian Høgsberg2-9/+8
2013-12-16evdev: Replace EVDEV_BUTTON with local has_button flagKristian Høgsberg2-6/+6
2013-12-16evdev: Replace EVDEV_MOTION_ABS with local has_abs flagKristian Høgsberg2-7/+3
2013-12-16evdev: Use has_abs only for ABS_X and ABS_Y, introduce has_mt for MT eventsKristian Høgsberg1-4/+6
We split up has_abs into plain ABS_X/Y and MT events, but this shouldn't introduce any logic changes.
2013-12-16evdev: Drop EVDEV_MOTION_REL flagKristian Høgsberg2-6/+6
This is only used inside evdev_configure_device() and we now use a local has_rel flag instead.
2013-12-16evdev: Combine evdev_handle_device() and evdev_configure_device()Kristian Høgsberg1-11/+7
We split the device probing and idenfication somewhat arbitrarily between these two functions. This commit combines them into one. Return of -1 indicates error, 0 success, but succesful probing can return a device with device->caps == 0, which means we don't handle the device.
2013-12-09sdk: make C++11 plugins build againGiulio Camuffo1-4/+0
compositor.h must not define a 'static_assert' macro, since that conflicts with the new 'static_assert' in the standard and breaks the build.
2013-12-09Update .gitignoreJasper St. Pierre1-8/+0
2013-12-08shell: Make sure the shell implementation and protocol versions matchKristian Høgsberg1-0/+4
2013-12-06input: make sure the devices get the resource destruction signalGiulio Camuffo1-12/+14
The device may not have a resource for the client yet, but install the listeners nevertheless. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=65726
2013-12-05compositor-x11: Damage output when we receive expose events for the windowKristian Høgsberg1-0/+1
The gl renderer typically repaints everything since we don't have EGL_buffer_age under X, but the pixman renderer carefully only repaints damaged regions. So to actually repaint anything with the pixman renderer, we need to damage the output. https://bugs.freedesktop.org/show_bug.cgi?id=72351
2013-12-04rpi: launcher must init before udev-seatPekka Paalanen1-12/+12
udev-seat will call weston_launcher_open(), so we better init launcher first. Fixes a segfault. Cc: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-12-04rpi: seat quick fixPekka Paalanen1-1/+1
Fix the default seat name, so that we can find the input devices by default. This is just a quick fix. Further enhancement would be to make the default seat on rpi taken from a command line option like the other backends do. Furthermore, udev_input_init() should accept NULL as seat to use the default seat, avoiding us hardcoding "seat0" all over. Cc: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-12-04rpi: compile in the common udev codePekka Paalanen1-0/+2
In a recent commit 37d38d932cea8a642e644d091747d0d9c046a00a, "rpi: Use common udev_input for input device handling", the rpi-backend was made to use the common udev code. It just forgot to actually build the common udev code into the rpi-backend. Cc: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-12-04gl: fix fallback definition of EGL_DEFAULT_DISPLAYPekka Paalanen1-1/+1
Compiling fbdev backend on RaspberryPi caused the following warning: compositor-fbdev.c: In function 'fbdev_compositor_create': compositor-fbdev.c:929:6: warning: passing argument 2 of 'gl_renderer->create' makes integer from pointer without a cast [enabled by default] compositor-fbdev.c:929:6: note: expected 'EGLNativeDisplayType' but argument is of type 'void *' Fix the definition of EGL_DEFAULT_DISPLAY to match the definition in EGL/egl.h (of Mesa). Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-12-04desktop-shell: Move to new desktop-shell subdirectoryKristian Høgsberg2-6927/+0
2013-12-04Move xwayland up one directory levelKristian Høgsberg9-4217/+0
2013-12-04tablet-shell: RemoveKristian Høgsberg2-617/+0
The tablet-shell is unmaintained and unused. It is currently dead-weight and a burden when we make changes to weston. Let's drop it for now, we can pull it out of git if we find a need for it later.
2013-12-03Check if the frame exists before reading its sizeDima Ryazanov1-2/+2
This fixes crashes caused by popup windows that don't have override_redirect (e.g., menus in VLC and KDE apps). Signed-off-by: Dima Ryazanov <dima@gmail.com> Reviewed-by: Axel Davy <axel.davy@ens.fr>
2013-12-03Check for frame being NULL before setting/unsetting flagsDima Ryazanov1-2/+4
Fixes a crash in Firefox when clicking an "install plugin" popup. Signed-off-by: Dima Ryazanov <dima@gmail.com>
2013-12-03Set the view to NULL when unmapping an X11 windowDima Ryazanov1-0/+2
Fixes a crash caused by accessing a deleted view in weston_wm_window_schedule_repaint. It can be easily reproduced by switching between menus in Firefox. Signed-off-by: Dima Ryazanov <dima@gmail.com>
2013-12-03data-device: Fix surface configure function typeJonas Ådahl1-8/+9
The commit "Remove the weston_view.geometry.width/height fields" changed the type of the surface configure callback function, but did not change the callbacks in data-device.c. This commit fixes the type of the functions left needed to be changed. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-12-03logind: delay wakeup until DRM-device is resumedDavid Herrmann1-21/+37
The logind API was designed to allow any kind of devices and any number of devices. It has no idea of "main DRM device" or similar. However, the weston DRM backend was designed with a single DRM device as master. Therefore, we wake it up unconditionally on session-wakeup. But this may fail with logind as a session may be awake, but not all devices have been resumed, yet. Therefore, we change the weston-logind backend to deal with this case correctly. Instead of waking up the compositor on session-wakeup, we wait for the main DRM device to wake up. Once we get the event, we notify the compositor. For sleep, we reverse this logic. On *any* of the following events we tell the compositor to go to sleep: - Session gets inactive - DRM device gets inactive - DRM device is removed This guarantees, that weston is only active if *both*, the session and the main DRM device are awake/active. Note that we could actually rely solely on the DRM-device Pause/Resume events from logind and drop all the Active-Prop-Changed handling. logind guarantees proper ordering of both. However, in case we ever change weston to support multiple GPUs, we need the per-device notification. Thus, keep the code. This also makes weston more fail-safe in case logind fails to send the PauseDevice event (for whatever reason..).
2013-12-03xdg-shell: Add key bindings for setting maximized and fullscreen.Rafael Antognolli1-0/+52