Commit Graph

161 Commits

Author SHA1 Message Date
Chris Michael 8a24d64030 ecore_evas_wayland: Fix null pointer dereference
Coverity reports a null pointer dereference here because
evas_engine_info_get can return NULL. Check for a valid return before
trying to use it.

Fixes Coverity CID1365655

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-08 11:09:00 -05:00
Chris Michael 90dabc831f ecore-evas-wayland: Fix use after free
Coverity reports illegal access here as we are trying to pass a freed
pointer to ecore_evas_free. Rework error handling to avoid this.

Fixes Coverity CID1365657

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-08 11:06:36 -05:00
Jean-Philippe Andre eb8d9387c1 wayland: Remove support for "draw_frame"
draw_frame is a legacy feature that draws a very ugly window border
with a white rect and a black text as title bar. This could be
used in wayland when using only the ecore_evas APIs, rather than
elm_win.

Note that the API ecore_evas_draw_frame_set() can not possibly work
as the flag is checked when the ecore_evas is created, so changing
the flag has no effect on existing windows.
2016-11-03 17:22:14 +09:00
Derek Foreman c425140a67 ecore_evas_wayland: Minimize differences between shm and egl
Finally bring these together as much as possible to avoid future
diversions when bugs are only fixed in one or the other.

There are functional changes - state tracking for client side effects is
now added to the shm engine, some bug fixes for the egl engine have been
brought to the shm engine.
2016-11-02 13:37:02 -05:00
Derek Foreman 4260d5d3a2 ecore_evas_wayland: Make resize code common
Brings resize code into the common implementation - there is a functional
change.  There appears to have been a bug in the egl resize where it
used the same w, h order for portrait evases as for landscape.  This was
fixed in shm.  I've used the shm variant for the common code.
2016-11-02 13:37:02 -05:00
Derek Foreman b23797c55a ecore_evas_wayland: Make rotation_set common
Rotation set can be moved into common now - should be no functional
change.
2016-11-02 13:37:01 -05:00
Derek Foreman 5d2a25a01d ecore_evas_wayland: Make transparent_set common
Moves transparent set into the common implementation - there is a
functional change here - the egl engine now calls transparent_set in
render_updates like the shm engine.

It is probable the this was the intended behaviour all along.
2016-11-02 13:37:01 -05:00
Derek Foreman 9ca6e274a4 ecore_evas_wayland: Make alpha set common
Moves alpha set into the common implementation - there is a functional
change here - the egl engine now calls alpha_do in render_updates like
the shm engine.

It is probable that this was the intended behaviour all along.
2016-11-02 13:37:01 -05:00
Derek Foreman 82277ae6b3 ecore_evas_wayland: Move more functions into the common implementation
Show and hide can be made common with almost no functional changes.
2016-11-02 13:37:01 -05:00
Derek Foreman 55de5c61cd ecore_evas_wayland: Don't include Evas_Engine_Wayland_Egl.h
There doesn't seem to be any need for this.
2016-11-02 13:37:01 -05:00
Derek Foreman 9e43a15526 wayland_egl: Remove pre_post_swap_callback_set
This stuff seems copied from gl_x11 which actually has API to use it.

In this engine nothing can actually set it, so it's just all dead code.
2016-11-02 13:37:00 -05:00
Derek Foreman b898d3f929 wayland ecore evas: move move_resize to common
It's identical in both shm and egl variants, share it.
2016-11-02 13:37:00 -05:00
Bruno Dilly 8bf74da7bc ecore_wl2: associate evas devices to input ecore events
So users would be able to differentiate between source
seats.
2016-11-01 16:06:19 -02:00
Bruno Dilly 7aab35961f ecore_wl2: add ecore event for seat capabilities change
So when mouse / keyboard are present or not it will
generate events.

ecore_evas/wayland will handle that creating or
deleting evas devices for each one (seat device
will be used as parent).
2016-11-01 16:06:19 -02:00
Bruno Dilly d7b1a5dfeb ecore_wl2: add ecore event for seat name change
And handle it on ecore_evas/wayland, properly
setting the evas device names.
2016-11-01 16:06:19 -02:00
Bruno Dilly 44fc1c6ecc ecore_evas/wayland: handle added / removed seats
Create or delete evas_devices with class EVAS_DEVICE_CLASS_SEAT
for seats on each ecore_evas created so far.

Initially it's named considering its Wayland id.
2016-11-01 16:06:19 -02:00
Bruno Dilly 26c1a564d9 ecore_evas/wayland: remove unnecessary NULL attributions
When freeing wdata there is no reason to set each
freed field to NULL.
2016-11-01 16:06:19 -02:00
Derek Foreman 54582858d8 ecore_evas_wayland: Don't use frame callbacks on windows with no shell surface
If we set a frame callback on a window with no shell surface (ie: and unmapped
window), the frame callback will never fire.  This was preventing some
applications like rage from ever posting a frame.
2016-10-14 16:07:08 -05:00
Youngbok Shin ceb0eab402 ecore_evas_wayland: Add NULL checking for surface
Summary: Need to NULL check before using surface like other cases.

Test Plan: N/A

Reviewers: jpeg, raster, ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D4301
2016-09-27 08:50:05 -04:00
Mike Blumenkrantz 9d5caf00b6 wayland: implement session recovery
add support for reconnecting wayland applications if the compositor dies

disconnect -> destroy gl ctx + image textures -> block rendering ->
reconnect -> create gl ctx -> create image textures -> unblock rendering ->
sprinkle special seasoning on top -> just like ma used to make

 #SamsungFeatures

@feature
2016-05-05 10:49:31 -04:00
Mike Blumenkrantz 0712218537 wayland: hook engine data from elm_win and update rect with evas size
the only way to accurately calculate the "evas" size in the engine from
window geometry is to have the size of the frame available to subtract from
window geometry

window geometry is NOT framespace--framespace is the entire csd region, possibly
containing a shadow, and window geometry is explicitly the region occupied by the
window, ie. not the shadowed part.

not my ideal solution to the synchronization issue here, but I guess this is a
benefit of the unified tree

fix T3396
2016-04-07 14:19:25 -04:00
Mike Blumenkrantz 5292b3de05 ecore-wl2: redo Ecore_Wl2_Event_Window_Configure entirely
this is an event representing the "new" state of the surface after a
configure event. it must contain the exact states which could potentially
have changed in the configure in order to ensure synchronization between
csd states and window size.

ecore events for xdg-shell configures must be sent only upon receiving a
configure event since states are set by the compositor and not by the client

@fix

 #hoorayforbeta
2016-04-07 14:19:25 -04:00
Mike Blumenkrantz afd083788b ecore-evas wayland: use www protocol when available
handle www protocol events and store the provided data into engine data

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2016-04-01 06:49:49 -04:00
Mike Blumenkrantz a6924ced9d wayland: add comment for ref T3396 2016-03-30 16:00:10 -04:00
Mike Blumenkrantz f70649a13d wayland: ignore resize from no-op surface configure events, send events always
this fixes the case where a configure event with the current window geometry
would cause (inaccurate) resizes

@fix
2016-03-30 15:42:21 -04:00
Chris Michael 99ac0763ab ecore-evas: Rename ecore_evas_wayland_window_get2 function
This renames the ecore_evas_wayland_window_get2 function to be
ecore_evas_wayland2_window_get before the 1.17 roll out.

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-01-07 15:02:13 -05:00
Mike Blumenkrantz 54df1d9c6a ecore-evas wayland: move frame sending to pre-flush callback
it was possible to deadlock rendering if a pre-render occurred but
the resulting render had no updated regions

@fix
2015-12-15 17:24:52 -05:00
Chris Michael 757f530af9 ecore-evas-wl: Defer creating surfaces for wayland canvas
This code adds support for deferring of surface creation and showing
inside Ecore_Evas Wayland. This is needed for Enlightenment so that it
does not try to create or show surfaces until the compositor has had a
chance to sync globals. This fixes an issue where early surface
creation would cause a crash in the compositor due to globals not
being syncd.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-11 11:26:24 -05:00
Mike Blumenkrantz 3760377e15 ee-wayland: do not send configure ack if no configure serial exists
also unset serial to ensure subsequent renders don't trigger the same ack
2015-12-10 16:00:45 -05:00
Chris Michael b5f8966fbe ecore-evas-wayland: Fix issue of starting resizing causing size jumps
Previously, when we started to resize an efl app, the size would
"jump" due to framespace being adjusted. This patch fixes that issue
and resize now works as expected.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2015-12-09 12:08:15 -05:00
Chris Michael abbfde9d68 ecore-evas-wayland: Move configure acknowledge to render_flush_pre
If we acknowledge a configure from xdg during post render, we end up
breaking maximize of EFL clients inside Weston (and perhaps other
compositors). In order to fix that, we will now send the configure ack
post render but pre flush.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2015-12-09 12:08:15 -05:00
Chris Michael 32eb2d32c4 ecore-evas-wayland: Don't set window geometry in ecore_evas
As we do not have the proper values for window geometry to be setting
it here, remove calls to set window geometry. We can more accurately
determine the window geometry from inside Elementary as it handles the
theme for the window borders.

@fix

ref T2919

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-07 15:36:42 -05:00
Chris Michael 3a8cfeb6d6 ecore-evas-wayland: Acknowledge configure event post render
This fixes a potential issue where we may have been sending the
configure acknowledgement before applying the actual new configuration
to the surface. Sending the ack_configure during post-render ensures
that we have already rendered according to the new configure
(addresses deferred rendering issue).

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2015-12-04 14:15:19 -05:00
Chris Michael 9f1eb3e021 ecore-evas-wayland: Use proper Ecore_Wl2 window functions
To get the proper maximized and fullscreen states, we should be using
the ecore_wl2_window functions, not the ecore_wl_window functions

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2015-12-03 14:55:42 -05:00
Mike Blumenkrantz 9c26f9311c ecore-evas wayland: enforce frame/state change triggering before move/resize
if a state change occurs on the ee, related callbacks must be run prior to
performing any resizes in order to ensure that the correct csd sizes are
calculated

@fix

ref T2841
2015-12-03 12:07:45 -05:00
Chris Michael 64a65f42a3 ecore-evas-wl: Fix issue of resize jumping
Summary: When an initial client application was shown and we tried to
resize it, the resize would jump by the amount of framespace. This was
because the xdg_surface@configure event would be sending window
geometry as the width/height params in the event. We need to account
for that in the callback of window configure and adjust size
accordingly.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:07:45 -05:00
Chris Michael caa1b4323b ecore-wl2: Port Ecore_Evas engines to use Ecore_Wl2 code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:07:20 -05:00
Chris Michael 116a0abf93 ecore-evas-wl: Fix issue of improper window geometry
This fixes an issue where maximizing a window would set improper xdg
surface window geometry. We receive window configure sizes based on
xdg surface window geometry, so we need to subtract framespace there
or else window size grows when maximizing/unmaximizing multiple times.
This also adjusts the call to xdg_surface_set_window_geometry to
account for framespace (Fixes T2842).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:05:49 -05:00
Mike Blumenkrantz d4dcd026f4 ecore-evas wayland: use correct values when updating wayland window size
by using the geometry from after the request size has been updated,
scenarios such as the following can be avoided:

[4208305.332] xdg_surface@46.set_window_geometry(0, 0, 1778, 1)
[4208305.370] xdg_surface@46.set_window_geometry(0, 0, 1778, 250)

@fix
2015-12-03 12:05:49 -05:00
Chris Michael 50411563aa ecore-wl2: Fix calling wl_surface_frame with proper Ecore_Wl2 window
frame

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:05:49 -05:00
Chris Michael 5ab650bf27 ecore-evas-wl: Fix ecore-evas wl common code due to botched rebase
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:05:01 -05:00
Chris Michael 7ae6c7d11d ecore-wl2: Port Ecore_Evas engines to use Ecore_Wl2 code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:05:01 -05:00
Mike Blumenkrantz 28a782283a ecore-evas wayland: enforce frame/state change triggering before move/resize
if a state change occurs on the ee, related callbacks must be run prior to
performing any resizes in order to ensure that the correct csd sizes are
calculated

@fix

ref T2841
2015-12-03 12:05:01 -05:00
Chris Michael 1b156a4b08 ecore-evas-wl: Fix issue of improper window geometry
This fixes an issue where maximizing a window would set improper xdg
surface window geometry. We receive window configure sizes based on
xdg surface window geometry, so we need to subtract framespace there
or else window size grows when maximizing/unmaximizing multiple times.
This also adjusts the call to xdg_surface_set_window_geometry to
account for framespace (Fixes T2842).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:05:01 -05:00
Mike Blumenkrantz 5b755a95c5 ecore-evas wayland: use correct values when updating wayland window size
by using the geometry from after the request size has been updated,
scenarios such as the following can be avoided:

[4208305.332] xdg_surface@46.set_window_geometry(0, 0, 1778, 1)
[4208305.370] xdg_surface@46.set_window_geometry(0, 0, 1778, 250)

@fix
2015-12-03 12:05:01 -05:00
Chris Michael ebc629375d ecore-evas-wl: Fix bad merge
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:05:01 -05:00
Chris Michael 123ac16eb7 ecore-wl2: Fix calling wl_surface_frame with proper Ecore_Wl2 window frame
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:05:01 -05:00
Chris Michael adf555660c ecore-evas-wl: Fix ecore-evas wl common code due to botched rebase
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:05:01 -05:00
Chris Michael 9e83ddbc48 ecore-wl2: Port Ecore_Evas engines to use Ecore_Wl2 code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:05:01 -05:00
Mike Blumenkrantz 787beec627 ecore-evas wayland: enforce frame/state change triggering before move/resize
if a state change occurs on the ee, related callbacks must be run prior to
performing any resizes in order to ensure that the correct csd sizes are
calculated

@fix

ref T2841
2015-12-03 12:05:01 -05:00