Commit Graph

151 Commits

Author SHA1 Message Date
Mike Blumenkrantz 10ce0cbd8a efreet: reset ipc connection after fork
ensure that existing connection is not reused
2018-02-02 16:59:44 -05:00
Vincent Torri 0c96d9e8cf Efreet_Mime: update comment about symlinks on Windows 2018-01-30 16:52:24 +09:00
Vincent Torri f5b01ac5ce all: Simplify definition of EAPI
This will help in the transition from Autotools to Meson. This has been
tested on Windows for which EFL_XXX_BUILD were first introduced.
2018-01-18 18:04:03 +09:00
Jean-Philippe Andre ff24ac2d6d efl: Reset ecore event types on init
This fixes cycles of init/shutdown/init where ecore event types would
become invalid, since they are now stored in a dynamic array rather than
a statically stored array.

The risk here is that if a module of EFL tends to init/shutdown in a
"normal" scenario then the event type array will grow in a leaking
manner. This could be fixed by resetting those event ID's only when the
loop actually exits (EFL_EVENT_DEL on the main loop). I'm not using
EFL_EVENT_DEL in this patch as this would add too many event callbacks
to the main loop object, which may result in slightly slower event calls
to it, affecting the overall performance.
2017-12-19 11:14:37 +09:00
Prince Kumar Dubey e8b2a954b5 efreet: putting local variable "data" under preprocessor flag "SLOPPY_SPEC" to avoid below warning, if "SLOPPY_SPEC" is disabled.
Reviewers: raster, cedric

Subscribers: jpeg, rajeshps

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-10-16 13:36:38 -07:00
Subodh Kumar 8070051789 efreet: unsigned int cannot be compared to less than zero.
Summary:
Wrong camparision with less than zero for unsigned integer.
@fix

Test Plan: NA

Reviewers: raster, cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-10-06 09:53:17 -07:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Carsten Haitzler b8a760ed58 efreet - dont complain if INTERNAL x extension hash of desktop is NULL
asking for an x- field from a desktop shouldnt result in null safety
checks IF the x hash is null - it's fine if it's null - that field
just doesn't eixst. if other fields were in the x hash but the desired
one wasn't it'd not complain, so why complain if there is just no x
hash?
2017-07-21 17:02:43 +09:00
Carsten Haitzler 0f73f10a42 efreet - remove noisy debug printfs 2017-07-21 06:06:59 +09:00
Mike Blumenkrantz b6b0b1b5b2 efreet: don't raise ERR on empty file in efreet_xml_new()
this is not an error, there is nothing to parse

@fix
2017-06-16 12:23:07 -04:00
Carsten Haitzler a6dc7da029 efreetd - make ability to not connect to efreetd non-critical
it's an error we can survive, so make it that level
2017-04-23 21:17:40 +09:00
Derek Foreman 67e07e5d2d efreet: Don't prefer the second perfect over the first in desktop_exec_find()
We test a second match for a perfect match, then stop all further processing,
but we never test the first match. This leads to a situation where a system
wide .desktop file is given precedence over a local override.

Instead, check the first match too.

 #test-e
2017-03-24 14:59:11 -05:00
Mike Blumenkrantz d0e5564c18 efreet: CRI and fail after 10 attempts to connect to efreetd
if efreetd cannot be connected to, stop infinitely trying to spawn it
since this generates crazy cpu load

probably this path should also send some cache events so that watchers
do not simply idle forever

ref T5200
2017-03-17 15:15:25 -04:00
Cedric BAIL 168d2a1446 efreet: avoid crash during shutdown due to Ecore_Event queue. 2017-03-09 16:17:58 -08:00
Carsten Haitzler 0356b1eb5e vpath usage - simplify to bare minimum to make gustavo happy
since these are only local path resolves, the do and wait are
technically not needed. also remove any other tmp strings
and use the vpath string resolving feature to avoid
printfs/strjoins/cats etc. etc. as well.

also remember to remove old name string from evas shm code - it worked
for me. i guess i was lucky and it happened to be NULL thus free was
fine.
2017-02-10 19:27:15 +09:00
Derek Foreman 2800038ee2 Revert "vpath usage - simplify to bare minimum to make gustavo happy"
This reverts commit 2037474dc0.

This causes the wayland_shm engine to seg fault immediately at
startup when attempting to create shm buffers.

Please make sure when committing changes to the wayland_shm engine to
test on intel, exynos, and at least one platform without dmabuf
capabilities - or using the EVAS_WAYLAND_SHM_DISABLE_DMABUF env var
to disable dmabuf on intel or exynos.

Anyone without the time or hardware to fully test changes to wayland_shm
can submit a patch to phabricator and assign it to me so I can fully
test it before landing.
2017-02-09 09:17:38 -06:00
Carsten Haitzler 2037474dc0 vpath usage - simplify to bare minimum to make gustavo happy
since these are only local path resolves, the do and wait are
technically not needed. also remove any other tmp strings and use the
vpath string resolving feature to avoid printfs/strjoins/cats etc.
etc. as well.
2017-02-09 22:06:16 +09:00
Carsten Haitzler 75e1033682 efreet - use vpath to get XDG_RUNTIME_DIR so we have a single impl
having too many places that get XDG_RUNTIME_DIR makes it harder to
keep secure etc, so make it a single location for efreet too.
2017-02-09 18:38:28 +09:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Carsten Haitzler a6f7b0f834 efreet cache - handle corner case where efreetd keeps disconnecting
so an odd one. there is a socket, but nothing is actually listening on
it, but clients keep spinning launching efreetd's because the launch,
connect, then get a disconnect and try again immediately keeping
things spinning heavily, so add a delay of 0.5 sec before launchnig
another efreetd if the launch + connect fails and gets a disconnect
within 0.5 sec ... so give up for 0.5 sec before trying again to avoid
a runaway system.

@fix
2016-12-26 13:06:35 +09:00
Chris Michael 72a3556fa7 efreet: remove float comparison warnings
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-20 11:01:27 -05:00
Cedric BAIL 6da2fbc9c4 efreet: make mime type evaluation way faster by using mmap. 2016-11-14 15:17:12 -08:00
Carsten Haitzler f4f5a042a6 efreet - fix command generation by fixing string buffer expansion
so by chance i discovered efreet is doing bad things(tm) when
expanding/appending to string buffers to generate commands based off
desktop files. the string append basically was buggy, so fixed it by
making it a lot simpler and more obvious and now reliable.

@fix
2016-09-25 23:50:53 +09:00
Carsten Haitzler 07ffb2e5c5 efreet xml parse - handle 0 sized xml specially to avoid crash
fixes T4493
2016-09-20 14:55:35 +09:00
Jean Guyomarc'h 1ab1e3697d efreet: mime types database can be empty
When the mime types database is empty, the file will
be exactly 28 bytes.

Fixes T4426
2016-08-26 21:16:39 +02:00
Mike Blumenkrantz 8c3efbd174 efreet: add doc note about stringshare reliability for efreet_mime_type_get() 2016-08-26 10:20:45 -04:00
Carsten Haitzler 510c093602 efreet - convert crash into NULL mimes when no mime db found
so ok - efreet crashed letting you know you have a missing mimedb...
return NULL instead fixes T4425 :) - rememebr to kill your efreetd's
to get a new mimedb - log out and in will do that.
2016-08-24 10:00:50 +09:00
Carsten Haitzler 561f8eaa8f efreet - save about 240-300k or so of memory used by efreet mime
so efreet mime was loading a bunch of mime type info files, parsing
them on startup and allocating memory to store all this mime info -
globs, mimetype strings and more. all a big waste of memory as its
allocated on the heap per process where its the SAME data files loaded
every time.

so make an efreet mime cache file and a tool to create it from mime
files. mmap this file with all the hashes/strings in it so all that
data is mmaped once in memory and shared between all processes and it
is only paged in on demand - as actually read/needed so if your
process doesnt need to know about mime stuff.. it wont touch it anyway.

this saves about 240-300k or so of memory in my tests. this has not
covered the mime MAGIC files which still consume memory and are on the
heap. this is more complex so it will take more time to come up with a
nice file format for the data that is nicely mmaped etc.

@optimize
2016-08-23 12:04:06 +09:00
Carsten Haitzler 56c52311e5 efreet - fix efreet_*_dir_get() to support the xdg env vars
these api's didnt respect the env vars xdg dictates should override
the xdg dirs for that process. this fixes this and uses them if set

@fix
2016-08-23 12:04:06 +09:00
Marcel Hollerbach 3f1d40cff8 efreet: free fallback cache on shutdown
this fixes errors like:
ERR<4864>:eet lib/eet/eet_lib.c:645 eet_shutdown() File '/home/osauser/.cache/efreet/icons___efreet_fallback_localhost.localdomain.eet' is still open 1 times !

@fix
2016-08-04 17:04:50 +02:00
Carsten Haitzler 2ca5075193 efreet - fix mime file path messing with short paths like /
this fixes T4015

@fix
2016-07-05 16:28:52 +09:00
Carsten Haitzler 9527240d74 efl - fix lots of little init/shutdown pairs that are wrong
i've fixed almost all the eina init/shutdown pairs to do the right
thing now... except one (ecore_shutdown) with comment inline where
eo_shutdown is not called. if this is called we are in crash land.
this needs further inspection.
2016-07-04 21:30:34 +09:00
Mike Blumenkrantz 200f45c2b5 efreet: add locking for efreet_desktop_x_field_get()
in a threaded environment, reading from a hash is not atomic and is
subject to race conditions

@fix

ref 39417cf0ea
2016-01-25 11:27:02 -05:00
Mike Blumenkrantz 9aee7c249a efreet: reject invalid "" data for Efreet_Desktop->x hash
ref T3096

@fix
2016-01-25 11:27:01 -05:00
Andy Williams c4cd3f19bf [efreet] document NULL return possibility.
If file is not found then NULL is the fallback
2016-01-20 23:37:15 +00:00
Vincent Torri e20978054a Efreet: support language, country and modifer on Windows
Summary:
On Windows, the environment variables LANG, LC_ALL and LC_MESSAGES
do not exist, so retrieve langage and country modifier directly from the systeM

Test Plan: verify the value with some ptrinF

Reviewers: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3464
2015-12-18 16:48:34 +09:00
Vincent Torri 3b44645363 efl: add binary mode to f(re)open() calls
This allows better compatibility with Windows

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-05 21:04:36 +01:00
Carsten Haitzler 5263e61585 efreet desktop tracking - fix monitoring of dirs of custom desktops
@fix

this is wrong - start monitoring every/any dir in which a desktop file
exists that we load a desktop file from. imagine you browse directories
in efm with lots of desktop files in them - we end up monitoring lots
of directories that we then rememebr and don't un-monitor. this
disables monitoring of dirs from which we load a .desktop file from to
fix this.
2015-12-02 20:53:27 +09:00
Marcel Hollerbach 7b9bb510b4 efreet_icon: Fix wrong inherit selection
Summary:
The list of elem->paths is given with the actual icon at position 0 and
the bigger the index is the lower the icon in the inherit structure is.

Due to the for loop beginning at 0 walking to the end this
direction is flipped. So the last r is returned, which is the lowest
icon in the inherit structure.

This is fixed by returning if the first valid path is found.

@fix

Test Plan: run jesus or efm with a custom icon theme beore the wrong icons are taken, now the correct ones are taken

Reviewers: raster, cedric

Subscribers: DaveMDS

Differential Revision: https://phab.enlightenment.org/D3366
2015-11-25 09:35:07 +01:00
Carsten Haitzler e89253e597 efreet - fix efreetd kill and start with clean cache case blank icons
if you kill efreetd ANd delete all the caches, the restart of efreetd
will lose all icons until an app re-registeres icon extensions and it
can scan all icons .. and then app has to actually get the right
upodate events and do the update properly when this happens. this
fixes that scenario

@fix
2015-08-12 20:08:14 +09:00
Vincent Torri b7a277efa0 Efreet: Fix config and data dir paths on windows.
@fix
2015-07-08 16:29:05 +01:00
Carsten Haitzler 2f4fb3edac efreet - improve edstop exec find to use the command with less args
efreet will just match any desktop file (at random basically -
whatever is first in the list), thjat has the base command looked at.
if you have various desktip files with the same command, like:

mycommand
mycommand %U
mycommand -a -b -c /path/to/file
/usr/bin/mycommand

etc. - which one does it match? it'll pick the first and the list
ordering is arbitrary, so this is pretty bad. this strips off the base
command at the start (full path or whatever) and then uses the command
with the shortest argument length. this means the generic command is
found first if we look for "mycommand" in the above list, whihc ends
up the best... ESPECIALLY for steam which does just this.
2015-07-05 12:53:14 +09:00
Carsten Haitzler ddb3a60518 efreetd - new ipc - re-register on reconnect 2015-06-25 11:41:15 +09:00
Carsten Haitzler 5abfefe99e efl - efreetd service move from dbus session bus to ecore ipc
this fixes warnings about no efreet dbus session bus in non session
environments as brought up on the mailing lists with:

Subject: Re: [E-devel] [EGIT] [core/efl] master 01/01: edje: unset
efreet cache update flag to prevent dbus connections

this moves all of efreetd client and server to ecore ipc, with client
auto-launching efreetd if not found as a service and trying for up to
500ms to connect. efreetd times out on last connection or no
connections after 10sec so it wont hang around forever if not in use.
it seems to work in my testing, so let me know if there is an issue.

@fix
2015-06-24 19:28:17 +09:00
Cedric BAIL 5098e787e8 efreet: use portable environment lookup. 2015-05-14 18:41:48 +02:00
Cedric BAIL 493a2b3ab4 efreet: lower error message to warning. 2015-05-14 18:41:47 +02:00
Sebastian Dransfeld 9e0a00d768 efreet: fix signed warning
Update to 6a0d23. Casting to int isn't a real solution, since we could
have values which overflows.

Since we want the absolute value, just make sure we subtract the larger
value from the smaller.
2015-05-11 13:34:10 +02:00
Cedric BAIL 0b4a911450 efreet: remove the need to order the header correctly for Windows. 2015-05-07 09:53:10 +02:00
Mike Blumenkrantz 3571e7364e efreet: fix leak in efreet_util_desktop_exec_find()
@fix
2015-04-22 19:34:59 -04:00
Jean-Philippe Andre 6a0d2382f1 Efreet: Silence clang warning
[unsigned - unsigned] is unsigned and might wrap around, the implicit
conversion to int (by calling abs()) saved the game here.
2015-04-21 20:32:54 +09:00