Commit Graph

411 Commits

Author SHA1 Message Date
Carsten Haitzler a2740126f1 e client - fix initial placement of override redirect windows in x....
several override redirect windows are being forcibly re-placed by e.
they should not be. ever. this affects scim's IM panel i see and
chromium's menus. it probably affects more than this. this fixes both
of these cases for sure. probably more.

@fix
2017-11-26 00:28:31 +09:00
Carsten Haitzler 9fe7343180 fix mouse hangs after unblank
this fixes T5883
2017-11-14 18:15:26 +09:00
Mike Blumenkrantz 8b798d9fb0 move x11 client re_manage code into corresponding NEW_CLIENT hook
setting desk after e_client_new() completes is too late, as a desk will have
been automatically set by this time and any existing positioning data will
have been mangled in the process

fix T6317
2017-11-08 09:29:35 -05:00
Mike Blumenkrantz 99db9e2557 more E_BITFIELD conversions 2017-11-08 09:22:24 -05:00
Mike Blumenkrantz ac49e6de22 unset xwayland client changes.pos flag during xwl->wl switch if client is unplaced
fixes some initial client positioning issues
2017-10-30 10:29:39 -04:00
Carsten Haitzler 32be41d505 ptr grab/ungrab for blank/unblank - log stages and work done for debug
looking to get more info for what is going on...
2017-10-26 10:50:37 +09:00
Derek Foreman 930cf317d6 Clear stored root window id when shutting down X
Currently e_comp_util_has_x() will still return true after the X
machinery is shut down - this can lead to crashes on logout under
wayland when xwayland apps are running.  Clearing the root window
id resolves this.

@ref T5593
2017-10-25 10:45:05 -04:00
Mike Blumenkrantz 40be5b9d45 move x11 compositor cleanup into shutdown function 2017-10-25 10:45:05 -04:00
Mike Blumenkrantz 3b319b5ef9 don't do full client rescale on x11 hint change if not maximized/fullscreen
regular windows don't get moved here, only resized if hints change

fix T6072
2017-09-26 12:26:18 -04:00
Mike Blumenkrantz 20ea0ed150 add/use helper function for rescaling individual clients
in any case where client needs to be rescaled to use new screen geometry
certain things must happen, such as handling shaded state and forcing the
new geometry to be applied
2017-09-12 13:21:04 -04:00
Carsten Haitzler 1d610fd609 fix up window+screen positioning fixup so it doesnt catch other clients
so some other clients like mpv also try to explicitly position their
windows (like centering on screen 0 ALWAYS) and this now gets caught
up in trying to detect libreoffice doing the same thing for
presentations. so only support this is the app has explicitly
requested initial positionin explicitly and then use pending configures.
2017-09-09 11:18:15 +09:00
Mike Blumenkrantz ef6197b119 do not force client focus setting after calling e_desk_last_focused_focus()
in some cases focus setting must be deferred, and forcing focus in these cases
will create focus bugs

ref 9ae24a3a4a
2017-09-01 13:40:12 -04:00
Carsten Haitzler 9ae24a3a4a e client focus - fix focus if moving focused window to new desk - long
fix client focus the very very very long way vs
418319fc94
2017-09-01 19:29:03 +09:00
Mike Blumenkrantz 57176bf29d do not rescale override x11 clients during hint fetching 2017-08-25 14:47:10 -04:00
Mike Blumenkrantz c31cb51499 replace <br> with <ps/> for all text 2017-08-21 10:16:35 -04:00
Carsten Haitzler 73e3ed1bb0 e x11 focus fixup - dont do the fixup if input grabbed
this actually fixes everything fully and has focus working nicely now
with the fixup
2017-08-20 01:02:03 +09:00
Mike Blumenkrantz 09a8888f76 batch x11 maximize state change requests
if an app wants to set both horizontal and vertical, set both at the same
time to improve performance and accuracy
2017-08-18 15:52:50 -04:00
Mike Blumenkrantz 5998f175b5 temporarily cache x11 configure requests which reposition hidden windows
when an app tries to position itself before being shown, attempt to store this
and apply it in order to effectively handle cases where an app attempts to show
on a specific screen, e.g., presentation apps which show a console on one monitor
and the presentation on a different monitor

fix T1571
2017-08-18 15:52:50 -04:00
Mike Blumenkrantz 121e7fab4b replace existing resize pointer mode for x11 client-initiated resizes
ensure there is no mismatch between pointer modes when pushing/popping modes

fix T4893
2017-08-18 15:52:50 -04:00
Mike Blumenkrantz b6759a8c27 do not apply x11 pointer focus if key/mouse grabs exist
fix T5871
2017-08-16 10:42:14 -04:00
Mike Blumenkrantz b2c5c20cde manually get client under pointer for checking x11 pointer focus
e_client_under_pointer_get() ignores overrides.

ref 3ee5a0378d

fix T5878, T5871

IF ONLY THERE WERE SOME METHOD FOR TESTING COMMITS BEFORE THEY WERE PUSHED
2017-08-14 07:30:04 -04:00
Carsten Haitzler 3ee5a0378d e - do workaround with in events due to flags to get ptr focus right
so we egnore some mouse in evets due to their flags (crossing events
thansk to grab changes or other stuff) that we want to ignore for
other reasons like when a popup menu happens and so on... so if we get
a mouse in... 0.1 sec later double check where the pointer is with a
poll then fix focus. this should patch over a long standing annoyance
here in x11.

@fix
2017-08-06 18:34:42 +09:00
Mike Blumenkrantz c804650482 rescale x11 clients after fetching hints
ensure that clients initially respect useful geometry after size hints
have been fetched
2017-08-04 16:05:16 -04:00
Mike Blumenkrantz 29617bf80b move Ecore_X_Stack_Type member from client to x11 comp_data
no functional changes
2017-08-04 16:05:15 -04:00
Mike Blumenkrantz 23613b3ded set client opacity any time netwm hint has changed in fetch
fix T5370
2017-07-28 15:44:55 -04:00
Mike Blumenkrantz 096c6b4090 continue to fetch netwm opacity hint if it changed since the last fetch
some apps (e.g., wine) do not trigger any event when changing this property,
and they use the property in order to simulate window fade in/out

ref T5370
2017-07-28 15:44:55 -04:00
Mike Blumenkrantz 596e48d066 use ecore_x_netwm_opacity_get() for x11 opacity checking
this makes the check for opacity more accurate since it returns a bool
2017-07-28 15:44:55 -04:00
Mike Blumenkrantz 5ddb8779e2 focus x11 root window on init when starting with xwayland
comp canvas does not have a valid xwindow and is unfocusable
2017-07-28 15:44:55 -04:00
Mike Blumenkrantz 263ee54545 rename bg_blank_object -> resize_object for a more accurate name 2017-07-21 14:43:37 -04:00
Carsten Haitzler c58bf393e0 mouse hiding - only grab pointer not pointer and keyboard - simple
dont need kbd grabbed at all. just pointer.
2017-07-12 10:45:50 +09:00
Mike Blumenkrantz 76484915e2 always perform initial input ungrab when waking screen
in the case where the desklock timer was longer than the blank timer,
this would permanently break input

input is still broken for the duration of the screen blank animation and
any time the screen is blanked
2017-07-11 15:04:22 -04:00
Mike Blumenkrantz 05a8df3d1a do not perform input grabbing during (un)blank if pointer will not animate
if the pointer will not animate, input will never ungrab

this commit still breaks input. do not use.
2017-07-11 15:03:55 -04:00
Mike Blumenkrantz 031d64c2ec Revert "Revert "move x11 suspend window grabbing to comp_x, ungrab on resume""
This reverts commit e90f63b25b.

move back to comp_x, put back grab on resume.

input is still broken with this commit, do not use.
2017-07-11 15:03:55 -04:00
Carsten Haitzler e90f63b25b Revert "move x11 suspend window grabbing to comp_x, ungrab on resume"
This reverts commit 7bc179da5a.

this now totally broke the glitch fix and it now animates in reverse
on suspend and does nothng on resume... testing might be a good idea
beforehand...
2017-07-11 09:00:05 +09:00
Mike Blumenkrantz 7bc179da5a move x11 suspend window grabbing to comp_x, ungrab on resume
ref d0c5fb465b
2017-07-10 09:49:34 -04:00
Carsten Haitzler d0c5fb465b support connected standby (non-s3 sleep/freeze) that new lpatops sport
this requires we have to force dpms on to reduce power. to avoid
glitches with the pointer staying around in x we need to support
suspending it too so it hides cleanly like the screen dims or undims.
also use the new powersave freeze mode to do this.

note that i've tested this on s3 supporting laptops and non-s3 and it
"works for me". it may require more testing and work. there is more to
power saving than just this as well but for now that's out of scope as
you have to mess with linux device autosuspend timeouts and a bunch
more (wowlan ... blahblah).

i need to find the source of the intermittent wakeups too in e. there
is a long lived timeout (8-ish seconds?) but more specifically e keeps
waking up from fd's and then reading /sys stuff about battery - some
event is causing us to do this... maybe to suspend this or make
battery checking very rare when in freeze mode (or screen off) etc.

so this fixes some glitches as well as supports a new way of sleeping
"alive" when hardware literally doesnt support normal s3 sleep... so
kind of a fix with a feature.
2017-07-10 10:18:50 +09:00
Mike Blumenkrantz fea11b1621 don't run x11 focus (un)set callbacks for override clients
this is unnecessary in x11 and broken in xwayland
2017-06-30 10:25:18 -04:00
Mike Blumenkrantz 836845a615 use xwayland check for clients when checking whether to reset focus to root
checking base pixmap returns false for xwayland clients
2017-06-30 10:25:18 -04:00
Mike Blumenkrantz d81818b309 do not show iconic x11 clients on on icccm hint change
this is supposed to handle the case of state changing from withdrawn
to normal, but attempting to show an iconic client in this case results
in dead windows on screen

fix T5444
2017-05-01 13:26:11 -04:00
Mike Blumenkrantz e1093c87ea set initial x11 window geometry for windows which do not have wm hints
fixes case where a non-override window has no hints and must be shown on
startup
2017-04-21 16:16:37 -04:00
Mike Blumenkrantz 174b0d040b add cache for dead x11 manager windows
in the case where an app unmaps and maps its window very quickly, this
allows detection of the maprequest event which will occur with the just-deleted
manager window so that the window can be correctly managed again

fix T5348
2017-04-07 16:08:38 -04:00
Mike Blumenkrantz e2be96901e do not attempt to set window hidden hints on non-internal x11 windows
this causes a BadWindow error
2017-03-17 15:08:38 -04:00
Mike Blumenkrantz 58b66048f1 block x11 focus eventing under xwayland
ensure that focus changes come from the compositor and not from clients
2017-03-17 15:08:38 -04:00
Mike Blumenkrantz 05ef0b0280 call e_randr2_shutdown in comp shutdown
this should always be called, not just in comp_x
2017-03-10 15:55:06 -05:00
Mike Blumenkrantz a064899511 move x11 iconic window init from e_hints -> comp_x initial fetch
this reflects the order in which the client passes through these functions
and fixes handling of iconic clients on startup
2017-03-10 15:55:06 -05:00
Mike Blumenkrantz f253351f0a force iconic state for iconic x11 clients during shutdown
this may or may not have been set previously if client mirrors are present,
but it should definitely be set during shutdown since there are no mirrors
2017-03-10 15:55:06 -05:00
Mike Blumenkrantz 8f896b7862 show x11 parent windows during reparent only if not withdrawn
iconic windows are still shown
2017-03-10 15:55:06 -05:00
Carsten Haitzler b40fd20fbc e comp x - fix property fetch to use int ptr from the start
this clears up soem warnings and do the cast on providing the pointer
to ecore_x_window_prop_property_get() which since it has to allocate
the data will be fine for alignment anyway, so a void * cast will do.
2017-02-12 16:25:35 +09:00
Derek Foreman 4cf555f36e Replace all timer_reset with timer_loop_reset
Another sed bomb - didn't occur to me first time around to
check for this.  Cleans up more clock_gettime calls.
2017-02-06 15:59:25 -06:00
Derek Foreman 73aecd73ab Replace all timer_add with timer_loop_add
So yeah, I've literally used sed to replace every occurrence of
ecore_time_add() with ecore_timer_loop_add() because I'm reasonably
confident that no part of E has a legitimate need for timer based on the
exact current time.

It would be really nice if I'm not wrong. :)

The reason for this is the incredible spew of clock_gettime() calls I'm
seeing on an ARM system (that should have a vdso for gettime, but...)
This can amount to thousands of system calls per second.

 #YOLO
2017-02-03 15:52:28 -06:00
Mike Blumenkrantz d1bb23954f break out code to set clients as transients for a parent 2017-01-13 11:33:36 -05:00
Chris Michael 92aa99b97a Use proper coordinate adjustment
This seems like just some copy/paste that was never corrected, however
when calculating coordinate adjustments we should be using the proper
values here. Previous code was using e_comp_canvas_x_root_adjust for
the Y value. This patch uses e_comp_canvas_y_root_adjust for Y
coordinates.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-12 10:44:23 -05: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 ef33638c42 create substruct for E_Comp to put canvas objects into
allow adding/removing objects in the future without breaking abi
2016-10-25 12:01:17 -04:00
Mike Blumenkrantz 0354f8a5b1 remove unused variable
ref b83cfb858c
2016-10-04 09:22:05 -04:00
Mike Blumenkrantz b83cfb858c remove x11 input window from desklock grab process
now the compositor canvas is grabbed, simplifying handling of grabs which
persist through the desklock activation
2016-09-28 10:40:38 -04:00
Mike Blumenkrantz 528cdd2614 remove more useless E_Comp struct members 2016-09-09 11:38:08 -04:00
Mike Blumenkrantz 82afc08c39 only check x11 configurerequest geometry changes when applicable
in some cases during a frame recalc this could lead to window positioning
being erroneously changed

fix T4097
2016-08-01 10:55:54 -04:00
Mike Blumenkrantz 08aaeffade handle e_comp_x init failure more effectively and perform cleanups
fixes autodetection for x11 wayland output without setting E_WL_FORCE
2016-07-12 12:51:00 -04:00
Mike Blumenkrantz 859b1b989f handle shaded state when receiving x11 configure requests
previously this would resize the window without unshading it, leading to
a confusing state for the window and the user
2016-05-31 12:31:50 -04:00
Mike Blumenkrantz 1fef7d04dc delete x11 mouse-in job when hiding the job's client
spurious x11 mouse events will be received when activating a mouse binding which
flips the active desk

fix T3716
2016-05-31 12:21:09 -04:00
Mike Blumenkrantz 55c83134c1 use parent windows for x11 binding grabs
ensure that internal windows do not receive mouse events before the compositor

fix T3347
2016-05-12 11:23:20 -04:00
Mike Blumenkrantz ada13539bf avoid infinitely looping when applying x11 window grouping
#ThatTimeKainXFoundABug
2016-05-11 18:29:38 -04:00
Mike Blumenkrantz f2ad686fc3 handle positioning of x11 overrides with csd accurately
when first applying the csd region to this type of window the coords must
be adjusted in order to account for the shadow

fix T2934, T2931
2016-05-10 16:04:57 -04:00
Mike Blumenkrantz 2a67b3a899 ensure damages do not get added for shapeless x11 clients
ref 32d4c2f2b9

ref T3157
2016-04-21 18:04:16 -04:00
Mike Blumenkrantz a97a50b306 don't force full damage on x11 override clients
reverts f6be761226

this didn't fix anything and can cause irregularities in rendering
2016-04-21 16:32:01 -04:00
Mike Blumenkrantz 019318b88f do not attempt to show x11 override windows
fix T3444, T1759, T2735
2016-04-21 15:28:55 -04:00
Mike Blumenkrantz 536a3a7ff6 make startup/restart app exec timing protocol-specific
this allows different display protocols to start their applications at
different times to ensure that any initialization has completed prior to
starting anything requiring a window

fix T3475
2016-04-18 15:27:47 -04:00
Mike Blumenkrantz 3cb11abb25 move x11 client icon caching to private functions in comp_x
ref 57ce6419e5
2016-04-01 14:16:21 -04:00
Carsten Haitzler 57ce6419e5 e icons: reduce mem usage (in x11) by a fair bit by de-duplicating
so i was profiling today .. leak hunting .. and i noticed. if you have
enough appss open - eg terminology, e uses a huge amount of memory...
for icons. terminology is 128x128 ...  thats 64k per icon. open up a
lot of terminology windows and we duplicate that 64k per every window
on the wm sside because we get the data. it would apply for any app
that sets a netwm icon. this can be come rather silly if you have like
100 terminals. it's worse with larger icons (eg 256x256 - 256k per
icon).

this puts in a simply list for shared icons and a lookup on fetch to
de-duplicate and share icon data. this should drop memory usage
nicely.

@improvement
2016-04-01 20:33:52 +09:00
Mike Blumenkrantz 9c3d8aa9ca optimize case where an x11 client is focused/unfocused in same loop iteration 2016-03-31 11:21:38 -04:00
Mike Blumenkrantz d229d26ef4 remove old compositor reset code 2016-03-30 17:48:03 -04:00
Mike Blumenkrantz d02679383f ignore x11 ConfigureRequest events when maximize_override is set 2016-03-28 13:37:40 -04:00
Mike Blumenkrantz e5cf1fb215 add workaround for xwayland client bug
sighhhhhhhhhhhhhhhhh
2016-03-12 15:43:39 -05:00
Mike Blumenkrantz 8d7e55f4dc remove direct references to ec->comp_data in x11 compositor
this fixes a number of xwayland client issues
2016-03-12 15:41:50 -05:00
Mike Blumenkrantz 114a604166 apply x11 focus/unfocus using jobs
if multiple x11 clients receive focus during the same mainloop iteration,
an almost unbreakable cycle of window focus chaining will occur, resulting in
both windows being focused simultaneously--or so it appears--which results in
no window being able to receive input. to avoid this, ensure that only one x11
client can receive focus in a given loop iteration
2016-03-07 14:47:26 -05:00
Mike Blumenkrantz 7e91bc721a apply x11 mouse in event for clients using a job
due to event bursts, it's possible for multiple x11 clients to receive
mouse in events on during the same main loop iteration. in this scenario,
only the last client has received an actionable mouse in, and applying this
event after the dispatch has completed ensures that multiple clients do not
all receive mouse in+out events during the same loop

this greatly improves mouse-based focus reliability in a number of cases
2016-03-07 14:45:32 -05:00
Mike Blumenkrantz e385bfa2d6 only use x11 mouse out event if client has received mouse in previously 2016-03-07 14:44:16 -05:00
Mike Blumenkrantz 0ba369330d reverse ordering for x11 client mouse in NotifyVirtual and NotifyInferior details
apparently I did this backwards.

ref 7b7dbbc249
2016-03-07 14:43:02 -05:00
Mike Blumenkrantz e1035aef81 Revert "e comp: fix crashes on exit/restart when e_comp is NULL"
This reverts commit 26a7ba3a58.

this can only occur if something forces an event flush during shutdown.
in this case, whatever is triggering the event flush is a bug, not the
dereferencing of a pointer which is guaranteed to exist for the normal
lifetime of the process
2016-02-25 15:05:24 -05:00
Mike Blumenkrantz 87d4e254f0 pre-remove pixmap from x11 clients during del hook
this breaks the compositor!

ref 0ca200513e
2016-02-19 18:02:54 -05:00
Mike Blumenkrantz 3f3ed7ae99 reshuffle x11 comp init to cleanup on failure cases
in the event of a wayland start, x11 comp init will fail, meaning that
cleanup must occur in order to avoid erroneous triggering of x11 handlers

 #TooSoon
2016-02-19 17:07:03 -05:00
Carsten Haitzler e75af1536d Revert "e bg: remove debug printf"
This reverts commit 77c2a2a3d1.

oops - i forgot i had all this other debugging there
2016-02-06 10:29:04 +09:00
Carsten Haitzler 77c2a2a3d1 e bg: remove debug printf 2016-02-06 10:27:09 +09:00
Carsten Haitzler 26a7ba3a58 e comp: fix crashes on exit/restart when e_comp is NULL
when we are shutting down i seem to get into a state where e_comp is
null yet we are still processing events. this fixes that and checks.
2016-02-05 18:35:49 +09:00
Mike Blumenkrantz 85d7c121bd do not attempt to create x11 canvas during xwayland init
this kills the gl_drm engine
2016-01-22 17:06:42 -05:00
Carsten Haitzler e1369a24bd per-desk profiles - move to per screen and use elm derived profiles
this removes the per desktop profile config and replaces it with a
per-screen one that is tied to a specific display so it is far more
logical than per desktop. this allows e to set up different scaling
per screen for apps that use elementary for example via this derived
profile.

this of course is slightly problematic for e itself since it now uses
elm - as this will cause e to go kind-of-crazy with differing profiles
as it fights with itself and elm if 2 screens have different profiles.
this requires elm to be fixed to allow custom profiles per window.

this also currently won't switch profile of a window when you
reconfigure screens.

@feature

xx
2016-01-08 21:54:31 +09:00
Mike Blumenkrantz fd338ef39e ignore withdrawn state for x11 override clients during show
these windows are already visible
2015-12-18 13:59:25 -05:00
Mike Blumenkrantz 4c9527cf14 show non-new x11 clients immediately when changing Withdrawn -> Normal
ref T2950
2015-12-17 11:57:48 -05:00
Mike Blumenkrantz 2d09b8ecac only show x11 clients during MapNotify/Request if they have Normal state 2015-12-17 11:56:10 -05:00
Mike Blumenkrantz 2a60033182 do not reapply x11 icccm state during fetch
this is the value which has just been obtained, so don't create potential
race conditions by sending it back to the client
2015-12-11 15:07:48 -05:00
Mike Blumenkrantz 027b044297 use client geometry for calculations in x11 ConfigureRequest handler
the values requested by the client will be based on its geometry and not
the geometry of the frame. using the frame geometry here results in windows
moving ↘ based on the top/left frame sizes

fix T2912
2015-12-03 14:12:37 -05:00
Mike Blumenkrantz 70c6dc30d1 use separate handler for x11 fatal errors when using xwayland
a fatal error with xwayland is not a fatal error for the compositor,
so this should not result in a dead session
2015-11-24 15:34:42 -05:00
Mike Blumenkrantz f09e410285 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:17:38 -05:00
Mike Blumenkrantz 551657e02a check client comp data existence in x11 mirror visibility callbacks 2015-11-09 14:29:23 -05:00
Mike Blumenkrantz bf2e36236c 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-07 13:10:02 -05:00
Mike Blumenkrantz cc137f6cd7 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-07 13:06:23 -05:00
Mike Blumenkrantz f0cc657e4c break out x11 client visibility setting into util functions 2015-11-07 13:05:18 -05:00
Mike Blumenkrantz 29a1fe0265 always unalias x11 client parent window <-> pixmap relation during delete
deleted state is not relevant, this should always be removed during deletion
to prevent further referencing of a deleted client

fix T2803
2015-10-26 13:02:34 -04:00
Mike Blumenkrantz 06f794bfe6 clear x11 client pixmap when returning from iconic
ensure pixmap remains usable during the entire hide process
2015-10-15 15:32:38 -04:00