Compare commits

...

13 Commits

Author SHA1 Message Date
Chris Michael 14239cac0e ecore-drm: Add missing initializer for fb2 command
drm_mode_fb_cmd2 has fields for a modifier to handle tiling,
compression, etc (per plane). Even tho we do not use these, we should
at least initialize them to zero else we end up with uninitialized
bytes in the cmd structure.

==11706== Syscall param ioctl(generic) points to uninitialised byte(s)
==11706==    at 0x57E05D9: ioctl (in /usr/lib/libc-2.20.so)
==11706==    by 0x4D30FA3: drmIoctl (in /usr/lib/libdrm.so.2.4.0)
==11706==    by 0x4CDF66B: _ecore_drm_fb_create2 (ecore_drm_fb.c:63)

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-03 08:19:46 -04:00
Chris Michael 17e3e665c5 evas: Fix improper extra library linkage for various engines
The drm and gl_drm engines were all linking to eeze internal
libraries however none of those engines actually use eeze at all so we
can remove the linking there.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-03 08:19:32 -04:00
Cedric BAIL 4bc6361c26 Revert "Set the name for table, box items"
This reverts commit 6f7608befd.

Item in table and box do not need names as they have an index. This
is breaking ABI for edje application that rely on getting the index
properly when a signal is emitted. To be precise, this did break
elemines.
2016-04-19 14:08:06 -07:00
Jihoon Kim a4e42ad303 edje entry: fix bug not to call ecore_imf_context_cursor_position_set when deleting surrounding text
@fix
2016-03-31 15:39:52 +09:00
Daniel Hirt 44c34fa172 Evas textblock: fix cached markup's stringshare refs
The last fix 00300e7761 was missing a
stringshare_del for the NOP case of markup_set. It led to a
constantly increasing ref count of the cached markup.

@fix
2016-03-07 09:23:46 +02:00
Mike Blumenkrantz 1b81417312 edje: clear pending programs upon calling stop_programs_on()
pending programs have not started yet, so they are not directly attached
to the part. failing to remove them results in unexpected behavior from programs

ref 71ce70bc3f

@fix
2016-03-02 13:29:30 -05:00
Mike Blumenkrantz cf2e35bcaa ecore-wl2: do not send double mouse up events during input ungrab
if the ungrab is triggered from a mouse up event, this ensures that a
mouse up will be sent from the ungrab function. continuing to send a
mouse up event in addition to this will guarantee multiple mouse events
are emitted

@fix
2016-03-02 13:29:23 -05:00
Tom Hacohen 7ac3dbbfe3 Evas textblock tests: Fix wrong test suite tests.
The tests were assuming that textblock returns a sanitised utf8 string.
This is not always correct, because textblock may cache and return the
set utf8 markup if the text hasn't changed since the last set.
2016-02-26 09:37:59 +00:00
Tom Hacohen 8d9a883f3a Edje textblock: Assume textblock knows to deal with setting the same markup.
Edje was trying to be smart and ask textblock for its markup and compare
with its own cache before setting it again. This is completely wrong,
and textblock is smart enough to deal with it now.

@fix
2016-02-26 09:14:51 +00:00
Tom Hacohen 00300e7761 Evas textblock: Fix markup cache, was completely broken.
The markup cache was completely broken. It was not compared correctly,
so it wasn't even used, but regardless it was cleared just after being
set in some of the cases.

This is the first part of a performance regression fix in elm label.

@fix
2016-02-26 09:14:49 +00:00
Mike Blumenkrantz de0b153105 eina: invalidate last add/del rects when the opposite operation occurs
applying this optimization to prevent the same rectangle from being added
or removed repeatedly in succession would result in the rejecting of successive
operations of the same type when the other operation occurred in between.

as an example:

add(0, 0, 100, 100)
del(0, 0, 100, 100)
add(0, 0, 100, 100)

should yield (0, 0, 100, 100), not zero rects and a failure to add the
second rect

this fixes a serious issue in enlightenment where stacking three windows
on top of each other with the first and third windows having the same geometry
would result in the top window receiving no input geometry (oops)

@fix
2016-02-05 17:34:10 -05:00
Tom Hacohen c7bc4e5d50 Ecore con local: properly clean up fd on error.
This wasn't done correctly in the previous commit. First of all, the
order of cleanup was wrong, the cleanup area should only be called if
failures occurred after the fd allocation, not before. Also, fd should
be reinitialised to -1 once we close the socket.
2016-02-05 11:52:02 +00:00
Awadhesh Singh 6ec5ba177b Ecore con: Close server socket fd on failure.
Summary:
Socket fd must be closed to avoid file discripter leak.
Programs can usually only open a limited number of file descriptors,
so if this happens a lot, it may turn into a problem.

@fix

Reviewers: raster, Hermet, wonsik, spacegrapher, cedric, jpeg, tasn

Reviewed By: tasn

Subscribers: cedric, alok25, yashu21985, singh.amitesh

Differential Revision: https://phab.enlightenment.org/D3660
2016-02-05 11:45:37 +00:00
11 changed files with 60 additions and 50 deletions

View File

@ -1263,9 +1263,8 @@ modules_evas_engines_drm_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
modules_evas_engines_drm_module_la_LIBADD = \
@USE_EVAS_LIBS@ \
@USE_ECORE_DRM_LIBS@ \
@evas_engine_drm_libs@ \
@USE_EEZE_INTERNAL_LIBS@
modules_evas_engines_drm_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@ @USE_EEZE_INTERNAL_LIBS@ @USE_ECORE_DRM_INTERNAL_LIBS@
@evas_engine_drm_libs@
modules_evas_engines_drm_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@ @USE_ECORE_DRM_INTERNAL_LIBS@
modules_evas_engines_drm_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
modules_evas_engines_drm_module_la_LIBTOOLFLAGS = --tag=disable-static
endif
@ -1302,9 +1301,8 @@ modules_evas_engines_gl_drm_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
modules_evas_engines_gl_drm_module_la_LIBADD = \
@USE_EVAS_LIBS@ \
@USE_ECORE_DRM_LIBS@ \
@evas_engine_gl_drm_libs@ \
@USE_EEZE_INTERNAL_LIBS@
modules_evas_engines_gl_drm_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@ @USE_EEZE_INTERNAL_LIBS@ @USE_ECORE_DRM_INTERNAL_LIBS@
@evas_engine_gl_drm_libs@
modules_evas_engines_gl_drm_module_la_DEPENDENCIES = @USE_EVAS_INTERNAL_LIBS@ @USE_ECORE_DRM_INTERNAL_LIBS@
modules_evas_engines_gl_drm_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
modules_evas_engines_gl_drm_module_la_LIBTOOLFLAGS = --tag=disable-static
endif

View File

@ -517,16 +517,9 @@ static void
check_packed_items(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
{
unsigned int i;
char *def_name;
for (i = 0; i < ep->items_count; ++i)
{
if (!ep->items[i]->name)
{
def_name = alloca(strlen("item_") + strlen("0xFFFFFFFFFFFFFFFF") + 1);
sprintf(def_name, "item_%p", def_name);
ep->items[i]->name = strdup(def_name);
}
if (ep->items[i]->type == EDJE_PART_TYPE_GROUP && !ep->items[i]->source)
error_and_abort(ef, "Collection %i: missing source on packed item "
"of type GROUP in part \"%s\"",

View File

@ -366,16 +366,16 @@ start:
goto error_umask;
if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0)
goto error_umask;
goto error_fd;
if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0)
goto error_umask;
goto error_fd;
lin.l_onoff = 1;
lin.l_linger = 0;
if (setsockopt(svr->fd, SOL_SOCKET, SO_LINGER, (const void *)&lin,
sizeof(struct linger)) < 0)
goto error_umask;
goto error_fd;
if (bind(svr->fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
{
@ -391,13 +391,13 @@ start:
else
{
ERR("Local socket '%s' removal failed: %s", buf, strerror(errno));
goto error_umask;
goto error_fd;
}
}
}
if (listen(svr->fd, 4096) < 0)
goto error_umask;
goto error_fd;
#ifdef HAVE_SYSTEMD
fd_ready:
@ -415,6 +415,9 @@ fd_ready:
return 1;
error_fd:
close(svr->fd);
svr->fd = -1;
error_umask:
umask(pmode);
error:

View File

@ -16,6 +16,7 @@ _ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb)
{
struct drm_mode_fb_cmd2 cmd;
uint32_t hdls[4], pitches[4], offsets[4], fmt;
uint64_t modifiers[4];
#define _fourcc_code(a,b,c,d) \
((uint32_t)(a) | ((uint32_t)(b) << 8) | \
@ -25,6 +26,7 @@ _ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb)
hdls[0] = fb->hdl;
pitches[0] = fb->stride;
offsets[0] = 0;
modifiers[0] = 0;
memset(&cmd, 0, sizeof(struct drm_mode_fb_cmd2));
cmd.fb_id = 0;
@ -35,6 +37,7 @@ _ecore_drm_fb_create2(int fd, Ecore_Drm_Fb *fb)
memcpy(cmd.handles, hdls, 4 * sizeof(hdls[0]));
memcpy(cmd.pitches, pitches, 4 * sizeof(pitches[0]));
memcpy(cmd.offsets, offsets, 4 * sizeof(offsets[0]));
memcpy(cmd.modifier, modifiers, 4 * sizeof(modifiers[0]));
if (drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &cmd))
return EINA_FALSE;

View File

@ -573,12 +573,11 @@ _pointer_cb_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned
}
else
{
if (input->focus.pointer)
_ecore_wl2_input_mouse_up_send(input, input->focus.pointer,
0, button, timestamp);
if ((input->grab.window) && (input->grab.button == button))
_ecore_wl2_input_ungrab(input);
else if (input->focus.pointer)
_ecore_wl2_input_mouse_up_send(input, input->focus.pointer,
0, button, timestamp);
}
}
@ -953,11 +952,11 @@ _touch_cb_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial
input->timestamp = timestamp;
input->display->serial = serial;
_ecore_wl2_input_mouse_up_send(input, input->focus.touch, id,
BTN_LEFT, timestamp);
if ((input->grab.window) && (input->grab.button == BTN_LEFT))
_ecore_wl2_input_ungrab(input);
else
_ecore_wl2_input_mouse_up_send(input, input->focus.touch, id,
BTN_LEFT, timestamp);
}
static void

View File

@ -1564,8 +1564,6 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
if (stl)
{
const char *ptxt;
if (evas_object_textblock_style_get(ep->object) != stl->style)
evas_object_textblock_style_set(ep->object, stl->style);
// FIXME: need to account for editing
@ -1575,11 +1573,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
}
else
{
ptxt = evas_object_textblock_text_markup_get(ep->object);
if (((!ptxt) && (text)) ||
((ptxt) && (text) && (strcmp(ptxt, text))) ||
((ptxt) && (!text)))
evas_object_textblock_text_markup_set(ep->object, text);
evas_object_textblock_text_markup_set(ep->object, text);
}
if ((chosen_desc->text.min_x) || (chosen_desc->text.min_y))
{

View File

@ -849,8 +849,22 @@ _edje_embryo_fn_stop_programs_on(Embryo_Program *ep, Embryo_Cell *params)
rp = ed->table_parts[part_id % ed->table_parts_size];
if (rp)
{
Eina_List *l, *ll, *lll;
Edje_Pending_Program *pp;
Edje_Program_Target *pt;
/* there is only ever 1 program acting on a part at any time */
if (rp->program) _edje_program_end(ed, rp->program);
EINA_LIST_FOREACH_SAFE(ed->pending_actions, l, ll, pp)
{
EINA_LIST_FOREACH(pp->program->targets, lll, pt)
if (pt->id == part_id)
{
ed->pending_actions = eina_list_remove_list(ed->pending_actions, l);
ecore_timer_del(pp->timer);
free(pp);
break;
}
}
}
return 0;
}

View File

@ -4379,6 +4379,12 @@ _edje_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx E
_edje_emit(ed, "entry,changed", en->rp->part->name);
_edje_emit_full(ed, "entry,changed,user", en->rp->part->name, info,
_free_entry_change_info);
_edje_emit(ed, "cursor,changed", en->rp->part->name);
_edje_emit(ed, "cursor,changed,manual", en->rp->part->name);
_edje_entry_imf_cursor_info_set(en);
_edje_entry_real_part_configure(ed, rp);
end:
evas_textblock_cursor_free(del_start);
evas_textblock_cursor_free(del_end);

View File

@ -1226,6 +1226,7 @@ EAPI Eina_Bool eina_tiler_rect_add(Eina_Tiler *t, const Eina_Rectangle *r)
return EINA_FALSE;
t->last.add = tmp;
t->last.del.w = t->last.del.h = -1;
return _splitter_rect_add(t, &tmp);
}
@ -1251,6 +1252,7 @@ EAPI void eina_tiler_rect_del(Eina_Tiler *t, const Eina_Rectangle *r)
return;
t->last.del = tmp;
t->last.add.w = t->last.add.h = -1;
_splitter_rect_del(t, &tmp);
}

View File

@ -505,7 +505,7 @@ struct _Evas_Object_Textblock
int l, r, t, b;
} style_pad;
double valign;
char *markup_text;
Eina_Stringshare *markup_text;
void *engine_data;
const char *repch;
const char *bidi_delimiters;
@ -6473,7 +6473,7 @@ _textblock_style_generic_set(Evas_Object *eo_obj, Evas_Textblock_Style *ts,
Evas_Textblock_Style *old_ts;
if (o->markup_text)
{
free(o->markup_text);
eina_stringshare_del(o->markup_text);
o->markup_text = NULL;
}
@ -6831,10 +6831,15 @@ _evas_textblock_text_markup_set(Eo *eo_obj EINA_UNUSED, Evas_Textblock_Data *o,
{
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
evas_object_async_block(obj);
if ((text != o->markup_text) && (o->markup_text))
{
free(o->markup_text);
o->markup_text = NULL;
text = eina_stringshare_add(text);
if (text == o->markup_text)
{
eina_stringshare_del(text);
/* Text is the same, do nothing. */
return;
}
}
_nodes_clear(eo_obj);
@ -6844,15 +6849,6 @@ _evas_textblock_text_markup_set(Eo *eo_obj EINA_UNUSED, Evas_Textblock_Data *o,
EINA_INLIST_GET(o->text_nodes),
EINA_INLIST_GET(o->cursor->node)));
if (!o->style && !o->style_user)
{
if (text != o->markup_text)
{
if (text) o->markup_text = strdup(text);
}
return;
}
evas_textblock_cursor_paragraph_first(o->cursor);
evas_object_textblock_text_markup_prepend(o->cursor, text);
@ -6865,6 +6861,8 @@ _evas_textblock_text_markup_set(Eo *eo_obj EINA_UNUSED, Evas_Textblock_Data *o,
EINA_LIST_FOREACH(o->cursors, l, data)
evas_textblock_cursor_paragraph_first(data);
}
o->markup_text = text;
}
EAPI void
@ -7134,7 +7132,7 @@ _evas_textblock_text_markup_get(Eo *eo_obj EINA_UNUSED, Evas_Textblock_Data *o)
free(text_base);
}
(((Evas_Textblock_Data *)o)->markup_text) = eina_strbuf_string_steal(txt);
(((Evas_Textblock_Data *)o)->markup_text) = eina_stringshare_add(eina_strbuf_string_get(txt));
eina_strbuf_free(txt);
markup = (o->markup_text);
@ -9248,7 +9246,7 @@ _evas_textblock_changed(Evas_Textblock_Data *o, Evas_Object *eo_obj)
o->content_changed = 1;
if (o->markup_text)
{
free(o->markup_text);
eina_stringshare_del(o->markup_text);
o->markup_text = NULL;
}

View File

@ -3644,11 +3644,11 @@ START_TEST(evas_textblock_escaping)
const char *buf = "This &middot; is";
evas_object_textblock_text_markup_set(tb, buf);
fail_if(strcmp(evas_object_textblock_text_markup_get(tb), "This \xc2\xb7 is"));
fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf));
buf = "This &nbsp; is";
evas_object_textblock_text_markup_set(tb, buf);
fail_if(strcmp(evas_object_textblock_text_markup_get(tb), "This \xc2\xa0 is"));
fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf));
END_TB_TEST();
}