summaryrefslogtreecommitdiff
path: root/recipes/xserver-common/files/avoid-rotated-server.patch
blob: 7511ed9acdd1a5672d6c87dde63a1a0ece3ced6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Index: xserver-common-1.25/X11/Xserver
===================================================================
--- xserver-common-1.25.orig/X11/Xserver	2009-06-18 20:48:31.000000000 +0000
+++ xserver-common-1.25/X11/Xserver	2009-06-18 20:49:36.000000000 +0000
@@ -48,6 +48,7 @@
 
 SCREEN_SIZE=`fallback_screen_arg`
 export USER=root
+export XSERVER_DEFAULT_ORIENTATION=normal
 
 ARGS="-br -pn $INPUT_EXTRA_ARGS"
 
@@ -88,7 +89,9 @@
 	"SHARP Shepherd" | "SHARP Husky" | "SHARP Corgi")
 		ARGS="$ARGS -dpi 200 -rgba rgb" ;;
 	"SHARP Spitz" | "SHARP Akita" | "SHARP Borzoi")
-		ARGS="$ARGS -dpi 200 -rgba rgb -screen 480x640@270" ;;
+		ARGS="$ARGS -dpi 200 -rgba rgb -screen 480x640"
+		export XSERVER_DEFAULT_ORIENTATION=normal
+		;;
 	"Simpad")
 		ARGS="$ARGS -dpi 100 -rgba rgb" ;;
 	"Generic OMAP1510/1610/1710")
Index: xserver-common-1.25/X11/Xinit.d/11zaurus
===================================================================
--- xserver-common-1.25.orig/X11/Xinit.d/11zaurus	2009-06-18 20:48:31.000000000 +0000
+++ xserver-common-1.25/X11/Xinit.d/11zaurus	2009-06-18 21:07:14.000000000 +0000
@@ -1,23 +1,35 @@
 #!/bin/sh
 
-if [ -z "`which chkhinge`" ]; then
-   # probably not a clamshell zaurus
-   exit 0
+if [ -z "`which chkhinge 2>/dev/null`" ]; then
+   # not a clamshell zaurus or we have kernel 2.6
+   # no rotation status check available
+   CHCK=true
+else
+   CHCK=chkhinge
 fi
 
 module_id() {
     # Get model name
-    echo `grep "^Hardware" /proc/cpuinfo | sed -e "s/.*: *//" | tr a-z A-Z`
+    echo `grep "^Hardware" /proc/cpuinfo | sed -e "s/.*: *//"`
 }
 
-chkhinge -e
+$CHCK -e
 if [ $? = 12 ]; then
    case `module_id` in
-   	*SPITZ | *AKITA | *BORZOI)
-   		DIRECTION="left" ;;
-        default)
+   	*Spitz | *Akita | *Borzoi)
+   		DIRECTION="normal" ;;
+        *)
                 DIRECTION="right" ;;
    esac
-   xrandr -o $DIRECTION
+else
+   case `module_id` in
+   	*Spitz | *Akita | *Borzoi)
+		# Xfbdev needs to settle
+		sleep 2
+   		DIRECTION="right" ;;
+        *)
+                DIRECTION="normal" ;;
+   esac
 fi
 
+xrandr -o $DIRECTION