@fix: If we are using the ecore_wl library in a "server", we cannot
sit and 'sync' during the init process as that just leaves the server
in a stalled state waiting for ecore_wl_init to complete (which never
does because the server has not finished it's work).
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Being annoyed by different types of eina critical macros - CRI, CRIT,
CRITICAL -, I concluded to unify them to one. Discussed on IRC and
finally, CRI was chosen to meet the consistency with other macros -
ERR, WRN, INF, DBG - in terms of the number of characters.
If there is any missing bits, please let me know.
The previous workaround used to send a mouse up event to the
application, using the pointer enter callback to determine when an
implicit grab has finished. This was "simulating" a mouse up event when
the surface move or resize finished.
However, this doesn't work for touch-based move. The pointer enter isn't
emitted, because the wl_touch interface doesn't have the concept of a
pointer.
Changing this code to make it more similar to what Weston's toytoolkit
does, the mouse up event is sent as soon as the move or resize grab
starts. After that, the compositor takes care of the move/resize almost
entirely.
Should fix T468.
down_info is a struct that stores some information about the current
pressed touch events. It should be used for that specific touch point,
instead of the generic input info, when sending a mouse_up event.
Previously, if you were hold down shift for 1-2 seconds and then press
a key, you would get superfluous key repeats (even tho you released
the printable key). This was because the "key repeat" code was not
checking for the same key before (re)starting the repeat timer.
This fixes the repeating key issue by checking if the key pressed is
different than the one already pressed. If so, it will (re)start the
timer. If it is not different, then the timer is already running and
we don't need to do anything.
Fixes T552
Signed-off-by: Chris Michael <cp.michael@samsung.com>
values.
Previously, the keyname and key fields of the Ecore_Event_Key
structure were being filled in with the capitalized version of the
key. This is due to xkb_keysym_get_name always returning keys with the
modifier applied. There is no actual function in xkbcommon to Not do
this :/ so we have to manually check if Shift is pressed, and if so
then we need to convert the key to lowercase.
Fixes T550
Signed-off-by: Chris Michael <cp.michael@samsung.com>
The subsurface protocol was moved into Wayland Core
around v1.3.90 (i.e. v1.4.0).
Test if subsurface protocol is part of wayland-client.h.
If not, we include our own copy of the protocol header.
Also, some whitespace cleanup in ecore_wl.c.
Tested with Wayland 1.3.0 and 1.3.90 (master:360dca5).
Fixes T529
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Send events to properly focused surface.
Fill in missing parts of the event structures (ev->root, ev->multi).
Signed-off-by: Chris Michael <cp.michael@samsung.com>
When deleting the drag, free any dupped strings.
Hopefully this fixes Phab Ticket T471. Don't know for sure as I cannot
reproduce the crash here :/
Signed-off-by: Chris Michael <cp.michael@samsung.com>
them else wayland segfaults (internal wayland code does no safety
checks). Also, Fix some formatting while I am here...
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This adds support for Windows logo, caps lock, num lock, scroll lock
and AltGr as keyboard modifiers
Signed-off-by: Chris Michael <cp.michael@samsung.com>
These two APIs will save the title and class_name inside
Ecore_Wl_Window, so if they are called before the shell surface is
created, the stored names will be used later when the window is finally
shown (shell surface is created).
This way we are also hiding the shell surface from ecore_evas modules.
This is a configure event info, so put it in the right place. Some
places adding edges info were also removed, which means that they were
redundant.
Tested with <Meta> + middle click resize, and with window border resize,
on all the edges. Apparently, nothing breaks.
It's mostly only used inside ecore_wayland library anyway.
The only bit needed outside of the library is the "seat" pointer, but a
new function was added to retrieve such pointer from Ecore_Wl_Input.
This struct is only used inside ecore_wayland itself, so there's no real
reason to expose it. Apparently, hiding it doesn't break anything,
except for the ecore_imf wayland module, which was easily fixed.
If anyone notices a breakage, please let me know.
This centralizes the place where we have to wait for the init to have
finished before first using the compositor. It's also part of the later
step of hiding Ecore_Wl_* private structs.
At the end of the ecore_wl_init() function, send a sync request to the
server, and add a callback listener to the "done" event. When this event
is received, we are sure that all the registry bind requests done so
far were processed already, and that the registry and globals are
available and can be used.
Now, on the functions that request interfaces or registry, we call
_ecore_wl_init_wait(), which will check if the callback was received
already (that means that all requests inside the init were processed).
If it was not yet, then we wait until receiving that callback, before
returning the requested data.
Is there a title for the commiter with the longest revert of a revert list?
I screwed this one up. Had other local changes that sneaked in.
Resetting and doing it right now.
This reverts commit ee155b771d.
You can bet on reverting makes people speed up the process in fixing it.
Revert the revert here now that Cedric fixed it in eina.
This reverts commit 875e7cf74d.
Phab Ticket T359
https://phab.enlightenment.org/T359
NB: When setting the window opaque region, take into account any
existing window rotation, and set opaque region accordingly.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
NB: Needed so that we can reset the opaque region if alpha_set is
being toggled on/off all the time.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Removed 2 Eina_Rectangles from window structure as we only use width &
height anyway, so we can store those as ints.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
as being set, then get out.
This reduces unnecessary calls to resetting the input & opaque regions
if nothing has changed in terms of size.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
events.
NB: xkbcommon automatically converts the pressed key to Upper if Shift
is pressed. this is a problem as ecore key down events expect them to
be lower-case (not converted yet).
NB: Fixes Phab Ticket T232.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
NB: Apparently, setting these functions to NULL in the listener Does
Not Work anymore ! :( (used to work just fine).
NB: This makes EFL Apps work again inside Weston with latest from git.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
ecore_evas_object_cursor_set), assign the pointer properties to the
window structure so they can be applied on pointer_enter events.
NB: Phab T230
Signed-off-by: Chris Michael <cp.michael@samsung.com>
During a pointer_enter event, if the window was assigned a custom
cursor, respect it. By default we will still set left_arrow initially,
but if the window was assigned a custom cursor, use it.
NB: Fixes Phab T230
Signed-off-by: Chris Michael <cp.michael@samsung.com>
NB: This is used in a case where someone calls
ecore_evas_object_cursor_set on a specific window. The generic
pointer_enter code for a window initially sets the cursor to
left_arrow by default. When the above function is used, and a pointer
enter event occurs, the cursor assigned from the above function was
not being respected.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
due to code reuse and is not needed from the client side anyway).
Add function for setting "server mode" (this will allow us to avoid
any display_iterate calls which would block our compositor).
Signed-off-by: Chris Michael <cp.michael@samsung.com>
during dnd operations (by setting surface_user_data to buffer)
NB: This bug was fixed in Weston, so this workaround is not needed
anymore
Signed-off-by: Chris Michael <devilhorns@comcast.net>
The "compose" component of the ecore input events must be translated to
the correct value when CTRL keys are pressed. This implementation was
copy & pasted from the xcb backend.
Also changes the default window type to ECORE_WL_WINDOW_TYPE_TOPLEVEL as it is
the most used case. If someone needs another type, set it manually.
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
When destroying window, also destroy animator callback.
Change ecore_wl_window_damage function to Only do damage.
Add separate ecore_wl_window_commit function to push those accumulated
damages.
In ecore_wl_window_surface_create, if the window already has a
surface, return that ... Not Null.
During window show, only create a shell_surface if it does not Already
exist.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
keypress, but rather Only on they actual modifier event.
Add some printf debugging for Non-Printables like Ctrl, etc
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Set surface_user_data in attach function to be the buffer we are
attaching (NB: Expected by some compositors like weston).
Signed-off-by: Chris Michael <cp.michael@samsung.com>
not function.
Add Dnd Offer and Dnd End events.
Add a new window type (dnd).
Add new functions for dnd
Signed-off-by: Chris Michael <cp.michael@samsung.com>
NB: This is needed because some compositors like Weston are expecting
the wl_surface user_data to be a buffer, not some arbitrary data.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
If this Ecore_Evas already has a mouse inside it, there's no need to
send an additional mouse in event.
Additionally, always send a mouse_move event before a mouse_down, so the
Evas pointer position can be updated properly before the mouse down.
Move this handling entirely into ecore_wl_window_update_size() and
create and set it whenever it is necessary. There's no need to keep a
pointer on the Ecore_Wl_Window struct.
Now the opaque and input regions are updated on ecore_wl_window_resize,
there's no need to call ecore_wl_window_buffer_attach() for this
anymore.
The checks on alpha and transparent flags were also fixed.
ecore_wl_window_update_size() is now called by ecore_wl_window_resize(),
reducing duplicated code.
Since we don't have a changed state callback on Wayland, just call the
changed_state callback of Ecore_Evas from the configure callback.
There's no need to add the Ecore_Job that will send the event later.
This makes the code cleaner, simpler, and will call the callback when
the configure event is received, which is a good place to check for the
changes.
not needed.
During buffer_attach, just call window_damage function which already
handles surface_damage & commit.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
It's implemented exactly the same way as on the X11 backend. It does
handle multiple devices, though may need some adjustments when
multi-touch is added, since there's no support for multi-touch on
EFL-wayland yet.
The wl_display_sync() request doesn't really wait for all the requests
to be processed, but instead sends a request for the "done" event.
Wayland relies on the fact that the requests are processed in order, so
when the "done" event is received, it means that all the other requests
requested prior to the respective "sync" have been processed already.
This commit makes the ecore_wl_sync() call actually wait for its "done"
event (thus blocking the ecore mainloop).
Width and height should be swapped when the screen is rotated by 90 or
270 degrees.
Additionally, add a command to the ecore_evas_window_sizes_example which
returns the screen geometry.
On some use cases, it is necessary to create a new wl_surface without
associating it to a wl_shell_surface. This new API makes it possible.
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>