Commit Graph

743 Commits

Author SHA1 Message Date
Ander Conselvan de Oliveira 1b4312d326 clients: Add a client that renders transformed buffers
This new client, called transformed, renders a cross with the top part
red and the right green, with the same transform as the output the
surface is in.

This is based on simple-egl.
2012-11-27 11:30:09 -05:00
Scott Moreau 6655e00e03 simple-egl: Reset opaque region if not fullscreen.
If simple-egl is toggled fullscreen, the opqaue region is set for the surface
but never removed after exiting fullscreen. This patch resets the opaque region
to 0 if the surface is not fullscreen and -o was not passed. This fixes the
problem introduced sometime since d7f282b84e, when this was last fixed.
2012-11-19 17:23:59 -05:00
Pekka Paalanen 768117f90b window: make display_create_surface() shm-only
Nothing uses it to create EGL-surfaces outside of window.c. This makes
refactoring the EGL-based code easier, since we do not need to support
EGL-based Cairo surfaces without an associated struct window.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-11-19 16:00:01 -05:00
Pekka Paalanen 32127ca86d window: use different keys for different cairo privates
cairo_surface_t objects have a private set, either struct
shm_surface_data, or struct egl_window_surface_data. Use separate
private keys for each type to avoid mismatch.

This makes display_get_buffer_for_surface() safe, in that it won't
return garbage for an EGL-based cairo surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-11-19 15:55:28 -05:00
Pekka Paalanen 0c6a34378a window: merge struct surface_data into shm_surface_data
Struct surface_data was not really useful, and it definitely was not
used with EGL-based windows.

This also fixes a semantic mistake, where struct shm_surface_data was
put into cairo_surface_t private, but got out as struct surface_data
instead. Due to struct layout, however, this did not cause a real bug.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-11-19 15:55:26 -05:00
Pekka Paalanen f86504c881 window: remove unused MULT macro
Leftovers from

commit f02a649a3c
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Mon Mar 12 01:05:25 2012 -0400

    Consolidate image loading code and move to shared/

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-11-19 15:55:24 -05:00
Pekka Paalanen a8d4c84693 window: make window_flush() private
Not called from any client.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-11-19 15:55:17 -05:00
Pekka Paalanen ce36f6dff4 window: make window_{create,set}_surface private
I do not think these are meant to be called by the applications
directly. Applications certainly do not have to call them.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-11-19 15:55:12 -05:00
Pekka Paalanen 99b705bb17 simple-shm: honour wl_buffer.release
Change simple-shm to properly process the wl_buffer.release event, and
not reuse a buffer until it is released by the server, as specified in
the protocol.

In case the server has not released the buffer, but signals that it has
been shown (frame callback), allocate a second buffer. Simple-shm will
now automatically do double-buffering if needed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-11-19 15:55:09 -05:00
Ander Conselvan de Oliveira edce9c295c simple-egl: Set the right size for the opaque region when fullscreen
window.window_size holds the size of the window in windowed mode. Use
window.geometry for setting the opaque region since that holds the
current size.
2012-11-16 19:24:09 -05:00
Jan Arne Petersen 1f1b39792b keyboard: Rename keyboard to weston-keyboard
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-08 14:27:37 -05:00
Jan Arne Petersen 5ec05fb251 keyboard: commit preedit before sending key events
Commit the current preedit text before sending control key events.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-08 14:27:26 -05:00
Jan Arne Petersen 8083e019cd editor: Remove preedit text on startup
There should not be preedit text when a text entry does not have focus.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-08 14:26:43 -05:00
Jan Arne Petersen 25f6db51f0 editor: Initalize editor struct with 0
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-08 14:26:30 -05:00
Jan Arne Petersen 6345faa39a editor: Fix handling of UTF-8 text
Fix display, cursor movement and text deletion for UTF-8 text.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2012-11-08 14:26:21 -05:00
Daniel Stone a84687174c Terminal: Handle keypad symbols
XKB provides keypad symbols in a separate namespace.  We don't care
about the distinction, so map them to normal symbols before starting
processing.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-11-08 14:08:53 -05:00
Daniel Stone 4eb445abba smoke: Remove unused offset member
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-11-08 14:08:53 -05:00
Daniel Stone 8097274ce6 Clients: Don't set the cursor when we have no pointer
Avoids a segfault whenever we get a key event, and try to set the
cursor, dereferencing a NULL input->pointer.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-11-08 11:31:37 -05:00
Kristian Høgsberg 0f7a285fe1 window.c: Move misplaced break to where it belongs
The break statement wasn't copy and pasted along with the rest of the code
causing menu item before it ("Move to workspace below") to fall through to
the fullscreen case.
2012-11-05 20:24:32 -05:00
Kristian Høgsberg e77d7577a2 window: Fix use-after-free in menu button handler
Commit d2fbb3870c introduced a use-after-free
error in the case where we destroy the menu.
2012-10-30 18:10:32 -04:00
Kristian Høgsberg efb948846f window: Only advertise fullscreen menu item if client supports it
If the client doesn't set a fullscreen handler, we can't go fullscreen
and shouldn't advertise that in the window menu.  The menu implementation is
a little simplistic, so we just move the "Fullscreen" entry to the end of
the list and don't count it if we don't want it in the menu.

https://bugs.freedesktop.org/show_bug.cgi?id=47751
https://bugs.freedesktop.org/show_bug.cgi?id=48106
2012-10-30 18:07:02 -04:00
Kristian Høgsberg 9468708f70 image: Set dragging pointer on button press, not first motion
We want feedback that we're starting to drag when we press the button
not when we later start dragging the image.
2012-10-30 15:50:37 -04:00
Kristian Høgsberg d3bf6766ab image: Combine clamp_view() and center_view ()
We need to clamp or center on a per axis basis.  If the window is wider
but the image is taller, we need to center horizontally but
clamp vertically.  We can only do that if by combining the two
functions.
2012-10-30 15:46:39 -04:00
Kristian Høgsberg 719b2158e7 image: Add keyhandler to handle keyboard zoom 2012-10-30 15:42:20 -04:00
Kristian Høgsberg a369ff5273 image: Set resize handler and center view on resize/fullscreen 2012-10-30 15:09:49 -04:00
Scott Moreau 1bdb477522 toytoolkit: Don't destroy window cairo surface on shm attach.
https://bugs.freedesktop.org/show_bug.cgi?id=52454
2012-10-30 14:18:49 -04:00
Kristian Høgsberg d2fbb3870c window: Make press-drag-release menu selection mode work
The intended behavior is that a quick click (press and then release
within 500ms) just pops up the menu and doesn't select anything.  Then
we can mouse around and and click to select an item.  Alternatively, a
click and hold (ie press and release after 500ms) lets you press right
button, mouse down on the menu item you want and release to select it.
This is how menus work in most toolkits.

The handling in weston is fine, it's there to handle the case where
the button release happens outside any client window, since the client
doesn't get those events.  If such a release happens late or we get a
second release outside the popup window we shut down the popup.

The problem is in toytoolkit, where we need to select the item if we
get a release within 500ms or if we get a second release.  A second
release is the case where the first release came after 500ms and
didn't pop down the menu, and the second release event is from a click
on a menu item.

https://bugs.freedesktop.org/show_bug.cgi?id=52456
2012-10-30 13:45:31 -04:00
Kristian Høgsberg 191e0eee77 simple-egl: Add a default cursor
If clients don't set a cursor, they get whatever the last cursor was
before the pointer entered their window.  That's a little confusing, so
set a pointer on enter to avoid that.  The down-side is that simple EGL
isn't very simple anymore.

https://bugs.freedesktop.org/show_bug.cgi?id=52452
2012-10-29 17:41:46 -04:00
Kristian Høgsberg 6326c5de82 clients: Remove $(toolkit_libs) from weston_screensaver_CFLAGS
The typo that broke the build.
2012-10-29 17:15:54 -04:00
Kristian Høgsberg e530a0a240 window: Ignore input_set_pointer_image() if we don't have a pointer
https://bugs.freedesktop.org/show_bug.cgi?id=55782
2012-10-29 16:42:26 -04:00
Damien Lespiau 4df7e27055 dnd: Use %zd in the format string for size_t types
len i size_t, so is the result of the sizeof operator.
2012-10-29 16:28:19 -04:00
Kristian Høgsberg b98905e810 configure.ac: Check for libGLU for screensaver
https://bugs.freedesktop.org/show_bug.cgi?id=56376
2012-10-29 13:44:33 -04:00
Pekka Paalanen 9564c75163 desktop-shell: background should be opaque
Toytoolkit does not support setting opaqueness for anything else than
the immediate child widget of the frame widget. Backgrounds do not have
frames, so we need to poke it in manually.

This should allow Weston to paint the background without blending.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-25 14:59:23 -04:00
Pekka Paalanen fedc527723 window: remove window_set_transparent() declaration
The function is not implemented.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-25 14:59:08 -04:00
Kristian Høgsberg 8c31a4c025 Define our own container_of as well
Don't rely on libwayland-client/server to define this for us.
2012-10-19 23:05:37 -04:00
Kristian Høgsberg 5717b6dbf1 Stop relying on ARRAY_LENGTH being defined in wayland-util.h
Time to break a bad habit.
2012-10-19 17:12:38 -04:00
Jonas Ådahl f461eee2b0 window: Always pass focused widget to widget motion handlers
Grabbed widgets should always receive motion events as if it was the
widget that would receive it if no grab was active. This means that the
focused widget should always be passed as the widget argument to widget
motion handlers.

This reverts commit 8c9c8fcf6e.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-19 16:56:08 -04:00
Jonas Ådahl f82eda5247 window: Don't set pointer image when requesting to move a surface
Since it's the server who moves the surface it's the server who sets the
pointer image.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-19 16:54:42 -04:00
Ander Conselvan de Oliveira d0f24cf6ec simple-shm: Don't use ret variable in main() uninitialized 2012-10-17 16:51:07 -04:00
Kristian Høgsberg 3146756adf clients: Don't ask for EGL_PIXMAP_BIT when choosing configs 2012-10-16 15:31:31 -04:00
Kristian Høgsberg a17f7a13fd clients: Check return value of wl_display_dispatch()
The simple clients all just call wl_display_dispatch() in a while loop
without checking the return value.  Now, if the server dies or other
error occurs, we get a -1 return value instead and need to break the loop.
2012-10-16 13:17:16 -04:00
John Kåre Alsaker 011a1ce350 Remove some dead code. 2012-10-16 11:29:10 -04:00
Pekka Paalanen 379d3d140d configure: build tablet-shell client conditionally
Do not build the tablet-shell client if --disable-tablet-shell is given.

Change --enable-tablet-shell to --disable-tablet-shell in ./configure
--help output, since it is enabled by default. Add a description.

Use proper quoting in the conditional.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 10:49:08 -04:00
Pekka Paalanen 392c5f275d simple-touch: do not include GL headers
since it doesn't use any of them. Fixes a build failure on systems,
where (E)GL headers are in non-standard path.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 10:48:55 -04:00
Pekka Paalanen 5f8a67cce8 configure: separate simple EGL clients from others
Separate simple EGL clients from other simple clients. This allows to
build either simple-shm or simple-egl, whichever you want. We avoid
linking libEGL and GLESv2 into simple-shm, and we can build simple-shm
even if nothing provides EGL, GLESv2, or wayland-egl APIs.

Change the options in configure --help from --enable to --disable, since
these are enabled by default, and you would normally only ever give the
--disable flavor. Add descriptions.

Remove the #define BUILD_SIMPLE_CLIENTS since it is not used.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 10:48:19 -04:00
Pekka Paalanen fb39d8d23c toytoolkit: make all EGL code dependant on cairo-egl
configure.ac: The toytoolkit clients used to get libEGL linked to them
even if there was no cairo-egl. This is useless, and actually harmful on
platforms, where libEGL absolutely requires one of the GL ES libraries
to be linked in, too.

Look for EGL-related packages only for cairo-egl with toytoolkit.

window.c: protect all GL header includes with HAVE_CAIRO_EGL, since that
is the only case we can support EGL, GL, or GLESv2 at all. In the case
we do not have cairo-egl, add enough definitions to let us build the
stubs for EGL-related functions.

Remove some #ifdefs that were inside of the same #ifdef already.

These changes allow to build sorfware rendering toytoolkit clients
without any bits of EGL libs or headers.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 10:47:22 -04:00
Pekka Paalanen 53e58485a5 window: remove dead EGL code
- remove unimplemented function from header
- remove the egl function pointers that were not used

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-16 10:46:15 -04:00
Kristian Høgsberg 3fb613effe window: Set input region also when we go fullscreen
We used to rely on the compositor resetting this as a side effect of
changing size, but it doesn't work like that any more.
2012-10-15 20:54:43 -04:00
Jonas Ådahl 972d506de3 clients: image: Add support for panning and zooming
Support for zooming by using ctrl + the vertical axis (scrolling upwards
zooms in) and panning by both the horizontal and vertical axis as well
as click and drag was added to demonstrate how axis should work.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-15 20:54:43 -04:00
Jonas Ådahl d9f6b078b6 window: Update modifier state directly after receiving a modifier event
If the keyboard modifier event was received after the key event the
modifier state would end up incorrect.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-15 20:54:43 -04:00