Commit Graph

1130 Commits

Author SHA1 Message Date
Kristian Høgsberg
c2010b3af0 nested: Add EGL_WL_create_wayland_buffer_from_image compat defines
Make it possible to compile this example with EGL implementations without
this extension.
2013-12-17 10:40:01 -08:00
Jonny Lamb
92d90f225d clients: add scaler test app
This client tests the wl_scaler and wl_surface_scaler protocol
extensions by cropping and then scaling a surface to ensure it is
rendered correctly. More details in comments in the code.
2013-12-16 22:55:47 -08:00
Jasper St. Pierre
80c798bdf0 Update .gitignore
Ignore the new stacking demo...
2013-12-09 12:19:40 -08:00
Kristian Høgsberg
1e65840b61 simple-egl: Add option to allow not syncing to compositor repaint cycle
It's the GO FASTER option.
2013-12-07 22:26:23 -08:00
Kristian Høgsberg
deb322237b simple-egl: Print fps for the spinning triangle
This is not a benchmark.
2013-12-07 22:26:23 -08:00
Kristian Høgsberg
acdae2e641 stacking: Set a keyboard focus handler so we can repaint the frame
Yes, perhaps this should be more automatic...
2013-12-05 15:37:29 -08:00
Neil Roberts
a5059eb187 nested: Add an option to disable subsurfaces
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-04 16:34:08 -08:00
Neil Roberts
1f020a1fdb nested: Add a renderer using subsurfaces
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-04 16:34:07 -08:00
Neil Roberts
5e10a04481 clients: Add a widget_get_wl_subsurface
Adds a simple accessor for the wl_subsurface for widgets created with
window_add_subsurface.
2013-12-04 16:34:07 -08:00
Neil Roberts
47b87d5ec0 nested: Add a ‘renderer’ mechanism with a vtable
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-04 16:34:07 -08:00
Neil Roberts
f9b2541df1 nested: Move the frame callback list to the surface
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-04 16:34:07 -08:00
Neil Roberts
2855766333 nested: Add damage tracking to the nested compositor example
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-04 16:34:07 -08:00
Neil Roberts
15a8d340fd nested: Add double-buffered state semantics to the nested example
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-04 16:34:07 -08:00
Neil Roberts
6bf23879e9 nested: Add the buffer reference semantics from Weston
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.
2013-12-04 16:34:07 -08:00
Neil Roberts
8fbe3a68d4 nested: Remove the surface from the surface list when destroyed
Otherwise if the surface is destroyed then it will crash when it later
tries to render all of the surfaces. You can replicate this by doing
killall weston-nested-client while the example is running.
2013-12-04 16:34:07 -08:00
Kristian Høgsberg
873b515aee tablet-shell: Remove
The tablet-shell is unmaintained and unused.  It is currently
dead-weight and a burden when we make changes to weston.  Let's
drop it for now, we can pull it out of git if we find a need for it later.
2013-12-04 10:18:29 -08:00
Pekka Paalanen
fdca95c7db window: handle insufficient buffer space
It is quite possible for os_create_anonymous_file() to fail when trying
to allocate a new wl_shm buffer. Propagate this failure out from
shm_surface_prepare. Most parts of toytoolkit are already avoiding NULL
cairo surfaces.

If cairo surface allocation fails, do not try to call the widget redraw
functions, those are not prepared to deal with NULL. Also do not
schedule a frame callback, this allows us to retry drawing the next
time.

If redraw fails for the main_surface of a window, restore the widget
geometry to what the compositor currently is showing. This keeps the
window visual appearance in sync with application state, so interacting
with the application does not break too badly.

If the very first draw of any window fails, then forcefully exit the
program. E.g. if weston-desktop-shell fails to allocate buffers for the
unlock dialog, w-d-s exits, and weston unlocks the screen automatically.

This patch allows e.g. weston-terminal to stop from enlarging while
resizing, if new sized buffers can no longer the allocated. Even then,
the application stays usable, as it can often repaint in the last
successful size. It does not crash, and the user is able to resize it
smaller, too.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-12-02 16:20:58 -08:00
Philip Withnall
17c2fb4f29 clients: Add a new weston-stacking demo
This allows creation of a variety of window types, for the purposes of
testing window ordering and stacking in Weston.
2013-12-02 11:44:50 -08:00
Philip Withnall
c971d2a8b3 clients: Add window_is_transient() helper to the toy toolkit window 2013-12-02 11:44:50 -08:00
Xiong Zhang
bf3c1c6913 distinguish touch screen and pointer dnd in client
Data device interface in client just handle with pointer's dnd.
If a touch screen trigger dnd, it will use pointer struct like i
nput->sx, input->sy, input->pointer_focus. So if pointer is moving
when touch screen trigeer a dnd, wrong behaviore will occur.
Before touch screen start dnd, system call touch_grab()
to mark the following drag and drop operation is generated by
touch screen.
Defined some common variables in struct input to track dnd.

Note, touch screen and pointer can't generate drag and drop at the
same time, becuae data device protocol can't identify the drag
and drop event is generated by touch screen or pointer.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Reviewed-by: Kristian Hogsberg <hoegsberg@gmail.com>
2013-11-25 16:32:12 -08:00
Xiong Zhang
853a7799d6 client/dnd.c: add dnd support for touch screen in client
Adding the interface for touch screen event in clients/dnd.c, once
user touch down on this app, it will trigger a touch and drag
operation.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Reviewed-by: Kristian Hogsberg <hoegsberg@gmail.com>
2013-11-25 16:32:08 -08:00
Xiong Zhang
49c6aeee70 terminal: add touch screen selection support
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
Reviewed-by: Kristian Hogsberg <hoegsberg@gmail.com>
2013-11-25 11:26:00 -08:00
Kristian Høgsberg
1d781ee204 terminal: Update terminal->end whenever we write a character
We used to only update it on newline, which breaks when somebody moves
the cursor below terminal->end and writes stuff.  Instead update it whenever
we write a character to the terminal.

https://bugs.freedesktop.org/show_bug.cgi?id=71935
2013-11-24 17:01:26 -08:00
Kristian Høgsberg
dcfff55ef3 terminal: Init tab ruler after setting terminal->width
terminal_init_tabs() needs an accurate terminal->width to be able
to correctly initialize the tab ruler.
2013-11-22 22:43:20 -08:00
Kristian Høgsberg
617e9a37f2 dnd: Simplify drag icon creation
We used to have to composite the pointer on top of the drag icon, but
the final protocol allows us to specify both a drag icon and a cursor.
Remove the complexity that dealt with that.
2013-11-22 11:59:40 -08:00
Kristian Høgsberg
8b66ebd3fa weston-info: Handle shm formats better
Use a switch for this and don't fall back to XRGB8888 if we don't
recognize the format.
2013-11-20 13:54:00 -08:00
Pekka Paalanen
a662206e71 protocol: move sub-surfaces to Wayland
This reverts commit 2396aec684.

This exact version of the sub-surface protocol has been copied into
Wayland core. Therefore it must be removed from here to avoid build
conflicts and useless duplication.

No other changes to sub-surface protocol consumers are needed, the
identical API is now offered by libwayland-client and libwayland-server.

The commit adding sub-surfaces to Wayland is:
Author: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

    protocol: add sub-surfaces to the core

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-11-15 16:23:17 -08:00
Jasper St. Pierre
77a51fd2c8 westoy: Remove some accessors for wl_shell / wl_shell_surface
We want to remove support for these deprecated interfaces. Since
nothing is using them, this is a simple change.
2013-11-13 20:43:56 -08:00
Jasper St. Pierre
bf17590f86 westoy: Remove unused support for window parents
It seems that this was only used by the popup menu infrastructure,
which can handle this all on its own. Implementing e.g. transients
in the future can be done with a simple xdg_shell_set_transient_for.
2013-11-13 16:43:03 -08:00
Jasper St. Pierre
01eaaac79a westoy: Remove window_touch_move
It seems to be the same as window_move, except it ignores the passed
in serial (???) and instead just uses the one of the display.
2013-11-13 16:37:36 -08:00
Jasper St. Pierre
47f1043877 westoy: Fix the version number we request for wl_seat
If the compositor supports a lower version, like version 2, we need
to request that instead of version 3.
2013-11-12 11:42:43 -08:00
Jason Ekstrand
4a7409a1f5 toytoolkit: Don't segfault on window close
Without this commit, the client will segmentation fault due to accessing
the frame after everything has been destroyed.
2013-10-30 08:40:24 -07:00
Kristian Høgsberg
8ae63851dd window.c: Don't ungrab input after displaying the menu
We used to ungrab first to stop any existing grab and then grab after
showing the menu. That was broken in c680e90489, which
moved the ungrab down below the grab, and as a result menus are now
shown without a grab.  This commit moves the grab back up.
2013-10-28 22:06:11 -07:00
Xiong Zhang
83d8ee779e window, desktop-shell: deal with output unplug on client side
when output is removed, weston-desktop-shell should destroy panel
and background surface on destroyed output.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-10-23 22:36:37 -07:00
Kristian Høgsberg
89f4bc4fc4 window.c: Don't put titlebars on menu windows 2013-10-23 22:12:13 -07:00
Kristian Høgsberg
c680e90489 window.c: Use frame code for drawing menus
This gives us a nice frame and drop shadows for the menus.
2013-10-23 21:49:30 -07:00
Kristian Høgsberg
a83be20d7f terminal: Show character grid size in header bar when resizing
We don't have a reliable way to know when to clear this indicator.
Typically the pointer will still be over the window when the resize is
done and we'll get an enter event, but if the window sets a max size
the pointer may be over another window when the resize is done.

We'll need a new wl_shell (or more likely xdg_shell) event for this.
2013-10-23 20:47:35 -07:00
Kristian Høgsberg
67b8215bcb terminal: Add context menu with new terminal/copy/paste 2013-10-23 16:52:05 -07:00
Kristian Høgsberg
14f39b290b terminal: Add scroll-back history
Ctrl-Shift-UP/DOWN to scroll through the history.
2013-10-23 16:29:14 -07:00
Rui Matos
3eccb8658d clients/window: Dispose of previous keymap and state on keymap change 2013-10-22 15:25:04 -07:00
Cameron Stewart
4c4bb953fc Rename invocations of frame_create that were missed by ee7fefcf
For some reason it not only compiled with different parameters but the
method succeeded and just failed later.
2013-10-21 21:04:08 -07:00
Kristian Høgsberg
afb9828d57 window: Only clamp min size for windows with frame
Also fix width/height typo.
2013-10-21 15:23:23 -07:00
Kristian Høgsberg
53ec560423 window: Set a minimum size for toytoolkit windows
The decorations tiles start to overlap and look weird if we go below
200x200 size windows.  Just set that as a minimum size if the app
doesn't provide a bigger minimum size.

https://bugs.freedesktop.org/show_bug.cgi?id=66794
2013-10-21 15:05:52 -07:00
Kristian Høgsberg
598477d832 window: Set opaque region to window size if we're fullscreen 2013-10-16 16:06:18 -07:00
Kristian Høgsberg
78fe75368a simple-egl: Add support for using a 16 bpp EGLConfig 2013-10-15 22:03:41 -07:00
Jason Ekstrand
3f66cf92ed Use cairo-util frame in tinytoolkit
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-10-14 12:27:55 -07:00
Jason Ekstrand
ee7fefcffc Rename frame_create and frame_set_child_size with a window_ prefix
This is to avoid a collision with an actual frame structure.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-10-13 22:12:16 -07:00
Stefan Schmidt
db044cb9a5 clients: Update .gitignore for weston-multi-resource
Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
2013-10-11 13:31:29 -07:00
Kristian Høgsberg
cab9aeaff5 multi-resource: Don't include non-existing xmalloc.h
It existed on my local disk, of course.  Just copy over xzmalloc().
2013-10-10 19:21:05 -07:00
Kristian Høgsberg
e8344e3dbc nested: Cast away warnings for differing arguments to eglQueryWaylandBufferWL 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
6773394000 nested: Free client struct on launch_client error paths 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
f1144dd0dc nested-client: Exit if we fail to create the nested client struct 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
b24d590e8f multi-resource: Use xzmalloc() instead of malloc+memset and calloc 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
d58e395bf2 tablet-shell: Avoid leaking icon or path strings from invalid launcher section 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
b5c973c8c2 window.c: Free cursor theme name once we're done with it 2013-10-10 16:50:18 -07:00
Kristian Høgsberg
6a11a8ab54 Revert "Resize the shell when the mode is switched"
This breaks panel resizing as it doesn't account for output rotation.

https://bugs.freedesktop.org/show_bug.cgi?id=70249

This reverts commit a356f7b1ef.
2013-10-09 15:23:16 -07:00
Hardening
a356f7b1ef Resize the shell when the mode is switched
Resize the panel and the background when we're notified of a mode
switch.
2013-09-29 14:23:54 -07:00
Stefan Schmidt
639fd86493 clients: Include and link against math lib for new multi-resource
Linking failed with missing ceil() here. Making sure that we include
the header and add the missing -lm.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
2013-09-23 10:10:48 -07:00
Emilio Pozuelo Monfort
7f951e1117 Update .gitignore 2013-09-23 10:08:03 -07:00
Kristian Høgsberg
1abe0486bb config-parser: Make weston_config_parse() tkae a file name
Take a basename of the config file to parse instead of an fd.
2013-09-21 23:05:45 -07:00
Kristian Høgsberg
b159560da2 tablet-shell: Use new weston_config instead of old config parse 2013-09-21 22:35:13 -07:00
Kristian Høgsberg
8c079ae052 window.c: Port to use weston_config instead of old parser 2013-09-21 22:26:10 -07:00
Kristian Høgsberg
9c3dee18ce terminal: Port to new weston_config parse 2013-09-21 22:23:08 -07:00
Neil Roberts
f428d25779 Add a test client to test multiple pointer/keyboard resources
This adds a hacked version of simple-shm which can create multiple
pointer and keyboard resources. The resources are created with the
command line options -p and -k. Both take an integer argument which
specifies the time in seconds after the program is started when the
resource should be created. It can also take a second time with a
colon separator to specify when the resource should be released.

For example:

 weston-multi-resource -p5 -p7 -k9 -p12:14

That would create a pointer after 5 seconds, a second pointer 2
seconds later, a keyboard 2 seconds after that, a third pointer after
a further 3 seconds and finally after 2 more seconds it would release
that final pointer resource.

This can be used along with WAYLAND_DEBUG to check that it gets the
right events for example if the pointer is created while the client's
surface already has focus and so on.
2013-09-21 20:57:46 -07:00
José Bollo
4a4704a7d0 Minor improvement of weston-terminal resizing 2013-09-13 15:42:28 -07:00
Peter Hutterer
f97a68079b clients: remove superfluous call 2013-09-13 15:12:23 -07:00
Peter Hutterer
e2a9eff77b clients: de-duplicate demo clients list 2013-09-13 15:12:14 -07:00
Kristian Høgsberg
8a20500847 terminal: Stop complaining about OSC escape code 7
This is the current working directory of the shell as an URI.  We
don't use that for anythign at the moment, but let's not complain
about it at least.
2013-09-11 11:52:56 -07:00
Kristian Høgsberg
735bda25da dnd: Support dropping as text/plain;charset=utf-8 2013-09-09 15:03:27 -07:00
Kristian Høgsberg
0749e3f470 terminal: Accept utf-8 text drop 2013-09-04 20:41:06 -07:00
Kristian Høgsberg
938f102a97 dnd: Only accept dnd with the application/x-wayland-dnd-flower mime-type
Currently, the dnd sample client accepts all mime-types and assumes they
are the custom flower mime-type.  Only accept if the offer has the right
mime-type.
2013-09-04 19:36:49 -07:00
Brian J Lovin
a8e627f4f2 keyboard: Add rudimentary touch support to keyboard.
At this time there is no way to have a key be activated when
touch_up is called, so all this patch does is activate they
key on touch_down.

Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
2013-09-03 22:49:16 -07:00
Rob Bradford
080311879e window: Use new wl_pointer/keyboard_release request
Since we bump the version we ask for from the compositor it is also
necessary to implement the new "name" event in the seat listener.
2013-08-30 14:58:04 -07:00
Bryce W. Harrington
eec6aee490 .gitignore: Reflect recent client binary rename
Commit 77ab1721 renamed the client binaries; this change updates
.gitignore to follow this change.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-30 13:00:16 -07:00
Paul Winwood
b22bf57e21 window.c: Fix SIGSEGV in pointer_handle_motion
Move null pointer check and assignments before first window dereference.
2013-08-29 21:17:51 -07:00
Stanislav Vorobiov
6346e501ac subsurfaces: fix rendering problem with cairo-glesv2
when using cairo-glesv2 subsurface rendering code
implicitly calls eglMakeCurrent(dpy, NULL, NULL, ctx)
(since EGL_KHR_surfaceless_context is used), thus,
triangle_frame_callback:eglSwapBuffers returns EGL_BAD_SURFACE
error for all invocations other that the first one
2013-08-28 22:31:33 -07:00
Brian J Lovin
c4df4082c2 desktop-shell: Add support for touch unlock
Add support for unlocking on touch up using the
green button on the unlock dialog

Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
2013-08-26 22:11:11 -07:00
Kristian Høgsberg
777874350b simple-egl: Handle missing EGL_EXT_buffer_age better
Including src/weston-egl-ext.h breaks distcheck, so lets just copy the
one EGL_EXT_buffer_age into simple-egl.c.
2013-08-26 15:30:42 -07:00
Kristian Høgsberg
c7d2c4c147 Add more missing config.h #includes
Now that we use AC_SYS_LARGEFILE, we need to pull in config.h at least
whereever we use mmap().  Fixes at least the test-suite and simple-shm
on 32 bit systems.
2013-08-26 14:59:14 -07:00
Kristian Høgsberg
0b36d9780f terminal: Include config.h instead of defining _XOPEN_SOURCE 2013-08-21 22:13:17 -07:00
Daiki Ueno
3e9df07269 autotools: Don't use wayland-scanner.m4 2013-08-20 11:15:19 -07:00
Peng Wu
cfcc111070 Fixes CJK wide character display
By jumping two columns when wide character prints,
and draw wide background under wide character.
2013-08-19 15:37:19 -07:00
Rusty Lynch
1084da506e Add touch support for wl_shell_surface_move 2013-08-16 10:56:00 -07:00
Ander Conselvan de Oliveira
d224bb9218 nested: Fix skipping frames due to texture update without a context
Calls into cairo-gles may change the current context, so it was only by
chance that sometimes we had the proper one as current and updated the
correct texture in surface_attach().

In order to fix this, calling display_acquire_window_surface() before
binding the texture for setup is necessary. However this call has the
side effect of allocating a cairo surface for the window. At flush time,
the existence of this surface will cause an eglSwapBuffers(), even
if no rendering was done to it, leading to undefined contents on the
screen. This happens when the idle redraw task runs while there is a
pending frame callback.

Workaround this by moving the texture setup from surface_attach() to the
redraw handler, so that the cairo surface is only allocated when
redering is done.
2013-08-16 10:56:00 -07:00
Kristian Høgsberg
0d5fe3a231 nested: The wl_resouce is the buffer, not the wl_resource user data 2013-08-16 10:56:00 -07:00
Kristian Høgsberg
69594ccf9c window: Use xzalloc() instead of silently failing to add output 2013-08-16 10:55:59 -07:00
Kristian Høgsberg
06b16c2a0b weston-info: Use xmalloc() in weston-info 2013-08-16 10:55:59 -07:00
Kristian Høgsberg
adcd54bc3c window: Use xzalloc() instead of failing to add input device 2013-08-16 10:55:59 -07:00
Kristian Høgsberg
1a5f0c34ff window: Fix logic for looking up widget default cursor
We may deref a NULL pointer if there is no grab and no focus widget.
2013-08-16 10:55:59 -07:00
Kristian Høgsberg
980b018825 window: Don't check for subcompositor in window_add_subsurface()
Client should check for subcompositor support up front.  Now
window_add_surface() can never return NULL.
2013-08-15 11:56:41 -07:00
Kristian Høgsberg
b20b00923a window: Add API to check for subcompositor, use in subsurface example
This way we can fail with a nice error message.
2013-08-15 11:54:03 -07:00
Kristian Høgsberg
c85a9178c7 simple-touch: Handle OOM when allocating struct touch 2013-08-15 11:40:30 -07:00
Kristian Høgsberg
96c619af43 simple-shm: Handle OOM when allocating struct display 2013-08-15 11:39:52 -07:00
Kristian Høgsberg
20ffdffc03 keyboard: Don't use next_utf8_char() to go back where we came from
We go one utf8 char back and then one forward.  Just remember the original
position instead, which also avoids a warning about potentially
dereferencing a NULL return value from next_utf8_char().
2013-08-15 11:37:14 -07:00
Kristian Høgsberg
3e125830a5 terminal: Make utf-8 state machine assemble unicode code point value 2013-08-13 17:23:54 -07:00
Kristian Høgsberg
e9cabc1bc3 nested: Use a void * to avoid warnings with EGL_WL_bind_wayland_display 2013-08-12 22:21:22 -07:00
Kristian Høgsberg
473f248d7e screenshooter: Add missing newline and use program_invocation_short_name 2013-08-12 22:15:38 -07:00
Kristian Høgsberg
bdd8377312 screenshooter: Only link to $(CLIENT_LIBS) not libtoytoolkit.la
This application doesn't use toytoolkit, so don't link to it.  We have to
add a copy of xmalloc, to link without toytoolkit.
2013-08-12 22:12:32 -07:00
Adrian Negreanu
f5e3ad295c fix compile error when EGL_BUFFER_AGE_EXT is missing
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-08-12 16:54:10 -07:00
Adrian Negreanu
6d14b14147 remove dependency on EGL_KHR_surfaceless_context
cairo_egl_device_create(), which is called next,
already checks if EGL_KHR_surfaceless_context is
available. If not, it fallbacks to pbuffer.

Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
2013-08-12 16:54:10 -07:00
Rusty Lynch
4384a24a9e desktop-shell: Add touch support to panel launcher icons 2013-08-12 16:54:10 -07:00
Rusty Lynch
3ba1263438 calibrator: Add touch support to calibrator 2013-08-12 16:54:10 -07:00
Rusty Lynch
3bb2b8cfe9 smoke: Add touch support to smoke example 2013-08-12 16:54:10 -07:00
Rusty Lynch
041815aa05 window.c: Add touch handlers
This adds basic infrastructure for handling touch events in the toytoolkit.
2013-08-12 16:50:26 -07:00
Brian Lovin
1bf14815ef terminal.c: Check if fdopen() fails
If fdopen() fails we just close the fd and return, failing
the copy-and-paste.

Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
2013-08-08 16:25:13 -07:00
Peter Hutterer
3ca59d3968 clients: fix an error message
_GNU_SOURCE is always true as of c228e23b05, so
program_invocation_short_name is available.
2013-08-08 13:46:14 -07:00
Peter Hutterer
f3d62276d2 malloc + memset -> zalloc
And for clients using the xmalloc helper, use xzalloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-08 13:46:13 -07:00
Brian Lovin
bc91926e0c clients: use xmalloc in more places
For the clients continue to use xmalloc() to simplify OOM-handling.

Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
2013-08-07 16:27:33 -07:00
Kristian Høgsberg
cb61dcf2ce nested: Update to use weston-nested-client binary name 2013-08-07 09:50:12 -07:00
Kristian Høgsberg
3c17933de8 Use #define WL_HIDE_DEPRECATED to avoid deprecated warnings for wl_buffer 2013-08-06 19:27:04 -07:00
Stefan Schmidt
85c40f2d85 clients: Fix typo in simple-touch and simple-shm.
listenter -> listener. Better fix it now before it spreads further.

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
2013-08-06 17:02:59 -07:00
Bryce Harrington
c814c58adc Drop extraneous duplicate header includes
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-08-06 17:02:22 -07:00
Tomeu Vizoso
bee45a14cd window: Allow hinting of a preference for RGB565 when creating a window
And check if the renderer supports the RGB565 format for wl_shm buffers
before creating the cairo surface and requesting the buffer.

It can save quite some memory with big surfaces such as desktop
backgrounds.
2013-08-06 16:49:27 -07:00
Rob Bradford
09252d4b5e desktop-shell: Refactor launcher configuration reading to avoid leaking 2013-07-30 11:06:42 -07:00
Rob Bradford
5ab9c75d59 window: Free the allocated display if we fail to setup libxkbcommon 2013-07-30 11:05:42 -07:00
Rob Bradford
c48c34d6fa tablet-shell: Avoid leaking the path on failed icon loading 2013-07-30 11:05:23 -07:00
Rob Bradford
c9213e7353 image: Free filename saved into structure on error path 2013-07-30 11:04:58 -07:00
Armin K
a02d154b13 autotools: Correctly prefix simple-egl client name 2013-07-30 10:56:42 -07:00
Bryce W. Harrington
3d2046ed4b screenshot: Drop extraneous 'is' to improve warning msg grammar
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2013-07-29 16:32:51 -07:00
Armin K
aac6021bc0 autotools: Add an option to install demo clients
This patch adds a configure option which will enable
user to install demo clients if desired. It is disabled
by default.

v2: Remove AC_DEFINE as it is not necesary
2013-07-29 10:51:19 -07:00
Armin K
77ab1721b8 autotools: Rename demo clients
Prefix demo clients names with weston-, so they can
be installed if user desires.
2013-07-29 10:51:15 -07:00
Kristian Høgsberg
4162483d74 window.c: Simplify window_create() 2013-07-25 16:53:10 -07:00
Kristian Høgsberg
b886212545 Use xmalloc in desktop-shell.c 2013-07-25 16:44:45 -07:00
Kristian Høgsberg
8eeb30b9d1 window.c: Use xmalloc for frame_create() 2013-07-25 16:25:15 -07:00
Kristian Høgsberg
9a6c48d0fd cliptest: Use xmalloc in cliptest 2013-07-25 16:24:36 -07:00
Kristian Høgsberg
ce27841be5 clients: Introduce xmalloc() and use it a few places
For the sample clients we introduce xmalloc() to simplify OOM-handling.
This patch only converts a few callsites, but this will be our strategy
going forward.
2013-07-25 15:54:20 -07:00
Kristian Høgsberg
5addaa1820 simple-touch: Attach buffer before posting damage 2013-07-25 09:49:43 -07:00
Rob Bradford
5f087746ee window: Disregard motion events outside our current surface dimensions
It is possible to receive a motion event that was generated by the
compositor based on a pick of a surface of old dimensions. This was
triggerable on toytoolkit clients when minimising. The new window
dimensions were propagated through the widget hierarchy before the event
was dispatched.

This issue was triggering a segfault due to the focussed widget being
lost as the client code tried to identify which widget should have the
focus using co-ordinates outside the dimensions of the surface.

https://bugs.freedesktop.org/show_bug.cgi?id=66795
2013-07-13 00:00:49 -04:00
Rob Bradford
7000283741 editor: Support shift-left/right for selecting text
If the shift modifier is active then we don't make the cursor and the
anchor the same and as a result we develop a selection in the direction
that the arrow key gets pressed in.

https://bugs.freedesktop.org/show_bug.cgi?id=66802
2013-07-12 23:56:18 -04:00
Rob Bradford
3c9d967688 window: Allow popup menu when the window is maximised
https://bugs.freedesktop.org/show_bug.cgi?id=66793
2013-07-12 23:56:18 -04:00
Peter Maatman
b9a23f4fb8 clients/editor.c: Draw cursor at correct verical position
With this patch, the editor cursor now moves up and down correctly
instead of having the top part stuck on the first line.
2013-07-09 19:43:53 -04:00
Peter Maatman
08c38d4bc5 clients/editor.c: Ignore ESC key
Otherwise, editor would print the "unknown UTF-8 glyph" boxes.
2013-07-09 19:41:12 -04:00
Kristian Høgsberg
919cddb0ab Convert to wl_global_create/destroy() 2013-07-09 02:02:11 -04:00
Peng Wu
f291f20553 Use the average width of ASCII glyphs for cell width
As some CJK fonts are dual-width, calculate the average width of ASCII
glyphs and use that instead of the max_x_advance of the font.  This is
what VTE does too.

https://bugs.freedesktop.org/show_bug.cgi?id=63796
2013-07-08 17:57:59 -04:00
Ander Conselvan de Oliveira
e492549536 desktop-shell: Don't crash on output hotplug
The panel and background were never created for hotplugged outputs and
since some parts of the code assume that they always exist that would
lead to desktop-shell client to crash in that case.

This was easier to spot when the display was locked, because Weston
respawns the shell client and the user might not notice since there is
no flicker.

https://bugs.freedesktop.org/show_bug.cgi?id=66531
2013-07-05 16:48:32 -04:00
Ander Conselvan de Oliveira
6d75da7906 desktop-shell: Adapt to the new config parser API
This lets the code for adding panel launchers and setting up the
background to be moved into panel_* and background_* functions.

Note that this changes the behavior of the default launcher. Before
this change a default launcher would be added only if there was no
config file. Now a launcher is also added if there is no valid
launcher section.
2013-07-05 16:47:29 -04:00
Jason Ekstrand
d27cb096ad window: Request version 3 of wl_compositor
Originally window.c was requesting version 1 but several clients were
calling version 2 and 3 events including the desktop shell itself.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-07-03 14:52:06 -04:00
Daiki Ueno
b08b3296b8 editor: Fix segfault when deleting the first character 2013-07-02 00:02:56 -04:00
Matt Roper
e61561fd9c toytoolkit: Allow operation without a keymap
In preparation for upcoming changes, we want to make sure that apps
written with the toy toolkit continue to operate properly if no XKB
keymap is received.  If there's no XKB keymap, then we shouldn't
try to figure out keyboard modifier states (since we probably don't
even have equivalents of PC-style modifiers).

Reviewed-by: Singh, Satyeshwar <satyeshwar.singh@intel.com>
Reviewed-by: Bob Paauwe <bob.j.paauwe@intel.com>
2013-06-28 19:54:53 -04:00
Kristian Høgsberg
1d7d8f0e95 nested: Fix direct access to resource->data 2013-06-25 16:15:27 -04:00
Kristian Høgsberg
88dab17b0e nested: Port away from old wl_resource API 2013-06-24 22:53:38 -04:00
Daniel Stone
c228e23b05 configure.ac: Enable AC_USE_SYSTEM_EXTENSIONS
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar
macros to expose the largest extent of functionality supported by the
underlying system.  This is required since these macros are often
limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually
on some systems hide declarations which are not part of the X/Open spec.

Since this goes into config.h rather than the command line, ensure all
source is consistently including config.h before anything else,
including system libraries.  This doesn't need to be guarded by a
HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org
modular transition.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>

[pq: rebased and converted more files]
2013-06-05 01:16:34 -04:00
Rob Bradford
14a7601340 weston-info: Report the seat name provided by the compositor 2013-06-05 00:17:48 -04:00
Armin K
a94e285be7 clients/nested: Fix compilation 2013-06-04 23:50:41 -04:00
U. Artie Eoff
a2326ed77f add fullscreen to .gitignore
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-06-04 23:20:22 -04:00
Kristian Høgsberg
1cc5ac34b5 clients: Nested compositor example
A wayland compositor doesn't provide a mechanism for buffer sharing between
clients.  Under X, one client can render to a Pixmap and another can use it
as a source in a subsequent drawing operations.  Wayland doesn't have a
mechanims to share Pixmaps or textures between clients like that, but it's
possible for one client to act as a nested compositor to another client.

This less work than it sounds, since the nested compositor won't have to
provide input devices or even any kind of shell extension.  The nested
compositor and its client can be very tightly coupled and have very specific
expectations of what the other process should provide.

In this example, nested.c is a toytoolkit application that uses cairo-gl
for rendering and forks and execs nested-client.c.  As it execs the client,
it passes it one end of a socketpair that will be the clients connection
to the nested compositor.  The nested compositor doesn't even create a
listening socket.

The client is a minimal GLES2 application, which just renders a spinning
triangle in its frame callback.
2013-06-04 02:47:12 -04:00
Jan Arne Petersen
8ccb7cc258 editor: Do not commit/preedit after invalid delete
Ignore the whole commit-string or preedit_string transaction when the
delete_surrounding event was invalid.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:55 -04:00
Jan Arne Petersen
895a128ce1 editor: Improve checks on delete add asserts
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:52 -04:00
Jan Arne Petersen
9eaa8e51ca editor: Properly adjust cursor on delete
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:48 -04:00
Jan Arne Petersen
a96953dffa editor: Support deleting text in preedit_string
Delete text marked with wl_text_input::delete_surrounding_text on
preedit_string event. When text is explicitly marked with
delete_surrounding_text do not delete selected text.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:46 -04:00