Commit Graph

148 Commits

Author SHA1 Message Date
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
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
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 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 fc973b9640 ecore_wl2: Remove window_transparent_set
This is exactly the same as alpha_set, so it really doesn't have much
reason to exist.
2018-04-20 13:00:27 -05:00
Derek Foreman f560c76b52 ecore_wl2: Properly handle minimize request before shell surface exists
If we're asked to iconify a window before it's visible we need to track
this and apply the state as soon as we create the shell surface.

fix T6834
2018-04-11 11:48:27 -05:00
Derek Foreman 5a2c5479bf ecore_wl2: Stop pretending to fully control minimized state
Under wayland we can set minimized but not unset it, nor can we tell
if it's been unset.  This means we can't cache the value, we need to
make the protocol request any time ecore_wl2_window_iconified_set is
called.

ref T6834
2018-04-11 11:48:27 -05:00
Derek Foreman 94ddefc6fb ecore_wl2: Send a mouse-up event on reentry after client initiated resize
Apparently when we initiate a client side move in ecore_wl2 we flag that
and send a mouse-up immediately on the next pointer enter.

Do the same for resize.

At some point this might need to be revisited, we should probably be
sending a "cancel" at the start of client initiated move/resize instead
of an up at the end?

Fix T6422
2018-03-20 14:30:39 -05:00
Derek Foreman 879f248f08 ecore_wl2_surface: Flush surfaces for offscreen windows
When a surface leaves all outputs we can discard its buffers to save
memory.

Currently most compositors don't send leave events for iconify, so this
pretty much just saves us a cursor buffer under weston for now, but in
the future it could be used for freeing resources of offscreen (fully
occluded or iconified) windows.
2018-01-30 17:09:52 -06:00
Derek Foreman 8abac6da65 ecore_wl2: Track outputs a surface is present on
Keep a list of Ecore_Wl2_Output * a surface is present on.
2018-01-30 17:09:51 -06:00
Derek Foreman cc0cfb7822 ecore_wl2: Add internal _ecore_wl2_output_find
This finds the Ecore_Wl2_Output * for a given struct wl_output *
2018-01-30 17:09:51 -06:00
Derek Foreman 376d8d1e36 ecore_wl2: Make surface managers modular
This allows loading modules to handle wayland surfaces, and makes the
existing dmabuf manager a module.
2018-01-26 15:54:00 -06:00
Derek Foreman 03671c9c20 ecore_wl2: Add a way to register new surface managers
And use it for the existing dmabuf surface manager.
2018-01-26 15:54:00 -06:00
Derek Foreman 044106c8a2 ecore_wl2: Move backend specific members into a private data struct
buffers and current buffers are really specific to the dmabuf backend,
another plug-in might not need them.
2018-01-26 15:54:00 -06:00
Derek Foreman 1c2bb7bda7 ecore_wl2: Make the surface interface a pointer 2018-01-26 15:53:59 -06:00
Derek Foreman b87606775f ecore_wl2: Move surface manager interface into public API
So people can write plug-ins for this stuff.
2018-01-26 15:53:59 -06:00
Derek Foreman 84f703cf67 ecore_wl2: Call check function through a pointer
We'll need this in the function array when we make surface managers
modular.
2018-01-26 15:53:59 -06:00
Mike Blumenkrantz ffa276fce3 wayland: add xdg-shell vfinal support for client-side
@feature
2018-01-10 11:39:52 -05:00
Derek Foreman c48ca81026 ecore_wl2: Add ecore_wl2_surface_flush
This removes all buffers from a surface.
2017-12-01 10:58:44 -06:00
Derek Foreman fdd05f8028 ecore_wl2: add Ecore_Wl2_Surface to Ecore_Wl2_Window
Track the surface of a window and only allow one.

Eventually this might be worthwhile to apply to subsurfaces, but for today
lazy is the way.
2017-12-01 10:58:44 -06:00
Derek Foreman 4f63f327b0 ecore_wl2: Make Ecore_Wl2_Buffer struct private
Nothing needs these members anymore.  If need arises in the future then
proper getter/setter functions can be added.
2017-12-01 10:58:44 -06:00
Derek Foreman 8a3b983c53 ecore_wl2 wayland_shm: Move surface functions into ecore_wl2
Finish pushing these all into ecore_wl2
2017-12-01 10:58:44 -06: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 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
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 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 10b6383640 ecore_wl2: Synchronize state with surface commits
This is really several inseparable commits mashed together, as doing this
a piece at a time would introduce broken intermediate revisions.

Double buffer incoming "configure" state from the compositor so it's held
back during asynchronous render and processed at frame completion.

Hold off on certain requests if their API has been invoked during async
render.

This should fix a lot of races, cosmetic issues, issues where weston can
kill our clients for acking configure (or not) at bad times, etc.
2017-10-12 12:24:03 -05:00
Derek Foreman 0a185d3efd ecore_wl2: Add new API to latch window state for updates
Add an API to call at the beginning of render to latch state at
that moment, and use it for the wayland engine.
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
Chris Michael 114f559e23 ecore-wl2: Formatting
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-08-30 15:50:12 -04:00
Derek Foreman 4e41f7569b ecore_drm2: Fix warning with a dirty hack
So because we include wayland-server.h we're told that wl_buffer is
deprecated - however clients are still expected to use it, it's only
deprecated for usage in a compositor.

Making these into void pointers shuts up the warning.

We need to include wayland-server.h since some of the code provided by
ecore_wl2 is for compositors, but some of it is also for clients...
2017-08-30 14:11:47 -05:00
Derek Foreman 51768ff62b ecore_wl2: Add ecore_wl2_window_buffer_attach API
Let ecore_wl2 track some buffer related state so we can more easily sync
things between ecore_evas and the evas_engines.
2017-08-18 14:27:32 -05:00
Derek Foreman 8f038b2591 ecore_wl2: Add new APIs ecore_wl2_window_frame_callback_add/del()
Abstract frame callbacks through ecore_wl2_window so we can add them in
multiple places without having the wayland compositor generate more than
one.

Also allows us to keep a callback registered over hide/unhide of a window
easily.
2017-08-18 14:27:32 -05:00
Derek Foreman 11d3bf7939 ecore_wl2: Add API ecore_wl2_window_commit()
Abstract wl_surface commits in ecore_wl2_window.
2017-08-18 14:27:32 -05:00
Mike Blumenkrantz 5ffb7d423c wayland: set min/max size hints to surface before show
with deferred surface creation the first canvas change of hints may not
be able to trigger protocol methods for size hints, so ensure that hints are
set
2017-08-11 18:43:13 -04: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 f03028d22f wayland: fix min/max size setting
also don't set arbitrary hints on init

@fix
2017-08-04 16:10:42 -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 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 aae4d21b63 ecore-wl2: handle null offer drags more effectively
this is valid and refers to an offer with no types; a leave event
with no enter is a protocol error, however

fix T5770

@fix
2017-07-24 08:30:05 -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
Chris Michael 632d6018d5 Revert "ecore-wl2: Add API to support setting window stack mode"
This commit reverts support for added API functions inside Ecore_Wl2
to support setting window stacking mode as per IRC discussion with
Cedric

This reverts commit 1359fc9e5f.
2017-06-15 13:09:34 -04:00
Chris Michael 1359fc9e5f ecore-wl2: Add API to support setting window stack mode
Small patch to add support for setting stack mode on a given window

"#divergence"

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-15 11:34:50 -04:00
Chris Michael e3abac30f1 ecore-wl2: Add API to get/set if a window is in floating mode
Small patch to add API functions which allow getting/setting if a
window is in floating mode

"#divergence"

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-15 11:07:48 -04:00
Chris Michael bdcf798dba ecore-wl2: Add API to set window role
Small patch to add support for setting a window role on a given window

"#divergence"

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-15 10:54:30 -04:00
Chris Michael 9b76c284c9 ecore-wl2: Add API to set if a window should skip focus
Small patch to add an API function which can be called to set if a
window should skip focus.

"#divergence"

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-15 10:32:25 -04:00