Commit Graph

20827 Commits

Author SHA1 Message Date
Shinwoo Kim 6f06979cdc elementary: atspi - fix dbus abort
This patch set fix following abort occured on dbus side.

(gdb) bt
0   __GI_raise (sig=sig@entry=6)
1   __GI_abort ()
2   _dbus_abort ()
3   _dbus_warn_check_failed
4   dbus_message_iter_append_basic
5   append_basic
6   eldbus_message_iter_basic_append
7   _bridge_signal_send
8   _text_text_removed_send
9   _bridge_accessible_event_dispatch
10  _elm_interface_atspi_accessible_event_emit
11  elm_interface_atspi_accessible_event_emit
12  _entry_changed_user_signal_cb

(gdb) f 12
(gdb) p *$1
$2 = {change = {insert = {content = 0x0, pos = 0, plain_length = 1},
                del = {content = 0x0, start = 0, end = 1}},
      insert = 0 '\000', merge = 0 '\000'}

The following patch set would fix the root cause of this problem.
https://phab.enlightenment.org/D5240
2017-09-28 20:29:33 +09:00
Jean-Philippe Andre 76ab8e3f54 efl: Remove @owned tag from pack/content APIs
Refer to the previous commits for more context.

When an evas object is given to a container, be it with a variant of
efl_pack() or efl_content_set(), its "ownership" is given to the new
parent container. But ownership here means that the new container may
delete the child when it sees fit (i.e. when the container itself dies,
for instance). This does not mean that a reference was passed from the
calling context to the container. The actual EO owner of the child is
always the canvas or another canvas object, even if it the object is
unpacked.

Note: This means that invalid calls to efl_pack or efl_content_set will
not automatically delete the child object. This is the same as legacy,
and results in floating objects. Just check the return value! :)

Hopefully this is correct for bindings.
2017-09-28 17:29:03 +09:00
Jean-Philippe Andre ce84604068 tests: Use efl_unref() on duplicated event objects
efl_del() is valid but bindings such as C++ should be using efl_unref()
and not efl_del() in this situation: a reference was given, so it should
be released.
2017-09-28 16:50:53 +09:00
Jean-Philippe Andre f7a7a29cc0 evas: Give a parent to duplicated event objects
This comes back to an earlier situation where the fake event objects
created by efl_input_dup() had a parent (it should be the evas or maybe
the window). But that led to issues as efl_unref() would print error
messages. Using efl_allow_parent_unref_set() we hide the error message,
because in this situation we want the caller to use efl_unref() and not
efl_del() (eg. think of bindings...).

See d3436af616
See 6bed255fc4
See 96d94e0076 <-- main commit
2017-09-28 16:45:45 +09:00
Jean-Philippe Andre d3436af616 eo: Add API to allow deletion by unref
This allows deleting an object by simply calling efl_unref() on it, even
if there is a parent. Normally the parent is in charge, and you can
request deletion by calling efl_del() or efl_parent_set(NULL).

But in some rare cases, you want to give ownership of an object (@owned)
and still give a parent to that object. efl_unref() should be used (and
would be used by bindings when going out of scope or on garbage
collection), which would then print an error message. This API allows
the specific behaviour.

@feature
2017-09-28 16:42:04 +09:00
Jean-Philippe Andre 662a172139 eo_debug: Allow disabling of backtraces
export EO_LIFECYCLE_BACKTRACE=0

This means that the lifecycle can be tracked but we don't care about the
backtraces. Related to some recent eo_debug patches.
2017-09-28 16:15:07 +09:00
Jean-Philippe Andre 008ec97d84 eo: Allow efl_reuse to be called with a parent
If an object still has a parent inside the del intercept, we shouldn't
reset the "parent_sunk" flag. This would indeed break logic as
parent_sunk == false implies that a parent was never set, which means
the parent must be null. Right now this case isn't used but it can be
imagined with caches of evas objects (they should remain parented to
their evas).

@fix
2017-09-28 16:10:53 +09:00
Carsten Haitzler 9ee741cf7f ecore wl2 - fix null checing of drag offer - coverity
fix CID 1378629
2017-09-28 15:28:00 +09:00
Carsten Haitzler 92e8935fa6 ecore evas - wayland - avoid divide by 0 if height is 0
fixes CID 1379247
2017-09-28 15:28:00 +09:00
Carsten Haitzler dea4e5aa46 elm widget - fix possible null ptr access found by coverity
_propagate_event_legacy checked event_flags ptr for null then just
derefs it anyway... so check everywhere. fixes CID 1379920
2017-09-28 15:28:00 +09:00
Carsten Haitzler 1dcac1853d efl ui focus - fix coverity complaints about derfer before null check
indeed there was a child cnull check after dereferencing the child...
so check completely. fix CID 1379925
2017-09-28 15:28:00 +09:00
Carsten Haitzler 49df80aa6f efl ui win - quieten coverity complaint about dead code
the count ?: 1 check is pointless as count is already checked above.
make it clearer that it's > 0 and remove the ? check. silence for
coverity CID 1380542
2017-09-28 15:28:00 +09:00
Carsten Haitzler 35b65e0643 efl ui text - remove logically dead code
it is indeed pointless code. fix coverity CID 1380544
2017-09-28 15:28:00 +09:00
Carsten Haitzler 22466b991c edje - fix check return of _edje_fetch
fixes CID 1381326
2017-09-28 15:28:00 +09:00
Carsten Haitzler bee7bf5767 efl ui text - fix resource leak of strbuf and pointless buffer code
edje_object_part_text_style_user_push() doesnt need you to
stringshare_add a string... some other code did it because it "gets"
the string from an obj that might free/delete the string on push etc.
or before so it keeps a copy but then it stringshare_del's it
anyway... the _textpath_ellipsis_set() code creates a trsbuf that
wasn't freed if enabled was false and it never stringshare_del'd the
string is stringshare_added... all of this was pointless code anyway.
you could just pass the constant string directly.

fixes CID 1380543
2017-09-28 15:28:00 +09:00
Carsten Haitzler e095562ea1 evas font loading - fix possible divide by 0 when font size is 0
fix coverity CID 1381446
2017-09-28 15:28:00 +09:00
Jean-Philippe Andre 902938f626 eo: Fix unnecessary ERR logs with eo_debug
efl_data_scope_safe_get() is often used to assert that an object is of a
certain type, but assuming it may be NULL or not of the required type.
This means that encountering an invalid type is an error handled by the
caller (we return NULL), and shouldn't print out extra ERR() logs.

This fixes issues with E run under eo_debug. E's code was safe as it's
using evas_object_smart_data_get() and verifies whether the returned
value is NULL (which is expected for a rectangle, for instance).

@fix
2017-09-28 12:30:36 +09:00
Jean-Philippe Andre 6bed255fc4 tests: Fix leak of input event & devices
After the previous patch, the caller of efl_input_dup() clearly owns the
reference on the returned object, which means she must absolutely delete
or unref if manually.

Note that the previous patch changed the bug from use of invalid eo
pointer to leaking of objects. But the only way to support bindings with
something like dup() is to ensure we give a ref to the caller, and thus
the parent should be null.

Note: eo_debug was used extensively to reach this point.
2017-09-28 12:30:36 +09:00
Jean-Philippe Andre 96d94e0076 evas: Fix dangling references with input devices
This solves issues with efl_input_dup() which didn't properly give a
reference to the caller, resulting in dangling eo ids.

Note: This may trigger leaks (instead of invalid refs), but this now
actually reflects the meaning of @owned. This should work with bindings
and C API users should know to call efl_unref().

This patch is the reason for the previous improvements on eo_debug.

@fix
2017-09-28 12:30:36 +09:00
Jean-Philippe Andre 3dc140abfb eo_debug: Also print out the current backtrace
We can't use EINA_LOG_BACKTRACE=1 for that as eo_lifecycle itself prints
out ERR messages for its backtrace dump.
2017-09-28 12:30:36 +09:00
Jean-Philippe Andre 213821240b eo_debug: Enable logging of all ref/unref
This is done via the syntax (not documented yet):

  EO_LIFECYCLE_DEBUG=N:<class names>

Where N is:
 1. new/free
 2. new/free/ref/unref
 3. new/free/ref/unref/reuse

@feature
2017-09-28 12:30:36 +09:00
jiin.moon 98147ce097 evas : Improve the performance by reusing map surface
Summary:
If object just has update of map point without other changes included child,
the map surface can be reused.

Reviewers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D5181
2017-09-28 12:30:36 +09:00
Jean-Philippe Andre fcdb37dd3e tests: Improve test case for win/evas event refeed 2017-09-28 12:30:36 +09:00
Amitesh Singh 8ab7042149 intv slider: use scope_get instead in finalize() 2017-09-28 12:19:49 +09:00
Cedric BAIL 245ea06a65 eio: convert Efl.Io.Manager.stat() to return Eina_Future. 2017-09-27 16:32:58 -07:00
Cedric BAIL 3a3ae49afd eina: add an helper to setup Eina_Value structure description.
This is particularly useful on system like Windows who doesn't allow
setting pointer at compile time in static const structure.
2017-09-27 16:30:31 -07:00
jiin.moon d23aca3c8e emile: unmap the memory for image file after decode.
Summary:
In case of emile, unmap the memory of the image file when the image file is closing.
But closing of image file happen when the image is flushed from the cache, so the
mapped memory of image file remain for long period of time with no benefit (If it is
in cache, it won't get decoded again). So I think we don't need to keep the mapped
memory of image file.

Test Plan: self

Reviewers: cedric, jpeg, jypark

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D5210

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-09-27 11:51:50 -07:00
Cedric BAIL 1ac4a03d4f elementary: avoid segfault when getting focus due to an infinite recursion.
This was two line switched and setting the callbacks on the wrong object.
2017-09-26 15:21:12 -07:00
Cedric BAIL 37d6bc03fd ecore: we can actually inherit from Efl.Object, just not in the first position. 2017-09-26 11:13:06 -07:00
Vincent Torri 9b416d2360 eina: remove EFL_HAVE_WIN32_THREADS define as it is unused since winpthread is used
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-09-26 10:17:04 -07:00
Cedric BAIL 448244360f elementary: remove useless fprintf. 2017-09-26 10:15:07 -07:00
Cedric BAIL 0b37853f14 elementary: actually implement the terminate event. 2017-09-26 10:15:07 -07:00
Cedric BAIL 5c14be4ecf ecore: we need a different event for tracking the lifecycle of the main loop.
If the main loop is destroyed a lot of companion information might already
have been so relying on EFL_EVENT_DEL might be way to late in the shutdown
process. terminate will be triggered as soon as the process of shutting down
is started, so all the data are still valid and have not been destroyed yet.
2017-09-26 10:15:07 -07:00
Cedric BAIL 8e5a79f957 elementary: don't crash if API is called after shutdown. 2017-09-26 10:15:07 -07:00
Cedric BAIL 0b8e3e6fcf elementary: restore input propagation and destroy array properly. 2017-09-26 10:15:07 -07:00
Derek Foreman 0ad6c47ec2 efl_wl: Stop queuing buffer release events
This was an optimization that caused more pain than benefit in the
long term.  Weston no longer does it, so we're just following suit.
2017-09-26 11:39:19 -05:00
Jean-Philippe Andre a742edb486 examples: Fix C++ bg example
This is not nice yet... part API needs to be improved in C++.
2017-09-26 22:00:02 +09:00
Jean-Philippe Andre 7cc23b1754 elm: win part EO files are public 2017-09-26 22:00:02 +09:00
Jean-Philippe Andre 15f0614e6f elm: Fix make distcheck
See ebff5e8639
2017-09-26 22:00:02 +09:00
Youngbok Shin 42ac2136b0 evas textblock: use main font's ascent/descent as minimum value
Summary:
The patch will adjust ascent/descent with considering main font's ascent/descent
as minimum value. Actually, this patch re-apply D5217 with resolving linegap issue
on the _layout_format_ascent_descent_adjust() function.
@fix

Test Plan: Put a text which will load smaller font. And put a text which will load primary font.

Reviewers: raster, cedric, herdsman, jpeg

Differential Revision: https://phab.enlightenment.org/D5227
2017-09-26 14:33:11 +03:00
Jean-Philippe Andre 56667a84b1 win: Remove invalid callbacks
Faulty commit (guess who?):
  596dba5fe5

See also d567faa778

Finally make check works again. That was... a painful lot of patches to
fix.
2017-09-26 18:15:45 +09:00
Jean-Philippe Andre e1df334caf Revert "Fix infinite recursion for legacy + efl ui win events"
This reverts commit d567faa778.

This is not trying to fix the root cause for the infinite loop.
2017-09-26 18:11:38 +09:00
Jean-Philippe Andre ba12712e0d elm: Fix shutdown of atspi (unregister handlers)
@fix
2017-09-26 18:11:16 +09:00
Jean-Philippe Andre 25520583a7 ecore: Reset do_quit when ecore shuts down
After ecore_shutdown the main loop is dead, so the flag do_quit can be
safely reset to 0. This will fix issues with cycles of
elm_init/shutdown. This fixes:
  CK_FORK=no tests/elementary/elm_suite elm_win

This patch relies on a few of the previous patches which ensure that
ecore is well shut down.

@fix
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre e401b223f8 elm: Delete atspi root object on shutdown
Ugly implementation but this will do.

@fix
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 0ae529ac19 eo: Fix crashes with call cache after init cycle
It's not enough to check the init generation count, if the cache data is
not reset properly.

This patch adds safety in two ways:
 1. Actually reset the op call cache when we detect a new generation
 2. Verify that we don't return NULL function pointer

The 1st point is absolutely necessary, 2nd is optional (extra cost of
one if()).

@fix
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre f839905184 ecore_ipc: Unregister log domain on shutdown
An old comment mentioned that this was explicitely not unregistered, but
I believe the comment isn't valid since ecore_event_type_flush() was
introduced.
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 5cea60d157 elm: Fix elm_shutdown
ecore could not shut down properly in an elm_init()/elm_shutdown()
cycle, with 7 remaining references, all because of a typo.

This should help @cedric as well
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 5258a6d46f win: Avoid calling same function twice on shutdown
This avoids calling:
  ecore_evas_callback_delete_request_set
  ecore_evas_callback_resize_set
twice when deleting a window. Also adds safety over sd->ee.
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 3d2551175d evas: Fix shutdown of async cmd cache
The incomplete reset (array to NULL but max not reset) triggers errors
in evas_thread_queue_append() where eina_inarray_grow() returns NULL.

This shows up in:
   CK_FORK=no elm_suite

@fix
2017-09-26 17:58:07 +09:00