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.
Summary:
The !global test is a post-condition that _ecore_wl2_global_find
provided valid data, so the code is clearer if this is kept separate
from the subsequent if chain for looking up the shell. Since this
post-condition returns from the function on error, it can stand alone.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewers: devilhorns, ManMower
Reviewed By: ManMower
Subscribers: jpeg, cedric
Differential Revision: https://phab.enlightenment.org/D4690
We need to bind a shell on reconnect, but dfb2af697 made sure
we only bind a single shell per wayland display for the life of
the display object - which lives longer than the connection.
That means when session recovery tries to reconnect it never bothers
to bind a shell, so the client can never post buffers.
ref https://phab.enlightenment.org/T5226
ref https://phab.enlightenment.org/T5005
@fix
Commit c6b59be1da ensured display cleanup after roundtrips, however we
cannot call the display_cleanup function After the display has been
disconnected ... oopsie. Essentially the call to the cleanup function
was in the wrong place here so fix.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Commit ee52a28d04 added a roundtrip to
ensure and pending wl events were handled before we disconnected the
display. While this ensures some things like session recovery destroy
work again, it lead to an issue where the _ecore_wl2_display_cleanup
function was called BEFORE we processed pending events. This (in turn)
causes crashes due to processing of pending events that relied on
things like Ecore_Wl2_Input existing. As the display cleanup function
clears inputs & outputs, we need to defer calling that until the
display_roundtrip has dispatched and handled pending events.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
As per Mike, the iterator macro already does the casting for us, so we
can cleanup the code here and not do casting, plus we can remove an
extra variable...bonus ;)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Small patch to change from while (iterator) to using the
EINA_ITERATOR_FOREACH macro...that I had forgotten about...thanks Mike
;)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This patch adds prioritizing to our wayland shell binding code so that
we only bind One shell that the compositor advertises. During the
global_add callback, the shells get added to the 'globals' hash, and
when sync is done, we will search for shells to bind based on priority
so that we can ensure we always bind to the latest supported shell.
ref T5226
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Since we only ever use One shell at a time, let's not bind all of them
as that is useless.
ref T5226
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
We had to do some weird special case stuff when binding wl_compositor
because we implemented damage buffer before depending on a wayland
release that provided it.
Now our wayland dep is newer than damage buffer, so the test can be
more conventional.
Should have no functional change.
Now we must set EFL_WAYLAND_ENABLE_WWW to turn on www. (Note:
this does NOT re-enable any visual effect, it merely controls
the event infrastructure that can be used to let a client
know when its window is mapped or moving)
This wasn't really disabled properly earlier, so disable it now
for a slight performance win when dragging windows (and a major
reduction in log chatter when debugging wayland)
xdg v6 will barf if we attach a buffer to the surface before
we receive a configure - even if we attach before trying to
make a shell surface.
So we need to prevent any drawing into surfaces until we've
decided what kind of surface they'll ultimately be.
Fix T5090
This patch adds support (client-side) for xdg_shell version 6.
Enlightenment is currently using this version as it's desktop shell,
so we need to support it client-side also.
fixes T4998
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
When trying to create a window, the WL EGL engine creates
an ecore_evas and connects to the wayland display. But if
EGL is not supported (in weston with nvidia for instance),
the egl initialization fails and the window must be detroyed
in order to fallback to wayland_shm.
This led to a double disconnect from the wayland display
as both the ecore_evas del and the error handling code
were trying to disconnect.
Also, use ref == 0 in two places rather than ref <= 0, as
it can prevent double frees in bad situations (ref < 0).
And reset a global variable to NULL on shutdown.
Since session recovery can cause apps to constantly try and reconnect
to the display server, we probably should not be filling logs here. On
the other hand, any failures on first connect are now not going to
display any error messages.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Coverity reports that we could not reach the eina_hash_free here on
erorr condition. This was due to an erroneous return NULL above the if
(hash_create) check.
Fixes Coverity CID1357171
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
NB: No real major changes, just removal of an extra 'if' block. If
getenv of wayland display fails, we hard-code the default wayland
display name so subsequent check for 'if (n)' is erroneous
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>