Commit Graph

696 Commits

Author SHA1 Message Date
Carsten Haitzler c695dde8c3 ecore wl2 - remove pointless sntrcpys causing warnings
again pointless:

strcpy(dest, x); -> len - strlen(x); strncpy(dest, x, len);

code put in causing new warnings. this kind of "get rid of strcpy" is
actua;;y dangerous as it's more likely a mistake is made along the way
and bugs are added. strcpy's  should be reviewed and if ok - left
as-is. doing otherwise makes the code worse, not better and raises
risk. it now also produces warnings at compile time which creates
noise we just shouldnt' have.
2019-02-14 09:31:02 +00:00
Derek Foreman 87cf5188b4 ecore_wl2: Make our wayland socket handling thread safe
By using the prepare read code properly we can do wayland dispatch of
multiple queues in multiple threads.  I'm not advocating we ever do so,
but if a library (perhaps a gl implementation) wants to dispatch its own
queue, and that happens in a separate thread from our event loop, we
probably don't want the world to explode.

Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7915
2019-02-13 10:33:41 -06:00
Wonki Kim 33c4041950 ecore_wl2: replace strcpy with strncpy
Summary: this patch replaces a volnerable function with a safer one.

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7920
2019-02-13 10:43:23 -05:00
Christopher Michael 0fed1c77ae Revert this as it should not have been pushed yet
Revert "ecore_wl2: Make our wayland socket handling thread safe"

This reverts commit efa85f35f4.
2019-02-13 10:01:47 -05:00
Wonki Kim e355373e32 ecore_wl2: fix a non-thread safe call.
Summary:
this patch contains a change to
replace non-thread safe call 'strerror' with eina_error_msg_get.

Reviewers: cedric, bu5hm4n, devilhorns

Reviewed By: devilhorns

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7921
2019-02-13 09:58:11 -05:00
Derek Foreman efa85f35f4 ecore_wl2: Make our wayland socket handling thread safe
Summary:
By using the prepare read code properly we can do wayland dispatch of
multiple queues in multiple threads.  I'm not advocating we ever do so,
but if a library (perhaps a gl implementation) wants to dispatch its own
queue, and that happens in a separate thread from our event loop, we
probably don't want the world to explode.
Depends on D7914

Reviewers: zmike, devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7915
2019-02-13 09:58:06 -05:00
Wonki Kim 3bedc63315 ecore_wl2_input: update a timestamp whenever possible
Summary:
gettimeofday function returns a accumulated timestamp since around 1970 by the way,
a argument from server looks like a system uptime based timestamp
in some distribution such as tizen.

so that this patch appends a logic that updates a timestamp
inside Ecore_Wl2_Input* whenever possible to
prevent gettimeofday function from being called.

Reviewers: #reviewers, cedric, devilhorns

Reviewed By: #reviewers, devilhorns

Subscribers: devilhorns, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7766
2019-01-29 07:06:33 -05:00
Derek Foreman be3020b0ab ecore_wl2: Convert frame callbacks to inlist
They're only ever on a single list, and never counted.  inlist makes
more sense.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7610
2019-01-15 13:47:17 -06:00
Wonki Kim ee39639294 meson: refactor meson.build for ecore_wl2
this patch cleans emson.build for ecore_wl2 up little.
Differential Revision: https://phab.enlightenment.org/D7565
2019-01-10 10:57:42 +01:00
Carsten Haitzler 6fcc3a56d8 meson - vix ecore wl2 pc generation to not include nonexistent wl lib
the ecore wl2.pc wanted to -lwayland_protocol ... which is never
installed. it's an in-tree .a we stattically link in, so remove it
from the pub libs in the pc. rthis was causing things that build
against efl to fail (like enlightenment).
2018-12-20 19:00:37 +00:00
Derek Foreman c90826f72c ecore_wl2: Fix anchor for xdg pop-ups
Anchors are in window geometry, so we should be using 0,0 instead
of the parent x,y for the top left corner of the window.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7436
2018-12-14 10:29:59 -06:00
Derek Foreman f53c7341c3 ecore_wl2: Replace direct usage of set_config.geometry with getters
I'm going to deal with some ugly geometry problems in the getter func
shortly.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7431
2018-12-14 10:29:53 -06:00
Derek Foreman b32e5da641 ecore_wl2: remove uniconify path from ecore_wl2_window_iconified_set
Wayland shells have no way to unset iconified state.  What this code
did was corrupt current window state in potentially fatal ways.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7430
2018-12-14 10:29:52 -06:00
Yeongjong Lee 788507961a ecore_wl2_dnd: initialize source to NULL when it destroy
Summary:
This prevent double destruction of source. if _ecore_wl2_input_del is called
with destroyed source, it can make unexpected troubles.

Reviewers: Hermet, id213sin, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7265
2018-11-15 09:11:38 -05:00
Carsten Haitzler d52709eca6 ecore wl2 - fix wl touch handler struct to set extra cb fields
sape and orient were not set, set them to NULL with fixme's
2018-11-09 11:44:00 +00:00
Carsten Haitzler 37806b5bf9 ecore wl2 - fix wl protocol listyener to init all struct fields 2018-11-09 11:43:59 +00:00
Wonki Kim 97e71b9dc4 ecore_wl2: Fix a memory leaking case
Summary:
there is a memory leaking in some case.
this patch fixes it.

Signed-off-by: Wonki Kim <wonki_.kim@samsung.com>

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7167
2018-10-17 10:19:44 +09:00
Marcel Hollerbach a0562aa066 meson: add buildsystem to ecore_wl2
this was missing. Reported by jf_simon.
2018-10-12 11:15:29 +02:00
Marcel Hollerbach 07b69d3d85 ecore_wl2: fix build break
when i tested this commit i had wayland turned off. Sorry for the noise.
2018-10-10 14:09:24 +02:00
Hosang Kim 185a1f739b ecore_wl2: fix coverity issue. (Resource Leak)
Module is not freed when eina_module_load is failed.
Differential Revision: https://phab.enlightenment.org/D7152
2018-10-10 12:55:21 +02:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Woochanlee d702f714fe ecore_wl2_window: Fix incorrectly implemented null check.
Summary: It checks 'window->xdg_toplevel'  two times.

Reviewers: ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7065
2018-09-19 07:01:01 -04:00
Marcel Hollerbach 4aa480f6d3 ecore_wl2: add support for intree loading of the module
Summary: the module was not loaded when we were running intree.

Reviewers: ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: devilhorns, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7023
2018-09-12 08:39:14 -04:00
Derek Foreman b43033e393 ecore_wl2: Move surface module file to modules directory
It is now similar to how other modules are handled.

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

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
2018-09-11 09:54:49 +02:00
Yeongjong Lee 02d83ebcd4 docs: Fix typos in API reference doc and comments.
Reviewers: Hermet, segfaultxavi

Reviewed By: Hermet, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6948
2018-08-31 17:45:31 +09:00
Hermet Park 568ddfe397 ecore wl2: change logging level.
Summary: ease the error message to warning because it's not serious one.

Reviewers: devilhorns, ManMower

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6899
2018-08-23 07:29:35 -04:00
Marcel Hollerbach bda4565d9c ecore_wl2&elput: correctly fill the key structure
Summary: the key structure has two fields key and keyname, those should be identical to the keystructures from x. the method xkb_keysym_to_utf8 however returns different values for keys like "minus" thus only relying on xkb_keysym_name files this issue.

Reviewers: eagleeye, devilhorns

Reviewed By: eagleeye

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6520
2018-07-10 14:44:36 -04:00
Derek Foreman 0fe553cf06 ecore_wl2: Remove ecore_wl2_display_window_find
Summary:
This is now totally trivial and needs not exist.
Depends on D6522

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6523
2018-07-06 10:16:36 -04:00
Derek Foreman 78f27a3eff ecore_wl2: Replace window ids with pointers
Summary:
There's no benefit to generating ids instead of just using the
Ecore_Wl2_Window pointer in events.

This has the added benefit of working around a really nasty hash collision
bug when multiple ecore_evas engines are used at once.

ref T7053
ref T6222

@beta_break
Depends on D6521

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7053, T6222

Differential Revision: https://phab.enlightenment.org/D6522
2018-07-06 10:16:21 -04:00
Derek Foreman ee3df4efc3 ecore_wl2: Better error handling for dmabuf sync ioctls
Summary:
Turns out these can fail with EINTR or EAGAIN, and we're supposed
to try again.

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6250
2018-06-19 13:43:55 -04:00
Derek Foreman e4641649e2 ecore_wl2: purge surface buffers in semi_free
Summary:
This fixes a session recovery bug with software render.

An attempt to re-use a buffer in a new wayland connection resulted
in another disconnect and broken rendering.
Depends on D6281

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6282
2018-06-15 13:18:56 -05:00
Derek Foreman 54a877981c ecore_wl2: Add purge to ecore_wl2_window_surface_flush
Summary:
It's convenient to be able to pass this through this api too.

@betabreak
Depends on D6280

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6281
2018-06-15 13:18:53 -05:00
Derek Foreman b8d6923782 ecore_wl2: Handle purging flush in dmabuf module
Summary:
Allow destroying all buffers, even attached ones, in the dmabuf surface
module.
Depends on D6279

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6280
2018-06-15 13:18:39 -05:00
Derek Foreman a310667bec ecore_wl2: Add a purge option to surface flush
Summary:
We need to be able to forcibly destroy all surface buffers to make
session recovery work safely for software rendering.

@betabreak
Depends on D6278

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6279
2018-06-15 13:18:30 -05:00
Derek Foreman 551101b4cd ecore_wl2: Set the parent window's surface to NULL on surface destroy
Summary:
Prevents potential use after free.
Depends on D6277

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6278
2018-06-15 13:18:15 -05:00
Derek Foreman 03793c4c64 ecore_wl2: Remove ecore_wl2_window_raise
Summary:
Since this can't be done, it probably doesn't need API.

@betabreak
Depends on D6276

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6277
2018-06-15 13:18:00 -05:00
Derek Foreman 4ec261064f ecore_wl2: Fix dmabuf locking
Summary:
The ioctls weren't properly used so no locking took place at all, leading
to rendering anomalies when placing dmabuf buffers in hardware planes.

Also, forgetting to check error returns left no indication that the
ioctl was failing, so we now emit a warning if the ioctl fails.

Reviewers: zmike

Reviewed By: zmike

Subscribers: devilhorns, cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6237
2018-06-05 11:40:37 -05:00
Derek Foreman 249ae8e5f0 ecore_wl2_window: Silence early commit ERR for mouse cursors
Summary:
Our wayland mouse cursor code can trigger commits with commit pending
when mousing into a window across CSD, which results in quickly setting
the default cursors then an animated resize cursor before the first commit
has finished.

Fixing this is non trivial, and the bug is just a harmless inefficiency
of little impact, so just disable the ERR for that specific case instead.

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6184
2018-05-22 12:33:36 -04:00
Derek Foreman 0ef79bb941 ecore_wl2: complain loudly when move or resize doesn't provide a seat
Summary:
We now have the ability to provide the seat information properly, so
fire off an ERR if a caller doesn't.
Depends on D6131

Reviewers: zmike, cedric

Reviewed By: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6132
2018-05-08 13:27:00 -05:00
Derek Foreman 23d5ee88d5 ecore_wl2: warn on unused result from ecore_wl2_input_seat_id_get
Summary:
Make it harder to misuse this function in the future.
Depends on D6129

Reviewers: zmike, cedric

Reviewed By: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6130
2018-05-08 13:26:54 -05:00
Derek Foreman ed60eddff5 ecore_wl2: Fix window drag mouse eventing
Summary:
When a CSD button interaction under wayland leads to a compositor action
like move or resize, we essentially "give back" that button press to the
compositor, and it never sends us a mouse up for it.

We need to internally fire a mouse up event to fix up state so the client
doesn't think the mouse is still down.  Until now we've been doing this
by setting a flag when we start a move/resize and checking it at next
pointer enter for the window.

This leads to unsolvable races and wacky bookkeeping, and runs afoul of
the fact that we're not actually guaranteed a pointer enter immediately
after a move completes.  There is absolutely no way at all on wayland to
know if a move or resize operation has completed.

So, let's just fire the mouse up immediately on start of interaction,
which is raceless.

This fixes a years old bug where dragging a window might leave a stuck
mouse up, and allow hilighting text without drag after the window drag
completes.  (elementary-test -to "text editor" with multiple windows open
exhibits this bug)
Depends on D6127

Reviewers: zmike, cedric

Reviewed By: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6128
2018-05-08 13:26:46 -05:00
Derek Foreman f78ff5f445 ecore_wl2: Remove ecore_wl2_input_grab/ungrab
Summary:
These should never be called, so they shouldn't be API.

This kind of internal state fiddling should happen implicitly in the
API that need it.

@beta_break
Depends on D6126

Reviewers: zmike, cedric

Reviewed By: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6127
2018-05-08 13:26:42 -05:00
Derek Foreman 77f946a92c elm_win: Remove move stop callback
Summary:
This is only fired to trigger a cursor set under wayland, but that cursor
set should be done unconditionally on mouse in.

However, mouse in was being discarded because mouse out was being deferred
when the window was "grabbed" for moving.

If instead we just let the mouse out occur as it should, the cursor
is properly updated on mouse in.
Depends on D6118

Reviewers: zmike, cedric

Reviewed By: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6119
2018-05-08 13:25:54 -05:00
Derek Foreman 8bd47cf83c ecore_wl2: reduce wayland display flushes
Clean up various places where we do flushes that we don't need to
because some immediately following action is going to cause a flush.
Also fix places where we flush without actually doing anything.
2018-04-20 13:00:28 -05:00
Derek Foreman 4837f32443 ecore_wl2: Share same region between input and opaque when possible
If input and opaque region are the same (they usually are) we can use
the same region for both.
2018-04-20 13:00:28 -05:00
Derek Foreman 0ca813dbd0 ecore_wl2: Refactor region create
Trivial refactor
2018-04-20 13:00:28 -05:00
Derek Foreman 486bd23ca1 ecore_wl2: Make ecore_wl2_window_false_commit more robust
False commit when a commit is already pending is an error, but for safety
it should be a nop.

Currently it would overwrite the existing frame callback which could
cause problems on window destruction.
2018-04-20 13:00:28 -05:00
Derek Foreman f53bc90c62 ecore_wl2: Don't unmap buffers at unlock
We should be using dmabuf sync ioctls instead of mmap/munmap every draw,
this makes that happen.  The surface code continues to do what its always
done, and map/unlock.
2018-04-20 13:00:28 -05:00
Derek Foreman 324c4ede00 ecore_wl2: Add ERR for buffer lock errors
Should never double lock or double unlock, this isn't refcounted, and
probably doesn't need to be.
2018-04-20 13:00:28 -05:00
Derek Foreman 6b3f999cf4 ecore_wl2: Add dma_buf lock/unlock ioctls
These should help with coherency later when we don't unmap for every
surface post.
2018-04-20 13:00:28 -05:00