Commit Graph

1276 Commits

Author SHA1 Message Date
Jasper St. Pierre f184c382e8 window: Move the resize after interpreting the states
As the protocol says, the states determine how the width and height
arguments should be interpreted, so it makes logical sense to do the
interpretation after.
2014-05-12 23:34:31 -07:00
Jasper St. Pierre ccf908b078 window: Set frame flags immediately when we handle the new states in configure 2014-05-12 23:34:05 -07:00
Jasper St. Pierre 973d7879e3 xdg-shell: Turn "activated" into a state
This drops two events, and makes new window decorations race-free with
an attach in-flight.
2014-05-12 23:34:05 -07:00
Jasper St. Pierre de6809912e terminal: Only add the new size to the title when we're resizing
Add a new state_changed_handler callback to the window to know when the
window has changed state; the terminal will use this to know when the
window started and ended its resize operation, and modify the terminal's
titlebar accordingly.
2014-05-12 23:34:05 -07:00
Jasper St. Pierre 5befdda84f xdg-shell: Turn the resizing heuristics into an explicit state
Currently, there's a race condition. When resizing from the left, and
a client attaches a buffer after the resize ends, you suddenly see the
buffer jump to the right, because the resize ended while multiple
attaches were in-flight. Making resize a state can fix this, as the
server can now know exactly when the resize ended, and whether a commit
was before or after that place.

We don't implement the correct tracking in this commit; that's left as
an exercise to the reader.

Additionally, clients like terminals might want to display resize popups
to display the number of cells when in a resize. They can use the hint
here to figure out whether they are resizing.
2014-05-12 23:34:05 -07:00
Jasper St. Pierre ab2c108137 xdg-shell: Rework the state system
The states system, so far, has been a complicated mix of weird APIs
that solved a real race condition, but have been particularly ugly
for both compositors and clients to implement.
2014-05-12 23:33:59 -07:00
Jasper St. Pierre c815d62b85 xdg-shell: Rename set_transient_for to set_parent
It's a confusing name that comes from the ICCCM. The ICCCM is best
forgotten about.

With the addition of the potential new "transient" role meaning a
parent-relative toplevel like a long-lived popup, used for e.g.
tooltips, the set_transient_for name will become even more confusing.
2014-05-13 00:35:30 -04:00
Jasper St. Pierre 11f1433e0a fullscreen: Remove dirty sizing trick
xdg-shell mandates that the FULLSCREEN state means that we must match
the size that we were configured to, at least by default. Other states
or protocol extensions might relax this requirement, but at least for
now implement the behavior specified in the protocol documentation.
2014-05-13 00:35:29 -04:00
Jasper St. Pierre af314bb4f5 fullscreen: Remove our own focused state tracking
This is decided by xdg-shell now.
2014-05-13 00:35:29 -04:00
Ander Conselvan de Oliveira a57c9f1b90 window: Ignore input events from subsurfaces
Toytoolkit was not designed to handle input from subsurfaces and
instead it expects subsurfaces to have an empty input region. That way
input events for subsurfaces are generated on the main surface and
there is no need to convert coordinates before reporting the event to
the user.

However it is possible that a subsurface has a non-empty input region,
but in that case those events aren't properly processed. The function
window_find_widget() assumes the coordinates are in the main surface
coordinate space, and ends up chosing the wrong widget.

This patch changes the input code to completely ignore input events from
subsurfaces. This option was chosen instead of ensuring that the input
region on those surfaces is always empty since there's no enforcement
that a subsurface should completely overlap with the main surface. If
an event happens in the area of the surface that doesn't overlap, the
event could cause a completely unrelated surface to be picked.

https://bugs.freedesktop.org/show_bug.cgi?id=78207
2014-05-12 12:50:00 -07:00
Ander Conselvan de Oliveira 8e37d96bf7 editor: Fix cursor positioning with pointer and touch
The calculation off the vertical offset between the widget coordinates
and where the text was rendered was wrong. It was using the constant for
horizontal offset for that too.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=78411
2014-05-09 15:32:20 -07:00
Bill Spitzak 79b7cb3ee3 desktop-shell: Fix black edges on scaled desktop pattern
Filter sampling outside the source image can leak black into the edges
of the
desktop image. This is most easily seen by scaling the default tiled image
with this weston.ini:

	# no background-image and no background-color
	background-type=scale-crop
2014-05-09 14:03:05 -07:00
Ander Conselvan de Oliveira c3f03f557b simple-touch: Handle multiple seats properly
If simple-touch ran on a compositor with multiple seats, and the first
one happened to have the touch capability while the second one didn't,
the handler for seat capabilities would destroy the wl_touch device it
created on the first call for the first seat when it was called a again
for the second seat that has not touch capabilities.

Fix this problem by creating a separate struct for each seat.

https://bugs.freedesktop.org/show_bug.cgi?id=78365
2014-05-09 12:50:11 -07:00
Bryce W. Harrington 762b231e0b clients: Initialize label in keyboard handling code
Quells warning:
  clients/keyboard.c: In function ‘keyboard_handle_key.isra.5’:
  clients/keyboard.c:556:11: warning: ‘label’ may be used uninitialized in
  this function [-Wuninitialized]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-05-09 12:33:20 -07:00
Jasper St. Pierre bf39e5e1ba window: Add a simple getenv to force SHM rendering 2014-04-30 21:04:34 -07:00
Jasper St. Pierre bd600774be window: Clean up buffer type choosing
Extracting it to a function makes this cleaner and more
understandable.
2014-04-30 21:04:22 -07:00
Kristian Høgsberg 9c60933a13 window.c: Dismiss menu on touch up events 2014-04-29 14:47:19 -07:00
Kristian Høgsberg 1f67117f6f window.c: Also grab touch events when grabbing input 2014-04-29 14:30:44 -07:00
Kristian Høgsberg c31f624141 window.c: Prevent key event delivery while a grab is active
Ideally, we'll update the key event handling to deliver events to widgets,
but in the meantime, just blocking key event delivery while a grab is
active goes a long way.
2014-04-29 14:21:46 -07:00
Kristian Høgsberg 41f7ebc36a window.c: Update pointer focus when taking a grab 2014-04-29 14:12:20 -07:00
Bryce W. Harrington 66cd2c1ce1 terminal: Convert all *alloc's to x*alloc's.
This ensures the allocation results are checked for NULL (out of
memory), and terminates the program in such a case.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-04-29 13:25:50 -07:00
Neil Roberts a69dc01a6e clients/window: Don't remove the touch listener on a frame event
It looks like the handler for frame events from the wl_touch interface for
widgets may have been erroneously copied from the cancel handler so that it
removes all handlers as they are processed. I don't think this makes much sense
for the frame event. This was stopping the panel icons from being pushable with
touch events when using libinput since commit 1679f232e5. All that commit
does it make it start sending the frame events.
2014-04-25 15:18:37 -07:00
Kristian Høgsberg 4c3661fd7b desktop-shell: Only use default background if no background color is set
Previously we would only use the set background color if the
background-image value was explicitly set to empty or a non-existing
image.  With this change, we only load the default background image
if there's no configure background image or background color.  In case
of both an image and a color, the image takes precedence as before.
2014-04-21 22:54:37 -07:00
U. Artie Eoff cb0e3579af weston-info: fix log message typo
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-04-21 15:40:26 -07:00
Kristian Høgsberg 6375ea02e5 editor: Remove unused variables 2014-04-21 15:33:51 -07:00
Manuel Bachmann 8986c18f69 editor: react on Enter, Tab, and Up-Down arrow keys
The editor will now insert new lines and tabulations when
pressing the corresponding keys on the virtual keyboard.

The Up and Down arrows can be used to navigate through
lines.

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

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
2014-04-21 15:32:45 -07:00
Manuel Bachmann 301f06b894 keyboard: add the missing symbols layout, fix arabic layout
The "symbols" modifier key of weston-keyboard is no longer
inactive, but will provide an additionnal layout with
numerals and special characters.

Fix the Arabic keyboard, which was rendering out of the
bounds, and now use the Arabic IBM PC keyboard as a
reference for its standard and new symbols layouts.

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

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
2014-04-16 22:42:27 -07:00
Daiki Ueno 56d8a7a155 terminal: Don't try to render RLE used as a placeholder
weston-terminal uses RLE (U+202B) as a placeholder of the right half
of a double width character.  However, not all fonts include this
glyph and cairo renders it as .notdef (glyph index 0) in that case.
2014-04-08 10:03:17 -07:00
Kristian Høgsberg cdbbae2cac window.c: Create xdg_surface up front
Fixes initial fullscreen for calibrator.

https://bugs.freedesktop.org/show_bug.cgi?id=76970
2014-04-07 11:28:05 -07:00
Andrew Wedgbury 9cd661e746 Make sure config.h is included before any system headers
There was an issue recently in screen-share.c where config.h was not
being included, resulting in the wrong definition for off_t being used on
32 bit systems. I checked and I don't think this problem is happening
elsewhere, but to help avoid this sort of problem in the future, I went
through and made sure that config.h is included first whenever system
headers are included.

The config.h header should be included before any system headers, failing
to do this can result in the wrong type sizes being defined on certain
systems, e.g. off_t from sys/types.h

Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
2014-04-07 10:22:28 -07:00
Neil Roberts 40d02288cb nested: Disable cairo on the subsurfaces
The subsurface widgets on the nested example aren't using Cairo to
render so we should turn it off to prevent the toy toolkit from
creating a redundant extra surface for it. This is particularly
important since Mesa commit 6c9d6898fdfd7e2 because the surface that
the toolkit tries to create is zero-sized and that patch prevents that
from working. This was causing weston-nested to crash.
2014-04-06 23:00:37 -07:00
Manuel Bachmann cd186fbfaf toytoolkit: match parent surface type when adding a subsurface
When adding a subsurface (to display a tooltip) in toytoolkit,
we now get the parent window surface type (SHM or EGL) and
define the new surface type as the same.

This fixes crashes with tooltips in cases like having
Cairo-EGL available but running the X11 compositor.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-06 22:37:45 -07:00
Jason Ekstrand 7a17d42fb3 weston-fullscreen: Add cursor drawing support and properly handle WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:35 -07:00
Jason Ekstrand 2bb72fe6fb weston-fullscreen: Add wl_fullscreen_shell support
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:31 -07:00
Jason Ekstrand a669bd5e00 toytoolkit: Don't crash if wl_data_device_manager is not present
This is primaraly to get weston-fullscreen to run on compositors that lack
copy-paste support.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:20 -07:00
Jason Ekstrand 738715d628 toytoolkit: Expose output make and model
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:16 -07:00
Jason Ekstrand ce97a6b184 toytoolkit: Only require xdg_shell if the window is not custom
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:11 -07:00
Jason Ekstrand 428c24e25e simple-shm: Add wl_fullscreen_shell support
This makes simple-shm act like a very simple fullscreen shell client.  This
is the kind of interaction one would expect out of a boot splash screen or
similar.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2014-04-02 21:26:00 -07:00
Hardening 842a36ae4a Check return value of wl_cursor functions
This patch adds checks for themes and cursors returned by wl_cursor functions.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-04-01 16:46:41 -07:00
Pekka Paalanen 2d9d689427 clients/scaler: add modes to test wl_scaler version 2
This allows to test the effect of setting only source rectangle or
destination size, in addition to setting both.

In weston-scaler -h output, add descriptions on what the result in each
mode should look like.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-04-01 16:46:41 -07:00
Jasper St. Pierre e81a175fa1 clients: Remove unused client-side resize tracking code 2014-03-24 13:29:50 -07:00
Kristian Høgsberg c7680b09dd xdg-shell: Bump unstable version to 3 2014-02-19 10:14:46 -08:00
Jasper St. Pierre 8c6aa45f97 xdg-shell: Replace the set_* atrocity with a new approach
Rather than require that the client implement two methods for every state,
simply have one global request, change_state, and one global event,
request_change_state.
2014-02-19 09:50:40 -08:00
Jasper St. Pierre b223a72147 xdg-shell: Rename focused_set / focused_unset to activated / deactivated
To try and make the distinction between this event and keyboard focus.
2014-02-18 16:39:01 -08:00
Jasper St. Pierre a0d8a30931 clients: Add delete handler for simple-shm / simple-egl
It seems this was forgotten in the port.
2014-02-18 16:38:53 -08:00
Jasper St. Pierre 5a183329ca clients: Add support for the minimize button 2014-02-18 19:20:18 -05:00
Jasper St. Pierre 63a9c336f3 Reorder the xdg_shell implementations to fit the spec'd order 2014-02-18 19:20:17 -05:00
Jasper St. Pierre 63a1410348 window: Remove window_location enum
It's unused except for one easily-replaceable place.
2014-02-18 14:08:10 -08:00
Emilio Pozuelo Monfort e818d59e88 toytoolkit: avoid unnecessary redraws when focus changes
Clients that need to be redrawn when the focus changes do that by
listening to focus_changed and scheduling a redraw.

This was causing unnecessary redraws in the clients, as could be
easily seen by changing focus on weston-flower.

Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
2014-02-18 14:05:49 -08:00
Kristian Høgsberg 239902b323 client: Fix shell unstable version check
Use a static assert to catch mismatch between implementation and
interface version.  Fix window.c to not use XDG_SHELL_VERSION_CURRENT,
which will fail to catch version mismatches.  The implementation version
must updated manually when the implementation is updated to use the new
interface.
2014-02-11 16:22:10 -08:00
Kristian Høgsberg 2bff94e057 xdg-shell: Move "ping" and "pong" to xdg_shell, not xdg_surface
Responsivenes is a per-client thing so we move the ping/pong functionality
to xdg_shell.  Having this per-window was carries over from the EWMH
protocol, where the WM has no other way to do this.  In wayland, the
compositor can directly ping the client that owns the surface.
2014-02-11 16:22:10 -08:00
Kristian Høgsberg dfaf65ba16 clients: Port simple-shm and simple-egl to xdg-shell 2014-02-07 17:01:57 -08:00
Jasper St. Pierre 9679cf9ba2 Update .gitignore 2014-02-07 14:53:31 -08:00
Jasper St. Pierre 7407345446 xdg-shell: Add set_margin request
This is used to figure out the size of "invisible" decorations, which we'll
use to better know the visible extents of the surface, which we can use for
constraining, titlebars, and more.
2014-02-06 13:05:03 -08:00
Jasper St. Pierre 2097fe12d4 xdg-shell: Add a "delete" event
This is equivalent to WM_DELETE_WINDOW request under X11, or equivalent
to pressing the "close" button under CSD. Weston currently doesn't have
a compositor-side way to close the window, so no new code is needed on
its side.
2014-02-06 13:05:03 -08:00
Kristian Høgsberg 44cd1968f2 xdg-shell: Drop edges arg from xdg_surface configure event 2014-02-05 21:37:58 -08:00
Kristian Høgsberg 9a7ad67d65 window: Delay scheduled redraws if we start maximize or fullscreen protocol
When we set the fullscreen flag, we have to wait for the corresponding
configure event and then attach a buffer of that size to indicate
that we've successfully gone fullscreen/maximized.

Without this patch, we can schedule a redraw and go through with it after
setting maximize/fullscreen and end up attaching a buffer of the wrong size.
In practice, what happens is that pressing the maximize button triggers
setting maximized, but also triggers a redraw to paint the maxmize button.
Without this change, repainting the button triggers a repaint that attaches
the same size buffer immediately.

https://bugs.freedesktop.org/show_bug.cgi?id=71927
2014-02-05 17:01:47 -08:00
Kristian Høgsberg b405a80c05 terminal: Only reset title if we put the window size there
When resizing the terminal, it shows the grid size in the titlebar.
We reset the title next time we get an enter event.  This patch makes
sure we only reset the title the first time we enter after a resize.
2014-02-05 17:01:47 -08:00
Kristian Høgsberg d2a0213ee4 window: Ask xkbcommon whether or not to repeat a key 2014-02-05 13:43:59 -08:00
Quentin Glidic 088ba5e475 Makefile.am: Fix protocol source files usage
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2014-02-01 21:21:39 -08:00
Jasper St. Pierre 1e47a93f85 Revert "stacking: Remove transient window support"
This reverts commit 4c1a11074af2c2221d50b0c35d2d0d883647bc15.

Use the new window_set_transient_for / window_get_transient_for
and xdg-shell support for this...
2014-02-01 01:53:05 -08:00
Jasper St. Pierre 53686048cc window: Add wrappers for xdg_surface_set_transient_for 2014-02-01 01:53:05 -08:00
Jasper St. Pierre 0790e3978a westoy: Port the toy toolkit over to xdg-shell 2014-02-01 01:53:05 -08:00
Jasper St. Pierre c0f17aba5e westoy: Remove MAXIMIZED and FULLSCREEN as separate window types
xdg_shell changes this around so that they are flags on the remote
object itself, not separate surface types. Move to a system where
we calculate the state from the flags ourselves and set the appropriate
wl_shell_surface type.

When we port to xdg_shell, we'll drop these flags and simply sync
on the client.
2014-02-01 01:43:10 -08:00
Jasper St. Pierre 76ec0826bc westoy: Remove fullscreen methods
These aren't supported under xdg_shell, at least not right now.
If xdg_shell ever gets support for them, we can revert this commit
and adapt it.
2014-02-01 01:43:02 -08:00
Jasper St. Pierre 7f4386e90a westoy: Use subsurfaces for tooltips instead of transient windows
Transient windows, at least not as they are today, don't exist in
xdg_shell. Subsurfaces allow for specially placed surfaces relative
to a window, so use these instead.
2014-02-01 01:42:35 -08:00
Jasper St. Pierre e22952bb13 westoy: Schedule a full resize when we add a subsurface
If a client adds a subsurface, we need to make sure it's allocated
properly, so queue a resize and redraw on the parent window.
2014-02-01 01:42:31 -08:00
Jasper St. Pierre b0d604ff5b stacking: Remove transient window support
This will be replaced with xdg_surface_set_transient_for at some point...
2014-02-01 01:42:28 -08:00
Ander Conselvan de Oliveira 23900f70e5 input: Empty the current input region when configuring pointer surfaces
The input region of the cursor surface is set to empty in
pointer_cursor_surface_configure(). Since during the commit process
this function is called before the pending input region is made
current, it empties surface->pending.input instead of surface->input.

But pointer_cursor_surface_configure() is also called from
pointer_set_cursor() in order to map the cursor even if there isn't a
subsequent attach and commit to the cursor surface. In that case,
surface->input is never emptied, since the configure function emptied
only the pending input region and there wasn't a commit that made it
effective.

Fix this by emptying both pending and current input regions. The latter
shouldn't cause problems since the surface can't have a role prior to
being assigned the cursor role, so it shouldn't be mapped in the first
place.

Also change toytoolkit so that it triggers the bug.

https://bugs.freedesktop.org/show_bug.cgi?id=73711
2014-02-01 01:12:24 -08:00
Kristian Høgsberg e73eccdb66 build: Move clients/Makefile.am into toplevel Makefile.am 2014-02-01 01:05:33 -08:00
Kristian Høgsberg a72d375667 clients: Drop pdf viewer sample client
This doesn't really add anything over the existing sample clients
and only complicates the build system with extra checks for poppler.
2014-01-31 22:16:08 -08:00
Jonas Ådahl 82fced41cc simple-egl: Fix -Wsign-compare compiler warning
Fixes the following compiler warning:

simple-egl.c:434:36: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2014-01-27 21:12:33 -08:00
U. Artie Eoff bae79ca741 clients/window: fail if NULL returned from frame_create
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:03:50 -08:00
U. Artie Eoff 86c68b328a weston-info: free allocated memory and check OOM conditions
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:02:37 -08:00
U. Artie Eoff 09827e2643 terminal: use xstrdup instead to handle OOM
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:01:30 -08:00
U. Artie Eoff 5cda4e328d use xzalloc wrapper instead
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:01:23 -08:00
U. Artie Eoff 3c946779df clients/desktop-shell: check OOM conditions
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:01:12 -08:00
Kristian Høgsberg 6f394d59a1 resizor: Don't resize if maximized
https://bugs.freedesktop.org/show_bug.cgi?id=73723
2014-01-17 15:31:33 -08:00
Bryce W. Harrington 3abdafd12d terminal: Only set title if asprintf succeeded
Handles potential out of memory situation by skipping the title update.
This fixes the following warning:

  terminal.c: In function ‘resize_handler’:
  terminal.c:851:11: warning: ignoring return value of ‘asprintf’,
  declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-01-17 11:29:54 -08:00
Kristian Høgsberg 211b517e8c shell: Move maximize and fullscreen bindings to mod + SHIFT
mod + f and mod + m conflict with too many application bindings, in
particular if mod is mapped to ALT.
2014-01-11 13:58:33 -08:00
Kristian Høgsberg b637a40df9 window: Properly destroy tooltip windows when parent window is destroyed
If we destroy a window with an active tooltip, we leave the tooltip
hanging around.  Call tooltip destructor when destroying a window.
This fixes the stuck tooltip observed when unplugging a monitor with
an active tooltip on the panel.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72931
2014-01-10 00:27:35 -08:00
Kristian Høgsberg d6d3b377f8 keyboard: Make debug output less verbose
The keyboard is too chatty, make it use a dbg() function for logging
which defaults to disabled.

Also drop a noisy fprintf() in input_panel_configure().
2014-01-09 23:58:14 -08:00
Kristian Høgsberg 700d6ad071 keyboard: Don't strcat() into a strdup()ed string
We need to reallocate the memory to hold the entire concatenated string,
but strcat() doesn't do that.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=71750
2014-01-09 23:45:18 -08:00
Kristian Høgsberg a548b4b85c keyboard: Fix insert_text() string utility
strncat() into a newly allocated buffer isn't well-defined.  I don't know
how this didn't crash all the time, getting blocks from malloc() with
a NUL in the first byte must be fairly common.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=71750
2014-01-09 23:39:20 -08:00
Neil Roberts 97b747cdda westoy: Add an option to explicitly disable cairo on a widget
The subsurfaces example creates a subsurface widget and uses EGL to
render to it directly rather than using the cairo context from the
widget. In theory this shouldn't cause any problems because the westoy
window code lazily creates the cairo surface when an application
creates a cairo context. However commit fdca95c7 changed the behaviour
to force the lazy creation at the beginning of each surface redraw.
This ends up making the triangle surface get two attaches – one from
Cairo and one from the direct EGL.

It looks like it would be difficult to reinstate the lazy surface
creation behaviour whilst still maintaining the error handling for
surface creation because none of the redraw handlers in the example
clients are designed to cope with that. Instead, this patch adds an
explicit option on a widget to disable creating the Cairo surface and
the subsurface example now uses that.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72854
2014-01-09 15:03:15 -08:00
Pekka Paalanen b0420aeb3d protocol: rename wl_surface_scaler to wl_viewport
This seems like a better name, and will not conflict if someone later
extends wl_surface with a request scaler_set (yeah, unlikely).

This code was written by Jonny Lamb, I just diffed his branches and made
a patch for Weston.

Cc: Jonny Lamb <jonny.lamb@collabora.co.uk>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-01-08 21:33:19 -08:00
Kristian Høgsberg ef9c8eb2db keyboard: Handle touch up event
This fixes arrow keys which trigger on button up.

Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73169
2014-01-07 12:57:59 -08:00
Kristian Høgsberg 966e3ed247 editor: Add missing touch-to-activate for the entries
Closes: https://bugs.freedesktop.org/show_bug.cgi?id=72996
2014-01-07 10:42:41 -08:00
Armin K 917711bd59 clients: Fix libexec clients install 2014-01-03 17:33:36 -08:00
Kristian Høgsberg 7885890df8 editor: Add keyboard_focus handler to schedule repaint
This let the editor client repaint the frame to indicate it's active
when it receives keyboard focus.
2014-01-01 23:57:42 -08:00
Kristian Høgsberg 4598f965fa desktop-shell: Remove debug code from previous commit 2014-01-01 16:32:09 -08:00
Kristian Høgsberg 7c4f6cc145 shell: Only assign focus on click if there is a pointer focus surface
If we don't have a background image from the desktop-shell client or the
pointer for some other reason doesn't have a focus we trigger a
segfault as we try to deref the seat->pointer->focus NULL pointer.

https://bugs.freedesktop.org/show_bug.cgi?id=73066
2014-01-01 16:28:32 -08:00
Kristian Høgsberg f3fa832796 build: Move clients libexec_PROGRAMS under BUILD_CLIENTS conditional
All the libexec programs are only built when BUILD_CLIENTS is true,
so we can just assign libexec_PROGRAMS under the condition.  This lets us
drop most of the variable assignments and simplify it a bit.

https://bugs.freedesktop.org/show_bug.cgi?id=72812
2014-01-01 13:52:20 -08:00
Kristian Høgsberg 96e1c0b6e5 build: Don't try to build weston-info if client build is disabled
The weston-info sources are defined conditionally in the if BUILD_CLIENTS
section, but we always added weston-info to bin_PROGRAMS.

https://bugs.freedesktop.org/show_bug.cgi?id=72812
2014-01-01 13:52:20 -08:00
Kristian Høgsberg ea520d510c build: Rename option and conditional for installing demo clients
Previously the option was --enable-demo-clients and the conditional was
ENABLE_DEMO_CLIENTS.  They control whether or not we install the demo clients
(ie all other clients than weston-terminal and weston-info).  Rename the
option and the conditional to better reflect this.
2014-01-01 13:52:20 -08:00
Kristian Høgsberg c152ee11e3 window.c: Don't put buttons on frames for custom windows
Custom windows don't have a wl_shell_surface and can't do anything in
response to these button (except crash).  This only affects the unlock
dialog.

https://bugs.freedesktop.org/show_bug.cgi?id=72542
2013-12-31 15:35:51 -08:00
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