Commit Graph

257 Commits

Author SHA1 Message Date
Christopher Michael 6f68a9d892 ecore-wl2: Remove unused variables
Patch d584696f12 remove the unmapping of subsurfaces on window
hide, however the variables were left declared so remove those
2020-05-26 14:49:32 -04:00
Woochanlee 9ca13ef5c1 ecore_wl2 : Organize window creation/deletion events.
Summary:
Add create / destroy events.
Call hide event when the window terminated if the window was visible.

Reviewers: devilhorns, Hermet, raster

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11878
2020-05-26 11:49:16 -04:00
Shinwoo Kim d584696f12 ecore_wl2_window: do not unmap subsurface in hide
Summary:
If window_hide should unmap subsurface, then window_show should re-map
the unmapeed subsurface. I have no idea why window_hide unmap all subsurfs.

Reviewers: zmike, devilhorns

Reviewed By: zmike, devilhorns

Subscribers: devilhorns, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11869
2020-05-26 11:49:07 -04:00
Christopher Michael 73195a34de ecore-wl2: Fix return with no value in function returning non-void 2020-01-08 09:10:43 -05:00
Woochanlee 926cbb98af ecore_wl2: Add APIs to get window property.
Summary:
Creates APIs to get property.

+ecore_wl2_window_popup_input_get
+ecore_wl2_window_input_region_get
+ecore_wl2_window_opaque_region_get

ref T8016

Reviewers: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8016

Differential Revision: https://phab.enlightenment.org/D11038
2020-01-08 07:59:53 -05:00
Woochanlee 6162914be5 ecore_wl2: Add APIs to get window properies.
Summary: Creates APIs to get property.

Reviewers: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10743
2019-12-02 08:50:24 -05:00
Christopher Michael e36b1930bf ecore-wl2: Add API to find a window by given surface
This patch adds a convenience function to find a window by a given
wl_surface.

@feature
2019-11-19 09:44:45 -05:00
Christopher Michael 68ea9f1a71 ecore-wl2: Add API to return window type
Small patch whichs adds a new API to return the type of a given window

@feature
2019-11-19 09:44:45 -05:00
Carsten Haitzler ca32732373 ecore_evas/wl2 0 fux xdg close cb for window when it's closed remotely
this should fix this:

https://matrix.org/_matrix/media/r0/download/matrix.org/lhFneENlWAjuXDaJfSYuJjjJ

unfortunately this means adding an api and then using it in ecore_evas.

@fix
2019-10-14 22:58:27 +01: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 c90826f72c ecore_wl2: Fix anchor for xdg pop-ups
Anchors are in window geometry, so we should be using 0,0 instead
of the parent x,y for the top left corner of the window.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7436
2018-12-14 10:29:59 -06:00
Derek Foreman f53c7341c3 ecore_wl2: Replace direct usage of set_config.geometry with getters
I'm going to deal with some ugly geometry problems in the getter func
shortly.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7431
2018-12-14 10:29:53 -06:00
Derek Foreman b32e5da641 ecore_wl2: remove uniconify path from ecore_wl2_window_iconified_set
Wayland shells have no way to unset iconified state.  What this code
did was corrupt current window state in potentially fatal ways.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7430
2018-12-14 10:29:52 -06:00
Woochanlee d702f714fe ecore_wl2_window: Fix incorrectly implemented null check.
Summary: It checks 'window->xdg_toplevel'  two times.

Reviewers: ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7065
2018-09-19 07:01:01 -04:00
Hermet Park 568ddfe397 ecore wl2: change logging level.
Summary: ease the error message to warning because it's not serious one.

Reviewers: devilhorns, ManMower

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6899
2018-08-23 07:29:35 -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 e4641649e2 ecore_wl2: purge surface buffers in semi_free
Summary:
This fixes a session recovery bug with software render.

An attempt to re-use a buffer in a new wayland connection resulted
in another disconnect and broken rendering.
Depends on D6281

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6282
2018-06-15 13:18:56 -05:00
Derek Foreman 54a877981c ecore_wl2: Add purge to ecore_wl2_window_surface_flush
Summary:
It's convenient to be able to pass this through this api too.

@betabreak
Depends on D6280

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6281
2018-06-15 13:18:53 -05:00
Derek Foreman a310667bec ecore_wl2: Add a purge option to surface flush
Summary:
We need to be able to forcibly destroy all surface buffers to make
session recovery work safely for software rendering.

@betabreak
Depends on D6278

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6279
2018-06-15 13:18:30 -05:00
Derek Foreman 03793c4c64 ecore_wl2: Remove ecore_wl2_window_raise
Summary:
Since this can't be done, it probably doesn't need API.

@betabreak
Depends on D6276

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6277
2018-06-15 13:18:00 -05:00
Derek Foreman 249ae8e5f0 ecore_wl2_window: Silence early commit ERR for mouse cursors
Summary:
Our wayland mouse cursor code can trigger commits with commit pending
when mousing into a window across CSD, which results in quickly setting
the default cursors then an animated resize cursor before the first commit
has finished.

Fixing this is non trivial, and the bug is just a harmless inefficiency
of little impact, so just disable the ERR for that specific case instead.

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6184
2018-05-22 12:33:36 -04:00
Derek Foreman 0ef79bb941 ecore_wl2: complain loudly when move or resize doesn't provide a seat
Summary:
We now have the ability to provide the seat information properly, so
fire off an ERR if a caller doesn't.
Depends on D6131

Reviewers: zmike, cedric

Reviewed By: zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6132
2018-05-08 13:27:00 -05: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 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 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 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
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 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 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
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
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 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