Commit Graph

707 Commits

Author SHA1 Message Date
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
Chris Michael 7870721cab port wayland compositor to use Ecore_Wl2
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-09 13:16:48 -05:00
Derek Foreman 81ff082e0d Stop using MIN macros when choosing versions for wayland resources
Summary:
libwayland-server.so will post an error if the requested version
is higher than the supported one anyway, so there's no point in
doing this.

Using MIN() to pick versions is a client side idiom.

 #kansas

Reviewers: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3385
2015-11-26 20:12:47 -05:00
Mike Blumenkrantz e8f4f30f40 adjust for SSD geometry during wayland client resize
client moveinfo includes the frame geometry, so this must be taken
into account when resizing a client which has a frame

fix T2863
2015-11-24 17:29:53 -05:00
Mike Blumenkrantz d32392760a always set wayland E_Client->redirected during client creation
fix T2846
2015-11-19 15:58:52 -05:00
Mike Blumenkrantz 4250a14861 set e_comp->gl for wayland compositors based on gl display bind success 2015-11-07 12:23:04 -05:00
Mike Blumenkrantz fc01d6a24c check for wayland egl extensions before starting a gl compositor
when running in software mode, evasgl performs no checking to determine
whether gl is available, leading to a crash due to missing extensions
2015-11-04 12:23:05 -05:00
Nicolas Aguirre a8bf439f88 Revert "Adds eglfs to Enlightenment"
This reverts commit ff1e7b5083.
2015-11-03 08:01:58 +01:00
Nicolas Aguirre 31ce65a2c4 Revert "Don't load xwayland if it isn't compiled"
This reverts commit 496ae3746f.
2015-11-03 07:57:56 +01:00
Florent Revest 496ae3746f Don't load xwayland if it isn't compiled 2015-11-03 07:50:21 +01:00
Florent Revest ff1e7b5083 Adds eglfs to Enlightenment 2015-11-03 07:37:41 +01:00
Mike Blumenkrantz ae6416c27c add wayland egl client support
definitely not a feature, I promise™
2015-11-02 16:25:02 -05:00
Mike Blumenkrantz e8bcf1016f use correct param ordering for setting wayland client frame geometry
function uses l,r,t,b and not x,y,xx,yy

fix T2624
2015-10-13 13:31:47 -04:00
Mike Blumenkrantz 60a1dfaf4f remove duplicate surface size update for wayland clients during commit
this has already happened in e_comp_wl_surface_attach()
2015-10-13 13:25:15 -04:00
Mike Blumenkrantz be49b11bd3 do not set frame geometry on frame-possessing wayland clients 2015-10-05 15:56:04 -04:00
Seunghun Lee 1ce8b362de clear the tiler for input region after setting to comp object.
Summary:
there is no need to set repeatedly input region even if it's already applied.
and this patch remove the code to clear tiler from client's unmapped case.
this fixes that tiler for input region is removed before applying it to comp object in case client is unmmaped yet.

Reviewers: devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3076
2015-10-05 12:47:29 -04:00
Boram Park b9b650806f should remove a frame resource from pending.frames list also
Summary: Signed-off-by: Boram Park <boram1288.park@samsung.com>

Reviewers: stefan_schmidt, gwanglim, raster, zmike, devilhorns

Reviewed By: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3079
2015-10-02 12:38:30 -04:00
Mike Blumenkrantz cdf6650a11 redo wayland client buffer referencing
the previous methodology was effectively:
attach -> ref(new buffer) x2 / unref(old buffer) x2
...
...
attach -> ref(new buffer) x2 / unref(old buffer) x2

this resulted in buffer management failures and crashing. now the
buffer gets 1x ref before render and 1x unref after render, ensuring
that the lifetime is accurate (assuming evas doesn't lie to us)

now we still have random crashing during resize, but not as much as
before
2015-09-29 18:53:15 -04:00
Mike Blumenkrantz 89a789fe3d redo CSD for wayland clients to use comp object frame geometry
this fixes issues with client placement and is a more native solution
than the previous hacks
2015-09-29 18:53:03 -04:00
Mike Blumenkrantz ba92337882 never mark wl client pixmaps as dirty or refresh them
this has no meaning for a wl pixmap in the current implementation
2015-09-29 16:35:30 -04:00
Boram Park 6d2572efc0 Creating wl_shm global object before creating other global objects
Summary:
  It's more useful for client to bind wl_shm before receiving other global
  object's events. Then, App can quickly prepare some buffers. i.e. cursor,
  etc.

Signed-off-by: Boram Park <boram1288.park@samsung.com>

Reviewers: stefan_schmidt, gwanglim, raster, zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3080
2015-09-23 09:15:53 -04:00
Chris Michael 7c595f7ea1 enlightenment: Fix formatting of Wayland compositor code so it is easily readable in 80 columns
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-09-03 11:16:07 -04:00
Stefan Schmidt 714b84308d e_comp_wl: create global and bind session_recovery interface
Before we can use the session_recovery protocol extension we need to register
its global and bind the interface to our implementation.

The callback for the provide_uuid call from the client is just a stub for now.
2015-08-26 16:09:25 +02:00
Mike Blumenkrantz 91ed3995f0 remove some local aliasing of e_comp_wl global 2015-08-13 16:08:55 -04:00
Mike Blumenkrantz 3f13b6889d replace existing usage of x/wl_comp_data with corresponding globals 2015-08-13 16:05:57 -04:00
Mike Blumenkrantz 32adc0e901 add e_comp_x and e_comp_wl globals
constantly typing e_comp->x/wl_comp_data-> is tiring
2015-08-13 16:01:08 -04:00
Mike Blumenkrantz 97f131582e add local event for wl_wl output to use when a global has been received 2015-08-12 20:18:43 -04:00
Mike Blumenkrantz 48be7016ad make wl client mouse button handler fn external 2015-08-12 15:12:03 -04:00
Mike Blumenkrantz 5bc8376fb5 break out wl client motion sending, force motion events during x11 drags
weird, but fixes xwl drag positioning
2015-08-12 15:11:59 -04:00
Mike Blumenkrantz edc2de32c1 use unmodified client geometry for new xwl clients during first surface commit
fixes a race condition where a configure request occurring before the xwl
client swap could fail to take effect due to xwayland bug where buffer size
is reported incorrectly
2015-08-12 13:45:19 -04:00
Mike Blumenkrantz 263794f42f only update wl dnd surface client if a wl drag is active 2015-08-10 18:59:02 -04:00
Mike Blumenkrantz c696fa7088 do not send wl dnd positioning updates to xwl clients 2015-08-07 21:07:34 -04:00
Derek Foreman f124f1bf6e wayland: force wl surface frame callbacks on commit for undamaged surfaces
Summary:
Doing it just for bufferless surfaces wasn't quite enough, sometimes
we get a sequence like: attach, commit, frame, commit

And we need to respond to the frame.

 #Kansas

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2934
2015-08-07 17:20:05 -04:00
Derek Foreman 15d13dad16 wayland: Always add frame callbacks to current state on commit
Summary: Previously we ignored it for unmapped surfaces.

Reviewers: devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2932
2015-08-07 14:52:33 -04:00
Mike Blumenkrantz cae58cea9f force wl surface frame callbacks on commit for bufferless surfaces
#Kansas
2015-08-07 13:48:21 -04:00
Mike Blumenkrantz a579c2ec36 force render update on wayland clients during commit
an unmapped wayland client must still run post-render code to execute
frame callbacks

fixes terminology initial render with efl from git
2015-08-06 19:40:10 -04:00
Mike Blumenkrantz 106dfe4e21 only attempt to provide wayland drag motion data if drag exists 2015-08-06 19:31:20 -04:00
Mike Blumenkrantz 3dca058dfa block wayland mouse button propagation to clients while drag is active 2015-08-06 19:31:20 -04:00
Mike Blumenkrantz 1beecb72d7 add server-side wl dnd
weston-dnd seems to work as expected
2015-08-04 19:39:09 -04:00
Mike Blumenkrantz 965d089c8a add more wl data device debug infos 2015-08-04 19:39:09 -04:00
Mike Blumenkrantz 616ca6583e apply wayland data device focus after focus has been set
the focus_set client hook is for setting focus, not for doing things which
must occur after focus has been set
2015-08-04 19:39:09 -04:00
Mike Blumenkrantz e5678549da track the current pointer focus client in wayland compositor 2015-08-04 19:39:09 -04:00
Mike Blumenkrantz acf5d09796 reject deleted clients from wl show callback 2015-08-04 19:39:09 -04:00
Mike Blumenkrantz 04fe354592 notidle the screensaver in wl compositor mouse move cb
fixes screen blanking while user is active
2015-07-30 16:35:51 -04:00
Mike Blumenkrantz de1d24021b set ELM_DISPLAY appropriately for wayland compositors 2015-07-30 16:29:25 -04:00
Mike Blumenkrantz 1496b3db7b don't reset wayland surface geometry for overrides 2015-07-29 15:38:17 -04:00
Mike Blumenkrantz e5d367292f return immediately on wayland focus-in key timer when no focused kbds exist 2015-07-28 17:36:13 -04:00
Mike Blumenkrantz c9e35cc0f9 do not call ecore_time_unix_get() on each key sending loop for wayland clients 2015-07-28 17:34:58 -04:00
Mike Blumenkrantz db41479414 fix x11 detection for wayland compositor setup
ref T2609
2015-07-28 12:32:50 -04:00
Mike Blumenkrantz 0d19a5914b apply csd sizing transform for wayland configure events
when not resizing, the sizes passed to configure should be based on the
window size and not the surface size. in order to calculate this, it's
necessary to keep track of the last-known window geometry for non-maximized
states and create offsets with which to calculate new sizes

this fixes directional maximizes as well as unmaximizing
2015-07-24 16:35:21 -04:00
Mike Blumenkrantz 9e4fe82fbc always send geometry to configure method for wayland clients when not resizing
failure to set this would lead to clients changing geometry when maximized while
focus state was removed
2015-07-24 16:34:18 -04:00
Mike Blumenkrantz 0321fd690e do not send duplicate configures for wayland clients during maximize
this seems to not have caused any real issues, but it made debugging
more of a pain and is unnecessary connection noise
2015-07-24 16:33:33 -04:00
Mike Blumenkrantz 5cbbe261d7 add a timer for wl client focus to delay held key input
this prevents keys from immediately being sent to newly-focused clients
and avoids the case of reverting focus from one app to another on keybind
close, only to have the second app also close immediately using the same keybind
2015-07-22 17:55:30 -04:00
Mike Blumenkrantz d38b2eb6b3 create/manage list of focused wl keyboard resources for reuse in kbd operations
this simplifies kbd code all over
2015-07-22 17:40:28 -04:00
Mike Blumenkrantz 43ed8dbdb5 set shell-less wl surface mapped state regardless of visibility during commit
new_client flag here will defer show operations, but the operations will complete
2015-07-22 17:09:14 -04:00
Mike Blumenkrantz 6dfc6da02c update wl keyboard resource key presses on focus in/out of surfaces 2015-07-22 16:59:23 -04:00
Mike Blumenkrantz 5c5fb11187 allow wl client focus-out callback to execute on deleted E_Clients 2015-07-22 16:28:48 -04:00
Mike Blumenkrantz 435bd8794a don't update wl keyboard state on client focus events
this is always up-to-date
2015-07-22 16:28:08 -04:00
Mike Blumenkrantz 9c1fca5a16 fix wl build 2015-07-22 12:24:35 -04:00
Mike Blumenkrantz 5c00c1009b redo wl compositor key eventing
* break out key callbacks into EINTERNs
* remove extraneous/unused mouse event handlers
* enforce wl modifier updating in all cases
* ensure keybinds are activated before wl clients receive input
  - block wl client input during grabs

fixes T2565
2015-07-21 14:27:29 -04:00
Mike Blumenkrantz 2ce5dfa33f add wl compositor desklock hooks to add grabs during lock 2015-07-21 14:25:16 -04:00
Mike Blumenkrantz 612a61ce0e don't mangle wl client opaque region tiler during commit clip 2015-07-20 14:38:31 -04:00
Mike Blumenkrantz 4acce00428 improve wl compositor tiler usage
pixman <-> tiler api naming seems similar but functionality is totally
different
2015-07-20 14:10:55 -04:00
Mike Blumenkrantz 552f065c09 zero out wl surface opaque region on commit in all cases
it's possible that the opaque ptr may exist but have no regions,
which will result in the previous frame's opaque region being used
2015-07-17 15:58:14 -04:00
Mike Blumenkrantz 6471ba0a05 do not update client list hint when creating a new wayland client 2015-07-17 15:30:30 -04:00
Mike Blumenkrantz fbe55d20f1 always set new wayland E_Clients to be ignored during client hook 2015-07-17 15:30:30 -04:00
Mike Blumenkrantz d5e25a8449 add wl_wl wl output module
it is now possible to create a xephyr window in a drm-enlightenment session,
launch wl-x11 enlightenment in xephyr, and then launch wl-wl enlightenment
inside that enlightenment

the primary limitation on this output module is that all internal windows will
appear in the outer compositor due to the current restriction of ecore-wayland
with regard to only having a single global display server connection

 #Inception
2015-07-17 15:30:30 -04:00
Chris Michael bf993c6eee e-comp-wl: Fix region_add and region_subtract functions to make sure we have accurate opaque regions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-17 14:58:34 -04:00
Mike Blumenkrantz 7859787f73 wl clients should not use edges during keyboard resize
ref T2452
2015-07-15 18:08:32 -04:00
Mike Blumenkrantz 17e878eca3 simulate netwm sync for xwl clients
blocks execution of resizes until the surface commit arrives. reduces
the race condition between resize and render and eliminates frame drops
during slow resizes
2015-07-15 13:58:03 -04:00
Chris Michael 9e2512eb98 e-comp-wl: Fix T2570: stuck key when closing efm windows
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-14 15:26:38 -04:00
Chris Michael e46c0812fc e-comp-wl: Fix getting end key during key down/up events
NB: This is actually an Oopsie from a previous commit that should not
have gotten in.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-14 15:10:38 -04:00
Chris Michael 116af14649 e-comp-wl: Update keyboard and modifier state AFTER we send them to clients
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-14 14:18:21 -04:00
Chris Michael 74e96f3826 e-comp-wl: Update keyboard key state regardless of client focus or not
Key state updates need to be consistent. As we update the key state on
key up regardless of client focus, then we should be doing the same in
the key_down event handler so that key state remains consistent.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-14 13:29:02 -04:00
Chris Michael 5052bd9266 e-comp-wl: Don't call keyboard_modifiers_update twice
e_comp_wl_input_keyboard_state_update already makes a call to
e_comp_wl_input_keyboard_modifeirs_update so there is no need to call
it twice on key up/down events.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-14 13:29:02 -04:00
Mike Blumenkrantz 697e1beda3 add wayland client post-render references in the render loop 2015-07-10 13:22:15 -04:00
Chris Michael f214d9d73b e-comp-wl: Create compositor screenshooter global and add function to actually handle taking shots
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-08 15:08:35 -04:00
Mike Blumenkrantz 53ff8b764f properly calculate client+frame sizes during wl surface commit 2015-07-08 14:46:12 -04:00
Derek Foreman 528d8b31fc Init some vars to NULL in compositor create
Summary: In some cases these end up uninitialized and we crash.

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2788
2015-07-02 17:54:40 -04:00
Mike Blumenkrantz c054506d4e block wl key events from reaching clients during client actions or key grabs 2015-07-02 14:30:54 -04:00
Mike Blumenkrantz 0a5e00488d set initial surface attrs for internal wl clients 2015-07-02 14:26:02 -04:00
Chris Michael 899899e35a e-comp-wl: Update modifiers on key down/key up events
NB: Fixes Ctrl+D problem here.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-01 14:50:28 -04:00
Mike Blumenkrantz 52fd0581fa temporarily toggle ignored flag during wl surface commit
ensures canvas operations succeed during commit in cases where
subsequent commits do not occur (eg. menus, popups, ...)
2015-06-30 18:34:16 -04:00
Mike Blumenkrantz 8644c88b39 fix typo in iterating pending xwl clients on wl surface creation 2015-06-30 18:33:38 -04:00
Mike Blumenkrantz f1f4489822 free all ec->comp_data ptrs in _e_client_del
need this to live through multiple del hooks, so simplify all code by
freeing in one place
2015-06-30 18:33:00 -04:00
Mike Blumenkrantz 629f07e510 only reject ec->ignored clients from wl mouse events
fixes input on overrides
2015-06-30 18:31:43 -04:00
Chris Michael 7cd07acad7 e-comp-wl: Release keys on key_up regardless if client has focus
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-06-30 15:58:41 -04:00
Chris Michael 9d2e1fbc85 e-comp-wl: Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-06-28 11:09:56 -04:00
Mike Blumenkrantz 2bf57d79af set shm engine for wl internal windows
this seems to be necessary for now to prevent crashing
2015-06-25 20:25:41 -04:00
Mike Blumenkrantz 2b38147c43 add hooking for WL_SURFACE_ID atom on XWayland windows and composite them
in order to maximize the amount of reused code the following details the current
process for xwayland compositing:

* get map request from window
* force reparenting
* show window
* await WL_SURFACE_ID x11 message
* move x11 client data + pixmap onto corresponding wayland client
* business as usual with wayland compositing

this is pretty similar to the method of the reference code in weston,
except that there's no x11 compositor in weston
2015-06-25 20:25:36 -04:00
Mike Blumenkrantz fab0b8122f don't call wl comp delete function twice on shutdown 2015-06-25 20:04:31 -04:00
Mike Blumenkrantz 5b63ce91dc comment out grabinput focus calls in wayland compositor
these did nothing, remove for now
2015-06-25 20:04:31 -04:00
Mike Blumenkrantz 412595dc60 set client visibility for shell-less wayland clients appropriately during commit 2015-06-25 20:04:31 -04:00
Mike Blumenkrantz 01a4273c38 use ctrl+alt+backspace hotkey in wayland compositor for all non-release builds 2015-06-25 20:04:31 -04:00
Mike Blumenkrantz 05a0602f6e unused variable-- 2015-06-25 20:04:31 -04:00
Mike Blumenkrantz d7c58215f4 set wl client surface pointer in surface create method
remnant from when clients were created by the shell
2015-06-25 20:04:31 -04:00
Mike Blumenkrantz eec5cf6a67 remove E_Comp_Data typedef, use backend-specific typedefs unconditionally
this turned into a bit of a charlie-foxtrot due to constant pointer aliasing
in the wl compositor codebase

no functional changes
2015-06-25 20:04:31 -04:00
Mike Blumenkrantz dbce320216 load wl_desktop_shell and xwayland after wl comp load 2015-06-25 20:04:30 -04:00
Chris Michael 571633a32b e-comp-wl: #if 0 out a currently unused function for pre_frame assignment.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-06-17 11:28:55 -04:00
Yomi 0dc33a5aeb Fix misspellings in E's files.
Summary: Fix misspellings and spaces in E's files.

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2676
2015-06-16 16:10:21 -04:00
Boram Park 5c46de06c6 e_comp_wl: fix not sending a mouse enter event to client.
Summary:
First of all, currently cdata->ptr.x,y contains e_client related pos.
But, cdata is owned by e_comp, not per e_client. So cdata->ptr.x,y should contain
absolute pos.
And, when a pointer resource is created, enter event should be sent to client.

Change-Id: I21cb031e293fe281e35ba89f3a96116a28a48856
Signed-off-by: Boram Park <boram1288.park@samsung.com>

Test Plan:
1. run e as wayland server
2. move cursor to around 50,50
3. run elementary_test
4. click the mouse left button on slide toggle widget.
   (Don't move a cursor out of elementary_test. If you do, you can't find bug)

Reviewers: gwanglim, raster, devilhorns, ManMower, zmike

Reviewed By: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2330
2015-05-18 11:53:05 -04:00
Chris Michael a2d22437fd fix call to e_comp_wl_input_keymap_set for building with
wayland-client support

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-18 11:48:31 -04:00
Derek Foreman 7f6f4b6966 wayland: Remove a lot of E_Comp_Data pointers
Summary: We should just use e_comp->wl_comp_data everywhere we can.

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2507
2015-05-18 09:08:52 -04:00
Derek Foreman e1c9bfa619 wayland-compositor: Set server mode
Summary:
If we don't set server mode we can deadlock when trying to use functions
that way for server mode to become set.

This can currently cause a startup freeze in e_scale_init().

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2520
2015-05-15 14:44:21 -04:00
Chris Michael fd2e05f715 drm randr: More work on getting RandR functional in E-Wl. This adds a
function to remove an output from e_comp_wl also.

NB: Not entirely complete yet

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-13 14:50:40 -04:00
Chris Michael ab9abcb598 remove unused 'serial' variable in mulit-move callback
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-13 13:20:33 -04:00
Chris Michael 3a15df2454 fix numerous compile errors from D2482
NB: Mental Note: COMPILE BEFORE PUSH !!

 # butts

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-13 12:26:07 -04:00
jhyuni.kang c59595e964 Support wl_touch and send wl_touch events to client
Summary:
Currently enlightenment-wayland support pointer and keyboard events.(in input)
         So I added EVAS_CALLBACK_MULTI_* event handler and hanling functions for wl_touch interface.
         This code send wl_touch events to client like a pointer event.

Test Plan:
In wayland + enlightenment environment, generate multi touch events.
           The enlightenment will be send wl_touch events to client.

Reviewers: raster, devilhorns, zmike

Reviewed By: devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2482
2015-05-13 12:05:57 -04:00
Chris Michael 57fdd5613d send screen paramaters in proper order to e_comp_wl_output_init
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-13 12:05:17 -04:00
Boram Park 7a078ba99b e_comp_wl: fix segfault in case parent's surface is destroyed before subsurface is destroyed
Summary:
A parent surface can be destroyed. In this case, ec->comp_data->sub.data->parent has
a wrong address which has already destroyed. Then, it occurs segmentation fault.
To avoid segfault, ec->comp_data->sub.data->parent should be NULL when a parent surface
is destroyed.

Signed-off-by: Boram Park <boram1288.park@samsung.com>

Test Plan: Run attached test program(subsurface)

Reviewers: gwanglim, cedric, devilhorns, zmike

Reviewed By: devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2484
2015-05-12 14:43:00 -04:00
Chris Michael 0a94e8ba71 enlightenment: Make E build again with EFL from git
sed -i 's/EAPI/E_API/g'

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 15:13:10 -04:00
Mike Blumenkrantz fd558491fd don't set e_comp->root for wl compositors
root is the root window. wl compositors do not have root windows.
2015-04-24 14:57:05 -04:00
Mike Blumenkrantz a452baafca move comp_x screen setup code into e_randr
this was not x-specific, so move it for use in wl compositors
2015-04-22 21:20:57 -04:00
Mike Blumenkrantz 4b1925dadf init randr during wayland init...always 2015-04-22 21:20:57 -04:00
Mike Blumenkrantz 18c34ed151 change comp type check at start of e_comp_wl_init()
at present, this value will be set to either TYPE_NONE if no valid
compositor has been created or TYPE_X if running a wl compositor inside
an x11 compositor
2015-04-22 21:20:57 -04:00
Mike Blumenkrantz 3ac3e9bc71 ensure valid strings are send when sending wl output geometry 2015-04-22 21:18:53 -04:00
Mike Blumenkrantz e1181c4d03 create e_comp during e_comp_init, set comp_type automatically
this simplifies comp creation slightly
2015-04-22 21:18:53 -04:00
Chris Michael 57611c6d2f e-comp-wl: Init randr if we are not wayland only
This is needed for the wl-x11 module

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-22 10:46:41 -04:00
Mike Blumenkrantz 0bad7b6025 unadjust frame coords when calculating wl surface placement during commit
ec->y -> unadjust -> ec->client.y
2015-04-21 16:19:30 -04:00
Mike Blumenkrantz f276023e71 pass surface resource when creating wl surface pixmaps 2015-04-21 15:41:10 -04:00
Mike Blumenkrantz 96f07bff8a wl client pixmaps now use a different method for creating the pixmap id 2015-04-21 15:19:20 -04:00
Mike Blumenkrantz 6e222cede8 add wl client event callbacks at lower priority
this ensures that bindings will activate before events are passed to clients
2015-04-21 15:17:56 -04:00
Chris Michael 9b7358aa32 e-comp-wl: Don't crash if we fail to create a new e_client
This "should" fix T2344 crashing, however I suppose a better question
is ... why is e_client_new returning NULL when it Does find the client
already in the hash...

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-21 09:38:00 -04:00
Mike Blumenkrantz bdc0a6ab8b fix wl randr error message string 2015-04-06 14:29:47 -04:00
Mike Blumenkrantz 617c2d96ff move wl E_Client creation to same place as E_Pixmap creation
ensure that surface manipulation functions will succeed even with no shell surface
2015-03-30 12:13:04 -04:00
Mike Blumenkrantz 73abc46c61 remove useless wl comp code for shape exports 2015-03-30 11:07:29 -04:00
Chris Michael 4c541d3b32 fix debug message for wl_output_bind
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-21 16:59:48 -04:00
Chris Michael 5916823f79 add debugging when output gets bound, and fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-21 16:30:11 -04:00
Derek Foreman 73db701a92 wayland compositor: remove _e_comp_wl_client_focus()
Summary:
We now have a subset of that functionality in e_comp_wl_input.c, so use
that function instead.  The missing bits are moved into the one remaining
caller.

Reviewers: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2207
2015-03-20 15:26:09 -04:00
Derek Foreman def3ac82ae wayland compositor: Remove focus_update from compositor client data
Summary:
The only use for this was sending keyboard enter events on first commit
after a focus during app startup, and this has proven to be unreliable.

NOTE: Focus before an app requests the keyboard global is now broken and
will be fixed in a following patch.

Reviewers: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2205
2015-03-20 15:13:25 -04:00
Mike Blumenkrantz 9986311035 move E_Comp->root window setting into e_comp_wl_init() for wl compositors 2015-03-20 15:08:28 -04:00
Mike Blumenkrantz 58447e9508 completely remove E_Manager
the final step in flattening all the canvas/screen apis
2015-03-19 16:53:32 -04:00
Mike Blumenkrantz d466fe3824 remove E_Comp usage from e_comp_wl 2015-03-18 17:30:49 -04:00
Derek Foreman 1ed503281f wayland-compositor: Clamp to 1, 1 on drag resize
Summary:
Apparently negative values mean "pick a size", though this is
undocumented.

Reviewers: devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2191
2015-03-18 15:53:44 -04:00
Bryce Harrington 673de24fa7 wayland: Handle failure to init a display screen
Summary:
e_comp_wl_output_init will fail (silently) under a couple of
conditions.  Instead, make it propagate the error so it can be handled
at a higher level.  For now just issue an error message.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Reviewers: cedric, devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2155
2015-03-13 20:06:01 -04:00
Mike Blumenkrantz 1736d1ecb9 e_client functions no longer require E_Comp param 2015-03-13 16:53:19 -04:00
Mike Blumenkrantz d00127c2f5 e_comp functions no longer require E_Comp param 2015-03-13 16:48:41 -04:00
Mike Blumenkrantz 091142b032 remove E_Client->comp 2015-03-13 15:41:21 -04:00
Mike Blumenkrantz 289c6f0d1f send client sizes for wl configure events when fullscreening/maximizing 2015-03-12 15:19:52 -04:00
Mike Blumenkrantz b533ad67f3 remove unused wl variables 2015-03-12 15:15:40 -04:00
Mike Blumenkrantz 662d9fea2d don't reset placement of internal wl clients on first commit
fixes placement of evry et al
2015-03-12 15:14:27 -04:00
Mike Blumenkrantz 3f8d2d0596 disable wl client hide animations even with gl
broken until we start making textures for rendering clients
2015-03-12 13:24:42 -04:00
Mike Blumenkrantz bb436e6750 don't reuse wl surface pixmaps without adding a ref 2015-03-10 16:37:57 -04:00
Derek Foreman 281f283d7d Wayland: more checks to avoid consuming serials needlessly
Reviewers: devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2135
2015-03-10 16:24:46 -04:00
Mike Blumenkrantz 808ab60181 fix invalid eina list usage when merging wl surface frame list 2015-03-10 16:11:57 -04:00
Bryce Harrington 13f4582c76 wayland: Check for potential OOM from wl_array_add()
Summary:
wl_array_add() returns NULL if it can't malloc/realloc.  This
is probably unlikely but check for it and issue a meaningful error if it
occurs.

Reviewers: cedric, devilhorns, zmike, raster

Reviewed By: raster

Subscribers: raster, cedric

Differential Revision: https://phab.enlightenment.org/D2054
2015-03-10 15:07:38 +09:00
Derek Foreman b7f3a81f59 Send modifiers to wayland clients on focus in
Summary:
If we don't update the modifiers on focus in we can end up with stuck
modifiers if a modifier is held when starting a client.

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2124
2015-03-09 16:37:02 -04:00
Derek Foreman 8c7364b682 Don't update xkbstate when no app has focus
Summary:
We still update the keyboard array.  focus_in adds everything in the
array to xkbstate anyway, so adding it when there's no focus results
in a double update of state and potentially stuck modifiers.

Reviewers: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2111
2015-03-06 18:55:39 -05:00
Mike Blumenkrantz 7147b7d54b remove unnecessary wl client pixmap checks
these are direct object callbacks so they will only be triggered on wl clients
2015-03-06 16:02:49 -05:00
Derek Foreman 6e4214c8ad Fix stuck modifiers on client exit
Summary:
We still need to remove the active keys when focus_out happens, even
if the pixmap is already gone.  If we don't and a modifier was held
down during exit then the xkb state will have that modifier stuck
forever.

Reviewers: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2110
2015-03-06 13:08:24 -05:00
Mike Blumenkrantz b9f797a277 flag non-internal wl shm clients as dead and delete mirrors on hide
no more crashing?
2015-03-05 12:18:27 -05:00
Mike Blumenkrantz 7e8d442ac3 force non-internal wl clients to hide when gl is not available 2015-03-05 11:59:29 -05:00
Mike Blumenkrantz 230033aa67 Revert "when we get a request to close client app, defer resource deletion"
This reverts commit 1cf7c1f151.

didn't fix the issue and obfuscated the code unnecessarily
2015-03-05 11:41:43 -05:00
Mike Blumenkrantz de17793fe3 reapply wl surface focus during commit when necessary 2015-03-04 15:36:23 -05:00
Mike Blumenkrantz b069009a16 grab wl shell surface geom and use for adjusting resize operations
I think this still may not be 100% perfect,
but it's more like 95% perfect now instead of 50%
2015-03-03 16:48:25 -05:00
Chris Michael 1cf7c1f151 when we get a request to close client app, defer resource deletion
until After close animation has been run

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-02 15:42:26 -05:00
Mike Blumenkrantz e703b40073 improve wl grab resize calcs 2015-02-28 16:48:07 -05:00
Mike Blumenkrantz f62ab0a819 update+clamp wl surface client size to buffer size during commit
this is the same as the X render loop behavior, just in a different place
2015-02-28 15:46:16 -05:00
Mike Blumenkrantz 57c36f92a2 send different values to wl clients for configure when performing a resize action
the calculated values here seem to not be sufficiently accurate to manage a calculated resize.
instead, calc relative pointer coords and send them

 #barrel
2015-02-28 15:43:12 -05:00
Chris Michael 327e422aab set output->scale to e_scale, and when we wl_output_send_scale
actually send output->scale

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-28 11:36:42 -05:00
Bryce Harrington f92e241e8e wayland: Make sure we're initializing output scale sensibly
Summary:
By default the E_NEW() will create our output objects with a 0.0 scale,
which doesn't make any sense and if anything will lead to crashes.
Instead use a scale factor of 1.0.

When updating output details, if the scale setting is invalid then set
it to 1.0 as a sensible value.

Note this doesn't actually enable scaling, just helps make sure we're
not injecting invalid scale parameters from the start.

Reviewers: zmike, devilhorns, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2078
2015-02-27 19:45:25 -05:00
Bryce Harrington 9a4024a20a wayland: Refactor output initialization code
Summary:
The code to initialize outputs has duplicate stanzas for updating the
data members of the output structure.  This set of refactoring steps
shuffles things around to eliminate the redundant code.  I think this
also makes the code easier to follow too.

This also breaks out a new internal routine for looking up outputs by
id.  I suspect this will have general usefulness later.

Reviewers: devilhorns, cedric, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2077
2015-02-27 19:23:11 -05:00
Mike Blumenkrantz 5bac79422e remove wl client resize idler, send ec->w/h instead of ec->client.w/h on resize
this idler makes sense in X where there is a third party display server but not in wl
2015-02-27 15:56:14 -05:00
Chris Michael 8a76018025 remove missed use of E_COMP_WL_PIXMAP_CHECK macro
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-27 10:59:59 -05:00
Bryce Harrington c802239534 wayland: Document the public API
Summary: Add doxygen comments for public API members

Reviewers: zmike, cedric, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2067
2015-02-27 09:24:59 -05:00
Bryce Harrington 8441520030 wayland: Eliminate extraneous E_COMP_WL_PIXMAP_CHECK macro
Summary:
Many of the functions in the compositor do some preliminary checks, to
ensure objects are valid and the right type.  Most of the checks follow
a consistent pattern, for example:

    if (!(ec = data)) return;
    if (e_object_is_del(E_OBJECT(ec))) return;
    if (ec->iconic) return;

This style makes it pretty straightforward to review the pre-conditions
of the function.

The one exception is the check to see if an object is a wayland pixmap;
this is implemented as a C macro.

     E_COMP_WL_PIXMAP_CHECK;

The name of the macro is descriptive enough, but it conceals what is
actually being checked.  I think that it is clearer and fits better with
the style of the rest of the pre-condition checks for this check to just
be shown as regular C code:

     if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return;

Reviewers: zmike, cedric, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2066
2015-02-27 09:21:55 -05:00
Bryce Harrington 82e155eac6 wayland: Fix missing check on E_NEW return
Summary:
All other E_NEW calls in this file check the return value, except this
one place.  In this function, other calls are being checked for NULL and
handled so this one should as well.  The other handlers in this function
follow the style of issuing an error message, freeing objects, and
returning false; we don't need to free anything so just do the error
message and return.

Reviewers: zmike, cedric, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2065
2015-02-27 09:18:27 -05:00
Mike Blumenkrantz 8b40a12899 update wl xdg states on maximize/fullscreen events 2015-02-26 22:32:14 -05:00
Mike Blumenkrantz 69c4bc64db don't send wl mouse button events when client's menu is active 2015-02-26 21:55:34 -05:00
Mike Blumenkrantz e908d9a838 unify wl comp mouse button callback checks 2015-02-26 21:54:17 -05:00
Bryce Harrington 126d658914 wayland: Whitespace cleanup
Summary: Cosmetic

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2061
2015-02-26 16:42:27 -05:00
Chris Michael 35c3eb7dcf fix compile issue due to output change and fixup subsurface creation to match new "state" paradigm
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-26 15:33:40 -05:00
Chris Michael b6be9efe26 Implement buffer_reference to fix client resizing issue
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-26 15:33:40 -05:00
Derek Foreman dd2058d8a6 Don't crash when an error pop-up occurs before the compositor is set up.
Reviewers: devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2059
2015-02-26 14:43:10 -05:00
Bryce Harrington 5bebba3036 wayland: Refactor out common mouse handling code
Summary:
These two functions are nearly identical so move much of the common code
into a helper function.

Reviewers: cedric, devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2053
2015-02-25 22:00:11 -05:00
Bryce Harrington 89dbb9bd27 cosmetic: Whitespace cleanup of wayland client files
Summary:
cosmetic: Cleanup whitespace for wayland compositor

There is excess trailing whitespace in several of the files for the
wayland implementation.  These patches attempt to apply the spacing
rules for Enlightenment as documented at:
https://phab.enlightenment.org/w/coding_convention/

The whitespace rules are applied using the following emacs tabbing
settings:

 (defun start-efl-c-mode ()
  "C mode with adjusted defaults for use with Enlightenment
  development."
  (interactive)
  (c-mode)
  (c-set-style "gnu")
  (setq tab-width 8)
  (setq indent-tabs-mode nil)
  (setq c-basic-offset 3)
  (setq defun-block-intro 3)
  (setq statement-block-intro 3)
  (setq case-label 1)
  (setq statement-case-intro 3)
 )

This patchset also eliminates all tabs in favor of whitespace, as per
the coding style rules.

Reviewers: zmike, cedric, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2048
2015-02-24 17:34:20 -05:00
Chris Michael e8d0ac4f2d append E_Comp_Wl_Output to compositor's output list during output_init
call

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-24 15:27:48 -05:00
Chris Michael e36d2f5235 don't remove E_Comp_Wl_Output on unbind as this Could lead to nasty
crashes if a second client tries to bind wl_output

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-24 15:17:07 -05:00
Derek Foreman 1da3aa24dd Fix wl_output tracking in wayland compositor
Summary:
We should keep a list of resources per output to propagate wl_output
changes to each client that bound an output.

The output list now contains all outputs, not just bound ones.

Reviewers: devilhorns, zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2047
2015-02-24 15:10:37 -05:00
Bryce Harrington 40998b8a6e Code cleanup and check for OOM condition with wl_array_add
Summary:
wayland: Check wl_array_add return for OOM condition
cosmetic: Make error return check syntax consistent with rest of code
wayland: Reuse use_adj to track child-forced adjust
wayland: Refactor to collapse if chain
wayland: Refactor _e_comp_wl_client_priority_adjust to collapse if chain
 + This uses early returns to unwrap a couple if clauses to make the code a bit less nesty.
wayland: Refactor if statements for consistency with rest of file

Reviewers: cedric, zmike, devilhorns

Subscribers: devilhorns, cedric

Differential Revision: https://phab.enlightenment.org/D2034
2015-02-24 14:47:56 -05:00
Chris Michael a8eb773752 Fix T2131 (crash when creating wl_outputs)
This fixes the crash and creates outputs based on e_randr
configuration (when in wayland-client mode).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-24 13:25:22 -05:00
Chris Michael 8e6d512076 change output_bind function name
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-19 17:02:46 -05:00
Chris Michael 6458ac3f8e fix some formatting ugliness
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-19 17:02:04 -05:00
Chris Michael 2d4db291d2 fix compiler warning about pointer targets differ in signedness
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-19 17:00:24 -05:00
Derek Foreman 4276b3ac55 Provide wl_output interface to clients
Reviewers: devilhorns, zmike

Reviewed By: devilhorns, zmike

Subscribers: cedric

Maniphest Tasks: T2131

Differential Revision: https://phab.enlightenment.org/D2007
2015-02-19 14:49:01 -05:00
Mike Blumenkrantz 1d069ab3b6 add ctrl+alt+backspace to kill wl-only e
#barrel
2015-02-13 16:40:14 -05:00
Mike Blumenkrantz 23aad426aa remove some futile attempts at variable setting in wl client new hook
none of these attrs are available at this point so the client attrs can't be set
2015-02-13 15:17:48 -05:00
Mike Blumenkrantz a1af6fbdce remove unused var 2015-02-13 15:11:33 -05:00
Mike Blumenkrantz 67bbd1fe03 manage client pointer client hidden states when changing pointer cursor objects
fixes sticky cursors
2015-02-12 20:07:35 -05:00
Mike Blumenkrantz 9a6cddf91f don't clear wl surface input tiler during commit
this broke input regions for successive frames
2015-02-12 19:30:21 -05:00
Mike Blumenkrantz 5846e0febe unset wl client placed value on first commit to force placement
many clients still have not had a first commit prior to running new_client placement,
so this will force a second run of that algo to prevent placing as though a client's
size = 1x1
2015-02-11 17:58:27 -05:00
Mike Blumenkrantz aca462cb8c don't add wl evas callbacks multiple times
#sigh
2015-02-11 17:22:55 -05:00
Mike Blumenkrantz 6bf43fa081 don't use garbage values for new_client wl surface configures 2015-02-11 17:20:03 -05:00
Mike Blumenkrantz 9a82f7bcb0 reapply accurate ec->placed value for wl clients during surface commit configure
fixes client placement when client has not been placed prior to first commit
2015-02-11 17:14:28 -05:00
Mike Blumenkrantz e1e711ce53 use pixmap size for wl subsurface commit configure 2015-02-11 17:08:06 -05:00
Mike Blumenkrantz 491825c05f move map before configure for wl clients during commit
this ensures visibility is set correctly before attempting to set geometry
2015-02-11 17:02:01 -05:00
Mike Blumenkrantz 5ecc0ca0a1 use accurate xy coords for wl surface configures 2015-02-11 17:00:28 -05:00