IVI-Shell is a wayland shell implementation for in-vehicle infotainment.
Summary: This is a set of patches proposed to implement IVI-Shell (https://phab.enlightenment.org/T1552).
Reviewers: ntanibata, devilhorns
Subscribers: mbachmann
Projects: #efl
Differential Revision: https://phab.enlightenment.org/D1350
@feature
Summary:
Wayland client doesn't need to destroy previous data_source when client requests for selection_set,
because there is "cancelled" event by wayland server to notify clients that the data_source is not used more and has to be destroyed.
Before receiving the "cancelled" event, client cannot recognize that it is useless or not.
Even if the client wants to create new data_source, wayland server can choose previous data_source rather than new one.
Test Plan:
1. Launch weston
2. Launch "elementary_test -to entry5" on weston
3. Try to copy & paste
Reviewers: devilhorns
CC: cedric, gwanglim
Differential Revision: https://phab.enlightenment.org/D1152
The _ecore_wl_cb_handle_data callback only has the flag for ECORE_FD_READ
set while the callback funtion also monitors and acts on writes. I wonder
if and how that worked before.
@fix: There is no use for an input cursor surface if the seat does not
have the pointer ability (for kiosk cases, or touch-only cases where
a pointer is not created).
Signed-off-by: Chris Michael <cp.michael@samsung.com>
@bugfix: Store the input region into the window structure, and don't
re-add a duplicate input region (done by comparison of saved region).
Signed-off-by: Chris Michael <cp.michael@samsung.com>
unnecessary calls to surface commit.
@bugfix: We don't need to call surface_commit if we are just setting
the opaque (or input) region(s). This reduces some overhead on the
compositor side (and thus reduces useless redraws). Also, optimize
opaque_region_set to not Reset to the same region; we do this by
storing the opaque region into the window structure, and on calls to
opaque_region_set we can compare those values and not re-apply the
same opaque region.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Since we already check the button pressed state in the 'if' above
this, there is no need to check it again.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
@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>
Maximized/fullscreen will handle the repositioning of the window by
themselves, and restore the window to its original position when coming
back from that state. So there's no need to use the edge information and
manually adjust the window offsets.
SVN revision: 83779
Don't send only the mouse button stored inside input->button, since more
than one button may be pressed and unset the input->button when
unpressed.
SVN revision: 83647
This should return the pointer to the list, to get the desired behavior.
Fixes ticket #2252.
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
SVN revision: 83644
Add #ifdef __cpluscplus to Ecore_Wayland.h so the API can be used by C++
programs. Add accessors for the wl_registry and the globals list.
Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
Patch by: "U. Artie Eoff" <ullysses.a.eoff@intel.com>
SVN revision: 83642
This will allow it to report to Ecore_Evas that the window has changed
its state. Elementary uses this to update its maximized/fullscreen/other
window states internal information.
The code that uses this callback is also added to Ecore_Evas.
SVN revision: 83625
Store the wayland registry globals in a list so that we can bind to them from a
user/test program. When a custom interface (protocol extension) is used in a
wayland compositor, this allows user/test program to use that interface. For
instance, one might provide a custom wayland test protocol that give access to
otherwise hidden/missing functionality that allows effective automated testing
(in wayland engines). See the Weston unit test suite for an example of this
concept.
Patch by: "U. Artie Eoff" <ullysses.a.eoff@intel.com>
SVN revision: 83312
When compiling a C++ program that includes Ecore_Wayland:
Ecore_Wayland.h:56:14: error: use of enum ‘_Ecore_Wl_Window_Type’ without previous declaration
Ecore_Wayland.h:56:56: error: invalid type in declaration before ‘;’ token
Ecore_Wayland.h:57:14: error: use of enum ‘_Ecore_Wl_Window_Buffer_Type’ without previous declaration
Ecore_Wayland.h:57:70: error: invalid type in declaration before ‘;’ token
This patch fixes ticket #2217.
SVN revision: 83310
Date: Sat, 5 Jan 2013 10:50:19 +0800
Subject: [PATCH] ecore-wayland: Improve opaque setting logic.
1. Update win->region.opaque in ecore_wl_window_update_size, so that
the opaque info is synced with the geometry.
2. Add win->surface checking in ecore_wl_window_buffer_attach
before send any wl_surface related request, it will avoid segfault
in case that calling ecore_wl_window_buffer_attach() before
ecore_wl_window_show().
Signed-off-by: Christopher Michael <cp.michael@samsung.com>
SVN revision: 82385
1. Update win->region.opaque in ecore_wl_window_update_size, so that
the opaque info is synced with the geometry.
2. Add win->surface checking in ecore_wl_window_buffer_attach
before send any wl_surface related request, it will avoid segfault
in case that calling ecore_wl_window_buffer_attach() before
ecore_wl_window_show().
SVN revision: 82384
In ecore_wl_init(), adding wayland display fd with ECORE_FD_WRITE
flag make CPU usage 100%. The proper way to monitor the ECORE_FD_WRITE
is when the wl_display_flush() return value < 0 and errno == EAGAIN.
And if wl_display_flush() return, we remove ECORE_FD_WRITE flag from
the display fd.
Change from v1:
Add idle enterer destroy code into _ecore_wl_shutdown() to avoid
using freed wl_display.
SVN revision: 81360
collateral damages that need further investigation. All programs running with
wayland engines are consuming 100% CPU.
ecore-wayland: Fix monitoring ECORE_FD_WRITE defaultly on
wayland display fd lead to 100% cpu usage
In ecore_wl_init(), adding wayland display fd with ECORE_FD_WRITE
flag make CPU usage 100%. The proper way to monitor the ECORE_FD_WRITE
is when the wl_display_flush() return value < 0 and errno == EAGAIN.
And if wl_display_flush() return, we remove ECORE_FD_WRITE flag from
the display fd.
Patch by: Alex Wu <zhiwen.wu@linux.intel.com>
SVN revision: 80981
wayland display fd lead to 100% cpu usage
In ecore_wl_init(), adding wayland display fd with ECORE_FD_WRITE
flag make CPU usage 100%. The proper way to monitor the ECORE_FD_WRITE
is when the wl_display_flush() return value < 0 and errno == EAGAIN.
And if wl_display_flush() return, we remove ECORE_FD_WRITE flag from
the display fd.
Patch by: Alex Wu <zhiwen.wu@linux.intel.com>
SVN revision: 80476