summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-12-30 16:58:07 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-12-30 17:03:35 +0000
commitba156d2f464e5cc0ff728b6dbde3f5ed76cda717 (patch)
tree8a2e769b87b85cf391a08aa341c04abde80a0ba1
parent0404e68632514821bddf4c827680cd244db508d9 (diff)
downloadenlightenment-ba156d2f464e5cc0ff728b6dbde3f5ed76cda717.tar.gz
gesture - vm (vbox) detect hack to work around xorg no display bug
so... you go through wizard - only in vbox it seems (or maybe other vm's - don't know - only tried vbox - this doesnt happen on real systems). at the end e restarts... and it's blank. e is actually rendering. you can screengrab (eg import -window root out.png) and see the screen drawn just fine. xrandr is all set up right - everything is kosher... but nothing will display except the curosr. xorg is just not displaying rendered content. somehow e's gesture code and use of logind/libinput to get inpiut devices for gestures tickles this xorg bug. i don't quite know why as xorg doesnt seem to be complaining. once you restart the xorg process everything works fine from there on. it's some bug inside xorg that just refuses to display output. manually changing resolution with xrandr will reset things and have things render... until e restarts. a fukll xorg re-run is needed to fix it... there just is nothing i can see that e is doing wrong or to fix in e... so this is a workaround the xorg side by just not using the gesture support if on a vm. they won't have touchpads anyway and emulate mice so ... no real loss. this won't affect peolpe on real systems and it may not always work as a workaround as it relies on systemd-detect-virt or hostnamectl. @fix
-rw-r--r--src/bin/e_gesture.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/bin/e_gesture.c b/src/bin/e_gesture.c
index f447d38c88..9d2d48e247 100644
--- a/src/bin/e_gesture.c
+++ b/src/bin/e_gesture.c
@@ -208,10 +208,41 @@ _shutdown_for_x11(void)
elput_shutdown();
}
+static int
+_detect_vm(void)
+{
+ static int on_vm = -1;
+ int ret;
+
+ if (on_vm >= 0) return on_vm;
+ ret = system("systemd-detect-virt");
+ if (ret == 0) on_vm = 1;
+ else if (ret == 1) on_vm = 0;
+ else
+ {
+ ret = system("hostnamectl status | grep 'Chassis: vm'");
+ if (ret == 0) on_vm = 1;
+ else if (ret == 1) on_vm = 0;
+ // fallback to assuming not on vm
+ else on_vm = 0;
+ }
+ return on_vm;
+}
E_API int
e_gesture_init(void)
{
+ // we have some bizarre bug on vbox -> this causes xorg to stop displaying
+ // the screen output even though it's rendered and you can grab it through
+ // screenshots, xrandr reports a perfectly well configured display.
+ // somehow using elput to get input devices from logind causes xorg
+ // internally to not handle e's first restart after wizard - as if
+ // the xserver goes into some bixarre internal state - it doesn't report
+ // any errors though. this works around that by just avoiding the gesture
+ // support on vm's - they wont have touchpads anyway as they will emulate
+ // a normal mouse mostly... :)
+ if (_detect_vm()) return 1;
+
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
{
_init_for_x11();
@@ -230,6 +261,8 @@ e_gesture_init(void)
E_API int
e_gesture_shutdown(void)
{
+// if (_detect_vm()) return 1;
+
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
{
_shutdown_for_x11();