< prev index next >
src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c
Print this page
*** 1665,1674 ****
--- 1665,1679 ----
typedef XRROutputInfo * (*XRRGetOutputInfoType)(Display *dpy,
XRRScreenResources *resources, RROutput output);
typedef void (*XRRFreeOutputInfoType)(XRROutputInfo *outputInfo);
+ typedef XRRCrtcInfo* (*XRRGetCrtcInfoType)(Display *dpy,
+ XRRScreenResources *resources, RRCrtc crtc);
+
+ typedef void (*XRRFreeCrtcInfoType)(XRRCrtcInfo *crtcInfo);
+
static XRRQueryVersionType awt_XRRQueryVersion;
static XRRGetScreenInfoType awt_XRRGetScreenInfo;
static XRRFreeScreenConfigInfoType awt_XRRFreeScreenConfigInfo;
static XRRConfigRatesType awt_XRRConfigRates;
static XRRConfigCurrentRateType awt_XRRConfigCurrentRate;
*** 1678,1687 ****
--- 1683,1694 ----
static XRRConfigRotationsType awt_XRRConfigRotations;
static XRRGetScreenResourcesType awt_XRRGetScreenResources;
static XRRFreeScreenResourcesType awt_XRRFreeScreenResources;
static XRRGetOutputInfoType awt_XRRGetOutputInfo;
static XRRFreeOutputInfoType awt_XRRFreeOutputInfo;
+ static XRRGetCrtcInfoType awt_XRRGetCrtcInfo;
+ static XRRFreeCrtcInfoType awt_XRRFreeCrtcInfo;
#define LOAD_XRANDR_FUNC(f) \
do { \
awt_##f = (f##Type)dlsym(pLibRandR, #f); \
if (awt_##f == NULL) { \
*** 1753,1762 ****
--- 1760,1771 ----
LOAD_XRANDR_FUNC(XRRConfigRotations);
LOAD_XRANDR_FUNC(XRRGetScreenResources);
LOAD_XRANDR_FUNC(XRRFreeScreenResources);
LOAD_XRANDR_FUNC(XRRGetOutputInfo);
LOAD_XRANDR_FUNC(XRRFreeOutputInfo);
+ LOAD_XRANDR_FUNC(XRRGetCrtcInfo);
+ LOAD_XRANDR_FUNC(XRRFreeCrtcInfo);
return JNI_TRUE;
}
static jobject
*** 1893,1903 ****
XRRScreenConfiguration *config;
jobject displayMode = NULL;
AWT_LOCK();
! if (screen < ScreenCount(awt_display)) {
config = awt_XRRGetScreenInfo(awt_display,
RootWindow(awt_display, screen));
if (config != NULL) {
Rotation rotation;
--- 1902,1954 ----
XRRScreenConfiguration *config;
jobject displayMode = NULL;
AWT_LOCK();
! if (usingXinerama && XScreenCount(awt_display) > 0) {
! XRRScreenResources *res = awt_XRRGetScreenResources(awt_display,
! RootWindow(awt_display, 0));
! if (res) {
! if (res->noutput > screen) {
! XRROutputInfo *output_info = awt_XRRGetOutputInfo(awt_display,
! res, res->outputs[screen]);
! if (output_info) {
! if (output_info->crtc) {
! XRRCrtcInfo *crtc_info =
! awt_XRRGetCrtcInfo (awt_display, res,
! output_info->crtc);
! if (crtc_info) {
! if (crtc_info->mode) {
! int i;
! for (i = 0; i < res->nmode; i++) {
! XRRModeInfo *mode = &res->modes[i];
! if (mode->id == crtc_info->mode) {
! float rate = 0;
! if (mode->hTotal && mode->vTotal) {
! rate = ((float)mode->dotClock /
! ((float)mode->hTotal *
! (float)mode->vTotal));
! }
! displayMode = X11GD_CreateDisplayMode(
! env,
! mode->width,
! mode->height,
! BIT_DEPTH_MULTI,
! (int)(rate +.2));
! break;
! }
! }
! }
! awt_XRRFreeCrtcInfo(crtc_info);
! }
! }
! awt_XRRFreeOutputInfo(output_info);
! }
! }
! awt_XRRFreeScreenResources(res);
! }
! } else {
config = awt_XRRGetScreenInfo(awt_display,
RootWindow(awt_display, screen));
if (config != NULL) {
Rotation rotation;
*** 1952,1962 ****
if (res->noutput > screen) {
XRROutputInfo *output_info = awt_XRRGetOutputInfo(awt_display,
res, res->outputs[screen]);
if (output_info) {
int i;
! for (i = 0; i < res->nmode; i++) {
RRMode m = output_info->modes[i];
int j;
XRRModeInfo *mode;
for (j = 0; j < res->nmode; j++) {
mode = &res->modes[j];
--- 2003,2013 ----
if (res->noutput > screen) {
XRROutputInfo *output_info = awt_XRRGetOutputInfo(awt_display,
res, res->outputs[screen]);
if (output_info) {
int i;
! for (i = 0; i < output_info->nmode; i++) {
RRMode m = output_info->modes[i];
int j;
XRRModeInfo *mode;
for (j = 0; j < res->nmode; j++) {
mode = &res->modes[j];
< prev index next >