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.
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>
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.
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>
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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
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.
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).
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.
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
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.
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...
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.
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.
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
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
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>
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>
If we have no data device manager present, we would still like to
receive events when input devices get added or removed so these
handlers should be setup before we return from this function.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
As we are in the Ecore_Wl2 library, lets use a function name that
reflects this.
NB: No functional changes
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Small patch which adds more window types to the Window Type enum.
These window types may be used by various compositors in different
ways. This patch does not add or change any functionality, it just
extends the window type enum to include the ability to specify other
types of windows.
'#divergence'
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This patch adds and sends a client-side event for when a window gets
deactivated.
'#divergence'
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This patch adds and sends a client-side event when a window gets
activated.
'#divergence'
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Small patch to add and send a client-side event for when a window gets
hidden.
'#divergence'
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Small patch to add and send a client-side event for when a window gets
shown.
'#divergence'
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
As we may have both a pointer and touch device on a given system, we
need to accurately set event->device when sending mouse move, wheel,
down, and up events. Previous code here would always try to find a
mouse device first which could potentially end up setting the wrong
event->device (if a touch device also existed).
This patch fixes the issue by comparing the window used for the event
to our focused windows (either mouse or touch) and setting the proper
event->device based on that.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
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.
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>
Small patch to add an API function which can be used to find out if a
given window is set to skip focus events.
"#divergence"
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
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>
This patch just moves window related functions together in the
Ecore_Wl2_Window_Group
NB: No functional changes
Signed-off-by: Chris Michael <cp.michael@samsung.com>
As these events will be raised to ecore_evas_wl and the handlers there
do not pass along the Ecore_Evas as 'data', we need to change the type
of variable passed along in the event struture so that
ecore_event_window_match can be called to find the Ecore_Evas.
This patch also fixes some typos discovered during compile
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This patch adds an API function which can be called to determine if
window manager rotation is supported.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Small patch to add an API function which can be called to set if
window manager rotation is supported.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
When calculating output dpi, we should also be considering output
height in the calculation.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Small patch to add an API function which can be called to set a buffer
transformation on a given window.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Small patch to add a new API function that can be used to retrieve the
current transform value for a given output.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Small patch which adds an API function that can be used to find the
output where a given window resides.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Some servers may need to do special animations or other effects when
an output transformation happens, so raise an event in the output
geometry callback when this happens.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
copied from libX11.
I don't understand what's going on here but this fixes input bugs such
as, e.g., holding ctrl and pressing shift affecting cursor position in
terminology
@fix
this function does not make sense within the context of wayland and seats,
since a surface does not own and is not owned by a seat, nor is there a 1:1
association between surfaces and seats
windows do not have pointers or cursors under wayland, seats do. due to
lack of multiseat support, most components simply use the "default" seat
with these functions, but this should make the corresponding code more
easily adaptable
the current (v6) xdg-shell spec reads as follows:
Client window decorations should be painted as if the window is
active. Do not assume this means that the window actually has
keyboard or pointer focus.
so this is not equivalent to receiving/losing input focus and should not
be propagated as such
@fix