Rafal Mielniczuk [Sun, 7 Oct 2012 18:25:36 +0000 (20:25 +0200)]
shell: restore correct layer in shell_unset_fullscreen
This fixes the bug where surface is above panel_layer
just after it is restored from fullscreen mode.
How to reproduce:
* move surface under panel
* set surface fullscreen
* restore surface to normal mode
Rob Bradford [Tue, 9 Oct 2012 17:44:36 +0000 (18:44 +0100)]
backlight: Jump to cleanup code if synthesizing backlight string fails
This applies the same pattern as used in other error cases in this block - and
cleans up the file desciptors and allocated memory too.
Signed-off-by: Rob Bradford <rob@linux.intel.com>
Rob Bradford [Tue, 9 Oct 2012 17:44:35 +0000 (18:44 +0100)]
compositor-drm: Avoid leak during output configuration error path
Signed-off-by: Rob Bradford <rob@linux.intel.com>
Rob Bradford [Tue, 9 Oct 2012 17:44:34 +0000 (18:44 +0100)]
keyboard: Avoid access beyond end off buffer
If the for loop does not match on a button it will fall through and try and
dereference into the array using the terminating value of the loop. This
terminating value of the loop is the dimension of the array and thus beyond
its bounds.
Cc: Jan Arne Petersen <jpetersen@openismus.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
Rob Bradford [Tue, 9 Oct 2012 17:44:33 +0000 (18:44 +0100)]
backlight: Avoid buffer overflow in the use of readlink
readlink() returns the number of bytes that it has written excluding any NUL
byte (since it does not write that itself.) This could lead to attempting to
access beyond the end of buffer if the destination of the link is exactly 100
bytes long. The standard solution to this is to subtract one from the buffer
when passing it into readlink().
Signed-off-by: Rob Bradford <rob@linux.intel.com>
Rob Bradford [Tue, 9 Oct 2012 17:44:32 +0000 (18:44 +0100)]
evdev-touchpad: Iterate over the touchpad spec table correctly
The original code would overrun since the calculation of the range did not
take into consideration the size of the entries in the table.
Cc:Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
Rob Bradford [Tue, 9 Oct 2012 17:44:31 +0000 (18:44 +0100)]
evdev: Avoid unintended case drop through
e->code is in the same range for ABS_ and for REL_. As the code currently
stands and for the current values in Linux's input.h there is no risk of a
problem. However just in case it would be wise to break after evaluating the
relative events.
Signed-off-by: Rob Bradford <rob@linux.intel.com>
Rob Bradford [Tue, 9 Oct 2012 17:44:30 +0000 (18:44 +0100)]
tty: Log error if we cannot setup a valid tty keyboard mode
The previous logging code would never be reached - this change makes sure a
message is reported if changing keyboard mode to either the desired (K_OFF) or
fallback (K_RAW with handler that drops the events) fails.
Signed-off-by: Rob Bradford <rob@linux.intel.com>
Rob Bradford [Tue, 9 Oct 2012 17:44:29 +0000 (18:44 +0100)]
evdev-touchpad: Twiddle finger_state correctly
The original code always set the finger_state to the appropriate bitmask
irrespective of whether the event was a press or a release. It would also blat
all members of the bitmask rather than ORing in the new bit for the event.
Cc:Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
Jonas Ådahl [Mon, 8 Oct 2012 20:49:04 +0000 (22:49 +0200)]
window: Initialize workspace state before first roundtrip
The workspace state parameters were initialized after the first
roundtrip. If a workspace manager state event was received during this
roundtrip the state parameters were cleared leaving an incorrect state.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
John Kåre Alsaker [Wed, 3 Oct 2012 15:30:05 +0000 (17:30 +0200)]
tests: Remove GLfloat usage.
John Kåre Alsaker [Sun, 30 Sep 2012 00:57:21 +0000 (02:57 +0200)]
weston: Use float instead of GLfloat.
John Kåre Alsaker [Wed, 3 Oct 2012 16:02:22 +0000 (18:02 +0200)]
compositor-wayland: Create border after creating the OpenGL context.
U. Artie Eoff [Mon, 1 Oct 2012 22:21:16 +0000 (15:21 -0700)]
tests: add keyboard test
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 28 Sep 2012 13:39:32 +0000 (06:39 -0700)]
tests: add button test
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 28 Sep 2012 13:39:31 +0000 (06:39 -0700)]
tests: test surface to/from global functions
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Fri, 28 Sep 2012 13:39:30 +0000 (06:39 -0700)]
event-test: more aggressive event testing
Test surface pointer enter/leave/motion and surface leave/enter
events more aggressively.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
U. Artie Eoff [Wed, 3 Oct 2012 04:12:35 +0000 (21:12 -0700)]
desktop-shell: destroy data before exiting.
desktop-shell never returned from display_run() since it
was essentially killed when weston exited. To fix this,
it is necessary to watch for EPOLLHUP in window.c so that
toytoolkit clients will return from display_run() when
weston quits. This allows for clients to clean up
as needed.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Rob Bradford [Tue, 2 Oct 2012 17:03:15 +0000 (18:03 +0100)]
simple-shm: Draw the test motif surrounded by a white border
We can then use a wl_surface_damage to just trigger the compositor to update
just a selected region of the buffer and thus test damaging a sub region.
Rob Bradford [Tue, 2 Oct 2012 17:03:14 +0000 (18:03 +0100)]
simple-shm: Don't attach the buffer to the surface for every redraw
This will allow us to change just a sub region of the buffer.
Philipp Brüschweiler [Tue, 2 Oct 2012 09:06:54 +0000 (11:06 +0200)]
editor: more intuitive cursor positioning
Compute the nearest glyph edge instead of taking the one to the
left of the cursor.
Also fixes a segfault when trying to compute the position for an empty
buffer.
Philipp Brüschweiler [Tue, 2 Oct 2012 09:06:53 +0000 (11:06 +0200)]
editor: take text offset into account when computing cursor position
Philipp Brüschweiler [Tue, 2 Oct 2012 09:06:52 +0000 (11:06 +0200)]
editor: make selection a lighter shade of blue, much easier to read
Philipp Brüschweiler [Tue, 2 Oct 2012 09:06:51 +0000 (11:06 +0200)]
editor: fix assert to take preedit string into account
Martin Olsson [Sat, 29 Sep 2012 13:13:56 +0000 (15:13 +0200)]
Fix spelling errors
Tiago Vignatti [Thu, 27 Sep 2012 14:48:37 +0000 (17:48 +0300)]
xwm: Plug kill signal for killing X apps
Xeyes is the counter-example that fails on that heuristic and won't be caught
on kill binding. This and the last two patches should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=53679
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Tiago Vignatti [Thu, 27 Sep 2012 14:48:36 +0000 (17:48 +0300)]
compositor: Add kill signal
For now it's being emitted only on the desktop shell kill binding.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Tiago Vignatti [Thu, 27 Sep 2012 14:48:35 +0000 (17:48 +0300)]
shell: Skip clients that we forked ourselves in kill binding
When we fork a client and give one end of a socketpair, the credentials
on the socket fd comes back as ourselves. When that happens, do not kill
the process.
Also remove superfluous variables.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Tiago Vignatti [Tue, 25 Sep 2012 14:57:01 +0000 (17:57 +0300)]
shell: Start the desktop-shell client in the idle handler
https://bugs.freedesktop.org/show_bug.cgi?id=55259
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Tiago Vignatti [Thu, 27 Sep 2012 11:46:23 +0000 (14:46 +0300)]
toytoolkit: Process deferred tasks on fifo order instead
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
Jan Arne Petersen [Wed, 26 Sep 2012 12:39:45 +0000 (14:39 +0200)]
shell: Fix crash when an input panel is hiding
Set the geometry.dirty on the input panel surface before calling
weston_surface_update_transform, so that the surface gets an output
assigned.
Pekka Vuorela [Wed, 26 Sep 2012 12:05:45 +0000 (15:05 +0300)]
Require mouse release on top of frame button to trigger action
As common UI convention, allows action to be avoided by dragging
outside the button after mouse press.
Rob Bradford [Fri, 14 Sep 2012 22:25:41 +0000 (23:25 +0100)]
compositor-drm: Check that that we have a valid bo for scanout
If gbm_bo_import does not return a valid buffer for usage of
GBM_BO_USE_SCANOUT don't try and scan out the surface directly.
We've caught the SHM case explicitly earlier - this is to prevent other cases
where the bo cannot be scanned out.
Signed-off-by: Rob Bradford <rob@linux.intel.com>
Pekka Vuorela [Mon, 17 Sep 2012 19:15:57 +0000 (22:15 +0300)]
Protect window callbacks from deleted windows
Calling window_destroy() was able to cause segfault for
callbacks triggering afterwards.
Kristian Høgsberg [Tue, 25 Sep 2012 18:48:04 +0000 (14:48 -0400)]
compositor: Make weston_surface_assign_output() static
This is now done as part of weston_surface_update_transform().
U. Artie Eoff [Tue, 4 Sep 2012 21:37:45 +0000 (14:37 -0700)]
test-client: initialize input instance.
In seat_handle_capabilities, if input->pointer is not properly
initialized, then it will contain an arbitrary value and results
in the wl_pointer listener not getting registered if that value
is not 0/null. Thus, use calloc to initialize the "input" instance.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=49937
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Jan Arne Petersen [Mon, 24 Sep 2012 12:51:14 +0000 (14:51 +0200)]
text: Rename de/activate to enter/leave
Also add a surface argument to the enter event.
Pekka Vuorela [Mon, 17 Sep 2012 19:15:56 +0000 (22:15 +0300)]
PDF viewer to run until and only when it has existing windows
I.e. not to close whole application when one of the windows
is closed.
Pekka Vuorela [Mon, 17 Sep 2012 19:15:55 +0000 (22:15 +0300)]
Fix memory leak in PDF viewer
Pekka Vuorela [Mon, 17 Sep 2012 19:15:54 +0000 (22:15 +0300)]
Fix PDF viewer not to produce garbage windows for nonexistent files
Was calling window_flush() on redraw handler which already happens on
window redrawing.
Jan Arne Petersen [Mon, 17 Sep 2012 13:28:10 +0000 (15:28 +0200)]
editor: Fix selection anchor on text deletion
When text is deleted adjust selection anchor.
Jan Arne Petersen [Mon, 17 Sep 2012 13:28:09 +0000 (15:28 +0200)]
editor: Delete selected text before adding new
When inserting new text, delete selected text first.
Jan Arne Petersen [Mon, 17 Sep 2012 13:28:08 +0000 (15:28 +0200)]
keyboard: Allow backspace for pre-edit text
When there is a pre-edit text delete the last character of the pre-edit
text with the backspace key.
Jan Arne Petersen [Mon, 17 Sep 2012 13:28:07 +0000 (15:28 +0200)]
editor, keyboard: Add support for arrow keys
Add support for arrow keys on the virtual keyboard and make it possible
to move around the cursor in the editor example.
Ander Conselvan de Oliveira [Mon, 10 Sep 2012 12:55:53 +0000 (15:55 +0300)]
simple-egl: Set the opaque region if windowed and -o is passed
Since commit
6a615d262141de7cf094788203d9c044dfb9f08d [1], the opaque
region would be set only when running fullscreen. Having it set
properly for the windowed case is helpful to test the overlay path in
compositor-drm.
What this patch does is:
- reverts the above commit;
- remove the "if fullscreen make the window opaque" conditional, that
should have been removed when -o was introduced and was actually the
cause for the bug solved in [1];
- sets the opaque region when running fullscreen, regardless of the -o
switch.
[1] commit
6a615d262141de7cf094788203d9c044dfb9f08d
Author: Scott Moreau <oreaus@gmail.com>
Date: Thu Aug 30 14:44:16 2012 -0600
simple-egl: Only set alpha_size=0 when -o is passed.
v2: - Clarify in the commit message that this does not regress the bug
solved in [1].
- Use the correct sha1 for the reverted commit.
Ander Conselvan de Oliveira [Fri, 14 Sep 2012 13:12:04 +0000 (16:12 +0300)]
compositor: Always assign an output when updating a surface transform
Also make all the callers of weston_surface_assign_output() update the
transform instead. This makes sure that when the surface is assigned an
output its bouding box is valid.
This fixes a bug where a newly created surface would have a NULL output
assigned. This would cause weston_surface_schedule_repaint() to not
schedule a repaint, preventing the surface to be shown until something
else caused a repaint.
Ander Conselvan de Oliveira [Fri, 14 Sep 2012 13:12:03 +0000 (16:12 +0300)]
compositor: Generalize output previous damage into per buffer damage
This is a more generic fix for the issue solved in
4f521731 where
damage obscured by overlays could be lost in one of the output buffers
due to rapid move of a surface in an overlay plane.
This changes the renderer so it keeps track of the damage in each
buffer. Every time a new frame is drawn, the damage of the frame is
added to all the buffers and the rendered regions are cleared from
the current buffer's damage.
Jan Arne Petersen [Wed, 12 Sep 2012 22:55:14 +0000 (00:55 +0200)]
text: Improve text protocol documentation
Add some missing descriptions to the text protocol file.
Pekka Paalanen [Thu, 13 Sep 2012 10:46:27 +0000 (13:46 +0300)]
man: weston --xserver has been replaced
The generic module loading must be used now to load xserver.so.
Option --xserver was removed by
a6813d28876423b388cce3ff6d7edab7b9de0f20.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Abhijit Potnis [Thu, 13 Sep 2012 15:22:55 +0000 (11:22 -0400)]
compositor-android: Add output before gles2_renderer_init()
Calling android_compositor_add_output() before gles2_renderer_init(),
or else in gles-renderer_init will have an invalid EGLSurface.
Signed-off-by: Abhijit Potnis <abhijitpotnis@gmail.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:46 +0000 (23:08 +0200)]
text: Add reset requets to protocol
Add a reset request to the text_model interface and a reset event to the
input_method_context interface. Use it to reset the pre-edit buffers in
the example keyboard when the cursor is moved in the example editor
client.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:45 +0000 (23:08 +0200)]
text: Add support for control keys to the protocol
Add key event to the text_model interface and a key request to the
input_method_context interface. Implement it in the example editor
client and the example keyboard.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:44 +0000 (23:08 +0200)]
text: Add delete_surrounding_text to protocol
Add delete_surrounding_text event in the text_model interface and the
request in the input_method_context interface. Implement it in the
example editor client and in the example keyboard so that the backspace
key works with it.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:43 +0000 (23:08 +0200)]
text: Add support for pre-edit string
Add support of preedit-string to the example editor client. Also add a
preedit_string request to the input_method_context interface and use
that in the example weston keyboard to first create a pre-edit string
when entering keys and commit it on space.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:42 +0000 (23:08 +0200)]
keyboard: Use a qwerty virtual keyboard layout
Add support for a proper qwerty virtual keyboard layout with lowercase
and uppercase state, space and enter button.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:41 +0000 (23:08 +0200)]
text: Split text and input-method protocols
It makes sense to split the interfaces in a text and a input-method
protocol for now (only the text protocol needs to be used in toolkits).
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:40 +0000 (23:08 +0200)]
text: Fix set_surrounding_text request
Add cursor and anchor positions as arguments to the set_surrounding_text
request. The cursor and anchor positions are relative to the surrounded
text, so it does not make sense to have that separate. Remove the
separate set_cursor_index and set_selected_text requests. Also update
the corresponding event in input-method-context and add support for it
in the weston example keyboard.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:39 +0000 (23:08 +0200)]
editor: Add support for setting a preedit
Add support for setting a preedit text to the editor example.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:38 +0000 (23:08 +0200)]
editor: Add support for selection
Make it possible to select text and render the selection to the editor
example.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:37 +0000 (23:08 +0200)]
editor: Insert commit-string at cursor
Instead of appending at the end, insert the commit-string at the cursor
position.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:36 +0000 (23:08 +0200)]
editor: Add support for cursor
Add support for setting, moving and rendering a cursor.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:35 +0000 (23:08 +0200)]
editor: Extract text handling into text_layout
Create a text_layout struct and functions for handling simple text
layouts.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:34 +0000 (23:08 +0200)]
editor: Make text_entry a widget
Simplify the example client by making text_entry a widget.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:33 +0000 (23:08 +0200)]
text: Add some documentation to the text protocol
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:32 +0000 (23:08 +0200)]
text: Introduce input_method_context interface
Add an input_method_context interface which is the representation of a
text_model on input_method side.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Philipp Brüschweiler [Sun, 9 Sep 2012 21:08:31 +0000 (23:08 +0200)]
text: Have only one text_model_factory
Have only one text_model_factory instead of one per seat.
This commit also introduces destruction of an input method when the
corresponding seat is removed.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Jan Arne Petersen [Sun, 9 Sep 2012 21:08:30 +0000 (23:08 +0200)]
text: Remove surface arg in create_text_model
Remove the wl_surface argument from create_text_model request. The
wl_surface is specified as an argument in the activate request instead.
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
Ander Conselvan de Oliveira [Wed, 12 Sep 2012 14:16:31 +0000 (17:16 +0300)]
compositor: Accumulate obscured damage into the primary plane damage
When accumulating damage in the surfaces into the primary plane damage,
regions obscured by the opaque region would be excluded. This causes a
bug when a redraw of a surface is obscured by an opaque surface on
another plane. The drawing to the former surface is clipped but
its damage is never added to the primary plane and is just lost. Moving
the opaque window later reveals the not-up-to-date content below it.
Pekka Paalanen [Tue, 11 Sep 2012 14:02:05 +0000 (17:02 +0300)]
compositor: new intersection algorithm
The existing algorithm had some corner cases (pun!), where it failed to
produce correct vertices in the right order. This appeared only when the
surface was transformed (rotated). It also produced degenerate polygons
(3 or more vertices with zero polygon area) for non-transformed cases
where the clipping and surface rectangles were adjacent but not
overlapping.
Introduce a new algorithm for finding the boundary vertices of the
intersection of a coordinate axis aligned rectangle and an arbitrary
polygon (here a quadrilateral). The code is based on the
Sutherland-Hodgman algorithm, where a polygon is clipped by infinite
lines one at a time.
This new algorithm should always produce the correct vertices in the
clockwise winding order, and discard duplicate vertices and degenerate
polygons. It retains the fast paths of the existing algorithm for the
no-hit and non-transformed cases.
Benchmarking with earlier versions showed that the new algorithm is
a little slower (56 vs. 68 us/call) than the existing algorithm, for
the transformed case. The 'cliptest f' command before and after this
commit can be used to compare the speed of the transformed case only.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Acked-by: Rob Clark <rob.clark@linaro.org>
Pekka Paalanen [Tue, 11 Sep 2012 14:02:04 +0000 (17:02 +0300)]
clients: add cliptest program
Cliptest is for controlled testing of the calculate_edges() function in
compositor.c. The function is copied verbatim into cliptest.c.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Pekka Paalanen [Tue, 11 Sep 2012 14:02:03 +0000 (17:02 +0300)]
update .gitignores
Add workspaces-protocol.c, workspaces-server-protocol.h,
workspaces-client-protocol.h.
Remove wscreensaver.
Alphabetaize clients/.gitignore.
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Kristian Høgsberg [Wed, 12 Sep 2012 16:21:01 +0000 (12:21 -0400)]
compositor: Generalize module loading
We can now load any number of general modules, and the shell and xwayland
are just two of them. We continue to use the mechanism for testing but
custom input drivers or logging mechanisms, for example are other use cases.
Kristian Høgsberg [Tue, 11 Sep 2012 18:29:47 +0000 (14:29 -0400)]
compositor: Always set WAYLAND_DISPLAY
We used to only set it if we were given an argument on the command line.
It's useful to always set it so nested weston works out of the box.
Kristian Høgsberg [Tue, 11 Sep 2012 18:08:26 +0000 (14:08 -0400)]
compositor: Don't return the dlsym handle in load_module()
We don't use it.
Kristian Høgsberg [Tue, 11 Sep 2012 18:07:19 +0000 (14:07 -0400)]
compositor: Drop unused wl_shm field
Kristian Høgsberg [Tue, 11 Sep 2012 18:06:27 +0000 (14:06 -0400)]
compositor: Make all non-backend modules use module_init() as entry point
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>