提交 a3f28874 编写于 作者: D dcherepanov

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
上级 f3bbbdca
...@@ -1681,6 +1681,9 @@ typedef Status ...@@ -1681,6 +1681,9 @@ typedef Status
Rotation rotation, Rotation rotation,
short rate, short rate,
Time timestamp); Time timestamp);
typedef Rotation
(*XRRConfigRotationsType)(XRRScreenConfiguration *config,
Rotation *current_rotation);
static XRRQueryVersionType awt_XRRQueryVersion; static XRRQueryVersionType awt_XRRQueryVersion;
static XRRGetScreenInfoType awt_XRRGetScreenInfo; static XRRGetScreenInfoType awt_XRRGetScreenInfo;
...@@ -1690,6 +1693,7 @@ static XRRConfigCurrentRateType awt_XRRConfigCurrentRate; ...@@ -1690,6 +1693,7 @@ static XRRConfigCurrentRateType awt_XRRConfigCurrentRate;
static XRRConfigSizesType awt_XRRConfigSizes; static XRRConfigSizesType awt_XRRConfigSizes;
static XRRConfigCurrentConfigurationType awt_XRRConfigCurrentConfiguration; static XRRConfigCurrentConfigurationType awt_XRRConfigCurrentConfiguration;
static XRRSetScreenConfigAndRateType awt_XRRSetScreenConfigAndRate; static XRRSetScreenConfigAndRateType awt_XRRSetScreenConfigAndRate;
static XRRConfigRotationsType awt_XRRConfigRotations;
#define LOAD_XRANDR_FUNC(f) \ #define LOAD_XRANDR_FUNC(f) \
do { \ do { \
...@@ -1756,6 +1760,7 @@ X11GD_InitXrandrFuncs(JNIEnv *env) ...@@ -1756,6 +1760,7 @@ X11GD_InitXrandrFuncs(JNIEnv *env)
LOAD_XRANDR_FUNC(XRRConfigSizes); LOAD_XRANDR_FUNC(XRRConfigSizes);
LOAD_XRANDR_FUNC(XRRConfigCurrentConfiguration); LOAD_XRANDR_FUNC(XRRConfigCurrentConfiguration);
LOAD_XRANDR_FUNC(XRRSetScreenConfigAndRate); LOAD_XRANDR_FUNC(XRRSetScreenConfigAndRate);
LOAD_XRANDR_FUNC(XRRConfigRotations);
return JNI_TRUE; return JNI_TRUE;
} }
...@@ -2010,6 +2015,7 @@ Java_sun_awt_X11GraphicsDevice_configDisplayMode ...@@ -2010,6 +2015,7 @@ Java_sun_awt_X11GraphicsDevice_configDisplayMode
jboolean success = JNI_FALSE; jboolean success = JNI_FALSE;
XRRScreenConfiguration *config; XRRScreenConfiguration *config;
Drawable root; Drawable root;
Rotation currentRotation = RR_Rotate_0;
AWT_LOCK(); AWT_LOCK();
...@@ -2021,6 +2027,7 @@ Java_sun_awt_X11GraphicsDevice_configDisplayMode ...@@ -2021,6 +2027,7 @@ Java_sun_awt_X11GraphicsDevice_configDisplayMode
short chosenRate = -1; short chosenRate = -1;
int nsizes; int nsizes;
XRRScreenSize *sizes = awt_XRRConfigSizes(config, &nsizes); XRRScreenSize *sizes = awt_XRRConfigSizes(config, &nsizes);
awt_XRRConfigRotations(config, &currentRotation);
if (sizes != NULL) { if (sizes != NULL) {
int i, j; int i, j;
...@@ -2054,7 +2061,7 @@ Java_sun_awt_X11GraphicsDevice_configDisplayMode ...@@ -2054,7 +2061,7 @@ Java_sun_awt_X11GraphicsDevice_configDisplayMode
Status status = Status status =
awt_XRRSetScreenConfigAndRate(awt_display, config, root, awt_XRRSetScreenConfigAndRate(awt_display, config, root,
chosenSizeIndex, chosenSizeIndex,
RR_Rotate_0, currentRotation,
chosenRate, chosenRate,
CurrentTime); CurrentTime);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册