Commit Graph

177 Commits

Author SHA1 Message Date
Guilherme Iscaro 133b4fa65b Ecore Wl2: Add ecore_wl2_window_pointer_device_xy_get() API.
This commit adds a Wayland specific function to fetch a mouse
position.
2016-12-20 18:34:39 -02:00
Guilherme Iscaro 64986bccac Ecore Evas: Add API to set/get the pointer position per device.
Since Ecore Evas now support multiple mouse devices new APIs were
added in order to fetch the mouse position.
2016-12-20 18:34:39 -02:00
Chris Michael fa05393d02 ecore-evas-wayland: remove float comparison warning from wayland backend
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-20 08:53:16 -05:00
Chris Michael f449fca9d6 ecore-evas-wayland: Set all evas engine info fields before updating
Small patch to set all fields of the Evas Engine Info structure before
calling evas_engine_info_set function

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-02 14:25:10 -05:00
Chris Michael 0ecaf00d97 ecore-evas-wayland: Use engine 'hidden' field for ecore_evas_hide operations
This patch allows us to set a 'hidden' flag in the Evas Engine
information structure instead of setting a NULL surface. Setting this
flag allows us to hide/show a canvas without having to
destroy/recreate a wl_surface every time.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-02 14:25:10 -05:00
Guilherme Iscaro ad1d160bb6 Ecore Input Evas: Add ecore_event_evas_seat_modifier_lock_update().
This function will set the modifiers/lock per seat in Evas.
Some places will still use ecore_event_evas_modifier_lock_update(),
since multi-seat is not supported.
2016-12-02 09:57:50 -02:00
Guilherme Iscaro 75619fc290 Ecore Evas: Add multi seat support for mouse in/out. 2016-11-28 13:57:55 -02:00
Guilherme Iscaro be609118c6 Ecore_Evas: Add support for per-seat focus. 2016-11-28 13:57:55 -02:00
Bruno Dilly 1e62cd562e ecore_wl2: avoid adding repeated devices
Summary:
After changes done on commit 9f8e2e0d9c
it was possible to have multiple devices with the same
id added throught the function
_ecore_evas_wl_common_cb_global_added().

To avoid such issue, let's check if the device was already
created first.

Reviewers: iscaro

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4428
2016-11-24 18:31:23 -02:00
Guilherme Iscaro 9f8e2e0d9c Ecore Wayland: Remove ECORE_WL2_SEAT_CAPABILITIES_NO_SEAT.
Summary:
It's not possible to have an Ecore_Wl2_Input without a seat.

Ecore Evas Wayland: Remove seat existence check.

At this point every seat advertised is considered new, therefore
it will not be in the devices list.

Reviewers: barbieri, jpeg, cedric, bdilly

Reviewed By: bdilly

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4408
2016-11-16 17:50:32 -02:00
Guilherme Iscaro 9ba11c5cd0 Ecore Evas Wayland: Create the devices during Ecore_Evas setup.
Summary:
When launching an Elementary App using Wayland the elm_config will
automatically connect to the Wayland's display server and all events
regarding seats are lost, since by the time that Ecore_Evas is created
the global events were already dispatched. To fix this problem,
everytime an Ecore_Evas is created, the code must check if there
are any seat capabilities available, if so, the devices will be created.

Reviewers: bdilly, barbieri, cedric, jpeg

Subscribers: devilhorns, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4390
2016-11-16 18:26:25 +09:00
Derek Foreman 9ad35a6fa2 ecore_evas_wayland: Re-kill double disconnect bug on fallback
Jpeg caught this one a while back and it got re-introduced recently.
2016-11-09 16:33:49 -06:00
Chris Michael 11ef74c962 ecore-evas-wayland: Fix case of potential double-free
This patch addresses the case where we failed to allocate 'wdata' and
were calling free(ee) before going to an error handler. For the fix,
just don't free(ee) here and let the error handling do it's job.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-08 12:16:06 -05:00
Chris Michael 7a74a2e176 ecore-evas-wayland: Fix typo
Fix small typo which lead to undefined error statement.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-08 11:22:23 -05:00
Chris Michael b7406df4cf ecore-evas-wayland: Add warning if we fail to set engine info
Coverity reports an error handling issue here as we are not checking
the return value of evas_engine_info_set, so check that return and
issue a warning if it fails.

Fixes Coverity CID1365651

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-08 11:13:07 -05:00
Chris Michael 781a5089e5 ecore-evas-wayland: Fix NULL pointer dereference
Coverity reports that accessing 'einfo' here is a NULL pointer
dereference. evas_engine_info_get can return NULL, so we should be
checking for a valid return before trying to use it.

Fixes Coverity CID1365654

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-08 11:10:53 -05:00
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