Commit Graph

183 Commits

Author SHA1 Message Date
Mike Blumenkrantz 7bdbc9c9e4 improve x11 client focusing with mouse-based focus policies on mouse move
in the case that a mouse move event occurs, the compositor should validate
the event to ensure that the mouse cursor is actually over the window that
the event claims to be from

fix T2594
2015-11-12 17:24:46 -05:00
Mike Blumenkrantz 014d700f91 check client comp data existence in x11 mirror visibility callbacks 2015-11-09 14:35:22 -05:00
Mike Blumenkrantz 3e5d970c2f toggle x11 client iconic/mapped state based on mirror visibility
in order to continue rendering an iconic client without breaking icccm,
it's necessary to map the client's window again and unset iconic state
whenever rendering is needed, then re-set states when rendering
stops

ref T2788
2015-11-09 14:32:47 -05:00
Mike Blumenkrantz c31824c2ef move client iconic hint setting into x11 hide function
e_hints should probably be merged into the x11 compositor entirely
at some point
2015-11-09 14:23:23 -05:00
Mike Blumenkrantz 3a16a86ea3 break out x11 client visibility setting into util functions 2015-11-09 14:23:11 -05:00
Mike Blumenkrantz 979937cc20 clear x11 client pixmap when returning from iconic
ensure pixmap remains usable during the entire hide process
2015-10-15 17:04:02 -04:00
Mike Blumenkrantz 988df882ea reject deleted clients from x11 sync alarm event callback
E_Client->comp_data is null after a client has been deleted, so
attempting to handle events which require the dereferencing of this
pointer after a client has been deleted will result in a crash

these events should be rejected after delete regardless, since at this
time the compositor has stopped handling events for the client

ref f42c6aa187
2015-10-15 14:02:17 -04:00
Mike Blumenkrantz 72b7860cf6 trap shaped x11 clients and prevent compositor blocking with high rect count
in the case where a shaped window with many rects exists, there is a high
probability of the damage rect count being huge, leading to massive blocking for
each frame as the compositor attempts to fetch all of these rects from the xserver.

instead, the compositor can shortcut this by forcing a full-window damage any time
the rect count is sufficiently high, trading a blocking socket operation for some
amount of (potential) overdraw.

testing in affected scenarios has shown huge improvements: where previously the entire
compositor would lock up, things work as expected now

see https://bugzilla.mozilla.org/show_bug.cgi?id=1214746 for a sample case
2015-10-14 13:05:53 -04:00
Mike Blumenkrantz 8c95402fd9 do not return when x11 damage event returns no rects
ensure first_damage flag is set in all cases
2015-10-14 13:03:49 -04:00
Mike Blumenkrantz 0cec30df72 fix typo in previous damage rect commit 2015-10-14 13:03:49 -04:00
Mike Blumenkrantz 61d51eda56 subtract x11 client damage region even when forcing full override damage
fix T2785
2015-10-13 22:40:55 -04:00
Mike Blumenkrantz 21d2a84c2e force full damage for first frame of x11 override clients
it seems that damages for popup windows in some applications,
namely blink-based browsers, are reported incorrectly, resulting
in sometimes having a blank window
2015-10-13 17:11:53 -04:00
Mike Blumenkrantz 16f20ff336 only use fast-path pixmap size updating after a resize for x11 clients
updating these values after other operations will result in the pixmap size
being set inaccurately, leading to rendering inconsistencies
2015-10-05 17:30:54 -04:00
Mike Blumenkrantz b006832d38 free x11 damage region rects 2015-09-29 15:18:12 -04:00
Mike Blumenkrantz 12c4257159 _GTK_FRAME_EXTENTS changes using a property, not a client message 2015-09-28 16:17:31 -04:00
Mike Blumenkrantz f65991a7ba force pixmap clear when hiding an x11 window
failure to refetch this upon remapping the window will result in
a broken pixmap which cannot be rendered
2015-09-25 23:42:38 -04:00
Mike Blumenkrantz 89436035d6 map/unmap x11 client windows when toggling iconic state
ICCCM 4.1.4
2015-09-25 22:41:29 -04:00
Mike Blumenkrantz bfeeae6adf fix handling of x11 ICCCM WithdrawnState
according to ICCCM 4.1.4:
Only the client can effect a transition into or out of the Withdrawn state

withdrawn windows cannot be shown under any circumstances. the best that can
be done is to try mapping the window and hope it decides to appear.

to prevent any inadvertent showing of the window before it leaves the
withdrawn state, we play games with the E_Client->ignored flag in order
to skip client evals until we get notified that maybe we want to stop
skipping those evals

ref T2745

also includes 0e3cc2f533
2015-09-25 22:40:15 -04:00
Mike Blumenkrantz 53e0c56f5e fully support _GTK_FRAME_EXTENTS
gtk apps set an atom which provides information about the area
where non-window content (eg. shadows) may be drawn; this area
must not be used in placement calculations.

the easiest method for implementing this functionality was to add
a case to the compositor geometry interceptors which effectively
flip the client struct geometry values such that the E_Client->client
is outside of the more commonly used E_Client->x/y/w/h

fix T2744
2015-09-24 16:42:24 -04:00
Mike Blumenkrantz e4d065370b move focus setting on restart into desk restore function
the focused client on restart needs to be set after desk states
have been restored in order to avoid focusing the wrong client
2015-09-21 20:06:31 -04:00
Mike Blumenkrantz a108d8ec6a only lower x11 layer windows for layers which have windows during init 2015-09-21 16:55:03 -04:00
Carsten Haitzler b79fde5de7 e comp - set rects to null to silence compiler warning
even though n is 0 and we don't use rects, compiler doesn't know, so
to avoid noise - set to null so we can focus on warnings of real errors.
2015-09-11 13:01:16 -04:00
Mike Blumenkrantz 258680e60c fix x11 compositor to use damage events
it seems that since the first version of the enlightenment compositor
in e17, damage events in x11 have never been used correctly. using
the event struct members will only give the bounding box/area instead
of the damaged regions; the real regions must be explicitly fetched
from the server

this removes the need for a lot of hacks which were added over the years
to make override windows render correctly, and also probably reduces
rendering overhead slightly
2015-09-07 11:17:17 -04:00
Mike Blumenkrantz a8f301748c track focus time for x11 canvas focus, unset client focus on x11 canvas focus-in
in the case that the canvas window has just had focus set on it, apply this focus
and ensure that no client retains focus

this resolves a race condition where focusing the compositor canvas <-> client
extremely quickly would result in a client trying to steal focus when it was
not actually focused

a notable (but trivial) side effect is that now when flipping desks at high speed while using
mouse-based focus policies, the user is almost guaranteed to end on a desk which
has open windows on it
2015-08-21 16:45:57 -04:00
Mike Blumenkrantz 094fc3c15c add full damage for x11 override clients on resize configure event
it seems that the reported damage events upon resizing an override window
are not accurate, and so we must force a full damage here while avoiding a
render queue in order to ensure that the full contents of the override will
be rendered in the next frame

fix T2045
2015-08-21 16:43:44 -04:00
Mike Blumenkrantz 19caf62872 reject x11 NotifyVirtual and NotifyInferior mouse in events more accurately
these events are valid when moving from parent<->child window

fix T2674
2015-08-18 17:23:51 -04:00
Mike Blumenkrantz bbecf27c97 reject x11 NotifyVirtual and NotifyInferior mouse in events
these are triggered "in passing" when mouse in events occur and do
not necessarily indicate that the mouse has entered this specific window

failing to reject such events can cause mouse-based focus policies to
attempt to set focus onto windows which are not visible, resulting in
an infinite loop where no window is actually focused
2015-07-27 13:29:06 -04:00
Mike Blumenkrantz 7203abf8a3 allow x11 mouse wheel events to check ev->event_window for possible client match
in the event that these windows are different, event_window is the parent of window
which may or may not be explicitly tracked by an E_Client, so the wheel events here
should be sent to the parent as is done in mouse button events

fix T2604
2015-07-27 13:27:57 -04:00
Mike Blumenkrantz a0ac666b47 improve x11 compatibility with efl versions earlier than 1.15
canvas grabs changed completely in 1.15, and so it's required that
x11 grab handling also have special runtime cases for this

for such versions the compositor must:
* always grab the internal client window instead of the parent
* always ungrab the window when it has focus
2015-07-24 13:19:11 -04:00
Mike Blumenkrantz 510660e157 use runtime check for determining x11 compositor grab behavior
this should fix the case of users not recompiling enlightenment after
upgrading their efl version
2015-07-24 13:00:16 -04:00
Mike Blumenkrantz 73102c7048 simulate modal windows for badly behaved x11 clients
it seems that some clients, eg. libreoffice, don't set the modal window
property on child dialogs. instead of fighting for focus, set up the child
as a modal on the parent and then avoid the whole issue

fix T2594
2015-07-21 18:35:47 -04:00
Mike Blumenkrantz ef18cc3f93 ensure clients possess comp_data before dereferencing it during x11 stacking
ref T2566
2015-07-21 14:36:33 -04:00
Mike Blumenkrantz a6990c69a8 never use new clients for stacking part 2: the secret of the stacking
a client with this flag set here is unreliable to use as a stacking
reference since it has yet to be stacked and can be located anywhere
in the window stack.

fixes internal window stacking on startup
2015-07-15 16:26:06 -04:00
Mike Blumenkrantz 3dfb5e07af only trigger client mouse-in from x11 mouse move event if client+desk are visible
ref T2566
2015-07-15 16:24:50 -04:00
Mike Blumenkrantz 75df7e0943 only unset e MANAGED atom on non-shutdown
broken during a bad rebase of 4f8af72fe3
2015-07-15 15:19:24 -04:00
Mike Blumenkrantz b8ee271011 always set x11 override client geometry on startup
this geometry isn't something we can change later, so apply it now.
also fixes an ACK when trying to show input_only clients early
2015-07-10 13:10:41 -04:00
Mike Blumenkrantz 4f8af72fe3 move grabinput focus fix timer to x11 compositor and fix it to Work Better
see inline comments about x11 focus eventing for details

fix T2547
2015-07-08 12:49:06 -04:00
Mike Blumenkrantz eef5efe8c3 move E_Client->mouse.in to E_Client->mouse_in to avoid abi breakage 2015-07-07 13:15:45 -04:00
Mike Blumenkrantz 62da0f32bf do not apply x11 focus grabs to internal clients if efl version > 1.14
due to recent changes in ecore-input-evas, mouse events are propagated
differently; specifically, there are now "more" events than there previously were.
as a result, grabs on internal wins are no longer necessary, though they probably
never were necessary after the elm conversion

see 5cb6cdbc5e1a13ea0262e155983b494e6519abde in efl
2015-07-02 12:35:21 -04:00
Mike Blumenkrantz 632bdd84a7 fix build break from last commit 2015-07-02 12:34:55 -04:00
Mike Blumenkrantz 0c518414e1 reject x11 replay clicks when event window != client window 2015-07-01 18:02:26 -04:00
Mike Blumenkrantz 26c291c02d only ungrab x11 windows when appropriate focus options are set 2015-07-01 16:50:01 -04:00
Mike Blumenkrantz b0df36d595 ensure x11 focus grabs are applied on client init when needed 2015-07-01 15:57:39 -04:00
Mike Blumenkrantz 00904480d5 straggler ungrab of x11 parent window from previous commit 2015-07-01 15:33:34 -04:00
Mike Blumenkrantz f1fdb26d20 redo all x11 client mouse grabbing for focus
I did an audit of this and it seemed that it no longer served the purpose
for which it was originally intended. specifically, this is for enforcing
click: raise/focus options, and so grabs must be in play on client windows
only when they are not focused to ensure that we get mouse events and can
then focus them. the grabs must then be removed once the window has focus
to avoid spurious mouse eventing
2015-07-01 15:32:06 -04:00
Mike Blumenkrantz 87f4a69612 use client window for x11 button ungrabbing
ref afb62b4989
2015-06-30 18:49:26 -04:00
Carsten Haitzler d7f384f092 e passive window grabs - fix side-effect leave/enter events on clients
when you have click to focus we have a passive grab set up. somewhere
that window changed to the parent window instead of the client. this
leads to a side effect of a leave and enter event on clients for every
click. generally clients are ok with this, but some seem to have buggy
event handling. these enter/leave events are a side effect of the
passive grab even though we allow/replay the event.

this fixes that by placing passive grabs on the client window itself
instead of the parent.

@fix
2015-06-30 18:46:07 -04:00
Mike Blumenkrantz cf332e874c trigger client mouse-in on x11 mouse movement for non-action clients
this should fix the case of mouse-based focus policies trying to reapply
focus after another client has stolen it away without the pointer leaving
the window
2015-06-29 16:08:47 -04:00
Mike Blumenkrantz a416f96c12 check for possible parent window on x11 mouse button events
in the case of different window <-> event_window, window is a child window
of event_window, and thus checking event_window here is valid (and necessary)
2015-06-29 16:04:33 -04:00
Mike Blumenkrantz 84ba19d576 stop rejecting possibly-valid x11 focus events
fixes case where window assumes focus without wm interaction
2015-06-29 16:04:26 -04:00