Commit Graph

297 Commits

Author SHA1 Message Date
Chris Michael 5fc4b971dc ecore-wl2: Fix issue of misleading 'if' statement
Gcc reports that this 'if' statement is misleading due to indentation.
We should only be sending the 'finish' call if the dnd version
supports it, however we should always be sending 'destroy'

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-11 11:56:17 -04:00
Marcel Hollerbach f0325fc190 ecore_wl2: Make offer destroy more secure
Check if it is NULL and NULL after each destroy call
2016-07-11 11:02:52 +02:00
Marcel Hollerbach 75bb8060b3 ecore_wl2: split of cnp_selection_data_ready and
dnd_selection_data_ready

before there was the case that both handlers are called even if just dnd
data arrived.
2016-07-11 11:02:52 +02:00
Marcel Hollerbach 63e88bdcfa ecore_wl2: only destroy source when not needed anymore.
Otherwise we are destroying the source before getting dnd_finished or
cancled events, which is a problem.
2016-07-11 11:02:52 +02:00
Marcel Hollerbach c300678391 ecore_wl2: buffer reading of the data
Otherwise callbacks can go out even if the selection data is not ready
to read.
2016-07-11 11:02:52 +02:00
Marcel Hollerbach cf5a79ea60 ecore_wl2: delay the destruction of the offer or do it in the read 2016-07-11 11:02:52 +02:00
Chris Michael 7496df08aa ecore-wl2: Fix error handling for bad fd
If we end up failing to get the fd from ecore_main_fd_handler_fd_get,
then we should just bail out of this function and try again later.

Fixes Coverity CID1357213

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-07-03 18:23:45 -04:00
Chris Michael 183a611cde ecore-wl2: Fix uninitialized variable
Coverity reports that len is used un-init here, so let's give it a
value at declaration time

Fixes Coverity CID1357214

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-07-02 07:17:23 -04:00
Chris Michael ff7a5e4f1b ecore-wl2: Fix issue where hash would not get destroyed on error
Coverity reports that we could not reach the eina_hash_free here on
erorr condition. This was due to an erroneous return NULL above the if
(hash_create) check.

Fixes Coverity CID1357171

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 11:14:40 -04:00
Chris Michael 79277d1cb4 ecore-wl2: Fix issue of passing negative number to close() and read()
We should be checking the return value of ecore_main_fd_handler_fd_get
calls as they can return a negative number...which cannot be passed to
the close() or read() functions.

Fixes Coverity CID1357152 and CID1357153

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 11:09:11 -04:00
Chris Michael 35f76fe8a8 ecore-wl2: Check the return value of ecore_main_fd_handler_fd_get
This patch fixes an issue where ecore_main_fd_handler_fd_get could be
returning a negative number and passing that to close() which cannot
accept negative numbers.

Fixes Coverity CID1357152

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 11:05:14 -04:00
Chris Michael 0eac1e4372 ecore-wl2: Fix derefence after null check
'window' here could potentially be null so we should be checking that
it is valid before trying to assign event window

Fixes Coverity CID1357148

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 11:01:22 -04:00
Chris Michael bbdb4e5a53 ecore-wl2: Fix formatting
NB: No functional changes

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-29 13:08:26 -04:00
Chris Michael df65a16620 ecore-wl2: Prevent duplicated mouse up events
If you touch downs and ups about all of fingers,
that is sufficient condition to call ecore_wl_input_ungrab().
And then one mouse up event is generated from that function.
So if you set a callback about ECORE_EVENT_MOUSE_BUTTON_UP,
you can watch two mouse up events are occurred.

This is a port of the patch for Ecore_Wayland library (deprecated) to
the newer Ecore_Wl2 library.

ref D4112

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-28 09:01:38 -04:00
Marcel Hollerbach 5ce3c4a049 ecore_wl2: Fix dnd breakage when focus leaves window
Summary:
If dnd in the same window is activated, the focus goes away from the
ecore_wl2 window to the dnd window, after that focus.pointer is NULL.
After focus.pointer is NULL ev->win of all the events will be 0 which
breaks dnd-motions, drop and end.

With prev_pointer beeing the last focused window, we can simply set this
window as event window. After that dnd with jesus works perfectly.

@fix

Reviewers: devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4093
2016-06-27 11:32:18 -04:00
Marcel Hollerbach 9f2055de34 ecore_wl2_input: Fix key keyname pairs
before key and keyname could have been filled invalid, for example the
character "ö" from the german layout produced "Odiaeresis" instead of ö.

This commit also documents and refactors _ecore_wl2_input_key_translate.
I added the documentation for later use, it was hard to find out why
this was done.
The function also drops the input now if invalid control codes would
have been generated, this is equivalent to the behaviour in x. So
applications cannot get confused by codes which dont exist.
It also doesnt check if there is actual output by checking the highest
bytes anymore, it just tries to create a utf8 character. This fixes
arabic greek and korean keyboard input on wl.

If this breaks the input for some user, feel free to contact me.

This fixes T3073.
2016-06-24 13:52:09 +02:00
Derek Foreman a4f64d6fcb ecore_wl2: Fix keyboard repeat handling
Recent timer changes broke keyboard repeat under wayland - while that
will probably be fixed shortly, this should be more robust and
more accurate anyway.
2016-06-09 12:43:50 -05:00
Chris Michael 0a93ff051f ecore-wl2: Support wl_seat_listener version 4
This patch adds support for wl_seat_listener version 4 (which is used
in wayland 1.11). We do not actually make use of the seat callback for
name yet, but when the rest of multi-seat issues are sorted, we may
need this.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-07 13:36:18 -04:00
Jean-Philippe Andre a6fe58364a ecore_wl2: Fix uninitialized fields in function array
Ping @devilhorns
2016-06-07 16:15:41 +09:00
Mike Blumenkrantz 7510e42c1b elm_win: implement v2 of teamwork api using window-based display protocol
this adds support for wayland and makes teamwork integration trivial for any
application

@feature
2016-05-20 14:54:06 -04:00
Chris Michael ac4ac88a72 ecore-wl2: Minor formatting fix
NB: No functional changes, just making this readable for me

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-19 09:12:29 -04:00
Chris Michael 08d286fdaf ecore-wl2: Minor formatting fixes
NB: No function changes, just formatting

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-18 16:08:46 -04:00
Carsten Haitzler 9e04c6824f ecore wl2 - remove warning with unused goto label 2016-05-18 02:02:45 +09:00
Chris Michael f7796faa59 ecore-wl2: Remove erroneous check for wayland display
NB: No real major changes, just removal of an extra 'if' block. If
getenv of wayland display fails, we hard-code the default wayland
display name so subsequent check for 'if (n)' is erroneous

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-16 06:53:27 -04:00
Marcel Hollerbach ca55a920d9 ecore_wl2: connect to default display
Summary: if there is no env var AND no name, connection to wayland-0

Reviewers: raster, jpeg, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3945
2016-05-16 19:14:40 +09:00
Chris Michael fb76fe55a5 ecore-wl2: Add environment variable to optionally disable wobbly windows
As not everyone needs/wants extra eye-candy, add a check for
EFL_WAYLAND_DISABLE_WWW environment variable to be able to disable
wobbly windows support

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-14 05:26:27 -04:00
Chris Michael 05a3cd6219 ecore-wl2: Remove need for including <sys/param.h>
As we already have MIN & MAX defined in Eina, we no longer need to
include sys/param.h header to get those defines

ref d00643fcc4

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-10 14:26:01 -04:00
Mike Blumenkrantz 37ed59474e Revert "elm cnp/Wl: Remove duplicated data receive callback"
This reverts commit f5d10f1961.

this breaks pasting into efl applications on wayland

fix T3455
2016-05-10 13:23:05 -04:00
Mike Blumenkrantz 037a3916bc ecore-wl2: only print socket ERR messages when not attempting to reconnect
reduces spamming in logs
2016-05-06 15:43:01 -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 fa66ce28ec ecore-wl2: null out subsurface pointers after destroying them 2016-05-05 10:49:30 -04:00
Derek Foreman 74283f076e ecore_wl2: Check return of wl_display_dispatch()
If the compositor crashes at just the right time this dispatch can fail
and result in a stuck app spinning in a tight loop.  Fix it so we do a
proper shutdown in this case.

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-03 14:24:45 -05:00
Chris Michael ebf26f2017 ecore-wl2: Formatting
Minor formatting fix. No functional changes

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-03 12:33:26 -04:00
Thiep Ha f5d10f1961 elm cnp/Wl: Remove duplicated data receive callback
If we do drag & drop and then do copy & paste, both _wl_selection_receive
and _wl_dnd_receive are called for one action (dnd or cnp). It is reduntdant.
We only need one data received callback to handle two cases dnd and cnp.
2016-05-03 17:13:47 +00:00
Thiep Ha aa0ace21d7 ecore wayland: add selection type
We have copy & paste and drag & drop selection types, but we cannot
distinguish between these two types when requesters receive data
from data ready event.
This patch adds a new enum to help selection requesters distinguish
between two selection types and have suitable actions for each type.
2016-05-03 17:13:47 +00:00
Mike Blumenkrantz 49302010f4 ecore-wl2: preserve data selection source after receiving the selection
this is copied from weston, except all the code which is supposed to be of
struct type "offer" has been renamed "source" and then reused in the same way
that weston uses "offer" in order to maximize reader confusion

deleting the source here is invalid since the selection only changes in the
corresponding callback from the wayland interface
2016-04-25 16:15:59 -04:00
Mike Blumenkrantz 7da4d8a4ae ecore-wl2: isolate regular selection requests from dnd-specific code
fix T3455
2016-04-22 11:32:08 -04:00
Chris Michael 262ac55287 ecore-wl2: Fix formatting
NB: No functional changes

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-04-22 09:36:54 -04:00
Chris Michael 98e8183b1b ecore-wl2: Port session recovery protocol to work with Ecore_Wl2
This patch ports the existing session recovery protocol from
Ecore_Wayland so that it is used inside Ecore_Wl2.

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-04-22 09:32:45 -04:00
Mike Blumenkrantz d36c931fac ecore-wl2: more dnd v3 updates
ref d34b5958051c87fe491e358b24e9f25238fda10f

 #gladthiswasabetaapi
2016-04-21 13:58:45 -04:00
Mike Blumenkrantz 74ed3fbe74 ecore-wl2: use fd handler for receiving selection data
not sure what trac ticket was referenced here, but probably the issue was
not using ecore_main_fd_handler_file_add()
2016-04-21 13:58:45 -04:00
Mike Blumenkrantz 46666de75d ecore-wl2: return some copied code back to its original state
this will make future rebases easier
2016-04-21 13:58:45 -04:00
Mike Blumenkrantz 19239b9251 ecore-wl2: update wl dnd/clipboard support to v3 of protocol
this code is mostly copied from weston:
78d4bf9a3ec990dceee23fd53962a69891352a0e
9c93179023fe894e417ccd20533d72d672d976fc

credit to Carlos Garnacho <carlosg@gnome.org> as original author

fix T3455

@feature
2016-04-21 13:58:45 -04:00
Mike Blumenkrantz 1f6746cedb ecore-wl2: correct the name and type of some function params 2016-04-21 13:58:45 -04:00
Mike Blumenkrantz ad9ae67e46 ecore-wl(2): add copyright headers (MIT) from weston
these files were created containing code which was very obviously copied from
weston. when copying code, copyright headers must also be copied in order to
comply with licenses.
2016-04-20 08:47:01 -04:00
Derek Foreman f7cbb12fd4 ecore_wl2: Add API to get dmabuf protocol object 2016-04-19 15:11:09 -04:00
Derek Foreman d6e5bdf428 ecore_wl2: Bind dmabuf global if available
Bind the dmabuf global so we can make use of it later.
2016-04-19 15:11:09 -04:00
Derek Foreman 7514d08ae6 ecore_wl2: Add generated dmabuf files
This adds the framework for the dmabuf protocol for wayland - the files
are generated with wayland-scanner.
2016-04-19 15:11:09 -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 af1c7d3407 ecore-wl2: remove maximized/fullscreen/transient from window types enum
these aren't real window types and only complicate internals/api

 #hoorayforbeta
2016-04-07 14:19:25 -04:00