summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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-16protocol: crop & scale RFC v3Pekka Paalanen2-1/+158
Add cropping and scaling to wl_surface. Add a global factory interface wl_scaler, which creates wl_scaler_surface objects tied to a given wl_surface. The wl_scaler_surface object can be used to set a cropping and scaling transformation to change how a wl_buffer maps to wl_surface contents. Changes in v2: Take into account buffer_transform and buffer_scale, and try to explain more clearly how the coordinate transformations work and what their order is. Add, that crop and scale state is double-buffered. Explain missing dst_x, dst_y. Clarify that undefined content still is some content, but NULL buffer implies no content nor size. Changes in v3: Disallow zero values for dst_width and dst_height. Open issues: Should this be a separate interface like here, or just a wl_surface request? If we keep this as a separate interface, rename wl_surface_scaler to wl_viewport.
2013-12-16Add a weston_surface_set_size functionJason Ekstrand3-10/+18
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-16shell: Reset fullscreen and maximized state on output unplugAnder Conselvan de Oliveira1-0/+3
When a view is moved to another output because its current output was unplugged, remove the fullscreen and maximized state.
2013-12-16desktop-shell: Invalidate saved position when output is destroyedZhang, Xiong Y3-5/+36
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 Camuffo2-4/+4
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-0/+1
Ignore the new stacking demo...
2013-12-09Update .gitignoreJasper St. Pierre3-8/+6
2013-12-09shell: Fix set_transient_for with a NULL parentJasper St. Pierre1-2/+6
2013-12-08shell: Make sure the shell implementation and protocol versions matchKristian Høgsberg2-0/+7
2013-12-07simple-egl: Add option to allow not syncing to compositor repaint cycleKristian Høgsberg1-19/+27
It's the GO FASTER option.
2013-12-07simple-egl: Print fps for the spinning triangleKristian Høgsberg1-5/+17
This is not a benchmark.
2013-12-07tests: Test whether a simple EGL main loop uses too many buffersNeil Roberts7-2/+223
This adds a test that tries to simulate a simple game loop that would be like this: while (1) { draw_something(); eglSwapBuffers(); } In this case the test is relying on eglSwapBuffers to throttle to a sensible frame rate. The test then verifies that only 2 EGL buffers are used. This is done via a new request and event in the wayland-test protocol. Currently this causes 3 buffers to be created because the release event generated by the swap buffers is not processed by Mesa until it blocks for the frame complete event in the next swap buffers call, but that is too late. This can be fixed in Mesa by issuing a sync request after the swap buffers and blocking on it before deciding whether to allocate a new buffer.
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-05desktop-shell: Drop next_type from shell_surfaceKristian Høgsberg1-29/+13
The surface type now no longer changes and we track pending state changes in next_state. Instead of testing type != next_type to detect changes in state, we just look at state_changed.
2013-12-05shell: Put xwayland surface at the top of the fullscreen layerKristian Høgsberg1-0/+2
An xwayland surface corresponds to a override-redirect window under X, which is typically a menu or a popup window. They typically appear with a keyboard and mouse grab and by nature of being override-redirect these window can appear anywhere on screen and in the stack. We need to resort to heuristics to decide where to place the override-redirect in our surface stack, and for now we'll just put it on top of everything. That's going to be correct for almost all cases of clicking to open a menu, but we can revisit and refine if we run into a case that needs better handling.
2013-12-05desktop-shell: Make set_toplevel() clear surface statesKristian Høgsberg1-3/+2
This is used from wl_shell and xwayland and we need to make sure xwayland also gets this behavior.
2013-12-05desktop-shell: Set fullscreen flags in common code pathKristian Høgsberg1-6/+3
Just as for set_maximized() we can move the setting of the fullscreen and state_changed flags into the common set_fullscreen() function. This function is also used from the xwayland wm to set fullscreen windows, and with this change that now works again.
2013-12-05desktop-shell: Set maximized flags in common code pathKristian Høgsberg1-6/+3
We can set the maximized and state_changed flags in set_maximized(), which is shared between shell_surface_set_maximized() and xdg_surface_set_maximized().
2013-12-05stacking: Set a keyboard focus handler so we can repaint the frameKristian Høgsberg1-0/+11
Yes, perhaps this should be more automatic...
2013-12-05shell: Don't try to switch to a NULL shell surface.Rafael Antognolli1-10/+3
Fixes the crash from alt+tab when there's a fullscreen surface.
2013-12-05shell: Set a surface as TOPLEVEL instead of the old surface types.Rafael Antognolli1-2/+3
Since internally there's no more SHELL_SURFACE_FULLSCREEN and SHELL_SURFACE_MAXIMIZED, the surface must be set to SHELL_SURFACE_TOPLEVEL on the respective functions. This fixes the bug when clients start already in fullscreen mode. In that case, they aren't set first to toplevel, and then change to fullscreen. They are set as fullscreen directly, not receiving the SHELL_SURFACE_TOPLEVEL type on the set_fullscreen function.
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-05shell: Add missing break to a case statement inside set_surface_type.Rafael Antognolli1-0/+1
This should fix the surface not going back to its original position after unsetting fullscreen or maximized states. https://bugs.freedesktop.org/show_bug.cgi?id=72321
2013-12-04nested: Add an option to disable subsurfacesNeil Roberts1-0/+12
This adds a -b option to force the nested compositor example to use the old blit renderer even if the appropriate extensions are available.
2013-12-04nested: Add a renderer using subsurfacesNeil Roberts1-5/+209
Adds a second renderer implementation to the nested compositor example that creates a subsurface for each of the client's surfaces. The client buffers are directly attached to the subsurface using the EGL_WL_create_wayland_buffer_from_image extension instead of blitting them in the redraw_handler. The new renderer is always used if the parent compositor supports the wl_subcompositor protocol and the EGL extension is available. Otherwise it will fall back to the blit renderer.
2013-12-04clients: Add a widget_get_wl_subsurfaceNeil Roberts2-0/+9
Adds a simple accessor for the wl_subsurface for widgets created with window_add_subsurface.
2013-12-04nested: Add a ‘renderer’ mechanism with a vtableNeil Roberts1-71/+147
Eventually the nested compositor example will want to be able to cope with either rendering as it does now with a blit to an intermediate surface or by attaching the client buffers directly to a subsurface without copying. This patch moves the code that is specific to the blitting mechanism into a separate set of functions with a vtable to make it easier to add the second way of rendering in a later patch.
2013-12-04nested: Move the frame callback list to the surfaceNeil Roberts1-11/+27
Previously the frame callback list was tracked as part of the global compositor state. This patch moves the list to be part of the surface state like it is in Weston. The frame callback now iterates the list of surfaces to flush all of the callbacks. This change will be useful when the example is converted to use subsurfaces so that it can have a separate frame callback for the subsurface and flush the list for an individual client surface rather than flushing globally.
2013-12-04nested: Add damage tracking to the nested compositor exampleNeil Roberts1-0/+21
The nested compositor example now responds to damage requests and tracks them in the pending buffer state. This isn't currently used for anything and it is immediately discarded when the surface is commited but it will be used later when the example is converted to use subsurfaces.
2013-12-04nested: Add double-buffered state semantics to the nested exampleNeil Roberts1-27/+103
The buffer and frame callback state on the surfaces in the nested compositor example are now double-buffered so that they only take effect when the commit request is received. This doesn't really make much difference for the current state that the example has but it will be useful when more state is added in later patches.
2013-12-04nested: Add the buffer reference semantics from WestonNeil Roberts1-4/+95
This copies the buffer reference busy count implementation from Weston to the nested compositor example and adds an internal nested_buffer struct that we could eventually use to attach data. This will be useful to adapt the example to use subsurfaces so that we can attach our compositor-side buffer to the resource.