6882909: Resetting a full-screen window to normal rotates screen to normal orientation.
authordcherepanov
Thu, 12 Nov 2009 12:06:46 +0300
changeset 4266 b105f9beb20f
parent 4265 8950a3d33a86
child 4267 3dee4217d3dc
6882909: Resetting a full-screen window to normal rotates screen to normal orientation. Summary: retain rotation upon change to full screen mode Reviewed-by: art, anthony
jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c
--- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Wed Nov 11 19:18:27 2009 +0300
+++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Thu Nov 12 12:06:46 2009 +0300
@@ -1681,6 +1681,9 @@
                                      Rotation rotation,
                                      short rate,
                                      Time timestamp);
+typedef Rotation
+    (*XRRConfigRotationsType)(XRRScreenConfiguration *config,
+                              Rotation *current_rotation);
 
 static XRRQueryVersionType               awt_XRRQueryVersion;
 static XRRGetScreenInfoType              awt_XRRGetScreenInfo;
@@ -1690,6 +1693,7 @@
 static XRRConfigSizesType                awt_XRRConfigSizes;
 static XRRConfigCurrentConfigurationType awt_XRRConfigCurrentConfiguration;
 static XRRSetScreenConfigAndRateType     awt_XRRSetScreenConfigAndRate;
+static XRRConfigRotationsType            awt_XRRConfigRotations;
 
 #define LOAD_XRANDR_FUNC(f) \
     do { \
@@ -1756,6 +1760,7 @@
     LOAD_XRANDR_FUNC(XRRConfigSizes);
     LOAD_XRANDR_FUNC(XRRConfigCurrentConfiguration);
     LOAD_XRANDR_FUNC(XRRSetScreenConfigAndRate);
+    LOAD_XRANDR_FUNC(XRRConfigRotations);
 
     return JNI_TRUE;
 }
@@ -2010,6 +2015,7 @@
     jboolean success = JNI_FALSE;
     XRRScreenConfiguration *config;
     Drawable root;
+    Rotation currentRotation = RR_Rotate_0;
 
     AWT_LOCK();
 
@@ -2021,6 +2027,7 @@
         short chosenRate = -1;
         int nsizes;
         XRRScreenSize *sizes = awt_XRRConfigSizes(config, &nsizes);
+        awt_XRRConfigRotations(config, &currentRotation);
 
         if (sizes != NULL) {
             int i, j;
@@ -2054,7 +2061,7 @@
             Status status =
                 awt_XRRSetScreenConfigAndRate(awt_display, config, root,
                                               chosenSizeIndex,
-                                              RR_Rotate_0,
+                                              currentRotation,
                                               chosenRate,
                                               CurrentTime);