Commit Graph

48 Commits

Author SHA1 Message Date
Carsten Haitzler f8bda510a7 e randr - fix plug/unplug of external screen
it seems some logic to stop internal screen fake plug/unplugs from
interfering were hurting external screen plug/unplug. fix makes that
work again.
2019-09-28 18:44:08 +01:00
Carsten Haitzler 1cbd5ee024 e wl randr and screen setup - fix rotation mapping
a few problems i found on my rpi's...

1. rpi's retun that they do NO rotations (not even the normal 0 degree
default), so assume 0 degrees if none listed. this makes screen setup
even try and configure things on these kinds of drivers/devices
2. there was a mistmatch of 0, 90, 180, 270 srtyle rotation ints vs
the enum stype ecore drm2 uses. this fixes that so it uses ecore_drm2
considtently as ecore_drm2 expects. this stops output becomeing odd.
3. also seemingly we forgot to set the max mouse region based on res.
re-enable that commented out function.

now i can change res on my rpi3 and rpi4 in wl mode and it works right...
hooray!
2019-07-14 22:20:49 +01:00
Carsten Haitzler 752360e0c0 e randr - fix crash when no zones found 2018-07-18 02:19:12 +09:00
Carsten Haitzler 5a1e9a995c e laptop lid fixes to bring back behavior and trim down glitches
so i spent a few days lopening and closing the lids of a few laptops,
plugging and unplugging external screens in, plugging and unplugging
ac power and doing lots of combinations of these. this led to a whole
slew of interrealted issues that were pretty hard to detangle into
just single issues, so this is all one blob.

this fixes:

1. if a lid close gets a monitor unplug from x or e's randr wants to
unplug then this lead to slow unsuspend or lid open times as e was
reconfirguring the screens entireluy on lid open. dont do that. just
keep things as is, unless we have an external display, then reconfigure.

2. we had 2 systems monitoring for a wake. a poller and a systemd
event. this was redundant and lead to interesting things in the debug
output, so clean that up and on systemd systsems use the systemd wake
events

3. some systems dont shut down their screens on lid close, so they
stay open until screensaver timeouts kick in. bad. so also force the
screen to go off on lid close (if the lid screen is the only one we
have).

4. x seems to have a bug where if you force dpms off etc. to turn the
screen on, it still thinks it's of and wont dpms off again after that
until you eother give some input to have the wake event make the dpms
system in x think its now time to go on, or you toggle dpms on and
off, so i found toggling tricks x into thinking the right thing.

this makes some debugging also be consistent with printfs.

all in all i have a pretty well supported laptop doing swimmingly with
e and a not so well designed (acpi dsdt - missing many events like
acpi battery ones, ac power change acpi events, missing logic to power
off a closed screen in firmware or hardware and leaving it to sw...
not this laptop has a tocuh panel and extra fun points awarded since
the touch panel doesnt shut off on lid close... AND it reprots touch
events when it closes  as it touches the keys/case... hooray! that has
another work-around local to my system, as efl has no mechanism to do
this).

@fix
2018-05-18 21:45:20 +09:00
Mike Blumenkrantz b492e87851 use correct string for randr screen fuzzy matching
using the full edid string results in infinite recursion
2017-09-01 13:40:11 -04:00
Mike Blumenkrantz 75a12a9461 check for matching '/' in screen edid before fuzzy matching in randr init
if no / exists then this function is pointless
2017-09-01 13:40:11 -04:00
Mike Blumenkrantz 43d837d681 don't pretend randr mode can be null when it can't
CID 1379945
2017-08-25 14:47:10 -04:00
Carsten Haitzler 03aeb1d463 fix fallthrough warnings 2017-08-04 12:35:27 +09:00
Mike Blumenkrantz 6928ca8ce4 pass screen id when opening config dialog with ASK hotplug policy 2017-07-21 14:43:36 -04:00
Mike Blumenkrantz 48a7181089 add a configurable default policy (default: extend) for screen hotplugging
make an effort to "just work" instead of the classic enlightenment ux of being
as annoying as possible

ref T5707
2017-07-21 14:42:29 -04:00
Mike Blumenkrantz e65c64ff63 use 1 second for screen config apply delay
I want my life back from all this time spent waiting...
2017-07-20 17:18:33 -04:00
Carsten Haitzler 7ab621925f e randr2 - fix freeing of stringshare by making it a stringshare
cs->id was strduped but freed as a stringshare... so actually add it
as a stringshare.
2017-03-31 17:45:57 +09:00
Mike Blumenkrantz 32c55ebc51 handle null E_Comp->screen during randr2 shutdown
some output modules have no screen iface (e.g., buffer, wl_wl, wl_x11)
and so this will always be null
2017-03-10 15:55:19 -05: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
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
Carsten Haitzler e183ffa748 e randr2 - provide lookup funcs for screen and dpi 2016-01-08 18:04:53 +09:00
Carsten Haitzler 1fa0c79662 e randr - fix leak of modes list in randr code
this fixes a leak of the modes list in randr

@fix
2015-12-07 20:01:03 +09:00
Carsten Haitzler 58d5c6d3f6 e randr - slicken up fade to use sinusoidal interpolation
@feature
2015-12-07 20:00:14 +09:00
Carsten Haitzler f63f651800 e randr2 - remove auto-clone and now make randr dialog come up instead
some odd things happen with auto-clone, so give the user manual
intervention automatically with the randr conf dilaog coming up on an
unconfigured screen being detected.

@fix
2015-12-07 19:58:58 +09:00
Carsten Haitzler b018ac1abc e screens/zones/randr - store randr2 id in xinerama and zones for lookup
so e has a bit of a problem. we mostly deal with zones, BUt these
zones come from our old xinerama code (this likely should just die
some time) and THIS code gets fed info from e's randr code. we
re-fill/modify as randr finds new screens or things get reconfigured.
thus zones adapt. the problem is now all our zone code really has a
hard time reverse mapping the zone back to where it came from -eg the
randr screen data. you literally can't do a whole bunch of things like
know if that zone was an internal laptop lid or an external screen, or
if it was rotated or even what the dpi is... as you ave no deasy way
to map it back other than by guessing geometry matches.

this fixes that by storing the randr screen id (which should be
unique) fromt he original src randr screen in the xinerama screen and
then in the zone. with this you can do a quick lookup in the e randr
data should you ever need to find the info. this should pave the way
for some other fixes/improvements, but without this they cannot be done.

@fix
2015-11-11 21:22:30 +09:00
Mike Blumenkrantz 4b40ad10e5 always apply all randr changes after a screen event
fixes case where plugging an external monitor would cause the screen
to expand onto that display without the display being effectively usable
until after a restart
2015-10-01 13:17:27 -04:00
Mike Blumenkrantz 725890f105 emit randr change event on randr init
wayland compositors have been failing to create any outputs for some
time as a result of not getting any randr events on init
2015-08-12 20:17:25 -04:00
Mike Blumenkrantz 7986b084f8 enforce compositor canvas resizing/updating when emitting randr events
all compositors will want this to occur, so make it automatic
2015-08-12 19:27:53 -04:00
Carsten Haitzler 019b6641a3 e - randr - handle lid close screen turnoff correctly again
this USED to work until i made things like auto-clone work without
config and so on and that broke turning off closed lid screens. it
also works when i suspend while lid is closed and resume (i can only
test with lid open as i need to open lid to unsuspend).
2015-08-09 00:22:16 +09:00
Carsten Haitzler ee16a11455 e - randr allow you to turn off screens and keep them off if config says so 2015-07-19 22:41:48 +09:00
Carsten Haitzler 964fabe6e2 e randr2 - auto clone and use common res when doing so - make it work
tested this and made it work. should fix T2100
2015-07-12 18:12:00 +09:00
Carsten Haitzler d17851f714 fix leak in randr2 when matching clone modes 2015-06-08 20:53:13 +09:00
Carsten Haitzler 1a19a72a61 e - randr2 - filter to the "best" common mode match on clone config
this should fix T2100
2015-05-21 13:03:04 +09:00
Yomi aa56794304 Fix misspelling in e_randr2.c
Summary: Fix misspelling in e_randr2.c

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2476
2015-05-07 18:41:11 -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 97a1642222 fix typo when setting event state in e_randr2_screen_refresh_queue()
a non-event should not unset this variable
2015-04-23 08:33:20 -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 a4ea6e7f23 add a small screen management interface to E_Comp, remove hardcoded x11 randr calls
this interface is extremely basic and should allow easy additions for other display
backends
2015-04-22 21:19:00 -04:00
Mike Blumenkrantz e383b5b55a always register E_EVENT_RANDR_CHANGE
failing to register this will cause event handlers for it to fail
on creation
2015-04-22 21:18:53 -04:00
Mike Blumenkrantz 881e0ab805 move all x11-related randr code into e_comp_x_randr.c 2015-04-22 16:16:05 -04:00
Mike Blumenkrantz 7104e637ef _config_screen_find() -> e_randr2_config_screen_find() 2015-04-22 16:07:58 -04:00
Mike Blumenkrantz b4e65519d1 move acpi lid status tracking from e_randr to e_acpi 2015-04-22 16:05:16 -04:00
Mike Blumenkrantz 853d04592e move e_randr internal screen changing timer -> e_randr2_screen_refresh_queue() 2015-04-22 16:04:36 -04:00
Carsten Haitzler da4d1ecfe8 add options to randr2 to ignore acpi and hotplug randr events. 2015-04-09 15:44:07 +09:00
Carsten Haitzler e60889981e randr2 - handle missing clone src and walk back config only structs 2015-02-23 12:11:46 +09:00
Carsten Haitzler 054adb6351 e - randr - handle missing relative display and use priority for zone
this makes highest priority screen the lowest (0) zone. this also
handles missing screesn that you are relative "of". missing clones are
not working atm. also zone reconfigure moves windows now too
2015-02-13 19:24:31 +09:00
Carsten Haitzler adf5b5dc84 e - remove earns from randr2
for wahetever reason i dont get warnings from gcc:

-Wno-shadow -Wno-unused-but-set-parameter -Wno-clobbered -W -Wall -Wextra

are the warning flags i get and i simplt dont get a tonne like using
uninitialized var. don't know why.
2015-02-11 21:45:39 +09:00
Carsten Haitzler da7bb6e9a1 shut up shadow warnings 2015-02-11 12:28:29 +09:00
Carsten Haitzler 790183d74a e - randr - laptop lids - handle plug/unplug and well as lid open/close
this fixes some issues in the new randr2 code that made it not work
right with plug/unplug and lid close/open. now it does work right and
plugging/unplugging displays is seamless (if your driver does not give
plug/unplug events bind a key to update screen config acvtion and e
will figure it out when you hit the key).
2015-02-09 18:22:02 +09:00
Carsten Haitzler 91969500de e - randr2 - handle lid close/open as screen unplug/plug
when your laptop lid opens/closes even if we dont get a randr event
with a disconnect, the screen as logically been unplugged (you can't
see it anymore) so we should treat it as if the screen is not
connected. this fixes that.
2015-02-05 12:00:36 +09:00
Chris Michael 4b992e38fd de-e_comp_get()-ify e_randr2
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-27 14:35:45 -05:00
Carsten Haitzler 33d4531f1d e - rewrite randr code entirely. core and dialog. dialog is basic atm
the dialog for now is simple and lets you just raw edit the properties
per screen in a dialog. nothing fancy. not user firendly. but it works.

the randr core has been totally rewritten and tested against a range
of drivers and setups before even getting a commit. it works solidly
and configures screens reliably now. drivers tested:

nvidia
intel
radeon

some drivers still are unreliable in terms of delivering plug/unplug
events for outputs (both intel and radeon are flakey - nvidia is solid
and reliable). so to fix this there is now a screen redo action you
can bind to a hotkey or something and have e re-evaluate current
screen setup and apply ny pending config if needed.

also to make reconfiguring prettier the screen is faded to black
first, then configured, then faded back in. some drivers work
flawlessly with this, others still flicker some garbage.

i admit - i haven't tested nouveau, but my general take on this is the
randr code is now in far better shape than where it was (minus pretty
and easy dialog). the dialog can be done next, but i'd like to get the
core in now for more testing.

@fix
2015-01-25 22:50:23 +09:00