Commit Graph

754 Commits

Author SHA1 Message Date
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
Derek Foreman 1fddfdfaae ecore_wl2: Add lock/unlock function pointers to buffers
For backend specific lock/unlock behaviour
2018-04-20 13:00:28 -05:00
Derek Foreman 52e2ef8b22 ecore_wl2: Add ecore_wl2_buffer_lock
Currently we're making mapping implicitly take a lock.
2018-04-20 13:00:28 -05:00
Derek Foreman f73bc10201 ecore_wl2: Don't do anything but update alpha in alpha_set
This is now done in ecore_evas where it should be.  alpha_set now does
only what its name claims it does - sets whether a surface has an alpha
channel or not.
2018-04-20 13:00:28 -05:00
Derek Foreman ab7419908c ecore_wl2: Reconfigure window on alpha set
This allows software renderers to reconfigure their buffers to actually
change whether alpha is present.
2018-04-20 13:00:27 -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 8b5b9989af ecore_wl2_dmabuf: Properly reconfigure on surface alpha change
When alpha changes we need to blow away all our buffers in reconfigure,
even if they're still the right dimensions.  Otherwise we can end up
rendering to an XRGB buffer when we wanted to use ARGB and we won't have
proper transparency.
2018-04-20 13:00:27 -05:00
Derek Foreman a10feaed0c ecore_wl2: Add ecore_wl2_surface_alpha_get query
We'll need this for some surface modules to properly handle alpha changes
2018-04-20 13:00:27 -05:00
Derek Foreman 6da0933d60 ecore_wl2: Add alpha to reconfigure
Currently we only ever make wayland windows with alpha, this is a step
towards changing that.
2018-04-20 13:00:27 -05:00
Derek Foreman e50b43d02f ecore_wl2: handle configure_complete after handling configure
since configure_complete may result in a draw op, configure should be
handled first so the size is correct.
2018-04-17 11:12:27 -05:00
Derek Foreman 48e0c6ea90 ecore_wl2: Fix ecore_wl2_window_output_find
Window geometry x, y are the offset from the top left corner of the
buffer, and not screen co-ordinates, so has nothing to do with output
geometry and can't be used to determine which window we're on.

Now that we track surface enter/leave events we can just give the first
output in the list of outputs we know we're on.
2018-04-11 16:29:07 -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 d697e7936b ecore_wl2: Remove (beta) API ecore_wl2_window_iconified_get
We actually can't ever query this, it's clearly defined that way in the
protocol.  There is absolutely no way to ever know if we're iconified.

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 7784405ad9 ecore_wl2: Silence a commit ERR on window hide
Cosmetic fix, should be functionally identical.  Hide can be called
asynchronously, so it's ok, and the ERR can be silenced.
2018-03-16 12:48:41 -05:00
Derek Foreman 984d8bd4ce ecore_wl2_window: Silence some spurious warnings
ecore_wl2_window_commit() must be called during window size negotiation,
but this currently trips a warning when no frame callback has been
received for the first commit.  We can't even have frame callbacks at
that point because no buffer is attached.

Don't set up the commit_pending logic until after we have a buffer.
2018-03-14 16:10:14 -05:00
Cedric Bail 012bcff80c ecore_wl2: cleanup input code to string logic to reduce compiler warning and useless memory access. 2018-03-07 10:51:46 -08:00
Chris Michael 59a689faa4 ecore-wl2: Check for valid string before passing to strlen()
As strlen() cannot accept NULL (segfaults), we should check for valid
key, keyname, and compose strings here before passing to strlen().

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-03-07 09:50:58 -05:00
Chris Michael a1bb9b313f ecore-wl2: Reduce calls to strlen
Small patch to reduce calls to strlen when sending key events. This
patch is loosely based on Phab D5567

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-03-07 09:37:25 -05:00
Derek Foreman ec3784774d ecore_wl2: Disable horizontal resize optimization
We had a "clever" optimization that would keep a buffer on resize
if it was resizing up horizontal and fit within the previously
allocated stride.

Unfortunately, there still needs to be a buffer reconfigure between
client and compositor that wasn't taking place.  Remove this for now.
2018-02-27 16:27:56 -06:00
Marcel Hollerbach c4f33c67a8 move from efl.vpath to eina_vpath
The usages from efl.vpath are moved to to eina_vpath
2018-02-22 09:26:55 +01:00
Derek Foreman f80061e184 ecore_wl2: Take a library reference on surface create
Since surface handling is now done via modules, we need to ensure
the library can't be shutdown while a surface exists.  Otherwise,
we get a segfault trying to call a function we've unmapped.

Fixes a bug on shutdown for some wayland clients using software
rendering.
2018-02-15 11:07:12 -06:00
Derek Foreman 3da806bf3b ecore_wl2_surface_dmabuf: fix memory leak on surface destroy
We need to free the surface private data on destroy.
2018-02-13 17:31:41 -06:00
Derek Foreman 8708bfb0bf ecore_wl2: Fix memory leak on shutdown
The output list wasn't properly cleaned up on shutdown/disconnect.
2018-02-13 17:10:04 -06:00
Derek Foreman 563dba9d60 ecore_wl2: Send window hide in response to xdg popup done
Clients should be sent this event when the compositor sends popup done.
2018-02-12 11:27:50 -06:00
Derek Foreman a221bec6d0 ecore_wl2: Destroy offscreen event handler in surface destroy
Or we can get the event after destroying the surface and crash.
2018-02-09 09:49:52 -06:00
Derek Foreman 90fecc7485 wl2_surface_dmabuf: Trim the buffer queue after a while
If we have more buffers than we need for 100 frames then drop the oldest.

This can happen if we're on a hardware plane and then removed from it, or
really whenever the compositor feels like holding onto a few frames.

Trimming the queue too soon could result in having to do a costly full
frame redraw, so we wait a while to make sure we don't need one again.

Having more frames than we need costs us a little every draw since we
always use the oldest available.  It also wastes memory.
2018-01-30 17:09:52 -06: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 9632c7b56c wl2_surface_dmabuf: improve surface flush
We used to abandon all buffers even if they were locked. This can't
actually free them until they're all released by the compositor.

Instead just free any buffer the compositor doesn't have locked, so we can
still re-use them when they're released without needing a full redraw.

There's probably room for additional cleverness here.  If we get a new
frame event before the buffer release we may want to keep it, and if we
get the release first we may want to abandon it.
2018-01-30 17:09:51 -06:00
Derek Foreman 1bd41aa3b6 ecore_wl2: Add new event for windows not displayed on any output
When a window leaves all outputs we can free its render buffers to save
memory.  This new event is generated when a window leaves all outputs.
2018-01-30 17:09:51 -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 01aac084d7 ecore_wl2: Use wl_buffer_get in dmabuf_surface_post
This is the final place where this code was reliant on internal structures,
it now solely uses (beta) public api.
2018-01-26 15:54:00 -06:00
Derek Foreman 288b693ac4 ecore_wl2: fix ecore_wl2_buffer_wl_buffer_get
It was currently only used internally and had the side effect of
creating a new buffer instead of just returning the existing one.

Now it's useful to external callers, as it only returns the existing
wl_buffer and has no freaky side effects.
2018-01-26 15:54:00 -06:00
Derek Foreman 0fc4fa7156 ecore_wl2: Add surface_window_get api
One of the last remaining blockers for compiling dmabuf support as a
plug-in.
2018-01-26 15:54:00 -06:00
Derek Foreman fb3928ec96 ecore_wl2: Add API to remove surface managers
Someone might want to do this I guess.
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 83f8db157e ecore_wl2: rename _surface_flush for consistency
It was originally thought that this could be common code for multiple
back-ends, but that doesn't really make sense now, so rename it to match
the other dmabuf functions.
2018-01-26 15:54:00 -06:00
Derek Foreman 07c41f48c4 ecore_wl2: Move private data allocation into back-end code
The backend should allocate its own private data and return it instead
of a bool.

This assumes all back-ends will need some manner of private data, which
is certanly true for the one back-end we provide.
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 7c026c52cc ecore_wl2: Move surface size update into generic code
This didn't have to be in backend code in the first place.
2018-01-26 15:54:00 -06:00
Derek Foreman 4d430a98bf ecore_wl2: Add API surface_buffer_create
The specific surface code only needs these generic surface bits to pass
to buffer_create, so make a helper function for that instead of queries
for w, h, and alpha.
2018-01-26 15:54:00 -06:00
Derek Foreman e4122da211 ecore_wl2: Remove force from surface reconfigure
It no longer has any users or need to exist.
2018-01-26 15:53:59 -06:00
Derek Foreman e11bb10a4e ecore_wl2: Move smarts from surface_map to buffer_map
This simplifies the surface code so that it no longer needs access to
buffer structure members.
2018-01-26 15:53:59 -06:00
Derek Foreman 1a5e307f73 ecore_wl2: Add buffer_fit API and use it from surface code
This tries to resize the buffer's useable area to fit the specified size -
this is possible if the stride of the buffer is larger than the current
width.
2018-01-26 15:53:59 -06:00
Derek Foreman 7d81a16cdb ecore_wl2: Add buffer age inc and use it in surface code
Technically not necessary, since we could do this with get and set, but
it's a little more convenient to the user this way.
2018-01-26 15:53:59 -06:00
Derek Foreman dce3fcda86 ecore_wl2: Add buffer_age_set and use it in surface code 2018-01-26 15:53:59 -06:00
Derek Foreman e97a8cefe8 ecore_wl2: Add buffer_age_get API and use it in surface code 2018-01-26 15:53:59 -06:00
Derek Foreman ebcce5aefa ecore_wl2: Add API for setting buffer busy status and use it
Since surfaces will be managed by plug-ins, we need to make sure they
don't rely on internal structures.
2018-01-26 15:53:59 -06:00
Derek Foreman e3a3e02042 ecore_wl2: Add API for querying buffer lock status and use it
Since surfaces will be managed by plug-ins, we need to make sure they
don't rely on internal structures.
2018-01-26 15:53:59 -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
Derek Foreman bf4b828cb6 ecore_wl2: Move dmabuf surface specific tests into their own function
Refactoring to allow non-dmabuf surface managers.
2018-01-26 15:53:59 -06:00
Derek Foreman 601f9cc484 ecore_wl2: Make session recovery more robust
Clear out the window callback when doing session recovery, and
make sure we have a valid on if we get a double commit.

This should stop a session recovery crash, and fix a small leak per
recovery.
2018-01-26 15:51:44 -06:00
Mike Blumenkrantz d555c6c903 ecore-wl2: correctly translate spacebar keyname into key events
fix T6620

@fix
2018-01-22 13:04:15 -05:00
Derek Foreman 520821e432 wayland: Reduce number of unneccessary display flushes
b48781aa6c fixed multiple bugs where the
display wasn't flushed correctly, however it was a little overzealous.

Some of the flushes were added after calls that only updated internal
state, some in internal functions in which the caller was already going
to flush, and some were after wayland protocol calls that are double
buffered anyway and won't do anything until a following commit.

Also, I've removes at least one long standing flush where the recently
added flush is in a better location than the original.
2018-01-19 12:40:40 -06: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
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
Derek Foreman 51599fe86c ecore_wl2: Better handling of extra commit
Discard the old callback so it can't fire later - which can happen after
the window's deleted in certain cases.
2017-12-13 16:34:10 -06:00
Jean-Philippe Andre b867b6aa24 ecore_wl2: Fix a warning 2017-12-05 15:06:34 +09:00
Derek Foreman 7658fc101f ecore_wl2: Add API ecore_wl2_window_surface_flush
This allows something that only has the Ecore_Wl2_Window (ie: something
that isn't engine code) to force dropping of all the buffers.

This should be safe to call at any time as the buffer handling logic
will properly cleanup the buffers when async render is done with them
or the compositor releases them.

This will eventually be used when a wayland client receives a
wl_output.leave events to indicate it isn't displayed on any outputs.
2017-12-01 10:59:51 -06: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 5b4b18836a wayland_shm: Remove struct _Dmabuf_Surface
It's all piled into Surface now.
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
Chris Michael 83c292ffc4 ecore-wl2: Fix resource leak
Coverity detected a resource leak here because we were not freeing the
malloc'd 'obo' variable.

Fixes Coverity CID1382907

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-26 12:12:53 -05:00
Derek Foreman cf605549c5 ecore_wl2: Add dmabuf allocations for vc4
This should theoretically be better for software rendering on rpi3 since
it allows the compositor to use our sw rendered buffers as a texture.
2017-11-21 16:31:23 -06:00
Derek Foreman 9f3edead9d ecore_wl2: Fix buffer manager refcounting
commit 0cf806005e correctly fixed a
leaked buffer.  However, other code was already accounting for the
leaked reference to the buffer manager, so an extra deref happened
and broke the universe - but only on hardware that no developer
has access to for testing.
2017-11-21 10:11:47 -06:00
Chris Michael 0cf806005e ecore-wl2: Destroy buffer before we exit the buffer_test function
Small patch to destroy our test buffer before we exit the
_ecore_wl2_buffer_test function so that we do not leak here.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-20 11:27:15 -05:00
Derek Foreman 796de8cb86 wayland_shm: Don't use a fixed number of buffers
We no longer allocate 3 buffers at startup, we now allocate only as needed.

Trimming the queue will come later, as there are some situations where we
might need 3 buffers and later drop down to 2 (when on a hardware plane)

Most clients will only ever need 2 buffers, so this is a reasonable RAM
savings.
2017-11-17 14:33:36 -06:00
Derek Foreman 04ce069cba ecore_wl2: Properly handle buffer test failure during buffer_init
The buffer manager is already cleaned up at this point, don't try to
do it again.
2017-11-17 14:32:50 -06:00
Derek Foreman 1bd513305e ecore_wl2: fix user pointer for dmabuf param listener
Proving once again that those that defeat type safety usually get what
they deserve.
2017-11-16 13:18:48 -06:00
Derek Foreman 925be86f9e ecore_wl2: Fix dmabuf test failure
We need to destroy the buffer manager on fail, since it will exist but
only be able to create buffers we can't actually use.
2017-11-16 13:18:48 -06:00
Derek Foreman c08920820b ecore_wl2: Don't try to close drm_fd if we never opened it
derp.
2017-11-16 13:13:38 -06:00
Derek Foreman fcdbc07fe3 ecore_wl2: Don't open rendernode if we're not going to use it
We should only open this when actually testing dmabuf.  Otherwise we're
just wasting time and adding an opportunity to fail shm init over
unrelated issues.
2017-11-15 11:54:37 -06:00
Derek Foreman 23f5b41176 ecore_wl2: Reset buffer_manager to NULL on failure
Calling this multiple times even after it fails the first time is a legit
thing now.  We'll be doing that when we want to test dmabuf at connection
start.
2017-11-15 11:54:37 -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 3ac556f2e1 ecore_wl2: factor out part of buffer creation
So we can use it to make a non-immediate mode buffer test.
2017-11-15 11:54:37 -06:00
Derek Foreman 04cebba623 ecore_wl2: Filter buffer types by compositor capabilities
It does us no good to be able to allocate dmabuf capable memory if the
compositor can't handle it.  This should fix failures on systems where
allocation is possible but the compositor doesn't advertise 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 9fdcf7d0eb wayland_shm/ecore_wl2: Move buffer allocation into ecore_wl2
This moves all the platform specific buffer allocation into ecore_wl2
instead of the engine.

Note that this makes an internal struct available in the header.  This
will be removed shortly.
2017-11-15 11:54:37 -06:00
Chris Michael de9cf5a217 ecore-wl2: Minor formatting fixes
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-11-10 15:59:51 -05:00
Derek Foreman abba80f3d6 ecore_wl2: Add API for adding damage to a window
This was done in the engine previously, but would be better as a library
function.
2017-11-10 13:43:45 -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 807006385d ecore-wl2: correctly handle configure events on popup surfaces
@fix
2017-10-25 10:44:16 -04: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 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 9918a2c920 ecore_wl2: Don't overwrite saved geometry if switching fs to max
If we switch from fullscreen to maximized we need to keep the pre-fs
geometry around in case we ever unmaximize AND unfullscreen.
2017-10-12 12:24:03 -05:00
Derek Foreman 10de856ee9 ecore_wl2: Don't overwrite saved geometry if switching max to fs
If we switch from maximized to fullscreen we need to keep the pre-max
geometry around in case we ever unmaximize AND unfullscreen.
2017-10-12 12:24:03 -05:00
Derek Foreman 1d1d2d76aa ecore_wl2: Push out maximize set with a display flush
We want this request to get to the compositor as soon as possible.
2017-10-12 12:24:03 -05:00
Derek Foreman da85d1330d ecore_wl2: Push out fullscreen set with a display flush
We want this request to get to the compositor as soon as possible.
2017-10-12 12:24:03 -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 4985dee49d ecore_wl2: Fix setting empty input regions
We should still update window->input_rect when the input region is empty.
2017-10-12 12:24:03 -05:00
Derek Foreman c4b19a77b6 ecore_wl2: Fix setting empty opaque regions
We should still update window->opaque when the opaque region is empty.
2017-10-12 12:24:03 -05:00
Derek Foreman f6bd73167a ecore_wl2: Add as partial commit function for setting off a tick
This adds the concept of a "false commit" that just sends a surface
commit without changing any other state.

This is intended to be used by ecore_evas to request a frame callback
from the compositor
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 51e2514492 ecore_wl2: Add a getter for window->resizing 2017-10-12 12:24:03 -05:00
Derek Foreman 3fba59386b ecore_wl2: Fix some @since tags
Seems my brain missed the efl release and started tagging new API
incorrectly in the doxy.

This is all beta API that should probably only be used by other EFL
internals anyway, but I suppose it's a good idea to try to be somewhat
correct.
2017-10-12 12:24:03 -05:00
Carsten Haitzler 9ee741cf7f ecore wl2 - fix null checing of drag offer - coverity
fix CID 1378629
2017-09-28 15:28:00 +09:00
Derek Foreman 1f555c897e ecore_wl2: Don't set up callbacks on initial commit
We don't want to do frame callbacks until after we can actually draw stuff
2017-09-01 12:29:05 -05:00
Derek Foreman d0b8c41f92 ecore_wl2: Fix session recovery
I broke this in commit 1bb45f6e61

We intentionally *don't* flush in window_semi_free, as this could be
when there's no compositor left to flush to (in the case of session
recovery).
2017-08-31 11:17:34 -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
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 f886a76dae wayland: Force a display flush when committing surfaces
We had a hack in place to flush the display from an idle enterer instead
of after a surface commit.  This led to a problem where the idle
enterer dispatch order was:

renderer for main canvas
wayland dispatch idle enterer
renderer for mouse cursor canvas

The surface commit for the mouse cursor was never dispatched, so the mouse
cursor animation would only update at the rate other events occurred.

By flushing at the appropriate times instead we ensure a proper update.

ref T5850
2017-08-30 14:11:47 -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
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
Chris Michael 2ed81b0948 ecore-wl2: Formatting
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-08-30 09:10:55 -04:00
Mike Blumenkrantz 91f513f77d ecore-wl2: normalize axis event values
this is value * 10 from the compositor, so /= 10 to get real value

fix T5427

@fix
2017-08-25 14:48:11 -04:00
Derek Foreman 913e216ea3 ecore_wl2: Send configure complete when windows don't need configure
The intent of the "configure complete" event is to indicate that the
window is configured and ready to receive buffers.

For "windows" like mouse cursors, that's immediate - let them know.
2017-08-18 14:27:32 -05:00
Derek Foreman 9df39b5616 ecore_wl2: Refactor out code to send window configure complete event 2017-08-18 14:27:32 -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 b599b1b900 ecore_wl2: Add API ecore_wl2_window_pending_get()
Lets us test if a commit has been requested but the compositor hasn't
yet told use to draw new content for it.
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 dc073c1ea3 wayland: fix num/caps lock handling in events
locks are not the same as modifiers, and the corresponding event flag must
be set based on whichever value(s) are set instead of yolo mixing and matching

@fix

ref T5737
2017-08-18 15:24:37 -04: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 398ffe40a3 wayland: fix xdg-shell popup windows
@fix
2017-08-11 18:43:12 -04:00
Chris Michael 42b082fe36 ecore-wl2: Add support for Window Iconify State Change
This patch adds support for the Window Iconify State Change event
structure and the ecore event type to support it.

'#divergence'

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-08-08 09:53:52 -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 99b60390f4 ecore-wl2: sync aux hints after window creation
ensure hints are available when needed

@fix
2017-08-04 16:10:35 -04:00
Mike Blumenkrantz f2627d49c1 ecore-wl2: don't send null set_parent requests for every window
this is redundant

@fix
2017-08-04 16:10:34 -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
Chris Michael 0bd8259da8 ecore-wl2: Rename local function and make it static
As this function is not called from anywhere outside of
ecore_wl2_window.c file, this can be declared static.

NB: This patch also changes the function name to match the library
(ecore_wl2).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-08-03 10:15:41 -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