Kristian Høgsberg [Fri, 7 Sep 2012 02:25:25 +0000 (22:25 -0400)]
compositor: Remove unused 'fbo' field from weston_compositor
Kristian Høgsberg [Fri, 7 Sep 2012 01:59:29 +0000 (21:59 -0400)]
compositor: Destroy gles2 resource for weston_surface in gles2-renderer.c
This moves the last gles2 call out of compositor.c.
Kristian Høgsberg [Fri, 7 Sep 2012 01:44:24 +0000 (21:44 -0400)]
compositor: Move unbind_display call into gles2-renderer.c
Kristian Høgsberg [Fri, 7 Sep 2012 01:07:40 +0000 (21:07 -0400)]
compositor: Move EGL context creation to gles2-renderer.c
Kristian Høgsberg [Fri, 7 Sep 2012 00:51:00 +0000 (20:51 -0400)]
compositor: Create outputs before initializing GLES2 state
This way we can just use the first weston_output EGLSurface to make a
context current.
Kristian Høgsberg [Thu, 6 Sep 2012 02:49:55 +0000 (22:49 -0400)]
compositor: Introduce a weston_renderer object
Move the gles2 render functions to vfuncs on the renderer object.
Kristian Høgsberg [Thu, 6 Sep 2012 02:38:18 +0000 (22:38 -0400)]
compositor: Move EGL/GLES2 parts of weston_surface_attach to gles2-renderer.c
Kristian Høgsberg [Thu, 6 Sep 2012 02:13:58 +0000 (22:13 -0400)]
compositor: Move update_shm_texture() to gles2-renderer.c
We rename it flush_damage() as it's the point where we update our rendering
API source (eg, the gles2 texture) according to the accumulated damage,
if necessary.
Kristian Høgsberg [Thu, 6 Sep 2012 02:06:26 +0000 (22:06 -0400)]
compositor: Move gles2 initialization to gles2-renderer.h
Kristian Høgsberg [Thu, 6 Sep 2012 02:02:22 +0000 (22:02 -0400)]
compositor: Move non-GL initialization out of weston_compositor_init_gl()
Kristian Høgsberg [Thu, 6 Sep 2012 01:59:35 +0000 (21:59 -0400)]
compositor: Move surface repaint code to gles2-renderer.c
Kristian Høgsberg [Thu, 6 Sep 2012 01:54:15 +0000 (21:54 -0400)]
compositor: Consolidate output repaint logic
We move the EGL and GLES2 output repaint code into a new gles2-render.c
file. The eglMakeCurrent, glViewPort, surface loop etc was duplicated
across all backends, but this patch moves it to a new file.
Philipp Brüschweiler [Thu, 6 Sep 2012 13:23:28 +0000 (15:23 +0200)]
screensaver: fix decoding of transparency in xpm files
Use 0 as transparent pixel. This is needed when using premultiplied
alpha.
U. Artie Eoff [Tue, 4 Sep 2012 17:53:07 +0000 (10:53 -0700)]
test-text-client: fix compile error
Pass surface to text_model_factory_create_text_model.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54502
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Pekka Paalanen [Tue, 4 Sep 2012 10:55:44 +0000 (13:55 +0300)]
compositor: do not round a zero area to non-zero
surface_accumulate_damage() will call surface_compute_bbox() with the
extents of the surface damage region, for transformed surfaces only. If
there is no damage, surface_compute_bbox() will round up the empty
rectangle to a 1x1 rectangle. Triangles are produced for this 1x1
rectangle intersected with the surface.
The problem showed up with the triangle fan debug, where some seemingly
garbage pixels showed up relative to rotated surfaces.
Fix this by explicitly checking, that the area, for which a bounding box
is being computed for, is not zero.
Note, that the bbox will also be empty if only one of width and height
is zero. We do not paint things with zero thickness.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Rob Clark <rob.clark@linaro.org>
Pekka Paalanen [Tue, 4 Sep 2012 10:55:43 +0000 (13:55 +0300)]
compositor: do not duplicate ARRAY_SIZE
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Tue, 4 Sep 2012 10:55:42 +0000 (13:55 +0300)]
compositor: reduce the number of triangles
The intersection of two rectangles is guaranteed to be convex. Therefore
we do not need a center vertex for the triangle fan, we can simply use
the whatever first vertex the intersection polygon has. This reduces the
number of triangles, while still painting the exact same area.
While at it, emit_vertex() nested function is factored into the
for-loop, since that is the only calling site left.
Comments are updated to reflect the changes, and some unrelated comment
fixes are in repaint_region().
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Rob Clark <rob.clark@linaro.org>
Pekka Paalanen [Mon, 3 Sep 2012 13:48:43 +0000 (16:48 +0300)]
compositor: fix fan_debug mode
- make it respect output transforms by making sure the uniforms are
up-to-date
- properly restore the current shader program, in case it was
overridden
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 3 Sep 2012 13:48:42 +0000 (16:48 +0300)]
compositor: paint opaque regions with RGBX shader
weston_surface_draw() is restructured so that it will always use the
RGBX shader for opaque regions, if the surface is assigned the RGBA
shader.
Previously for opaque regions, we simply assumed, that the texture alpha
would be 1.0. If it was not (which really is an application bug), the
region would be misrendered. The RGBX shader forces the texture alpha to
1.0.
Xwayland surfaces may have bad alpha data in the opaque client area. If
blending was enabled, the bad alpha would be used with the RGBA shader.
This patch fixes rendering opaque xwayland windows with full-surface
alpha applied.
Test case: xterm, with full-surface alpha one step below 1.0. Before,
black text was fully transparent, now it is correctly only slightly
transparent.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Mon, 3 Sep 2012 13:48:41 +0000 (16:48 +0300)]
xwayland: replace opaque_rect, fix an alpha problem
Remove weston_surface::opaque_rect completely.
Instead, set the opaque region in xwayland.
Before this patch, black text in xterm was transparent. Now it is not.
However, this patch fixes only a part of the alpha problem. If you apply
full-surface alpha with super+alt+wheel, the problem reappears. This
problem is still due to bad alpha channel contents on xwayland windows.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Philipp Brüschweiler [Sat, 1 Sep 2012 14:21:40 +0000 (16:21 +0200)]
toytoolkit: supply correct widget in motion_handler callback
Philipp Brüschweiler [Sat, 1 Sep 2012 14:03:05 +0000 (16:03 +0200)]
workspaces: don't segfault on invalid move_surface_to_workspace request
Also fixes the off-by-one in toytoolkit that exposed the issue.
Jonas Ådahl [Wed, 29 Aug 2012 20:13:03 +0000 (22:13 +0200)]
shell: Improve focus handling when moving surfaces between workspaces
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Wed, 29 Aug 2012 20:13:02 +0000 (22:13 +0200)]
toytoolkit: Implement support for the workspace manager interface
Two buttons are added to the right-click menu of the window frame for
moving a surface either up or down.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Wed, 29 Aug 2012 20:13:01 +0000 (22:13 +0200)]
shell: Introduce workspace manager interface
The workspace manager interface purpose is to provide clients with
control and knowledge about the current workspace state. Initially only
one function and one event exists; moving a surface and state updated
event. A workspace is represented as an index in a 1 dimensional array.
A client keeps track of the state by being broadcasted events when the
state changes, currently limited to current workspace or number of
workspaces available.
A client can send an asynchronous request to the manager asking to move
a surface to workspace identified by an index. It is up to the shell to
actually move it.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Wed, 29 Aug 2012 20:13:00 +0000 (22:13 +0200)]
shell: Add possibility to move surfaces to other workspaces
By default, Control + Shift + Up/Down will move the currently active
surface, if any, while changing to another workspace.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Wed, 29 Aug 2012 20:12:59 +0000 (22:12 +0200)]
shell: Always set focus when restoring focus state
To avoid having a surface on a hidden workspace in focus always set the
focus (even to NULL) when restoring.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Jonas Ådahl [Wed, 29 Aug 2012 20:12:58 +0000 (22:12 +0200)]
Add sample configuration for workspaces to weston.ini
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Scott Moreau [Fri, 31 Aug 2012 09:18:15 +0000 (03:18 -0600)]
simple-egl: Avoid race condition.
After explaining the problem on irc, Pekka dictated this solution which works.
The problem is that simple-egl can hang when toggling fullscreen because of a
race where (quoting Pekka) "if it dispatches the frame callback simple-egl
itself requested before the Mesa's own frame callback came, simple-egl will go
to its redraw routing and call eglSwapBuffers so you end up effectively calling
eglSwapBuffers from within eglSwapBuffers, and deadlock". This patch avoids
redrawing (which calls eglSwapBuffers) when there is a pending frame callback.
Scott Moreau [Thu, 30 Aug 2012 20:44:16 +0000 (14:44 -0600)]
simple-egl: Only set alpha_size=0 when -o is passed.
When starting simple-egl with -f for fullscreen and toggling to 'windowed' mode with F11,
the surface is opaque instead of semi-trnasparent as it is when starting without -f. We
only want to create the surface with alpha_size=0 when the user explicitly passes -o
because otherwise it will never have the ability to use alpha.
Scott Moreau [Thu, 30 Aug 2012 20:44:15 +0000 (14:44 -0600)]
simple-egl: Remove unused variable.
Pekka Paalanen [Thu, 30 Aug 2012 21:47:21 +0000 (16:47 -0500)]
compositor: triangle fan debug
Draw the borders of all the triangles.
v1: original
v2: add keybinding to enable/disable fan debug (super-alt-space),
cycle colors to make it easier to see individual draws, and
redraw undamaged region to clean up previous frames debug
lines
Signed-off-by: Rob Clark <rob@ti.com>
Pekka Paalanen [Thu, 30 Aug 2012 21:47:20 +0000 (16:47 -0500)]
compositor: fix blending for full-surface alpha
We can use and render the opaque region only, if we are not applying a
full-surface alpha.
Test case: weston-terminal; use super+alt+mousewheel to adjust the
window transparency. Before it went black, now it blends correctly.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Thu, 30 Aug 2012 21:47:19 +0000 (16:47 -0500)]
compositor: specialised fragment shader for RGBX
Remove the weston_surface::blend attribute, which really meant that the
texture produced valid alpha values. This was used to override the opaque
region for RGBX surfaces, which produce undefined values for alpha.
Instead, compile a new shader especially for RGBX surfaces, that
hardcodes the sampled alpha as 1.0.
Before "compositor: optimize/simplify shaders" there was a 'vec4 opaque'
in the shaders, that would cause part of the texture to be forced to
alpha=1.0. Now that is gone, and we need this replacement.
To test: launch simple-shm, and use the super+alt+mousewheel combination
to make it transparent. It should not show a light cross over the window.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Rob Clark [Thu, 30 Aug 2012 21:47:18 +0000 (16:47 -0500)]
compositor: simplify shaders
Re-work how the shaders and emitted vertices work. Rather than always
rendering clip-rect sized quads and doing transformation in tex coords
(and requiring the corresponding clipping in frag shader), instead
emit transformed vertices, clipped wrt. dirty region, and use simpler
frag shaders. Also, split the rendering, so blended surfaces with an
opaque region have the opaque region drawn with blend disabled. The
result is considerably fewer pixels drawn with blend enabled, and much
fewer cycles in the frag shader.
This requires having some more complex logic to figure out the vertices
of the shape which forms the intersection of the clip rect and the
transformed surface. Which has perhaps got a few bugs or missing cases,
still (visual glitches in some cases) but at this point more or less is
starting to work. I think it is at least far enough along to get some
initial review.
The result, on small SoC GPU (omap4/pandaboard) on 1920x1080 display,
for simple stuff like moving windows around, I get 60fps (before 30fps
or less), and pushing YUV buffers for hw decoded 1080p video goes from
~6fps to 30fps, with no drop in framerate for transformed/rotated video
surface.
v1: original
v2: check that perpendicular intersect vertex falls within bounds of
transformed surface
v3: update w/ comments and fixes from Pekka Paalanen
v4: fix for full surface alpha from Pekka Paalanen, fix compositor-
wayland build
Signed-off-by: Rob Clark <rob@ti.com>
Rob Clark [Fri, 31 Aug 2012 21:42:18 +0000 (16:42 -0500)]
compositor: add support for OES_EGL_image_external
In cases where the GPU can natively handle certain YUV formats,
eglQueryWaylandBufferWL() can return the value EGL_TEXTURE_EXTERNAL_WL
and the compositor will treat the buffer as a single egl-image-external.
See:
http://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image_external.txt
v1: original
v2: rename EGL_TEXTURE_EXTERNAL_OES -> EGL_TEXTURE_EXTERNAL_WL and query
for the extension
v3: fix build without updated mesa headers, if EGL_TEXTURE_EXTERNAL_WL
#define is missing from older mesa headers.
v4: resend without missing parts
Signed-off-by: Rob Clark <rob@ti.com>
Pekka Paalanen [Wed, 29 Aug 2012 12:49:48 +0000 (15:49 +0300)]
man: add man page for weston
It is not complete, but has lots of stuff already.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Philipp Brüschweiler [Wed, 29 Aug 2012 08:53:36 +0000 (10:53 +0200)]
desktop-shell: don't segfault on invalid icon path
Instead draw a fallback icon and proceed as normal.
https://bugs.freedesktop.org/show_bug.cgi?id=53860
v2: coding style fixes
v3: memory leak, draw icon instead of relying on external files
Philipp Brüschweiler [Fri, 24 Aug 2012 13:43:55 +0000 (15:43 +0200)]
desktop-shell: respect CURSOR_NONE as grab cursor
Philipp Brüschweiler [Tue, 21 Aug 2012 18:36:16 +0000 (20:36 +0200)]
toytoolkit: try multiple names when loading cursors
The correspondence between cursor functions and names of cursors has
never been standardized. As a consequence, each cursor function can be
represented as a cursor with one of several names. Be more robust when
loading cursor by trying all known names that correspond to a cursor.
This should fix https://bugs.freedesktop.org/show_bug.cgi?id=50487
and https://bugs.freedesktop.org/show_bug.cgi?id=52609 a bit more
thoroughly.
Jan Arne Petersen [Tue, 21 Aug 2012 16:28:49 +0000 (18:28 +0200)]
tests: Add unit test for text model
Add tests for activate/deactivate and unfocusing of the assigned
surface.
Jan Arne Petersen [Tue, 21 Aug 2012 16:28:48 +0000 (18:28 +0200)]
tests: Explicitly define the test client to launch
Allow different test clients to launch. The test client is defined by
an argument in the test_client_launch() function.
Scott Moreau [Sun, 19 Aug 2012 01:52:42 +0000 (19:52 -0600)]
screenshot: Use correct buffer size for transformed outputs.
This is a workaround for screenshots with transformed outputs. It reorders
the output positions so the correct buffer size is determined for the final
image. This assumes the outputs are in succession on the x axis. The outputs
are rendered in their transformed state.
Philipp Brüschweiler [Sat, 18 Aug 2012 11:38:38 +0000 (13:38 +0200)]
terminal: support entering non-ascii characters
Unless the alt modifier is active and the MODE_ALT_SENDS_ESC mode is not
set, any value over 127 is converted to a UTF8 sequence.
Part of https://bugs.freedesktop.org/show_bug.cgi?id=53648 should be
fixed with this.
Part of https://bugs.freedesktop.org/show_bug.cgi?id=52419 is fixed, but
interestingly it depends on the activated keymap (i.e. it works with
dvorak, but not with ch).
Scott Moreau [Sat, 18 Aug 2012 07:04:05 +0000 (01:04 -0600)]
Implement output transformations.
This patch allows rotation and mirroring outputs for x11 and drm backends.
A new 'transform' key can be set in the [output] section. From the protocol:
"The flipped values correspond to an initial flip around a vertical axis
followed by rotation."
The transform key can be one of the following 8 strings:
normal
90
180
270
flipped
flipped-90
flipped-180
flipped-270
Philipp Brüschweiler [Thu, 16 Aug 2012 08:50:07 +0000 (10:50 +0200)]
toytoolkit: don't ignore resizes with negative width or height
E.g. this can happen when you grab the lower right corner of a window
and move over the top of the window when resizing. In this case, the
changed width is still important and should be acted upon.
https://bugs.freedesktop.org/show_bug.cgi?id=53560
Ander Conselvan de Oliveira [Wed, 15 Aug 2012 18:02:05 +0000 (14:02 -0400)]
compositor: Clear only the the damage that was actually repainted
Instead of clearing the whole output region after a repaint, clear
only the regions that were actually painted. This way, the damage
added when a surface moves from the primary plane to another one is
kept while this region is obscured by the opaque region. This allows
the contents below an overlaid surface to be culled, but to make this
work properly, it is also necessary to change the way previous damage
is drawn.
Consider the following scenario: a surface is moved to an overlay plane
leaving some damage in the primary plane. On the following frame, the
surface on the overlay moves, revealing part of the damaged region on
the primary plane. On the frame after that, the overlaid surface moves
back to its previous position obscuring the region of the primary plane
repainted before. At this point, the repainted region was added to the
output's previous damage so that it is draw to both buffers. But since
this region is now obscured, the redrawing is skipped. If the overlaid
surface moves again revealing this region, one of the buffers actually
contains the wrong content.
To fix this problem, this patch ensures that any previous damage that
would be lost is actually preserved by folding it back into the
primary plane damage just before repainting.
Scott Moreau [Thu, 16 Aug 2012 06:18:41 +0000 (00:18 -0600)]
Remove unused enum.
Scott Moreau [Thu, 16 Aug 2012 06:04:25 +0000 (00:04 -0600)]
Correct mistake in config file.
Philipp Brüschweiler [Wed, 15 Aug 2012 19:57:24 +0000 (21:57 +0200)]
weston-info: an output can have multiple modes
Philipp Brüschweiler [Wed, 15 Aug 2012 19:57:23 +0000 (21:57 +0200)]
weston-info: remove timerfd termination hack
Use wl_display_roundtrip to listen exactly as long as necessary.
Kristian Høgsberg [Wed, 15 Aug 2012 16:12:33 +0000 (12:12 -0400)]
clients: Move weston-info to bin_PROGRAMS
It's properly prefixed and pretty useful; let's install it.
Philipp Brüschweiler [Wed, 15 Aug 2012 15:12:00 +0000 (17:12 +0200)]
weston-info: client that print out information about the running compositor
This includes seat capabilities, shm formats and output information.
Rob Clark [Mon, 13 Aug 2012 22:39:17 +0000 (17:39 -0500)]
compositor: a couple debug logs
Well, they were useful to me in debugging, so probably sooner or later
useful to someone else.
Signed-off-by: Rob Clark <rob@ti.com>
Philipp Brüschweiler [Tue, 14 Aug 2012 09:02:41 +0000 (11:02 +0200)]
toytoolkit: add axis handler
Philipp Brüschweiler [Tue, 14 Aug 2012 12:46:38 +0000 (14:46 +0200)]
event-test: fix compilation
Also fixes a compiler warning in test-client. The test is still failing,
but that's for another patch.
https://bugs.freedesktop.org/show_bug.cgi?id=53462
Philipp Brüschweiler [Tue, 14 Aug 2012 10:26:54 +0000 (12:26 +0200)]
toytoolkit: remove unused actions from titlebar menu
They were introduced in
b3cca0a41130ff45b70b730cb8f2273dd91531a5
but never actually implemented. Removing them should at least stop
users from wondering if weston is broken.
https://bugs.freedesktop.org/show_bug.cgi?id=52455
Philipp Brüschweiler [Tue, 14 Aug 2012 09:02:42 +0000 (11:02 +0200)]
eventdemo: add axis logging
https://bugs.freedesktop.org/show_bug.cgi?id=52453
Philipp Brüschweiler [Tue, 14 Aug 2012 09:02:40 +0000 (11:02 +0200)]
eventdemo: fix --no-border
This was broken by commit
29af3ebce676b3cdd516dedc0cbedc47f70ce425
Philipp Brüschweiler [Tue, 14 Aug 2012 09:02:39 +0000 (11:02 +0200)]
eventdemo: fix incorrect comments
Kristian Høgsberg [Tue, 14 Aug 2012 03:34:04 +0000 (23:34 -0400)]
compositor-wayland: Set make and model
Kristian Høgsberg [Tue, 14 Aug 2012 03:29:53 +0000 (23:29 -0400)]
compositor-wayland: Call notify_pointer_focus() for content area only
We don't want to send enter/leave events to the compositor when the pointer
enters the surface, only when the pointer enters the content area. This
avoids hiding the cursor when entering the frame and sending out-of-bounds
coordinates to notify_pointer_focus().
Kristian Høgsberg [Tue, 14 Aug 2012 02:25:53 +0000 (22:25 -0400)]
window.c: Handle multiple keyboard foci
Keep a count of number of wl_keyboard focus we have instead of
tracking the more recent wl_keyboard.
Kristian Høgsberg [Mon, 13 Aug 2012 22:14:15 +0000 (18:14 -0400)]
compositor: Use pointer_cursor_surface_configure() in wl_pointer.set_cursor
This way we map the surface if it currently isn't mapped and avoid
duplicating some of the code already in pointer_cursor_surface_configure().
Without this, the cursor code relied on a wl_surface.attach() to show the
new pointer surface. If we're not changing the cursor buffer, we don't
get that, but we still need to map the cursor.
Philipp Brüschweiler [Mon, 13 Aug 2012 19:27:27 +0000 (21:27 +0200)]
shell: don't segfault when pressing super+k when no surface is focused
Philipp Brüschweiler [Mon, 13 Aug 2012 19:16:47 +0000 (21:16 +0200)]
image: handle multiple images correctly
Don't stop the application when only one window is closed. Don't stall
indefinitely if no valid image file is given as input.
Philipp Brüschweiler [Mon, 13 Aug 2012 18:04:54 +0000 (20:04 +0200)]
dnd: fix segfault on grabbing
Some cursor themes don't include a "grabbing" icon, causing a segfault.
This patch fixes this by just reverting to the stardard cursor instead.
https://bugs.freedesktop.org/show_bug.cgi?id=50487
Kristian Høgsberg [Mon, 13 Aug 2012 17:56:03 +0000 (13:56 -0400)]
compositor: Set WAYLAND_DISPLAY only after creating backend
The wayland backend needs to connect to the original WAYLAND_DISPLAY
before we overwrite it.
https://bugs.freedesktop.org/show_bug.cgi?id=53064
Scott Moreau [Mon, 13 Aug 2012 15:58:41 +0000 (09:58 -0600)]
shell: Eliminate unneeded function.
Replace all occurrences of workspace_damage_all_surfaces() with
weston_compositor_schedule_repaint(). This fixes a bug exposed by
982387011ff where trying to switch workspaces while there are no
surfaces on the current workspace fails to start the animation.
Christopher Michael [Sat, 11 Aug 2012 14:12:09 +0000 (15:12 +0100)]
Add support in Weston for X cursor themes.
This patch, along with the wayland patch, adds the ability to specify
a cursor theme in the weston.ini file:
[cursors]
theme=THEME_NAME
If specified, than Weston can use a specific X cursor theme for the
pointer. This relies on the 0001-Add-support-for-X-cursor-themes.patch
for wayland.
[krh: edited to use shell section and key name cursor-theme]
Rob Bradford [Mon, 13 Aug 2012 14:18:44 +0000 (15:18 +0100)]
shell: Avoid modulo by zero error in positioning algorithm
As spotted by Philipp Brüschweiler <blei42@gmail.com>
Rob Bradford [Mon, 13 Aug 2012 13:07:52 +0000 (14:07 +0100)]
shell: Enhance the basic random positioning algorithm
Place the window in a random position on the output where the first seat with
a pointer is. When calculating the random position limit the range to the
area that would ensure that the whole surface is visible. If the surface is
larger than the output then the surface is placed at the origin of the
output.
This change is based on the good work of Scott Moreau <oreaus@gmail.com>
Kristian Høgsberg [Sat, 11 Aug 2012 18:56:08 +0000 (14:56 -0400)]
window.c: Rearrange input handlers so they appear in the right order
They were all over the place before, now they appear in protocol order.
Kristian Høgsberg [Sun, 12 Aug 2012 02:39:12 +0000 (22:39 -0400)]
shell: Ignore unsolicited pong requests
If a client sends a pong message out of the blue, we deref ping_timer
which is NULL and then crash. Unsolicited pong requests indicate that
something is wrong on the client, but the compositor should survide that.
Jan Arne Petersen [Fri, 10 Aug 2012 14:47:23 +0000 (16:47 +0200)]
text: Deactivate text_model on keyboard focus lost
Assign a surface to a text_model on the text_model_activate request and
deactivate the text_model when the surface looses the keyboard focus.
Jan Arne Petersen [Fri, 10 Aug 2012 14:47:22 +0000 (16:47 +0200)]
text: Assign text_model to a wl_seat
Add a wl_seat argument to the activate and deactivate requests of
text_method.
On activation a text_model gets assigned to the input_method of the
wl_seat specified in the activate request.
Jan Arne Petersen [Fri, 10 Aug 2012 14:47:21 +0000 (16:47 +0200)]
text: Add activate/deactivate events
Let the client know when a text model gets activated or deactiavted.
Jan Arne Petersen [Fri, 10 Aug 2012 14:47:20 +0000 (16:47 +0200)]
text: Rename text_model_manager to factory
The text_model_manager interface is just used to create text_model
instances. It is more a factory than a manager so rename it to
text_model_factory.
Jan Arne Petersen [Fri, 10 Aug 2012 14:47:19 +0000 (16:47 +0200)]
text: Add missing callbacks for text_model events
Add all required callbacks for the text_model_listener in the editor
example.
Kristian Høgsberg [Fri, 10 Aug 2012 13:50:11 +0000 (09:50 -0400)]
compositor: Change notify_* function to take a weston_seat
Fewer indirections and derefs, and it's also more appropriate for a
backend calling into weston core to pass a weston_seat.
Kristian Høgsberg [Fri, 10 Aug 2012 14:09:20 +0000 (10:09 -0400)]
compositor: Don't hardcode output transform when sending the event
We add a transform field to weston_output and backends can override it
when they create the output.
Kristian Høgsberg [Fri, 10 Aug 2012 14:08:21 +0000 (10:08 -0400)]
compositor: Remove compositor->seat
Get rid of this quick-and-dirty assumption.
Kristian Høgsberg [Fri, 10 Aug 2012 14:07:55 +0000 (10:07 -0400)]
zoom: Pick the first seat in seat_list instead of compositor->seat
Kristian Høgsberg [Fri, 10 Aug 2012 14:06:59 +0000 (10:06 -0400)]
xwm: Use a simple heuristic for mapping X input events to a weston seat
Kristian Høgsberg [Fri, 10 Aug 2012 14:05:39 +0000 (10:05 -0400)]
shell: Track pointer focus for all seats
Kristian Høgsberg [Fri, 10 Aug 2012 14:04:36 +0000 (10:04 -0400)]
compositor-x11: Move X11 core input seat into x11_compositor
There can only ever be one of these, but keep that assumption in the
X11 backend.
Kristian Høgsberg [Fri, 10 Aug 2012 14:01:33 +0000 (10:01 -0400)]
compositor-wayland: Move weston_seat into wayland_input
Kristian Høgsberg [Fri, 10 Aug 2012 13:57:56 +0000 (09:57 -0400)]
compositor: Drop output->flags
All outputs are EGLSurface based so we can drop this detail now.
Kristian Høgsberg [Thu, 9 Aug 2012 21:19:23 +0000 (17:19 -0400)]
compositor-drm: Fix bad rebase
I failed to compile test my rebase of Robs compositor-drm fixes.
Philipp Brüschweiler [Thu, 9 Aug 2012 16:50:43 +0000 (18:50 +0200)]
shell: move input panels into a designated layer
This makes the separation between panels and input panels clearer and
prevents the (desktop) panel from removing existing input panels on
redraw.
The input panel layer is below the panel layer.
Rob Clark [Thu, 9 Aug 2012 18:24:45 +0000 (13:24 -0500)]
compositor-drm: don't keep trying if hw doesn't support cursors
Not all hw supports hw cursors. Similar to the case with sprites, if
the driver does not support it, don't keep trying and spamming the log
with error messages.
Signed-off-by: Rob Clark <rob@ti.com>
Rob Clark [Thu, 9 Aug 2012 19:18:28 +0000 (14:18 -0500)]
compositor-drm: don't attempt sprite for out of bounds dimensions
The drmModeAddFB2() call will fail anyways, and cause us to unnecessarily
set sprites_are_broken.
Signed-off-by: Rob Clark <rob@ti.com>
Rob Clark [Thu, 9 Aug 2012 19:18:27 +0000 (14:18 -0500)]
compositor-drm: skip overlay for shm buffers
They can't be imported by gbm, so no point in trying, and segfaulting
in gbm when we try to import (because it tries to deref the buffer as
a wl_drm_buffer).
Signed-off-by: Rob Clark <rob@ti.com>
Ander Conselvan de Oliveira [Thu, 9 Aug 2012 13:45:00 +0000 (16:45 +0300)]
compositor-drm: Return the newly added mode in drm_output_add_mode()
Most of the times the caller will look at the output's mode list to get
the new mode, so just return that instead.
Ander Conselvan de Oliveira [Thu, 9 Aug 2012 13:45:01 +0000 (16:45 +0300)]
compositor-drm: Check for OUTPUT_CONFIG_OFF instead of using strcmp()
A call to strcmp() is already made in output_section_done() and
output->config is set appropriately if mode is "off". There is
no need to duplicate that in create_output_for_connector().
Ander Conselvan de Oliveira [Thu, 9 Aug 2012 13:44:59 +0000 (16:44 +0300)]
shell: Fix repaint debugging
Since weston_surface_update_transform() was changed so it called
surface_damage_below() instead of surface_damage(), the trick of
clearing the surface damage did not work anymore.
Fix this by moving the repaint surface to a special plane before
calling update_transform. The move is made manually (as opposed to
calling weston_surface_move_to_plane()) to avoid the call to
weston_surface_damage_below(). The transform update causes the
damage to be added to this special plane, which is simply ignored.
After the geometry.dirty bit is clear, the surface is moved back to
the primary plane.
Ander Conselvan de Oliveira [Thu, 9 Aug 2012 13:44:58 +0000 (16:44 +0300)]
compositor: When redrawing, don't clip opaque regions from other planes
When accumulating damage in the repaint loop, the opaque region of
surfaces in other planes is added to the overall opaque region. This
causes surface->clip to contain the areas obscured by surfaces in
other planes. Change it to contain only the opaque region of surfaces
in the primary plane
This fixes a bug where moving a window that was just moved from the
primary plane to another would leave artifacts on the screen. The
problem was that the damage generated by weston_surface_move_to_plane()
would be clipped on weston_surface_redraw(), leaving the contets below
it unchanged. Moving the overlaid surface would no longer generate
damage on the primary plane, so the contents would remain unchanged
(i.e. wrong) indefinitely.
Rob Bradford [Thu, 9 Aug 2012 14:35:49 +0000 (15:35 +0100)]
spring: Avoid excessive calculation loops for the spring values
To handle the case where wall clock time jumps forwards by a large amount or
backwards limit the execution of the spring calculation loop.
We do this by forcing the spring update timestamp to being no older that 1s of
the most current time we've been given. We also present a log message if the
timestamp jumps more than expected.
Rob Clark [Thu, 9 Aug 2012 01:27:37 +0000 (20:27 -0500)]
compositor-drm: handle vblanks on secondary crtc
Signed-off-by: Rob Clark <rob@ti.com>
Juan Zhao [Tue, 7 Aug 2012 02:45:43 +0000 (19:45 -0700)]
image: Don't segfault when the file doesn't exist
Don't create a window when the file doesn't exist.
https://bugs.freedesktop.org/show_bug.cgi?id=52450