Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8212677: X11 default visual support for IM status window on VNC #345

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c
Original file line number Diff line number Diff line change
@@ -205,6 +205,8 @@ findWithTemplate(XVisualInfo *vinfo,
visualList = XGetVisualInfo(awt_display,
mask, vinfo, &visualsMatched);
if (visualList) {
int id = -1;
VisualID defaultVisual = XVisualIDFromVisual(DefaultVisual(awt_display, vinfo->screen));
defaultConfig = ZALLOC(_AwtGraphicsConfigData);
for (i = 0; i < visualsMatched; i++) {
memcpy(&defaultConfig->awt_visInfo, &visualList[i], sizeof(XVisualInfo));
@@ -213,20 +215,31 @@ findWithTemplate(XVisualInfo *vinfo,
/* we can't use awtJNI_CreateColorData here, because it'll pull,
SystemColor, which in turn will cause toolkit to be reinitialized */
if (awtCreateX11Colormap(defaultConfig)) {
/* Allocate white and black pixels for this visual */
color.flags = DoRed | DoGreen | DoBlue;
color.red = color.green = color.blue = 0x0000;
XAllocColor(awt_display, defaultConfig->awt_cmap, &color);
x11Screens[visualList[i].screen].blackpixel = color.pixel;
color.flags = DoRed | DoGreen | DoBlue;
color.red = color.green = color.blue = 0xffff;
XAllocColor(awt_display, defaultConfig->awt_cmap, &color);
x11Screens[visualList[i].screen].whitepixel = color.pixel;

XFree(visualList);
return defaultConfig;
if (visualList[i].visualid == defaultVisual) {
id = i;
break;
} else if (-1 == id) {
// Keep 1st match for fallback
id = i;
}
}
}
if (-1 != id) {
memcpy(&defaultConfig->awt_visInfo, &visualList[id], sizeof(XVisualInfo));
defaultConfig->awt_depth = visualList[id].depth;
/* Allocate white and black pixels for this visual */
color.flags = DoRed | DoGreen | DoBlue;
color.red = color.green = color.blue = 0x0000;
XAllocColor(awt_display, defaultConfig->awt_cmap, &color);
x11Screens[visualList[id].screen].blackpixel = color.pixel;
color.flags = DoRed | DoGreen | DoBlue;
color.red = color.green = color.blue = 0xffff;
XAllocColor(awt_display, defaultConfig->awt_cmap, &color);
x11Screens[visualList[id].screen].whitepixel = color.pixel;

XFree(visualList);
return defaultConfig;
}
XFree(visualList);
free((void *)defaultConfig);
}
5 changes: 3 additions & 2 deletions jdk/src/solaris/native/sun/awt/awt_InputMethod.c
Original file line number Diff line number Diff line change
@@ -676,9 +676,10 @@ static StatusWindow *createStatusWindow(
return NULL;
}
statusWindow->w = status;
//12-point font
//12, 13-point fonts
statusWindow->fontset = XCreateFontSet(dpy,
"-*-*-medium-r-normal-*-*-120-*-*-*-*",
"-*-*-medium-r-normal-*-*-120-*-*-*-*," \
"-*-*-medium-r-normal-*-*-130-*-*-*-*",
&mclr, &mccr, &dsr);
/* In case we didn't find the font set, release the list of missing characters */
if (mccr > 0) {