Commit Graph

1224 Commits

Author SHA1 Message Date
Frank Binns 77f7daca68 smoke: fix valgrind invalid read errors
There are a number of invalid read errors reported by valgrind of the
form:
	==13428== Invalid read of size 4
        ==13428==    at 0x405656: advect (smoke.c:116)
        ==13428==    by 0x405E80: redraw_handler (smoke.c:228)
        ==13428==    by 0x40DE74: widget_redraw (window.c:3995)
        ==13428==    by 0x40E02D: surface_redraw (window.c:4053)
        ==13428==    by 0x40E0C9: idle_redraw (window.c:4082)
        ==13428==    by 0x410FC9: display_run (window.c:5561)
        ==13428==    by 0x406518: main (smoke.c:373)
        ==13428==  Address 0xb2c9b14 is 4 bytes after a block of size
                   160,000 alloc'd
        ==13428==    at 0x4C29DB4: calloc
        ==13428==    by 0x40646B: main (smoke.c:360)

This results in invalid rendering when running a debug version of the
application.

Fix the issue by limiting the maximum values of px and py to 1.5 less
than width and height. This prevents reading past the end of the source
buffer.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82287
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-11 12:59:43 +02:00
Jasper St. Pierre c8e41868fd smoke: Don't commit an xdg_surface with a NULL buffer
Committing to an xdg_surface with a NULL buffer is currently illegal in
the mutter implementation, so this simply causes the client to error and
exit.

It seems the reason the client did this was so it could add its own
frame callback, but toytoolkit actually provides accurate everything we
need. Just use its functions instead to get the time and schedule a
redraw.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-11 12:33:01 +02:00
kabeer khan 6ce67ecbce window : compare version and call appropriate destructor
[Pekka Paalanen: removed trailing space, split long line.]

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-11-04 15:27:07 +02:00
Pekka Paalanen ef2b592ad4 clients: add presentation-shm demo
This started as a copy of simple-shm.c before it was converted to
xdg_shell.

This demo excercises the presentation feedback interface in five
different modes:

- A continuous repaint loop triggered by frame callbacks, and using
  immediate commits, just gathering presentation feedback and computing
  some time intervals for statistics.

- The same as above, except with 1s sleep before actually repainting as
  a response to frame callback. This tests how well the compositor can
  do a repaint from idle state (not continuously repainting), assuming
  nothing else is causing repaints.

- A continuous repaint loop triggered by 'presented' events rather than
  by frame callbacks. If Weston uses an appropriate scheduling
  algorithm, this mode achieves the smallest possible frame latency
  (below one output refresh period).

In all modes, all frames are pre-rendered at startup, so no rendering
happens during the animation.

[Louis-Francis Ratté-Boulianne: split queuing feature]

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
2014-09-30 13:02:20 +03:00
Pekka Paalanen 93a6afdf6e weston-info: report presentation clock
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
2014-09-30 11:37:02 +03:00
Xiong Zhang 382de46a2f clients: Maximize window when double touch on title bar
Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2014-09-22 10:19:44 +03:00
Olivier Blin 30e1f3c311 editor: do not crash when text input manager is not available
[Pekka Paalanen: whitespace fix]

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-17 13:55:24 +03:00
Olivier Blin 814f0ee5a6 keyboard: do not crash when input panel is not available
[Pekka Paalanen: whitespace fix]

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-17 13:52:09 +03:00
Ondřej Majerech b2c1864777 window: Don't needlessly sync parent and geometry
When a toytoolkit client redraws, the toolkit syncs the parent and
geometry. If a client redraws often (such as the terminal drawing a huge
amount of output), this can spam the compositor with requests and may
result in the client's eventual being killed.

We don't need to send requests for changing the geometry or parent if
these haven't changed. So remember the last geometry and parent, and
update them only if needed.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83297
Signed-off-by: Ondřej Majerech <majerech.o@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-15 11:22:05 +03:00
Bill Spitzak 5e3b693a11 image: don't print redundant error
This error is printed by load_image() now

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-11 13:11:29 +03:00
Pekka Paalanen 2623786277 Partially revert "xdg-shell: Add show_window_menu request"
This reverts the parts of commit 81ff075bf4
that touch window.c.

This brings the toytoolkit window context menus back, until someone
implements the xdg-shell equivalent in the compositor.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82972
Acked-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-11 11:34:31 +03:00
Jonas Ådahl 16fe4dcea9 input: Schedule pointer sprite repaint when cursor is set
If a cursor was set with wl_pointer.set_cursor but not in combination
with an action that has the side effect of damaging the region where the
cursor is positioned, it would not be drawn. This patch explicitly
schedules a repaint of the pointer sprite when it is set.

clickdot is updated to illustrate the bug; when moving the pointer over
clickdot, the pointer is hidden. When not having moved the pointer for
500 ms it is made visible using wl_pointer.set_pointer.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-10 14:20:13 +03:00
Xiong Zhang bfb4ade1a0 clients: Maximize window when double click on title bar
Signed-off-by: Xiong Zhang <panda0626@gmail.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-09-04 17:11:22 +03:00
Arnaud Vrac fb754a0a05 desktop-shell: properly set background widget as opaque
Toytoolkit resets the opaque region which was set manually using the
wayland protocol directly, so use the widget API instead.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-28 13:41:00 +03:00
Arnaud Vrac 488b7cd0f0 simple-egl: fix opaque and 16 bits mode options
In those cases we were writing to the wrong EGL config attribute.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-28 13:27:48 +03:00
Ryo Munakata 30b2a37a9a multi-resource: remove an unnecessary call of wl_display_get_fd()
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-28 13:08:43 +03:00
Ryo Munakata 445436c593 simple-shm: remove an unnecessary call of wl_display_get_fd()
Reviewed-by: Nils Chr. Brause <nilschrbrause@gmail.com>
2014-08-28 11:56:29 +03:00
Arnaud Vrac 38d90be5bb window: unbind egl surface and context on surface release
Binding null read and write surfaces to an egl context is not standard

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-27 16:37:44 +03:00
Pekka Paalanen 71182aed84 xdg-shell: bump experimental protocol version
The experimental versioning has not been updated when it was supposed
to. Let's try to be better at it now, as xdg-shell is close to have its
first stable version.

Bump the version now to bring the world into the same exact version.

There may be some protocol changes still coming, but we try to land them
before 1.6 gets out. Those changes will bump the experimental version
again as needed.

When 1.6.0 is released, the experimental version will no longer be
bumped, and no incompatible protocol changes will be made. Xdg-shell.xml
file will move to Wayland in 1.7.0, drop the experimental versioning,
and become stable.

Cc: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-21 17:47:20 +03:00
Pekka Paalanen effef73926 cliptest: sync calculate_edges with master copy
The master copy of calculate_edges() lives nowadays in gl-renderer.c.
Copy it verbatim from gl-renderer.c into cliptest.c.

Update cliptest.c for the following changes that happened in Weston
core, vertex.clipping.c, and gl-renderer.c:
- replace GLfloat with float
- introduction of weston_view, here replacing weston_surface
- API change of weston_view_to_global_float

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-20 11:51:27 +03:00
Ondřej Majerech 06e089275d Remove duplicated code from cliptest.c
Signed-off-by: Ondřej Majerech <oxyd.oxyd@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-20 11:43:26 +03:00
Ran Benita 2e1968fa1f Replace deprecated xkbcommon symbols with current names
These symbols (xkb_map_* and others) were replaced in xkbcommon with more
consistent names. See the header xkbcommon/xkbcommon-compat.h for how
the old names map to the new.

The new names have been available since the first stable xkbcommon
release (0.2.0).

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-08-20 01:05:13 -07:00
Derek Foreman a0fae4657f cliptest: Avoid use of uninitialized memory when regions don't intersect
Prevent attempting to draw the intersection polygon when it contains no
vertices.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-19 12:46:11 +03:00
Bill Spitzak 0fc3786dff weston-scaler --help works even if not run inside wayland 2014-08-19 12:21:44 +03:00
Bill Spitzak a8292618a6 weston-image --help works. Also help if no filename is given 2014-08-19 12:21:44 +03:00
Bill Spitzak bb0bb9ce96 weston-editor --help works 2014-08-19 12:21:44 +03:00
Bill Spitzak 6fd10c6c6c weston-dnd --help works 2014-08-19 12:21:37 +03:00
Bill Spitzak 36bcf47054 weston-cliptest --help works. You must use -b to run benchmark 2014-08-19 12:19:56 +03:00
Bill Spitzak 5cad843989 weston-terminal --help and other command-line options
Option array existed but was unused. Added --font-size.
2014-08-19 12:19:17 +03:00
Bill Spitzak 6e16a556f8 Made weston-screensaver --help work 2014-08-19 12:19:17 +03:00
Bill Spitzak 852254a7c7 Made weston-subsurfaces --help work 2014-08-19 12:19:17 +03:00
Bill Spitzak 6df71aae03 Made weston-nested --help work 2014-08-19 12:19:16 +03:00
Bill Spitzak 4fb8491e1b weston-eventdemo --help works
Also defaults to printing all events if you specify none.
Removed incorrect "-0" switch which would turn on one of them.
2014-08-19 12:19:16 +03:00
Ryo Munakata a3a5debe31 gears: fix invalid calculation of the first FPS
At the calculation of the first FPS, gears has initialized last
FPS time with gettimeofday().
But the callback_data passed in the callback of wl_surface_frame()
is the current time, in milliseconds, with an undefined base.
Because of this subtracting last FPS time from callback_data makes no sense.
 For example, below is the result of running weston-gears on weston with
drm backend:

$ weston-gears
Warning: FPS count is limited by the wayland compositor or monitor refresh rate
1 frames in 1094460.125 seconds =  0.000 FPS
301 frames in  5.016 seconds = 60.008 FPS
301 frames in  5.016 seconds = 60.008 FPS
301 frames in  5.016 seconds = 60.008 FPS

As you can see, the the first FPS value is something odd.

This patch fixes it by initializing last FPS time with the callback_data passed in
the first callback.

Reviewed-by: Nils Chr. Brause <nilschrbrause@gmail.com>
2014-08-18 15:27:16 +03:00
Jonny Lamb e67118c80a desktop-shell: add option to avoid creating the panel
This option is so we can disable showing any panel at all. The default
is to continue showing the panel and no example is added to weston.ini
because it's an uncommon request.

Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2014-08-18 13:26:41 +03:00
Magnus Hoff 1046f121f7 Implemented support for mouse scrolling in weston-terminal
[Pekka Paalanen: fixed some code style issues]
2014-08-15 16:06:05 +03:00
Boyan Ding 45ee1f9ef7 simple-egl: Clean up unused frame_listener
Unused since commit 1e65840b61

Signed-off-by: Boyan Ding <stu_dby@126.com>
Reviewed-by: Nils Chr. Brause <nilschrbrause@gmail.com>
2014-08-15 15:52:08 +03:00
Jonny Lamb 0695908a9f clients: use repeat_info event details
The weston-info client prints out the values, and the values are
respected in toytoolkit when actually repeating keys..
2014-08-15 15:39:47 +03:00
Jasper St. Pierre a177df09bf window: Don't use the frame's geometry when fullscreen
When fullscreen, we don't actually update the frame's geometry, so we
can't query it for there.
2014-08-05 12:31:04 -07:00
Jasper St. Pierre ccf48fb4f9 shell: Replace set_margin with set_window_geometry
Currently, there is a fun flicker when toggling maximization or
fullscreen on a window in mutter or more sophisicated compositors
and WMs.

What happens is that the client want so go maximized, so we
calculate the size that we want the window to resize to (640x480),
and then add on its margins to find the buffer size (+10 = 660x500),
and then send out a configure event for that size. The client
renders to that size, realizes that it's maximized, and then
says "oh hey, my margins are actually 0 now!", and so the compositor
has to send out another configure event.

In order to fix this, make the the configure request correspond to
the window geometry we'd like the window to be at. At the same time,
replace set_margin with set_window_geometry, where we specify a rect
rather than a border around the window.
2014-07-17 13:59:01 -07:00
Jasper St. Pierre bd65e50875 Interpret the size in the configure event as window geometry
The size of the configure event has always been specified as in window
geometry coordinates, but it was never implemented this way.
2014-07-17 13:58:45 -07:00
Jason Ekstrand ef5400843f Use pixman_region32_clear instead of our own empty_region
This requires pixman 0.25.2

Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2014-07-05 01:03:55 -07:00
vivek 31732f7c68 Clients: Fix memleak issues in various clients of weston
In many clients of weston, Display was not being destroyed so added it.
Also destroy windows, widgets which were not being destroyed.

Signed-off-by: vivek <vivek.ellur@samsung.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-06-24 10:22:43 -07:00
Jason Ekstrand 549a53f186 Add a simple client for testing compositor damage handling
This allows for easily testing a compositor's damage tracking in all
currently available configurations including wl_surface.buffer_transform,
wl_surface.buffer_scale, and wl_viewport.  It also includes a
--rotating-damage that flag instructs the client to change the
wl_surface.buffer_transform on every commit.  This tests the compositor for
proper handling of texture uploads even when the transform has changed but
the buffer size hasn't.
2014-06-18 10:45:50 -07:00
Jasper St. Pierre 81ff075bf4 xdg-shell: Add show_window_menu request 2014-05-23 09:43:17 -07:00
Jasper St. Pierre de8bd50d35 clients: Allow creating a "detached" menu
This will be used by the xdg_surface.show_menu_window implementation.
2014-05-23 09:37:19 -07:00
Jasper St. Pierre dda9313bd9 clients: Remove the window / user parameters from the menu function
We want the ability to create a detached menu.
2014-05-18 13:54:15 -07:00
Kristian Høgsberg be803ad67c window: Send ack_configure immediately from configure handler
Once we've updated the window state and scheduled a resize, we know that
the next frame we send to the compositor will match the configured state.
This means we can just ack the configure immediately and not jump
through hoops to try to do it from the redraw stage.
2014-05-12 23:34:34 -07:00
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