summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-05-20configure.ac: colord version to 0.1.27HEADmasterMun Gwan-gyeong1-1/+1
2013-05-20weston-launch: Print explanation of why we failed to open the deviceRob Bradford1-1/+6
2013-05-20shell: End grab if the grabbed shell surface has been destroyedRob Bradford1-1/+1
The shell_grab_start function sets up a destroy notification on the shell surface such that when the shell surface is destroyed the pointer on the grab to the shell surface is set to NULL. We must therefore check whether the shell surface is NULL and end the grab if it is. https://bugs.freedesktop.org/show_bug.cgi?id=64689
2013-05-20protocol: improve sub-surface spec wordingPekka Paalanen1-10/+17
Mention, that sub-surfaces are not clipped to the parent. Be more accurate on surface commit vs. apply state. Mention the initial stacking order. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-17Fix surface_pong when a seat doesn't have a pointerHardening1-2/+4
This patch fixes a crash with the surface_pong when one of the seats doesn't have a pointer. This was the case with the RDP compositor that use a fake seat with no mouse or keyboard.
2013-05-17weston-launch: Run weston in the user login shellQuentin Glidic1-3/+16
This patch brings back the user environment from the shell. In the future, weston-launch could create the Wayland socket earlier, in which case the user's shell could be used to run Wayland-specific tools in the new Weston session. Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-05-17protocol: remove an unused sub-surface error codePekka Paalanen1-2/+0
This was left over from allowing nesting. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-17compositor: forbid sub-surface nesting loopsPekka Paalanen1-0/+8
The only way to create a sub-surface loop by recursive nesting is to make the main surface (which does not have a role) a sub-surface of any of its sub-surfaces. All other cases should already be cought. This change checks for that exact case, and sends a protocol error. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-17tests: add a sub-surface nesting loop testPekka Paalanen1-0/+22
It should not be possible to create a loop by nesting sub-surfaces. Currently Weston fails this test. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-17protocol: set_desync should flushPekka Paalanen2-12/+24
wl_subsurface.set_desync should apply the cached wl_surface state. Otherwise, the sub-surface may be stuck: a commit on the parent surface, if desynchronized, will not commit the sub-surface because it is desynchronized, too. A commit on the sub-surface may not happen, if it is waiting for the frame callback from the previous commit. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-17tests: add sub-surface tree destruction permutationsPekka Paalanen1-0/+202
Add a test for varying the object destruction order in a complex sub-surface tree. This test attemps to fuzz the destruction of a sub-surface tree to make sure the server does not crash on any wl_surface or wl_subsurface destruction sequence. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-17fix module_init signature in module testsU. Artie Eoff2-4/+2
surface-global-test and surface-test did not get updated to the new module_init(...) signature when it changed in a50e6e4c500e3080b8df7ec14c7e42741477a423. Thus, they failed to compile. Simply running 'make check' shows the problem. This patch fixes it. fixes https://bugs.freedesktop.org/show_bug.cgi?id=64691 Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-05-17gl-renderer: Compile shaders only when neededAnder Conselvan de Oliveira1-29/+41
Saves some start up time by not compiling specific shaders until they are needed.
2013-05-15Fix missing corner resize cursors in Kubuntu (oxy-white theme)Dima Ryazanov1-8/+16
Looks like that theme uses different names. Also, add the correspoding horizontal and vertical resize cursors, just for consistency.
2013-05-15cms-colord: Warn if reading or writing to the FD failedRichard Hughes1-2/+8
This also fixes a compile warning when building the tarball.
2013-05-15cms-colord: Fix build after the API change 'Honor XDG_CONFIG_DIRS'Richard Hughes1-1/+1
2013-05-14lock-surface: Set geometry width and height before centeringKristian Høgsberg1-0/+2
The subsurface patches changed the center_on_output() behavior a bit. Instead of using the buffer width and height, it now looks at surface geometry. In lock_surface_configure() we haven't set up the geometry when we call center_on_output() so the lock surface would never show up.
2013-05-14text: Respawn input method process if it exitsEduardo Lima (Etrunko)1-0/+23
Just the same as it is done in shell.c, if the input method process exits for any reason, we relaunch it automatically, as it is not possible to launch a standalone application outside of the weston process. In v2: - Proper error message when giving up. Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
2013-05-14config-parser: Honor XDG_CONFIG_DIRSOssama Othman22-110/+158
This set of changes adds support for searching for a given config file in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in $XDG_CONFIG_HOME or ~/.config. This allows packages to install custom config files in /etc/xdg/weston, for example, thus allowing them to avoid dealing with home directories. To avoid a TOCTOU race the config file is actually open()ed during the search. Its file descriptor is returned and stored in the compositor for later use when performing subsequent config file parses. Signed-off-by: Ossama Othman <ossama.othman@intel.com>
2013-05-14compositor-drm: Don't page flip before a mode is setAnder Conselvan de Oliveira2-6/+28
The function drm_output_start_repaint_loop() unconditionally issues a page flip, even if the crtc for that output has not been enabled yet. That causes the page flip to fail, and drm_output_repaint() is never called. Solve this by bypassing the initial page flip if the output needs a mode set. This has the caveat of affecting latency predictability for that first frame and when a "driver" mode fullscreen surface causes a mode set. However, on both cases the mode set would take an unpredictable amount of time anyway. https://bugs.freedesktop.org/show_bug.cgi?id=63812 https://bugs.freedesktop.org/show_bug.cgi?id=64183
2013-05-14Add a colord implementation of a CMS plugin for westonRichard Hughes4-1/+572
This allows users to change the assigned display profile in GNOME (using gnome-control-center) or KDE (using colord-kde) and also allows the profiling tools to correctly inhibit the calibration state whilst measuring the native screen response.
2013-05-14move subsurface-server-protocol.h include out of compositor.hU. Artie Eoff2-1/+1
The subsurface-server-protocol.h header should not be included by any headers that are part of the SDK since it is not exported. Otherwise, SDK consumers will break during compilation. Move this include from compositor.h to compositor.c. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=64537 Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-05-10window: add DBG code for leaf management and redrawsPekka Paalanen1-3/+91
Aids for debugging and inspecting the algorithms. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10window: throttle resizing to the main surfacePekka Paalanen1-4/+9
In case a toytoolkit application manages to schedule resizes constantly, throttle them to the main surface display. When resizing, all surfaces are updated synchronously, so it also makes sense to synchronize on the main surface's frame callback particularly. Rendering any faster will not make sense. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10window: prevent EGL sub-surface deadlockPekka Paalanen1-0/+32
Mesa's eglSwapBuffers() waits for the frame event from the previous swapBuffers, before it returns. Apparently eglSwapInterval(), which should be able to disable the wait, is unimplemented for now. When a sub-surface contains an EGL widget, and the commit mode is synchronized, the frame events will not be delivered to EGL until the parent surface gets committed. Therefore rendering the EGL widget twice would lead to a deadlock. When the window is being resized, we need to force a repaint of the EGL widget, too, to make the whole window consistent. For that, we need to make sure the frame event from the previous eglSwapBuffers() actually arrives. This patch adds an extra wl_surface.commit(parent), when the window is being resized, which should guarantee, that the previous eglSwapBuffers gets its event. To properly handle an EGL widget in a sub-surface, running in its own thread, the EGL widget's automatic updates should be paused before sending the extra wl_surface.commit(parent). A natural place for the pause would be in the widget's resize hook. However, wl_surface.commit cannot be called right after resize hooks, because it would commit new, incomplete surface state. Therefore this patch is not enough for threaded toytoolkit applications. Luckily those do not exist yet. When eglSwapInterval() gets implemented, this patch should be reverted. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10clients: add subsurfaces demoPekka Paalanen6-0/+843
Add a demo program with: - a main surface (green) - a Cairo-image sub-surface (red) - a raw GLESv2 widget (triangle) Sub-surface input region is set empty to avoid problems in toytoolkit. If Cairo links to libGL, then we will end up with also libGLESv2 linked to subsurfaces program, and both libs getting really used, which leads to disaster. Do not build subsurfaces demo, if Cairo links to libGL and cairo-egl is usable. The GL rendering loop is not tied to the toytoolkit or the widget, but runs directly from its own frame callback. Therefore it runs independent of the rest of the application. This also relies on one of two things: - eglSwapInterval(0) is implemented, and therefore eglSwapBuffers never blocks indefinitely, or - toytoolkit has a workaround, that guarantees that eglSwapBuffers will return soon, when we force a repaint on resize. Otherwise the demo will deadlock. The code is separated into three sections: 1. The library component, using only EGL, GLESv2, and libwayland-client APIs, and not aware of any toolkit details of the parent application. This runs independently until the parent application tells otherwise. 2. The glue code: a toytoolkit application widget, who has its own rendering machinery. 3. The application written in toytoolkit. This patch also adds new toytoolkit interfaces: - widget_get_wl_surface() - widget_get_last_time() - widget_input_region_add() Toytoolkit applications have not had a possibility to change the input region. The frame widget (decorations) set the input region on its own when used, otherwise the default input region of everything has been used. If a window does not have a frame widget, it can now use widget_input_region_add() to set a custom input region. These are not window methods, because a widget may lie on a different wl_surface (sub-surface) than the window. Changes in v3: - replace set_commit_mode with set_sync and set_desync Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10window: implement per-surface redrawsPekka Paalanen1-27/+61
Add redraw_needed flag to all surfaces, in addition to having one in window. The window redraw_needed flag is changed to force a redraw of the whole window, regardless of frame events. widget_schedule_redraw() now schedules the redraw only for the surface, where the widget is on. window_schedule_redraw() is equivalent to scheduling a redraw for all (sub-)surfaces of the window. We still use only one deferred task for all redraws. surface_redraw() will skip the redraw, if the window does not force a redraw and the surface does not need a redraw. It will also skip the redraw, if the frame callback from the previous redraw has not triggered yet. When the frame callback later arrives, the redraw task will be scheduled, if the surface still needs a redraw. If the window forces a redraw, the redraw is executed even if there is a pending frame callback. This is for resizing: resizing should trigger a window repaint, as it really wants to update all surfaces in one go, to apply possible sub-surface size and position changes. Resizing is the only thing that makes a window force a redraw. With this change, subsurfaces demo can avoid repainting the cairo sub-surface while still animating the GL sub-surface. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10window: create sub-surfacesPekka Paalanen2-3/+155
The new application API window_add_subsurface() will create a plain widget that is on a new sub-surface. The sub-surface position is taken from the surface's root widget allocation. This way widget allocations are always in the main surface (i.e. window) coordinates. However, Cairo drawing coordinates will now be different to widget coordinates for sub-surfaces. Cairo coordinates are fixed by applying a translation in widget_cairo_create(), so that widget drawing code can simply use the widget allocation as before. Sub-surfaces are hooked up into resize, window flush, redraw, and find_widget. Window maintains a list of sub-surfaces in top-first order. Add a client settable default commit mode, and toggle the mode when resizing to guarantee in-sync updates of a window and its sub-surfaces. Changes in v3: - replaced set_commit_mode with set_sync and set_desync Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10window: implement shm triple-bufferingPekka Paalanen1-25/+41
Increase the maximum number of shm "leaves" to three, and rewrite the leaf release and pick algorithms. The new algorithms hopefully improve on buffer re-use while freeing unused buffers. The goal of the new release algorithm is to always leave one free leaf with storage allocated, so that the next redraw could start straight on it. The new leaf picking algorithm will prefer a free leaf that already has some storage allocated, instead of just picking the first free leaf that may need to allocate a new buffer. Triple-buffering is especially for sub-surfaces, where the compositor may have one wl_buffer busy on screen, and another wl_buffer busy in the sub-surface cached state due to the synchronized commit mode. To be able to forcibly repaint at that situation for e.g. resize, we need a third buffer. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10shell: account for the subsurfaces when going fullscreen or maximizingGiulio Camuffo1-21/+68
We must calculate the bounding box of the surface + subsurfaces set and use that when maximizing the window or going fullscreen. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10shell: enable moving and resizing of a surface when clicking on a subsurfaceGiulio Camuffo1-2/+6
[pq: changed to weston_surface_get_main_surface(), and used a temporary variable to clean up the expressions.] Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10shell: keyboard focus and restacking fixes for sub-surfacesPekka Paalanen3-18/+62
The shell needs to redirect some actions to the parent surface, when they originally target a sub-surface. This patch implements the following: - Move, resize, and rotate bindings always target the parent surface. - Opacity (full-surface alpha) binding targets the parent surface. This is broken, because it should change the opacity of the whole compound window, which is difficult to implement in the renderer. - click_to_activate_binding() needs to check the shell surface type from the main surface, because sub-surface would produce SHELL_SURFACE_NONE and prevent activation. - Also activate() needs to check the type from the main surface, and restack the main surface. Keyboard focus is assigned to the original (sub-)surface. - focus_state_surface_destroy() needs to handle sub-surfaces: only the main surface will be in a layer list. If the destroyed surface is indeed a sub-surface, activate the main surface next. This way a client that destroys a focused sub-surface still retains focus in the same window. - The workspace_manager.move_surface request can accept also sub-surfaces, and it will move the corresponding main surface. Changes in v2: - do not special-case keyboard focus for sub-surfaces - fix surface type checks for sub-surfaces in shell, fix restacking of sub-surfaces in shell, fix focus_state_surface_destroy() Changes in v3: - Renamed weston_surface_get_parent() to weston_surface_get_main_surface() to be more explicit that this is about sub-surfaces - Fixed move_surface_to_workspace() to handle keyboard focus on a sub-surface. - Used a temporary variable in several places to clarify code, instead of reassigning a variable. - Fixed workspace_manager_move_surface() to deal with sub-surfaces. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10tests: add sub-surface protocol testsPekka Paalanen3-1/+330
For testing the protocol behaviour only: - linking a surface to a parent does not fail - position and placement requests do not fail - bad linking and arguments do fail - passing a surface as a sibling from a different set fails - different destruction sequences do not crash - setting a surface as its own parent fails - nesting succeeds Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10compositor: introduce sub-surfacesPekka Paalanen2-16/+774
Implement the basic protocol for sub-surfaces: - expose wl_subcompositor global interface - error checking on protocol calls - associate a parent wl_surface to a sub-surface - introduce the sub-surface role, which is exclusive - an implementation of the wl_subsurface interface - allow nesting of sub-surfaces - proper surface transformation inheritance from parent to sub-surfaces - two different modes of wl_surface.commit for sub-surfaces - hook sub-surfaces up to repaint by modifying the repaint list code Struct weston_subsurface is dynamically allocated. For sub-surfaces, it is completely populated. For parent surfaces, weston_subsurface acts only as a link for stacking order purposes. The wl_resource is unused, parent_destroy_listener is not registered, the transform is not linked, etc. Sub-surfaces are not added directly into layers for display or input. Instead, they are hooked up via the sub-surface list present in parent weston_surface. This way sub-surfaces are inherently linked to the parent surface, and cannot be displayed unless the parent is mapped, too. This also eases restacking, as only the parent will be in a layer list. Also, only the main surface should be subject to shell actions. The surface list rebuilding in weston_output_repaint() is modified to process sub-surface lists, if they are non-empty. The sub-surface list always contains the parent, too, unless empty. The collection of frame_callback_list is moved to a later loop, to streamline the surface list rebuild functions. Features still lacking are: - full-surface alpha support for compound windows Changes in v2: - fix a bug in surface mapping: commit a sub-surface would cause the main surface to never be mapped. - remove debug printfs - detect attempt of making a surface its own parent - always zero-alloc weston_subsurface - apply wl_subsurface.set_position in commit, not immediately - add weston_surface_to_subsurface() - implement sub-surface commit modes parent-cached and independent - implement wl_subcompositor.destroy and wl_subsurface.destroy Changes in v3: - rebased, and use the new transform inheritance code - squashed the commit "add sub-surfaces to repaint list" - fixed a buffer reference leak in commit_from_cache() - Rewrite the sub-surface destructor code, and make it leave the wl_subsurface protocol object inert, if one destroys the corresponding wl_surface. - replaced set_commit_mode with set_sync and set_desync - allowed sub-surface nesting, and fixed repaint accordingly - implemented nested sub-surface commit modes - Made the sub-surface order changes from wl_subsurface.place_above and .place_below to be applied when the parent surface state is applied, instead of immediately. This conforms with the protocol specification now. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10protocol: add sub-surfacesPekka Paalanen9-0/+257
Add protocol for sub-surfaces, wl_subcompositor as the global interface, and wl_subsurface as the per-surface interface extension. This patch is meant to be reverted, once sub-surfaces are moved into Wayland core. Changes in v2: - Rewrite wl_subcompositor.get_subsurface description, and move mapping and commit details into wl_subsurface description. Check the wording in wl_subsurface.set_position description. - Add wl_subsurface.set_commit_mode request, and document it, with the commit_mode enum. Add bad_value error code for wl_subsurface. - Moved the protocol into Weston repository so we can land it upstream sooner for public exposure. It is to be moved into Wayland core later. - Add destroy requests to both wl_subcompositor and wl_subsurface, and document them. Experience has showed, that interfaces should always have a destructor unless there is a good and future-proof reason to not have it. Changes in v3: - Specify, that wl_subsurface will become inert, if the corresponding wl_surface is destroyed, instead of requiring a certain destruction order. - Replaced wl_subsurface.set_commit_mode with wl_subsurface.set_sync and wl_subsurface.set_desync. Parent-cached commit mode is now called synchronized, and independent mode is desynchronized. Removed commit_mode enum, and bad_value error. - Added support for nested sub-surfaces. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10compositor-drm: Destroy sprites before destroying the outputsKristian Høgsberg1-2/+2
2013-05-10editor: Removed unused utf8_characters() functionKristian Høgsberg1-11/+0
I left this in when I merged Jans patches.
2013-05-10Add initial color management framework codeRichard Hughes8-1/+403
ICC profiles can now be specified in weston.ini for each output, or a CMS implementation can optionally loaded from a pluggable module.
2013-05-08compositor: Move gl-renderer vertex arrays into gl-renderer.cKristian Høgsberg3-20/+22
They were still sitting in struct weston_compositor.
2013-05-08compositor: Remove stale prototypeKristian Høgsberg1-3/+0
We got rid of this function.
2013-05-08input: Remove unused focus and key fields from keyboard and focus grabsKristian Høgsberg1-3/+0
2013-05-08input: Move surface picking into the pointer grab focus callbackKristian Høgsberg5-56/+56
Currently the core input code does surface picking before calling into the focus callback of the current grab. Not all grabs need to pick a surface however, so we're doing work we don't have to in those cases. For example, the shell move and resize grabs don't need to pick and the default grab in implicit grab mode doesn't either. With this change, the pointer grab mechanism is now very simple: the focus callback is called whenever the pointer may have a new focus, the motion callback is called whenever the pointer moves and the button callback whenever a button is pressed or released.
2013-05-08input: Get rid of grab focus conceptKristian Høgsberg4-50/+36
This was another complication that we had to have to support the split between libwayland-server and weston. Different grabs want to send events relative to different surfaces at different times. The default grab switches between sending coordinates relative to the 'current' surface, that is the surface the pointer is currently above, or the 'clicked' surface, in case of an implicit grab. The grab focus was set by the grab implementation and the core input code would transform the pointer position to surface relative coordinates for the grab focus and store in grab->x/y. Now we can just let the grab implementation transform the pointer coordinates itself, leaving the implementation free to transform according to whichever surface it wants. Or not transform at all if it doesn't need surface relative coordinates (like the shell move and resize grabs).
2013-05-08input: Remove 'current' and related fields from weston_pointerKristian Høgsberg3-67/+40
The current surface field was used to track the surface the pointer was currently over along with pointer position relative to that surface, regardless of implicit or explicit grabs. The main purpose was to restore the default grab when another grab terminated. We can now just repick in that case and avoid keeping that state around, with the destroy listener overhead that involves. There was one other use case - we used to optimize out calls to weston_pointer_set_focus() if the focus didn't actually change. We can still do that, but we have to do that in the default_grab_focus() handler and compare against weston_pointer->focus instead.
2013-05-08data-device: Verify that the client has an implicit grab when starting a dragKristian Høgsberg1-2/+4
Make sure that the implicit is valid and still in effect as we start the drag. Fixes a long standing FIXME.
2013-05-08data-device: Eliminate two small helper functionsKristian Høgsberg1-42/+26
device_setup_new_drag_surface() and device_release_drag_surface() are both now fairly small and only called from data_device_start_drag() and data_device_end_grab() respectively. Folding the two functions in where they're called from simplifies the code flow a bit.
2013-05-08data-device: Rename generic weston_drag 'surface' field to 'icon'Kristian Høgsberg1-24/+24
2013-05-08data-device: Move all drag-related fields out of weston_seatKristian Høgsberg2-98/+99
We can now allocate a temporary weston_drag structure that we keep all this drag-and-drop related state in.
2013-05-08input: Move sprite fields into weston_pointer from weston_seatKristian Høgsberg3-60/+59
2013-05-08simple-egl: Add support for EGL_EXT_swap_buffer_with_damageKristian Høgsberg1-1/+39
This new EGL extension lets us communicate the damage area to the compositor by using eglSwapBuffersWithDamge() instead of the regular eglSwapBuffer(). http://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_swap_buffers_with_damage.txt