Commit Graph

155 Commits

Author SHA1 Message Date
Christopher Michael ab51bbeeef ecore-wl2: Add API to return the compositor object from a given display
This patch adds a convenience function to get the wl_compositor object
from a given display

@feature
2019-11-19 09:44:45 -05:00
Christopher Michael 7fb23c2da1 ecore-wl2: Add API to find a connected display given a name
This patch adds a convenience function to find a connected display
given a name

@feature
2019-11-19 09:44:45 -05:00
Christopher Michael a10a9ceccb ecore-wl2: Add API to find a window by surface
This patch adds a convenience API that can be used to find a window
based on wl_surface.

@feature
2019-11-19 09:44:40 -05:00
Christopher Michael e053c6e458 ecore-wl2: Minor formatting fixes
NB: No functional changes
2019-04-29 09:59:17 -04: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
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
Carsten Haitzler 37806b5bf9 ecore wl2 - fix wl protocol listyener to init all struct fields 2018-11-09 11:43:59 +00: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 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
Mike Blumenkrantz b48781aa6c wayland: always flush client display when protocol sends are pending
in the case where a connection was not actively rendering, there was nothing
which would trigger a display flush, leading to applications potentially
deadlocking

@fix
2018-01-17 17:06:13 -05:00
Mike Blumenkrantz ffa276fce3 wayland: add xdg-shell vfinal support for client-side
@feature
2018-01-10 11:39:52 -05:00
Derek Foreman f3dd394b85 ecore_wl2: Return NULL from ecore_wl2_window_display_get during recovery
This should save us from having to set the window to in the engine info
NULL and then back during/after recovery.
2017-12-01 10:58:44 -06:00
Derek Foreman 517f929aa5 ecore_wl2: Send a dmabuf non-immediate create at startup
We use immediate mode dmabuf creation at runtime, but this can result in
clients being killed with no option to fallback if the buffers can't be
consumed by the compositor.

This test should catch when a system can allocate a dmabuf buffer and the
compositor claims to accept dmabuf, but the buffer can't actually be used
for whatever reason.  We'll then use wl_shm at runtime instead of dmabuf.
2017-11-15 11:54:37 -06:00
Derek Foreman 579b6d69b3 ecore_wl2: Add a second sync for dmabuf formats
While we don't yet use these, we should, so let's make sure they're
available before we start making windows.
2017-11-15 11:54:37 -06:00
Derek Foreman 054bdc870b ecore_wl2: Refcount syncs at startup
There are some binds at startup that result in additional information
being sent, so we may need to call wl_display_sync() multiple times, and
only send the client a SYNC_DONE event when the final one completes.
2017-11-15 11:54:37 -06:00
Derek Foreman e863dcaae7 ecore_wl2: Create xkb_context before compositor connection
We really need this to exist before potentially processing seat/keyboard
stuff in _ecore_wl2_display_connect()
2017-11-15 11:54:37 -06:00
Derek Foreman 132a77c682 ecore_wl2: Discard too-old dmabuf support
We need at least version 2 for create_immed, so don't even bind the
global if it's useless to us.

This will also stop us from trying to use dmabuf (and getting killed by
the compositor) on older compositors that don't support the version we
need - we'll just use wl_shm instead when this pointer is NULL.
2017-11-09 16:06:42 -06:00
Mike Blumenkrantz 36bf4cbc4e wayland: expand efl-hints protocol to work for all types of xdg shell surfaces 2017-10-25 10:44:16 -04:00
Mike Blumenkrantz ed30f41de8 wayland: add support for efl weight hint propagation from elm_win to efl_wl
@feature
2017-10-25 10:44:16 -04:00
Derek Foreman 3314d36f9b ecore_wl2: Remove just the flush from the idle handler
Flushing should be done where it's needed now, but we still
need the rest of the idle handler as something like mesa may
have dispatched its queue, which reads all the pending wayland
events.  In that case we have events to process but the fd will
not poll readable.

@fix T6250
2017-10-22 10:19:50 -05:00
Derek Foreman e23854eb6a Revert "ecore_wl2: Kill the wl idle enterer"
This reverts commit 57d5b5921e.

We need the dispatch, not the flush...
2017-10-22 10:16:57 -05:00
Derek Foreman 8e3793c90b ecore_wl2: Bind dmabuf version 2
Version 2 allows for create_immed requets.  No new events are added until
version 3, so this is a trivial update.
2017-10-12 12:24:03 -05:00
Derek Foreman 0badc0522b ecore_wl2: Split configurations into client set and compositor requested
This should lead to clearer and more maintainable code than having one
pile of state that's asynchronously fiddled with by both client and
compositor.
2017-10-12 12:24:03 -05:00
Derek Foreman 10b3a41ab0 ecore_wl2: Move some state into its own struct
These need to be double buffered, and that will be done in a follow up
patch.
2017-10-12 12:24:03 -05:00
Derek Foreman 57d5b5921e ecore_wl2: Kill the wl idle enterer
We do flushes when we need them now, so we don't need this somewhat
non deterministic flush mechanism anymore.

Anything that breaks as a result of this should be fixable by adding an
ecore_wl2_display_flush() somewhere appropriate.
2017-08-30 15:08:53 -05:00
Derek Foreman 1bb45f6e61 ecore_wl2: Use ecore_wl2_window_commit for all wl_surface_commits
This adds an explicit flush to every surface commit.
2017-08-30 15:08:53 -05:00
Derek Foreman e7db6eec46 ecore_wl2: Add ecore_wl2_display_flush() api
Allowing engines to explicitly flush at the right times will remove some
awkwardness and bugs from our current display flush paradigm
2017-08-30 14:11:47 -05:00
Derek Foreman e0d94b8234 ecore_wl2: Fix small bug in flush handler
If wl_display_flush() returns a non negative number it was successful,
so we should disable the write handler then.  We were theoretically always
doing an extra flush on an empty buffer.

This is mostly cosmetic as that's not a costly operation.
2017-08-30 14:11:47 -05:00
Mike Blumenkrantz f00a49835d wayland: remove xdg5 support
this has not been used or tested since last year and there are no major
compositors which lack xdg6 support
2017-08-11 18:43:12 -04:00
Mike Blumenkrantz 9a189d29d0 wayland: add efl-hints protocol for setting aspect on surfaces
@feature
2017-08-04 16:15:43 -04:00
Mike Blumenkrantz cd7633ecbf ecore-wl2: make _ecore_wl2_display_sync_get() local instead of static 2017-08-04 16:10:34 -04:00
Mike Blumenkrantz ab2c330b27 ecore-wl2: simplify server pid detection 2017-08-04 16:10:34 -04:00
Mike Blumenkrantz 4e68271416 ecore-wl2: pass display to aux hint event_adds
fixes display refcounting

ref 6bb56b3f56

@fix
2017-08-04 16:10:31 -04:00
Mike Blumenkrantz 6bb56b3f56 ecore-wl2: implement support for aux hints
this is a direct copy of a feature from tizen git with no modifications other
than what was required for compilation and functionality

https://review.tizen.org/git/?p=platform/upstream/efl.git;a=commitdiff_plain;h=01e72b7e3484ece4b589f95315990ba2c366c231
https://review.tizen.org/git/?p=platform/upstream/efl.git;a=commitdiff;h=670d84b579f248ae0e3df48e9953fe8128da9468

fix T5780

@feature
2017-07-28 15:43:48 -04:00
Mike Blumenkrantz 38d18e559d ecore-wl2: create surfaces once compositor global is bound
it's expected that surfaces are created when a window exists

@fix
2017-07-07 15:22:23 -04:00
Mike Blumenkrantz 03d2c43018 ecore-wl2: don't leak display event pointers 2017-07-07 15:22:23 -04:00
Mike Blumenkrantz 3d098097bf ecore-wl2: do not send exit event on disconnect if servers exist
this kills the compositor.

@fix
2017-06-23 17:43:44 -04:00
Chris Michael 1d453eece4 ecore-wl2: Free auxiliary window hints when we destroy a window
@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-13 12:57:24 -04:00
Mike Blumenkrantz 871e0c8de8 ecore-wl2: add ecore_wl2_display_input_find_by_name()
@feature
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz 0b10aa7f19 ecore-wl2: use nonblocking event flush when disconnecting a client
roundtrip will deadlock if called in a compositor process

@fix
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz a08f8e7bbf ecore-wl2: add ecore_wl2_display_name_get()
@feature
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz 047118c6e2 ecore-wl2: add ecore_wl2_display_input_find()
for finding seat using hw id

@feature
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz 00da1a771a ecore-wl2: correctly refcount display objects during events
ensure lifetime of display object is longer than events in which
the object is passed

@fix
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz 8b6526eb7a ecore-wl2: add safety check in ecore_wl2_display_inputs_get()
ensure this is not called on server displays
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz ba2a76d7ab ecore-wl2: handle case where session recovery listener triggers on dead surface
@fix
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz f32cb9ea00 ecore-wl2: add function for checking if a client connection sync is done
@feature
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz eb9a5165f4 ecore-wl2: move ecore_wl2_display_inputs_get() into ecore_wl2_display.c 2017-04-21 16:16:12 -04:00