Commit Graph

703 Commits

Author SHA1 Message Date
Chris Michael 7906537c02 send wl_touch events when we handle mouse buttons
Small patch to enable sending wl_touch down/up events when pointer
mouse button events are handled. This is needed in the case where we
do Not have any mouse pointer at all, but we do have touch support.

ref T5094

NB: This allows weston-simple-touch client to operate in Enlightenment
now. There is still something strange happening with EFL clients in E
wrt touch events tho...

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-17 11:31:48 -05:00
Mike Blumenkrantz 0c56e19a64 validate xdg-shell move/resize requests against latest button serial
these are supposed to match in order to initiate the corresponding action
2017-01-13 11:35:20 -05:00
Chris Michael c5ad11886c fix shadowed variable declaration
Eina_List *l is already previously defined at the top of this
function. Since we are just using it for list iteration, there is no
need to define it again.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-04 08:30:53 -05:00
Carsten Haitzler 652d7e113e e wl - fix build break with wl. 2016-12-16 22:03:17 +09:00
Carsten Haitzler 5c38609e0e client handling - add support for window stacks needed for views/manager
this adds core basic handling for window stacks where windows behave
correctly as a single unified stack something like what naviframe does
but out-of-window so you can including multiple processes. only on x11
right now as it's being supported/worked on.

as we dont plan to kepe naviframe in future, this is the way to go.
naviframe "pages" will be windows in a stack. the wm should do the
nice thing. in e this will be very nice. for now elsewhere we use
transient_for so a wm would treat this like a bunch of dialogs with a
single parent window. i guess in a desktop thats probably what you
might expect. e will be a little more "finesse" filled.

need to make ibar, tasks,m win menu and winlist (alt-tab) respect this
and only show the top member of a stack.

need to send messages to clients when they are "top" or "middle" or
"bottom" or "alone" in the stack or something so decorations can change.

should add soem new border signals in theme (for both SSD and CSD) to
make this look nice. will need some config additions for that and
ability for e comp to do the right thing

but this is a solid start
2016-12-16 16:17:10 +09:00
Mike Blumenkrantz ca7c77d05e fix internal wl windows to exit when border X is clicked 2016-12-05 10:49:06 -05:00
Chris Michael 4aba7e7beb remove unused variables in e_comp_wl
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-02 10:41:46 -05:00
Derek Foreman 41e60d251e Stop sending key up/down events on focus change under wayland
We shouldn't be doing this, but there's a collective memory that
this was put in place to fix stuck modifier bugs.

If we run into stuck modifiers again because of this patch, then we
should be fixing them in a different way.

If anyone bisects to this point, I apologize - assign me a ticket.
2016-12-01 10:55:49 -06:00
Mike Blumenkrantz 08ee9293df feed mouse move and canvas mouse up upon breaking a wl surface grab
ensure that the hw pointer location and the cursor location match after grabs

fix T4939
2016-12-01 11:22:42 -05:00
Derek Foreman 60617c82d7 More aggressively prune keyboard focus list
Even if a client is deleted we still need to get its resources off the
keyboard focus list.
2016-11-30 14:48:54 -06:00
Derek Foreman ce34c550e7 Fix crash when exiting an xdg shell application
The focus in timer has been firing for deleted clients, this causes a
NULL pointer dereference.

Then again, maybe the timer should've been disabled by now...
2016-11-30 14:48:54 -06:00
Derek Foreman 8245c1eb7a Fix keyboard tracking when leaving an xdg shell window
_parent_client_contains_pointer() shouldn't return true if there is no
parent client.  This could result in leaving stale resources in the
keyboard focus list and crash the compositor.
2016-11-30 14:48:54 -06:00
Mike Blumenkrantz ca5176e6fa handle input detection for wl surface grabs more accurately using stacking
this should more accurately handle cases where mouse movements over grabbed
surfaces are intercepted by overlapping windows
2016-11-30 12:46:54 -05:00
Mike Blumenkrantz f83045dc62 move the comp canvas cursor object during wl surface grabs
the struct member is not guaranteed to be the visible object, so get
the ee cursor and move that
2016-11-30 12:34:30 -05:00
Mike Blumenkrantz 19a902ec09 stack subsurfaces above their parents upon creation
handles the case where no explicit stacking is set on the subsurface
2016-11-29 10:11:23 -05:00
Mike Blumenkrantz e95541635e clarify some wl surface checks to require elm wins
these should not apply to role-less surfaces
2016-11-22 11:31:22 -05:00
Mike Blumenkrantz 7b7e56af0c require an elm win to apply auto-visibility for internal wins in wl surface commit
other internal surfaces could be things like cursors, and these should not be made visible
before setting a role
2016-11-22 11:31:22 -05:00
Mike Blumenkrantz 5497fadce4 xdg6 support 2016-11-22 11:31:22 -05:00
Mike Blumenkrantz 6f5feb99b2 remove wl client pixmap aliasing on del
not sure why I added this but it was wrong
2016-11-08 12:49:23 -05:00
Mike Blumenkrantz 886d29d5d5 unset wl client surface pointer on surface destroy
leaving this around after this point is dangerous and has a high probability
of crashing
2016-11-08 12:49:23 -05:00
Mike Blumenkrantz 1c4b11ef9f reset initial internal wl client states when hiding (but not deleting)
ensure that these windows are not able to be shown again until commits occur
2016-11-08 12:49:23 -05:00
Derek Foreman b5205a0ca3 Stop passing dimensions to _e_comp_wl_surface_state_init
The dimensions we passed were frequently wrong anyway, so let's stop
doing that.
2016-11-04 16:25:58 -05:00
Derek Foreman a9d710ab27 Fix wayland opaque regions
Similar set of changes to the recent input region changes.  They may not
have been quite so broken to begin with, but it's probably less confusing
to treat both types of region the same way.
2016-11-04 16:25:58 -05:00
Derek Foreman 404a23f7d3 Fix massive wayland input region brokenness
It was impossible to set an empty input region.

Input regions were being clipped to the size of whatever buffer was
previously attached when they should really be clipped at commit
time to whatever buffer was attached in the commit.

The intersection operation created round off errors and
e_comp_object_input_area_set is clipping anyway, so we can simplify this
and retain precision.
2016-11-04 16:25:58 -05:00
Derek Foreman e74f2a45af Increase area of tilers for regions
We don't have any idea at this point what the region will be used for,
and tilers clip to their area on ingress.  If we're going to use tilers
for wayland regions we need to make them huge and clip them later.
2016-11-04 16:25:58 -05:00
Chris Michael d6c6961ab4 check if a client is internal or not before deleting
This fixes a crash where mousing back into internal windows would
cause a crash (from efl wayland mouse pointers).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-31 14:22:03 -04:00
Derek Foreman 30e9f45dfc Block session recovery for internal windows 2016-10-25 14:12:15 -05:00
Chris Michael 2c096f685c Revert "reset elementary softcursor config on shutdown"
This reverts commit bdd290591c.

Reverting this as we need to find a better way to handle mouse
pointers on EFL Wayland Clients.
2016-10-25 11:06:07 -04:00
Chris Michael d4b9ad591e Revert "disable elementary softcursor mode for wayland compositing"
This reverts commit f7592166eb.

Reverting this as we need to find a better way to handle mouse
pointers for EFL Wayland Clients.
2016-10-25 11:06:07 -04:00
Chris Michael bdd290591c reset elementary softcursor config on shutdown
This is needed because if we shutdown E then try to run EFL apps in
Weston, the Elm Softcursor mode would have been saved as 'off' so we
should be sure to reset this.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-25 07:44:41 -04:00
Chris Michael f7592166eb disable elementary softcursor mode for wayland compositing
This commit disables elementary softcursor mode when running as a
wayland compositor. This stops any EFL Wayland Client apps from
creating their own mouse pointer and thus we do not have 2 mouse
pointers on EFL apps anymore.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-24 13:52:09 -04:00
Derek Foreman e4da5ba56a Auto generate wayland protocol
Replaces any checked-in wayland protocol files with auto-generation.

In some cases this means renaming include files that didn't use "standard"
names, or adding missing xml files.  Any source edits are simple search and
replace, there should be no functional changes.
2016-09-26 15:23:50 -05:00
Derek Foreman c528245469 Don't send keyboard leave events to unfocused clients
This fixes a problem when focus moves between two xwayland clients.

My testing of gtk applications shows no regressions, bug if xdg_shell
popups start behaving oddly again, look here first.
2016-08-26 12:05:58 -05:00
Mike Blumenkrantz 3a561bb00a ignore xwl clients when flagging wl surfaces as internal
fix T4430
2016-08-26 10:51:20 -04:00
JengHyun Kang dca5cc2fa0 e_comp_wl: break from meaningless loop
Summary:
kbd.keys are only added from e_comp_wl_key_down().
         And in that function, duplicated keys are not add in the list.
         So only one key is going to be in the list.

Test Plan: Watch kbd.keys list during key press / release.

Reviewers: raster, devilhorns, zmike!, ManMower

Reviewed By: ManMower

Subscribers: duna.oh, input.hacker, cedric

Differential Revision: https://phab.enlightenment.org/D4230
2016-08-17 10:22:37 -04:00
Mike Blumenkrantz 3b21839615 clear wl subsurface data during delete only if subsurface is not also deleted
fix T4297
2016-08-08 11:38:32 -04:00
Derek Foreman 926d9ab6d8 Fix test for object visibility when deleting wayland clients
In the very last commit I got the visibility check wrong.

ref 0680250d72
2016-07-21 14:29:20 -05:00
Derek Foreman 0680250d72 Fix wayland clients not deleting when they're hidden
We kept an extra reference for wayland clients and dropped it on their final
render to stop crashes.  However, if they're not on screen at the time of
their deletion this reference still needed to be dropped.

Fixes clients remaining on the deskmirror after dying on another desktop.
2016-07-21 13:11:37 -05:00
Derek Foreman 248fa6d1e6 Fix xdg_shell focus logic
Moves and resizes tripped up the new xdg focus logic, so test if the
focus is leaving the client entirely before trying to determine if it's
leaving into a parent surface.
2016-07-13 16:03:55 -05:00
Derek Foreman e32db0e7e3 Make sure the same keyboard resource doesn't end up on the focus list twice
This stops recent xdg_popup focus tracking changes from causing multiple
key events to be sent to the focused client.
2016-07-13 16:01:51 -05:00
Derek Foreman 963afc8fea Properly send kbd focus to xdg_shell popups
Oops, a client can have multiple top level windows.

ref f391a0fb67
2016-07-08 16:12:43 -05:00
Derek Foreman f391a0fb67 Fix xdg_shell keyboard enter/leave events
On xdg_shell we should only ever send enter/leave to top level surfaces
or GTK becomes sad.
2016-06-29 16:23:41 -05:00
Derek Foreman ada8e2deac Don't send keyboard leaves to unmapped wayland surfaces
There are actually toolkits that create surfaces, do nothing with them,
and destroy them.  Sending keyboard leave events for this causes problems.

Fixes a bug in handling of some GTK popups.
2016-06-29 16:21:49 -05:00
Derek Foreman 27e9845abd Only unignore a client on the first commit with a buffer
Otherwise, if a wayland client does its first commit without a buffer
attached it will confuse our focus logic.
2016-06-29 13:20:37 -05:00
Mike Blumenkrantz cefcc5248f add some hacks to route mouse events to wl popups correctly while mouse is down
in a choice between fixing a corner case popup behavior and breaking dnd
or having functional dnd and adding hacks to fix corner case popup behavior,
adding more hacks was the obvious correct solution

ref 03a4ecbdb0
2016-06-24 11:31:02 -04:00
Mike Blumenkrantz 4852a6903b remove unused event info from _e_comp_wl_mouse_out() 2016-06-24 11:31:02 -04:00
Derek Foreman eb94710146 Don't try to send surface presence events for zones with no wayland output
Avoid that NULL pointer deref.
2016-06-24 10:05:18 -05:00
Mike Blumenkrantz 99e4f8452b don't set need_maximize during wl commit maximize
this breaks the maximize!

partially reverts b5576dbb8c
2016-06-22 12:30:01 -04:00
Derek Foreman 19817b47de Send wayland surface enter and leave events
These events are supposed to be sent to clients that have bound wl_output
and manipulate surfaces.
2016-06-21 12:33:49 -05:00
Derek Foreman 3ff5e8dff4 Track wayland outputs for zones 2016-06-21 12:33:49 -05:00
Mike Blumenkrantz b5576dbb8c use separate flag for pending wl client unmaximize
also set flag to prevent saved geometry from being overwritten
2016-06-20 16:04:10 -04:00
Mike Blumenkrantz 771f71e6a9 add separate mouse in/out handlers for internal wins
internal wayland windows are windows with ssd, meaning they can only receive
pointer events on the contents of the window and not the entire window including
decoration regions

ref T3819
2016-06-13 12:00:09 -04:00
Mike Blumenkrantz 48ee824c63 only block mouse-out callback for wl action clients if the mouse is grabbed 2016-06-01 13:11:20 -04:00
Derek Foreman 2d1802375d Add DMABuf support for wayland
This adds compositor handling of DMABuf buffers.  DMAbuf capabilities
are advertised for the drm back-ends, and DMAbuf buffers are handled
as native surfaces.
2016-05-18 12:05:34 -05:00
Chris Michael b5e47665bb stop filling logs with buffer transform/scale spam
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-15 10:47:53 -04:00
Mike Blumenkrantz d3ba524a62 use window id for internal window pixmaps again on wayland
this was breaking internal windows when more than one was open, and
especially if any were open which had a parent-child relationship, by
using the same id for all internal window pixmaps
2016-05-11 15:40:10 -04:00
Mike Blumenkrantz 45e872ddf1 set E_Client->override flag for internal wins as needed 2016-05-11 15:40:10 -04:00
Mike Blumenkrantz 8d4a75575c remove some cruft from _e_comp_wl_client_cb_new() 2016-05-11 15:40:10 -04:00
Mike Blumenkrantz 2d85b8f111 ensure int64_t is used in all cases for wl pixmap ids 2016-05-11 15:40:10 -04:00
Mike Blumenkrantz e2390bebff only load wayland-specific modules on startup if they have been built 2016-05-10 14:18:09 -04:00
Mike Blumenkrantz e4f3179731 block keyboard sending for wl clients if a compositor grab is active
fix T3599
2016-05-10 13:00:01 -04:00
Mike Blumenkrantz 411f378998 flag wl surfaces as internal during create() based on pid matching
fix T3596
2016-05-06 13:52:10 -04:00
Mike Blumenkrantz ef1772b8cb implement wl client session recovery
another small feature patch brought to you by insomnia

 #SamsungFeatures
2016-05-05 15:47:55 -04:00
Mike Blumenkrantz 32cf7162ed ensure lifetime for wl client focus timer
fixes some focus-out crashing
2016-05-03 20:27:02 -04:00
Mike Blumenkrantz 049deb2c12 directly load extra wl modules during compositor init
speed++++++++
2016-04-28 17:58:45 -04:00
Mike Blumenkrantz 2c1e864fbc move wayland surface E_Client del check to a place where it's more useful
completely breaks wayland on first commit? off to an auspicious start!

ref d9679f765f
2016-04-26 08:58:50 -04:00
Derek Foreman d9679f765f wayland: Fix crash when attempting to create surfaces for deleted clients
Internal clients can be deleted by keybind before the surface create
callback fires resulting in a NULL pointer dereference.
2016-04-25 16:40:32 -05:00
Mike Blumenkrantz 08cb34f7ad ensure that wl clients do not run extra render on hide twice
fixes crash when applications crash
2016-04-21 13:55:23 -04:00
Mike Blumenkrantz 6aee63d1dc redo wl (xdg)shell surface ping
- remove (wrong) global variables which tracked client-specific resources
- start ping upon creating a shell surface
- track client-specific shell resources on a per-client basis
2016-04-18 15:37:22 -04:00
Mike Blumenkrantz 40af8d5193 reject xwayland clients in wl client resize handlers
fix T3461
2016-04-18 13:15:09 -04:00
Mike Blumenkrantz 005ad4e986 fake client-side geometry during wl (un)maximize interception
fixes internal window maximize
2016-04-11 13:41:19 -04:00
Mike Blumenkrantz 63af4ea865 buffer server-side (un)maximize commands to ensure synchronization in wayland
maximize is client-initiated and compositor-enforced in wayland, meaning that a
maximize should only be acted upon in the compositor after the client has
acknowledged that it has transitioned into the maximized state (likely removing
part of its csd region) and has resized itself to match the expected maximize
size

fix T3297
2016-04-08 16:08:32 -04:00
Mike Blumenkrantz b0f2443042 improve behavior of wl client buffered state changes during commits
apply e_config maximize policy for buffered (un)maximize, unset buffered states
after applying them
2016-04-08 16:05:00 -04:00
Mike Blumenkrantz 9578ae615f do not force wl client state update (configure) on (un)maximize done cb
this is spurious
2016-04-08 16:04:19 -04:00
Mike Blumenkrantz b17999de8d do not sent wl *shell configures from resize callback during maximize
this is spurious
2016-04-08 16:03:28 -04:00
Mike Blumenkrantz 9516031e93 only apply buffered wl client maximize during configure if client is not maximized
fixes directional maximize
2016-04-07 14:00:25 -04:00
Mike Blumenkrantz 657bc713c7 don't send duplicate configure to wayland clients during unfullscreen
this causes unnecessary client-side resizing
2016-04-07 13:56:03 -04:00
Derek Foreman b8ab7b0738 Remove unwanted debug detritus from last commit
#Oops

Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2016-04-07 13:29:58 -04:00
Derek Foreman 68587276cf Clean up some header inclusion
Including certain headers in the wrong order can cause problems if
we're configured to use beta api (right now wayland forces this).

In most cases we should just be including e.h and not the individual
EFL headers anyway.  This fixes some of that.

fix T3426, T3428
2016-04-07 13:14:43 -04:00
Mike Blumenkrantz 7e3c2b08ec move buffered maximize/fullscreen for wl clients to occur before csd update
this ensures that all such operations calculate based on the correct csd state
2016-04-06 16:42:10 -04:00
Mike Blumenkrantz 992e04feb2 wayland client maximize/fullscreen cleanups
ref da74e690f0
2016-04-05 16:54:04 -04:00
Mike Blumenkrantz da74e690f0 redo xdg shell to enforce double buffering of client-side configure serials
xdg shell configure states (maximize, fullscreen) return a client ack when the
client has applied the state. the ack, followed by the next surface commit,
indicates that the surface is ready to be transitioned into the configured state
2016-04-05 15:05:10 -04:00
Mike Blumenkrantz d50a20f812 do not send shell configures for deleted wl clients 2016-04-05 15:04:35 -04:00
Mike Blumenkrantz a99d505771 set WAYLAND_DEBUG=0 during wl compositor init
ensures that debug logs won't get both compositor and client output,
making the log impossible to read
2016-04-05 15:03:26 -04:00
Mike Blumenkrantz e4960ad652 set ELM_ACCEL=gl upon successfully creating a gl wayland compositor
...successfully

ref 4aecb7ad14
2016-04-04 16:06:52 -04:00
Mike Blumenkrantz ed6448eb21 send fake www data during maximize 2016-04-04 14:03:17 -04:00
Mike Blumenkrantz 687b5fb6b6 set maximizing flag during maximize resizing for wl clients
a helpful indicator for when to avoid potentially leaking positioning info
2016-04-04 14:02:39 -04:00
Mike Blumenkrantz 3f7e6dc359 wl popup surfaces should not receive focus on show if parent is not focused
fix T3339 harder
2016-04-04 12:51:29 -04:00
Mike Blumenkrantz b9b9ed68b0 remove video child references from wl compositor
this is an x11-only thing
2016-04-04 12:51:20 -04:00
Mike Blumenkrantz dead7646d4 delete internal wayland elm windows in wl client delete request callback
fix T2874
2016-04-01 16:48:50 -04:00
Mike Blumenkrantz 4aecb7ad14 set ELM_ACCEL=gl upon successfully creating a gl wayland compositor 2016-04-01 15:14:46 -04:00
Mike Blumenkrantz c70054174e implement www wayland extension handling for clients
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2016-04-01 06:29:49 -04:00
Mike Blumenkrantz 607975ccc0 enforce wl xdg popup stacking relative to parent stacking 2016-03-31 14:05:47 -04:00
Mike Blumenkrantz 772163fe3e force keyboard modifier update on wl client focus-in
ensure that clients always receive up-to-date modifiers when they get focus
2016-03-31 11:21:23 -04:00
Mike Blumenkrantz d7f7eb9448 redo wayland client unignore mechanism
wayland clients were previously set as ignored until they obtained
a shell surface in order to avoid early execution of things like placement.

this had no effect.

the ignore must last until the first commit, at which point surfaces have been
sized and can be placed accurately without needing to move the surface around
a lot of times due to resize/frame adjust/birthdays
2016-03-24 16:43:32 -04:00
Marcel Hollerbach a7c659e258 wl: remove useless calls to e_comp_wl_input_keymap_set
those calls are not needed anymore since they will be overriden by e_xkb
init which takes place a few calls later
2016-03-24 20:54:03 +01:00
Marcel Hollerbach ab4e4e17cb e_comp_wl: allow variants and options for keyboard settings
Also set options and variants to the rule names struct.
There is no need to use strdup here the values are just freed in the
end.
2016-03-24 20:54:03 +01:00
Mike Blumenkrantz 5d27befe44 send resize edges to wl clients on resize start and end 2016-03-23 16:03:33 -04:00
Mike Blumenkrantz a658c785c3 ignore xwayland clients in wl client delete request callback
this breaks the compositor!
2016-03-21 12:13:27 -04:00
Mike Blumenkrantz 952d2c1d25 hide wl clients before deleting them when surface is destroyed
clients without hide animations will fail to run cleanup operations during
hide if they are not marked as deleted
2016-03-17 14:09:08 -04:00
Mike Blumenkrantz d08abd43fd adjust wayland client coords by window_geometry during first surface commit
fixes first window positioning
2016-03-15 16:12:05 -04:00
Mike Blumenkrantz 885d24eeab unify client post_updates management code into single function 2016-03-14 14:27:15 -04:00
Mike Blumenkrantz 1a91486083 always send wl key releases if surface still exists
fixes stuck keys for wl_clients with multiple surfaces
2016-03-12 12:40:39 -05:00
Mike Blumenkrantz b2107ae2b0 remove maximize_pre flag from wl client comp_data
this breaks modification of maximized size for surfaces as well as animations

fix T3297

partially reverts 0321fd690e
2016-03-12 11:18:10 -05:00
Mike Blumenkrantz 57f62675cc make wayland client keyboard focus list pruning more robust
this should handle all possible cases where focused keyboard resources
need to be removed from the global list
2016-03-10 15:18:47 -05:00
Mike Blumenkrantz f91ed81cd1 run focus-out and mouse-out wayland client callbacks for deleted clients
this fixes a number of issues caused by clients not cleaning up on deletion

ref 3e9029ea08

 #YouAlwaysRememberTheFirstTimeYouBorkedTheCompositor
2016-03-10 14:47:41 -05:00
Derek Foreman ff70943f76 Fix wayland hide for internal windows
We need to make sure we drop reference on all exit paths through the
hide callback - somehow this only seemed to break internal windows.

ref 65166c5a36
2016-03-10 12:19:32 -05:00
Derek Foreman e4490c4bf6 Re-enable window close animations for wayland
These should work properly with the new buffer management code.
2016-03-08 12:46:32 -05:00
Derek Foreman 36586fbf9c Remove wayland buffer reference
This code is similar to code in weston, but doesn't really work properly
for us in E, since this can blow up buffers behind the async renderer's
back.

The rest of the reference code has been pushed into e_pixmap, so we can
kill this all now.
2016-03-08 12:46:32 -05:00
Derek Foreman dfc7c26ce4 Rework wayland buffer handling
We need to keep wayland buffers around even if they'll never be written
to again.  This is part of Buffer_Reference's task in weston, but we
already have our pixmap abstraction which can serve mostly the same
purpose.

Remove the "buffer reference" stuff from e_pixmap and replace it with a
kept buffer for the last commit.

Add shared memory pool references to keep pools from going away on us.
2016-03-08 12:46:32 -05:00
Derek Foreman 65166c5a36 Take an extra reference on wayland clients
We need to make sure wayland clients aren't deleted while the scene
graph has their data pointers, so we take an extra reference when creating
them.

We drop that reference by clearing the client's image data and putting it
in the render post_updates list.
2016-03-08 12:46:32 -05:00
Mike Blumenkrantz 8c969b5f5f remove some unused variables 2016-02-25 13:37:52 -05:00
Mike Blumenkrantz 6fe6fba44e redo wayland pixmap ids to use monotonic decreasing ints with no collisions
using pointers for this turned out to have some corner case collisions, so
now just use something totally unrelated to the surface to ensure uniqueness
2016-02-25 11:16:09 -05:00
Derek Foreman 625e417bb2 Remove wayland focus timer in delete callback
If we don't remove it now it could fire later when the structures
it depends on are already freed.
2016-02-18 12:40:52 -06:00
Derek Foreman b30c96e142 Use eina_list_merge instead of eina_list_move for wayland lists
We should use eina_list_merge for concatenating lists instead of
eina_list_move.
2016-02-18 12:31:31 -06:00
Derek Foreman 6a65d2a546 Protect the wayland frame callback list from corruption
The resource destroy callback for frame callbacks will walk the frame list
to remove itself.  When freeing that list we need to make sure the
resource destroy callback doesn't see the same list we're walking and
corrupt it.
2016-02-18 12:31:31 -06:00
Derek Foreman c373331f94 Remove wayland frame callbacks from subsurface cache on destruction
There are 3 places a frame callback could be hiding.  frames list,
pending.frames list, or subsurface cached.frames list.  We weren't
clearing it from the subsurface cache on destruction.
2016-02-18 11:51:10 -06:00
Derek Foreman 3e9029ea08 Ensure wayland clients haven't been deleted when processing callbacks
Summary:
It's apparently possible to trigger at least some of these by interacting
with a client as it's closing, so add a bunch of checks.

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3699
2016-02-16 16:41:03 -05:00
Mike Blumenkrantz 542079d841 move all wayland extension implementations into e_comp_wl_extensions.c
e_comp_wl.c getting a bit hard to manage already, future extension additions
are going to make it a lot worse
2016-01-22 16:25:29 -05:00
Mike Blumenkrantz 9245b1ec27 handle more mouse buttons in wayland
according to the "reference" compositor this is how it works
2016-01-21 16:28:25 -05:00
Mike Blumenkrantz fabf2de023 determine new_client state for xwayland clients using xwayland pixmap
in the case where the xwayland pixmap has previously been marked as usable,
the corresponding client is guaranteed to have gone through the new_client
eval. allowing a second eval will result in wrong geometries being set for
the window in some cases
2016-01-21 15:35:05 -05:00
Mike Blumenkrantz 3e8b5890bc enable surface visibility fallthrough for drag clients
more surfaces with no shell interfaces
2016-01-21 13:38:58 -05:00
Mike Blumenkrantz d689ab5e75 track wayland client mouse button states as a full button mask
sending a button release event to a surface which has not previously
received a button press yields strange results
2016-01-21 13:38:58 -05:00
Mike Blumenkrantz d33a12b434 remove _e_comp_wl_focus_down_set()
this function does nothing for wayland clients and never should have
been used in this file
2016-01-20 17:06:50 -05:00
Mike Blumenkrantz 9c23679bac reenable fallthrough surface (un)mapping for subsurfaces during commit
subsurfaces have no shell interface and rely upon the map state of parent
surfaces to determine whether they are mapped
2016-01-20 17:06:45 -05:00
Mike Blumenkrantz 039c08617e remove duplicate visibility setting blocks from wayland surface commit
this is already present (and identical) in state commit
2016-01-20 17:05:46 -05:00
Mike Blumenkrantz 1a47836723 always apply damages and input regions during wayland commit
mapped status is not relevant according to spec
2016-01-20 17:05:46 -05:00
Mike Blumenkrantz 97d8f26724 do not set focus in wayland client show callback for cursor clients 2016-01-20 17:05:46 -05:00
Mike Blumenkrantz fbedd9dcac automatically mark wayland cursor surfaces as visible during set_cursor
a cursor client should be shown/hidden as needed despite its lack of a
shell interface, and having a special flag to identify these types of
surfaces makes it easier to do that
2016-01-20 17:05:46 -05:00
Mike Blumenkrantz d4bbe0727e |= instead of = flag setting for want_focus during wayland surface commit
if want_focus has already been set, this check should not unset it
2016-01-19 13:52:07 -05:00
Mike Blumenkrantz 77485f322e improve focus setting during wayland client show callback
take_focus will only be handled if the new_client flag is set. in all
other casees, focus_set should be called directly

new_client flag implies changed flag
2016-01-19 13:51:05 -05:00
Mike Blumenkrantz 0a2442d3b7 only do passthrough surface map on xwayland surfaces during commit
these was a workaround for handling early internal windows which is
no longer necessary now that they will handle their map states more
effectively

now, any wayland surface (not xwayland) requires a shell to map the
surface as intended
2016-01-19 13:46:29 -05:00
Mike Blumenkrantz 092c834c5e Revert "Fix issue of compositor surface create passing wrong parameter to"
This reverts commit 67170f40a1.

this was changed intentionally to use the resource pointer in order to fix an
issue where external clients would reuse the same surface id,
thereby breaking the compositor with duplicate entries in the pixmap hash.

note, however, that internal windows in wayland DO use an int type pixmap id.
this is easily detected by checking the pid of the client for a window before doing
checks. this is necessary in order to be able to flag internal clients as internal
while still being able to match them with their surface id

also, uintptr_t is NOT indicative of an int type being used, it's an
int type which has the same size as a pointer, allowing casts between ints
and pointer.
2016-01-19 12:21:37 -05:00
Mike Blumenkrantz fbe959cccc remove need_reparent, reparented, first_damage flags from wl client comp_data
these flags, and related code, have no functional purpose in wayland
2016-01-19 12:10:49 -05:00
Chris Michael 67170f40a1 Fix issue of compositor surface create passing wrong parameter to
e_pixmap_new function

e_pixmap_new (when creating wayland windows) is expecting to get a
uintptr_t type passed into it (surface id). Previously we were passing
the entire wl_resource.

ref T3058

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-01-19 10:48:38 -05:00
Marcel Hollerbach 37ad839f51 e_comp_wl: only ignore ignored clients
a override client (in terms of override like x) should get focus, which
would not happen for the case of the function call.
2016-01-18 22:26:51 +01:00
Derek Foreman 3304ea7b6c Remove inappropriate usage of %m
Summary:
printf %m stringifies and prints errno.  This is actually hugely confusing
if used in error messages after failures that don't set errno.

You may get "Success", or you may get an errno that was harmless ages
ago.

Some of the functions followed by %m have only some error paths that
set errno, or make multiple system calls that can set errno
independently - knowing the errno at failure time is unlikely to be
useful in these cases.

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3571
2016-01-14 12:41:47 -05:00
JengHyun Kang bdb462e19f Set cached xkb context/keymap
Summary:
Set xkb context and keymap to Ecore_Drm.
         In enlightenment (used in wayland with drm backend), keymap is used only one.
         So for avoid unnecessary open keymap files, set cached context and keymap.
         But for this, enlightenment must compile keymap before init ecore_drm.
         So I changed booting sequence also.

Test Plan: Distinguish time between before and after during add a keyboard device.

Reviewers: raster, devilhorns, zmike

Subscribers: cedric, input.hacker, ohduna

Differential Revision: https://phab.enlightenment.org/D3504
2016-01-05 13:07:27 -05:00
Mike Blumenkrantz 3d3484739c call ecore_wl2_shutdown() in wl compositor delete callback
shutdown/restart crash--
2015-12-23 12:25:42 -05:00
Derek Foreman 2e2205dbcb wayland: Add support for wl_surface.damage_buffer
Summary:
damage_buffer posts damage in buffer co-ordinates instead of surface
co-ordinates.  For us currently these are always the same co-ordinate
spaces.  This will change when we start supporting viewports and
transforms.

Note: this is currently conditional on the macro
WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION which isn't in any
released wayland, but will be in the next.  We can remove
the ifdefs and change our wayland version dependency when
it's released

 #NefariousHiddenAgenda

Reviewers: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3468
2015-12-18 16:43:38 -05:00
Stefan Schmidt 46fbcd3f9b e_comp_wl: follow wayland session recovery namning change from efl.
Align out extension naming with other unstable wayland protocols.
No functional change, just rename.
2015-12-18 14:49:41 +01:00
Mike Blumenkrantz 09efa26653 set wayland new client focus based on accepts_focus and !override
seems to resolve some cases where focus is not applied to new clients
2015-12-10 13:37:52 -05:00
Mike Blumenkrantz 1313f64aa9 make e_comp_wl_surface_attach static and take a surface state
when attaching a buffer, it's necessary to have the state available
in order to pull the buffer data into the state for use during commit

fixes subsurface frame callbacks
2015-12-10 13:30:18 -05:00
Mike Blumenkrantz 83777909b2 do not drop subsurface buffer early after commit from cache
this should work the same way as a normal surface
2015-12-10 13:29:58 -05:00
Mike Blumenkrantz a010138dcc apply already-committed wayland subsurface positioning after parent surface move 2015-12-10 10:32:31 -05:00
Mike Blumenkrantz 1b240c5b63 enforce wayland subsurface stacking order when parent surface is restacked 2015-12-10 10:32:31 -05:00
Chris Michael f5741f1cb4 Fix using global ewd variable by making it part of e_comp_wl
ref T2919

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-09 13:16:48 -05:00
Chris Michael 36b6a402c6 Try to init (and error check the init) of ecore_wl2 library before we
create a compositor

ref T2919

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-09 13:16:48 -05:00
Mike Blumenkrantz f005ac9bff create wl client connection during compositor init, use in shot module
fixes shot module

ref T2919
2015-12-09 13:16:48 -05:00
Mike Blumenkrantz c22ddd6039 call ecore_wl2_init() during compositor init
ref T2919
2015-12-09 13:16:48 -05:00