Commit Graph

133 Commits

Author SHA1 Message Date
Mike Blumenkrantz 2fe7878235 wayland: move pointer-related functions to ecore_wl2_input namespace
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
2017-05-19 12:41:17 -04:00
Mike Blumenkrantz 5ebdf8f341 wayland: use shell activated state to indicate focus in csd
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
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz 704a22d1c9 ecore-wl2: add ecore_wl2_window_activated_get()
this is specifically for returning the shell surface's activation state
which is NOT equivalent to the window having input focus

@feature
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz 1bc837c3de ecore-wl2: redo ecore_wl2_window_move() to take a seat instead of coords
this triggers a move operation and is seat-dependent
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz d7d3c9adab ecore-wl2: redo ecore_wl2_window_resize() to take a seat instead of size
this triggers a resize operation and is seat-dependent
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz eb9a5165f4 ecore-wl2: move ecore_wl2_display_inputs_get() into ecore_wl2_display.c 2017-04-21 16:16:12 -04:00
Mike Blumenkrantz fc0c66675e ecore-wl2: create window surfaces immediately when windows are created 2017-04-07 16:06:41 -04:00
Mike Blumenkrantz bc7fb14a9c ecore-wl2: stop setting all windows as toplevels on creation
this is not a valid assumption since toplevel is a shell-specific concept and
it's possible to run a shell which does not implement such windows

@fix
2017-04-07 16:06:40 -04:00
Mike Blumenkrantz cb58baf400 ecore-wl2: CRI when attempting to create a window from a server display object 2017-04-07 16:06:40 -04:00
Derek Foreman 5e7456a315 ecore_wl2: Fix up xdgv6 ack_configures
We've been immediately acking configure with the correct serial number, then
later at commit time sending an incorrect serial (generating a new one).

Remove the extra ack, and save that serial for later, and don't overwrite
it with a current serial when we get a toplevel configure.

Oddly, compositors were letting us get away with this behaviour, so this
probably looks functionally the same as before.
2017-03-09 16:11:56 -06:00
Derek Foreman 4f1c858928 ecore_wl2: Fix initial maximized/fullscreen state
This defers the fullscreen/maximized states if we don't have a shell
surface, and sets them in the first shell surface commit.

ref T5044
2017-03-09 12:21:09 -06:00
Derek Foreman aedf55073a ecore_wl2: Rename badly named API
Oops, I broke naming convention with this, but it's unreleased and beta so
I hope nobody notices as long as I change it now...
2017-03-09 12:21:09 -06:00
Derek Foreman e1ffb46a0e ecore_wl2: Remove wl_shell client support
We're never going to encounter a compositor without at least xdg v5
support, so remove wl_shell support.
2017-03-09 12:21:08 -06:00
Chris Michael 927dc167ec ecore-wl2: Remove some debugging printouts
These prints were left over from
5b9374583e and should not have been pushed.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-03-07 08:19:26 -05:00
Chris Michael cb39bd158e Revert "ecore-wl2: Send surface_commit after ack_configure"
Reverting this as apparently one source says to send a commit after
ack_configure, and another source says its wrong...

This reverts commit 1187035fe6.
2017-03-01 13:14:50 -05:00
Chris Michael 1187035fe6 ecore-wl2: Send surface_commit after ack_configure
Small patch to ensure we send a surface commit after sending the
ack_configure. This fixes an issue where E-WL internal windows would
not maximize.

Fixes T5192

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-03-01 10:25:35 -05:00
Chris Michael 5b9374583e ecore-wl2: Actually update input/opaque regions
Previous commit f8f71d05cd to avoid resetting
opaque & input regions was not totally complete as it did not update
the actual values...small patch to fix that.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-02-28 10:12:31 -05:00
Chris Michael f8f71d05cd ecore-wl2: Avoid resetting opaque & input regions if they match
Small patch to avoid setting the same opaque/input regions if they
already match what is being requested.

ref T5226

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-02-28 08:51:21 -05:00
Chris Michael 515c2d0374 ecore-wl2: Fix setting input region on a window
Previous code here would store incorrect values into the
window->input rectangle. These values should be what is actually
getting set in the wl_region. This code also fixes an issue when
setting input region for transparent/alpha windows by clearing out
any pending input region (wl_surface_set_input_region(surface, null)).

Reviewed-By: Derek Foreman <derekf@osg.samsung.com>

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-02-14 13:36:13 -05:00
Chris Michael 559490d756 ecore-wl2: Fix setting opaque region on a window
Previous code here would store incorrect values into the
window->opaque rectangle. These values should be what is actually
getting set in the wl_region. This code also fixes an issue when
setting opaque region for transparent/alpha windows by clearing out
any pending opaque region (wl_surface_set_opaque_region(surface, null)).

Reviewed-By: Derek Foreman <derekf@osg.samsung.com>

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-02-14 13:36:03 -05:00
Chris Michael 4b2188103d ecore-wl2: Don't send focus in/out events based on keyboard enter/leave
We should not be sending focus events based on keyboard behaviour, but
rather send them according to xdg shell activate status. This makes
our focus behaviour more "standards" compliant.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-02-08 11:54:07 -05:00
Chris Michael a306cba6c3 ecore-wl2: Don't set opaque or input regions if already set
If the window opaque/input regions already match what is being
requested (to be set), then no need for the compositor to create
regions and set them.

@optimize
@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-25 12:02:35 -05:00
Derek Foreman 0669ca31ff wayland: Try not to draw into surfaces without roles
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
2017-01-19 15:25:17 -06:00
Mike Blumenkrantz de1a6d6f42 ecore-wl2: make session recovery listener global
global proxies have a single instance and do not work with
multiple listeners

@fix
2017-01-13 11:33:59 -05:00
Chris Michael 83defff028 ecore-wl2: Use input serial for move and resize functions
This is a partial revert of 2bd880c6c7 which changed to use
wl_display_get_serial function. When can do that for most things,
however things like window move/resize need to use the input serial
which started the move/resize.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-13 09:53:52 -05:00
Chris Michael 755c50a84e ecore-wl2: Add event to raise when window configure is completed.
Small patch to create and raise a new event letting ecore_evas know
when the window has been configured. With the addition of xdg_shell v6
support, we cannot commit a surface with an existing buffer until the
surface has been configured. This patch allows us to raise an event to
ecore_evas when the surface has been configured, so we can then attach
a buffer to it.

ref T5090

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-11 12:36:33 -05:00
Chris Michael 41ff3c9d94 ecore-wl2: Mark window as pending configure when showing popup
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-10 12:00:39 -05:00
Chris Michael 07433065aa ecore-wl2: Remove incorrect EINA_UNUSED
These parameters are actually used inside this function so remove the
EINA_UNUSED

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-10 11:49:10 -05:00
Chris Michael 2bd880c6c7 ecore-wl2: Use 'serial' directly from wayland call
As we cannot rely on window->display->serial to be accurate (it is
only set when there is input going on), we should be getting the
'serial' values here directly from a wayland function call.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-10 11:48:18 -05:00
Chris Michael 101c772412 ecore-wl2: Add flag to indicate pending configure
With the change to xdg_shell v6 we need to indicate that a window has
a pending configure event, and not show the window if a configure is
pending. In order to handle this, we add a flag to the window
structure and can check it inside ecore_evas.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-10 11:27:10 -05:00
Chris Michael 90ab99cba6 ecore-wl2: Use correct serial value
When we get a configure event, we should be using the current display
serial to set as the window configure serial value. Previous code
would always end up setting the window configure_serial to 0 as
win->display->serial was not getting updated.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-10 08:51:33 -05:00
Derek Foreman 8328d4db89 ecore_wl2: Remove the rest of the cursor frame callback
Oops, I made a clean spot, now I need to clean up the rest of this.

ref 641dfab516
2017-01-05 13:40:31 -06:00
Chris Michael d86b296813 ecore-wl2: Add support for xdg shell version 6
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>
2017-01-04 14:25:18 -05:00
Chris Michael 4ba4efb8fc ecore-wl2: Fix formatting
NB: No functional changes, just cleaning up formatting before the
serious work begins.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-04 11:08:49 -05:00
Guilherme Iscaro 133b4fa65b Ecore Wl2: Add ecore_wl2_window_pointer_device_xy_get() API.
This commit adds a Wayland specific function to fetch a mouse
position.
2016-12-20 18:34:39 -02:00
Mike Blumenkrantz b4740389f9 ecore-wl2: restore previous session recovery behavior on hide
ref 9492ee21df
2016-12-14 11:44:13 -05:00
Chris Michael 6dca94d8bf ecore-wl2: No need to call hide inside the free function
When we are freeing an Ecore_Wl2_Window, there is no need to call
ecore_wl2_window_hide anymore because inside the free function we are
destroying subsurfaces, surfaces, etc, etc so no need to even unmap
them.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-05 09:27:11 -05:00
Chris Michael 4c7ff57cb2 ecore-wl2: When we hide a window, attach a NULL buffer to the surface
This patch essentially makes sure that the surface gets a NULL buffer
attached to it when we are hiding.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-05 09:22:26 -05:00
Chris Michael 4c140180d1 ecore-wl2: Don't destroy surfaces on window hide
In order to hide a window (via wayland) we can actually assign a NULL
buffer to the surface, so there is no need to destroy the window's
wl_surface during a hide request.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-02 14:25:10 -05:00
Guilherme Iscaro 9ba11c5cd0 Ecore Evas Wayland: Create the devices during Ecore_Evas setup.
Summary:
When launching an Elementary App using Wayland the elm_config will
automatically connect to the Wayland's display server and all events
regarding seats are lost, since by the time that Ecore_Evas is created
the global events were already dispatched. To fix this problem,
everytime an Ecore_Evas is created, the code must check if there
are any seat capabilities available, if so, the devices will be created.

Reviewers: bdilly, barbieri, cedric, jpeg

Subscribers: devilhorns, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4390
2016-11-16 18:26:25 +09:00
Chris Michael e3f02acc93 ecore-wl2: Update cursor regardless of cursor surface
If a NULL surface gets passed into ecore_wl2_window_pointer_set that
would mean we are unsetting the cursor surface, so we should still be
calling wl_pointer_set_cursor even with a NULL surface.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-02 12:13:09 -04:00
Bruno Dilly 8bf74da7bc ecore_wl2: associate evas devices to input ecore events
So users would be able to differentiate between source
seats.
2016-11-01 16:06:19 -02:00
Chris Michael f3240f630b ecore-wl2: Unify surface creation code
As we call the same code during ecore_wl2_window_surface_get and
ecore_wl2_window_show functions that basically create the wl_surface
for a given window we can unify that code into one function that can
be called from various places. This also fixes an issue inside
ecore_wl2_window_show where the window surface_id may not have been
getting filled properly.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-31 14:05:13 -04:00
Chris Michael 72f2ac2c3a ecore-wl2: Only call pointer_update_stop once
As we already call _ecore_wl2_input_cursor_update_stop above, we
actually don't need to call it a second time.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 12:35:12 -04:00
Chris Michael d4a483c40b ecore-wl2: Disable pointer frame callback if no cursor surface
If we have no cursor surface, then we don't need the pointer frame
callback anymore so call cursor_update_stop which will delete the
pointer frame callback

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 09:55:27 -04:00
Chris Michael 2166ae6377 ecore-wl2: Remove cursor field from window structure
Remove the const char *cursor field from the window structure as this
is useless. It was never used for any real functional purpose.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 11:01:12 -04:00
Chris Michael a80d4ef5a5 ecore-wl2: Remove usage of libwayland-cursor
This commit removes usage of libwayland-cursor inside Ecore_Wl2
library. This is done so that EFL Wayland applications can use EFL
mouse pointers and not look ugly :)

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-25 14:22:07 -04:00
Chris Michael db63eff588 ecore-wl2: Don't call cursor_update_stop function twice.
When setting a cursor by name, the _ecore_wl2_input_cursor_set
function already makes a call to stop updating the cursor, so no need
to run that twice.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-25 14:22:07 -04:00
Chris Michael 3a44b0fd17 Revert "ecore-wl2: Remove all references to wl_cursor usage"
This reverts commit 173fda5c11.

Reverting this as we need to handle mouse pointers a different way.
2016-10-25 11:07:32 -04:00
Chris Michael 173fda5c11 ecore-wl2: Remove all references to wl_cursor usage
This commit essentially removes the ability to use wl_cursor for EFL
Wayland Client Applications. This is a request from "some old man" ;)
for efl wayland applications to use EFL pointers, not X/FDO pointers.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-21 15:32:47 -04:00