Re: RFR: X11 default visual support for IM status window on VNC

2019-01-29 Thread Sergey Bylokhov

Looks fine, if there are no other comments I'll push the fix this week.


On 21/01/2019 20:08, Ichiroh Takiguchi wrote:

Hello Sergey.

Sorry, code conflict was there.
I fixed code conflict and modified Copyright year.

Could you review the fix again ?

Bug:    https://bugs.openjdk.java.net/browse/JDK-8212677
Change: https://cr.openjdk.java.net/~itakiguchi/8212677/webrev.01/

Thanks,
Ichiroh Takiguchi
IBM Japan, Ltd.

On 2018-12-01 09:49, Sergey Bylokhov wrote:

Looks fine, if there are no other comments I'll push the fix.

On 26/11/2018 05:02, Ichiroh Takiguchi wrote:

Hello.

Could you review the fix ?

Bug:    https://bugs.openjdk.java.net/browse/JDK-8212677
Change: https://cr.openjdk.java.net/~itakiguchi/8212677/webrev.00/

Screen shots are in JDK-8212677.

I'd like to obtain a sponsor for this issue.

Thanks,
Ichiroh Takiguchi
IBM Japan, Ltd.

On 2018-06-21 21:58, Ichiroh Takiguchi wrote:

Hello Phil.

I'm sorry, I forgot to put my comment against your question.


Is this changing the default visual  for all WIndows, not just the IM status 
window?
I think we need to understand the implications before this can be accepted.

I put following debug code:
===
diff -r e1b3def12624
src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
--- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
 Wed Jun 13 06:35:04 2018 +0200
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
 Thu Jun 21 21:23:11 2018 +0900
@@ -667,6 +667,7 @@
 InputOutput,
adata->awt_visInfo.visual,
 attribmask, &attrib);
+    fprintf(stderr, "status window id = 0x%X\n", status);
 XSelectInput(dpy, status,
  ExposureMask | StructureNotifyMask | EnterWindowMask |
  LeaveWindowMask | VisibilityChangeMask);
@@ -680,6 +681,21 @@
 statusWindow->fontset = XCreateFontSet(dpy,

"-*-*-medium-r-normal-*-*-120-*-*-*-*",
&mclr, &mccr, &dsr);
+    {
+    int cntFonts;
+    for(cntFonts = 0; cntFonts < mccr; cntFonts++) {
+    fprintf(stderr, "[M][%d] %s\n", cntFonts, mclr[cntFonts]);
+    }
+    }
+    {
+    XFontStruct **font_struct_list;
+    char **font_name_list;
+    int cntFonts;
+    int numFonts = XFontsOfFontSet(statusWindow->fontset,
&font_struct_list, &font_name_list);
+    for(cntFonts = 0; cntFonts < numFonts; cntFonts++) {
+    fprintf(stderr, "[L][%d] %s\n", cntFonts,
font_name_list[cntFonts]);
+    }
+    }
 /* In case we didn't find the font set, release the list of
missing characters */
 if (mccr > 0) {
 XFreeStringList(mclr);
===

I tested it on RHEL7.
I thought since window id was assigned, but it was gone on current code.
===
$ java -jar Notepad.jar
status window id = 0x455
...
$ xwininfo -id 0x455
X Error: 9: Bad Drawable: 0x455
  Request Major code: 14
  Request serial number: 3
xwininfo: error: No such window with id 0x455.
===

===
$ java -jar Notepad.jar
status window id = 0x4CA
...
$ xwininfo -id 0x4CA

xwininfo: Window id: 0x4ca (has no name)

  Absolute upper-left X:  0
  Absolute upper-left Y:  600
  Relative upper-left X:  0
  Relative upper-left Y:  600
  Width: 80
  Height: 22
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsUnMapped
  Override Redirect State: yes
  Corners:  +0+600  -944+600  -944-146  +0-146
  -geometry 80x22+0+600
===

According to main window: (Left side: without fix, right side: with fix)
===
xwininfo: Window id: 0x409 " (failure   |   xwininfo: Window id:
0x460007e " (failure

  Absolute upper-left X: 4   Absolute upper-left X:  4
  Absolute upper-left Y: 25  Absolute upper-left Y: 25
  Relative upper-left X: 0   Relative upper-left X:  0
  Relative upper-left Y: 0   Relative upper-left Y:  0
  Width: 492 Width: 492
  Height: 571 Height: 571
  Depth: 24 Depth: 24
  Visual: 0x169 | Visual: 0x21
  Visual Class: TrueColor Visual Class: TrueColor
  Border width: 0 Border width: 0
  Class: InputOutput Class: InputOutput
  Colormap: 0x408 (not installed)   | Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity Bit Gravity State:
NorthWestGravity
  Window Gravity State: NorthWestGravity  Window Gravity
State: NorthWestGravity
  Backing Store State: NotUseful Backing Store State: NotUseful
  Save Under State: no    Save Under State: no
  Map State: IsViewable   Map State: IsViewable
  Override Redirect State: no Override Redirect State: no
  Corners:  +4+25  -528+25  -528-172  +4-1 Corners:  +4+25
-528+25  -528-172  +4-1
 

Re: RFR: X11 default visual support for IM status window on VNC

2019-01-21 Thread Ichiroh Takiguchi

Hello Sergey.

Sorry, code conflict was there.
I fixed code conflict and modified Copyright year.

Could you review the fix again ?

Bug:https://bugs.openjdk.java.net/browse/JDK-8212677
Change: https://cr.openjdk.java.net/~itakiguchi/8212677/webrev.01/

Thanks,
Ichiroh Takiguchi
IBM Japan, Ltd.

On 2018-12-01 09:49, Sergey Bylokhov wrote:

Looks fine, if there are no other comments I'll push the fix.

On 26/11/2018 05:02, Ichiroh Takiguchi wrote:

Hello.

Could you review the fix ?

Bug:    https://bugs.openjdk.java.net/browse/JDK-8212677
Change: https://cr.openjdk.java.net/~itakiguchi/8212677/webrev.00/

Screen shots are in JDK-8212677.

I'd like to obtain a sponsor for this issue.

Thanks,
Ichiroh Takiguchi
IBM Japan, Ltd.

On 2018-06-21 21:58, Ichiroh Takiguchi wrote:

Hello Phil.

I'm sorry, I forgot to put my comment against your question.

Is this changing the default visual  for all WIndows, not just the 
IM status window?
I think we need to understand the implications before this can be 
accepted.

I put following debug code:
===
diff -r e1b3def12624
src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
--- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
 Wed Jun 13 06:35:04 2018 +0200
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
 Thu Jun 21 21:23:11 2018 +0900
@@ -667,6 +667,7 @@
 InputOutput,
 
adata->awt_visInfo.visual,
 attribmask, 
&attrib);

+    fprintf(stderr, "status window id = 0x%X\n", status);
 XSelectInput(dpy, status,
  ExposureMask | StructureNotifyMask 
| EnterWindowMask |
  LeaveWindowMask | 
VisibilityChangeMask);

@@ -680,6 +681,21 @@
 statusWindow->fontset = XCreateFontSet(dpy,

"-*-*-medium-r-normal-*-*-120-*-*-*-*",
    
&mclr, &mccr, &dsr);

+    {
+    int cntFonts;
+    for(cntFonts = 0; cntFonts < mccr; cntFonts++) {
+    fprintf(stderr, "[M][%d] %s\n", cntFonts, 
mclr[cntFonts]);

+    }
+    }
+    {
+    XFontStruct **font_struct_list;
+    char **font_name_list;
+    int cntFonts;
+    int numFonts = XFontsOfFontSet(statusWindow->fontset,
&font_struct_list, &font_name_list);
+    for(cntFonts = 0; cntFonts < numFonts; cntFonts++) {
+    fprintf(stderr, "[L][%d] %s\n", cntFonts,
font_name_list[cntFonts]);
+    }
+    }
 /* In case we didn't find the font set, release the list of
missing characters */
 if (mccr > 0) {
 XFreeStringList(mclr);
===

I tested it on RHEL7.
I thought since window id was assigned, but it was gone on current 
code.

===
$ java -jar Notepad.jar
status window id = 0x455
...
$ xwininfo -id 0x455
X Error: 9: Bad Drawable: 0x455
  Request Major code: 14
  Request serial number: 3
xwininfo: error: No such window with id 0x455.
===

===
$ java -jar Notepad.jar
status window id = 0x4CA
...
$ xwininfo -id 0x4CA

xwininfo: Window id: 0x4ca (has no name)

  Absolute upper-left X:  0
  Absolute upper-left Y:  600
  Relative upper-left X:  0
  Relative upper-left Y:  600
  Width: 80
  Height: 22
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsUnMapped
  Override Redirect State: yes
  Corners:  +0+600  -944+600  -944-146  +0-146
  -geometry 80x22+0+600
===

According to main window: (Left side: without fix, right side: with 
fix)

===
xwininfo: Window id: 0x409 " (failure   |   xwininfo: Window 
id:

0x460007e " (failure

  Absolute upper-left X:  
4   Absolute upper-left 
X:  4
  Absolute upper-left Y:  
25  Absolute upper-left Y:  
25
  Relative upper-left X:  
0   Relative upper-left 
X:  0
  Relative upper-left Y:  
0   Relative upper-left 
Y:  0
  Width: 
492  
Width: 492
  Height: 
571 
Height: 571
  Depth: 
24   
Depth: 24
  Visual: 
0x169 
| Visual: 0x21
  Visual Class: 
TrueColor Visual 
Class: TrueColor
  Border width: 
0 
Border width: 0
  Class: 
InputOutput  
Class: InputOutput
  Colormap: 0x408 (not installed)   | 
Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity Bit 
Gravity State:

NorthWestGravity
  Window Gravity State: NorthWestGravity  Window 
Gravity

State: NorthWestGravity
  Backing Store State: NotUseful  
Backing Store State: NotUseful
  Save Under State: 
no    Save Under 
State: no
  Map Stat

Re: RFR: X11 default visual support for IM status window on VNC

2018-11-30 Thread Sergey Bylokhov

Looks fine, if there are no other comments I'll push the fix.

On 26/11/2018 05:02, Ichiroh Takiguchi wrote:

Hello.

Could you review the fix ?

Bug:    https://bugs.openjdk.java.net/browse/JDK-8212677
Change: https://cr.openjdk.java.net/~itakiguchi/8212677/webrev.00/

Screen shots are in JDK-8212677.

I'd like to obtain a sponsor for this issue.

Thanks,
Ichiroh Takiguchi
IBM Japan, Ltd.

On 2018-06-21 21:58, Ichiroh Takiguchi wrote:

Hello Phil.

I'm sorry, I forgot to put my comment against your question.


Is this changing the default visual  for all WIndows, not just the IM status 
window?
I think we need to understand the implications before this can be accepted.

I put following debug code:
===
diff -r e1b3def12624
src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
--- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
 Wed Jun 13 06:35:04 2018 +0200
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
 Thu Jun 21 21:23:11 2018 +0900
@@ -667,6 +667,7 @@
 InputOutput,
 adata->awt_visInfo.visual,
 attribmask, &attrib);
+    fprintf(stderr, "status window id = 0x%X\n", status);
 XSelectInput(dpy, status,
  ExposureMask | StructureNotifyMask | EnterWindowMask |
  LeaveWindowMask | VisibilityChangeMask);
@@ -680,6 +681,21 @@
 statusWindow->fontset = XCreateFontSet(dpy,

"-*-*-medium-r-normal-*-*-120-*-*-*-*",
    &mclr, &mccr, &dsr);
+    {
+    int cntFonts;
+    for(cntFonts = 0; cntFonts < mccr; cntFonts++) {
+    fprintf(stderr, "[M][%d] %s\n", cntFonts, mclr[cntFonts]);
+    }
+    }
+    {
+    XFontStruct **font_struct_list;
+    char **font_name_list;
+    int cntFonts;
+    int numFonts = XFontsOfFontSet(statusWindow->fontset,
&font_struct_list, &font_name_list);
+    for(cntFonts = 0; cntFonts < numFonts; cntFonts++) {
+    fprintf(stderr, "[L][%d] %s\n", cntFonts,
font_name_list[cntFonts]);
+    }
+    }
 /* In case we didn't find the font set, release the list of
missing characters */
 if (mccr > 0) {
 XFreeStringList(mclr);
===

I tested it on RHEL7.
I thought since window id was assigned, but it was gone on current code.
===
$ java -jar Notepad.jar
status window id = 0x455
...
$ xwininfo -id 0x455
X Error: 9: Bad Drawable: 0x455
  Request Major code: 14
  Request serial number: 3
xwininfo: error: No such window with id 0x455.
===

===
$ java -jar Notepad.jar
status window id = 0x4CA
...
$ xwininfo -id 0x4CA

xwininfo: Window id: 0x4ca (has no name)

  Absolute upper-left X:  0
  Absolute upper-left Y:  600
  Relative upper-left X:  0
  Relative upper-left Y:  600
  Width: 80
  Height: 22
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsUnMapped
  Override Redirect State: yes
  Corners:  +0+600  -944+600  -944-146  +0-146
  -geometry 80x22+0+600
===

According to main window: (Left side: without fix, right side: with fix)
===
xwininfo: Window id: 0x409 " (failure   |   xwininfo: Window id:
0x460007e " (failure

  Absolute upper-left X:  4   Absolute upper-left X:  4
  Absolute upper-left Y:  25  Absolute upper-left Y:  25
  Relative upper-left X:  0   Relative upper-left X:  0
  Relative upper-left Y:  0   Relative upper-left Y:  0
  Width: 492  Width: 492
  Height: 571 Height: 571
  Depth: 24   Depth: 24
  Visual: 0x169 | Visual: 0x21
  Visual Class: TrueColor Visual Class: TrueColor
  Border width: 0 Border width: 0
  Class: InputOutput  Class: InputOutput
  Colormap: 0x408 (not installed)   | Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity Bit Gravity State:
NorthWestGravity
  Window Gravity State: NorthWestGravity  Window Gravity
State: NorthWestGravity
  Backing Store State: NotUseful  Backing Store State: NotUseful
  Save Under State: no    Save Under State: no
  Map State: IsViewable   Map State: IsViewable
  Override Redirect State: no Override Redirect State: no
  Corners:  +4+25  -528+25  -528-172  +4-1    Corners:  +4+25
-528+25  -528-172  +4-1
  -geometry 492x571+0+0   -geometry 492x571+0+0
===

So main window's visual also changed by this fix.


Similarly for the fontset cha

RFR: X11 default visual support for IM status window on VNC

2018-11-26 Thread Ichiroh Takiguchi

Hello.

Could you review the fix ?

Bug:https://bugs.openjdk.java.net/browse/JDK-8212677
Change: https://cr.openjdk.java.net/~itakiguchi/8212677/webrev.00/

Screen shots are in JDK-8212677.

I'd like to obtain a sponsor for this issue.

Thanks,
Ichiroh Takiguchi
IBM Japan, Ltd.

On 2018-06-21 21:58, Ichiroh Takiguchi wrote:

Hello Phil.

I'm sorry, I forgot to put my comment against your question.

Is this changing the default visual  for all WIndows, not just the IM 
status window?
I think we need to understand the implications before this can be 
accepted.

I put following debug code:
===
diff -r e1b3def12624
src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
--- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
 Wed Jun 13 06:35:04 2018 +0200
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
 Thu Jun 21 21:23:11 2018 +0900
@@ -667,6 +667,7 @@
 InputOutput,
 adata->awt_visInfo.visual,
 attribmask, &attrib);
+fprintf(stderr, "status window id = 0x%X\n", status);
 XSelectInput(dpy, status,
  ExposureMask | StructureNotifyMask | EnterWindowMask 
|

  LeaveWindowMask | VisibilityChangeMask);
@@ -680,6 +681,21 @@
 statusWindow->fontset = XCreateFontSet(dpy,

"-*-*-medium-r-normal-*-*-120-*-*-*-*",
&mclr, &mccr, &dsr);
+{
+int cntFonts;
+for(cntFonts = 0; cntFonts < mccr; cntFonts++) {
+fprintf(stderr, "[M][%d] %s\n", cntFonts, mclr[cntFonts]);
+}
+}
+{
+XFontStruct **font_struct_list;
+char **font_name_list;
+int cntFonts;
+int numFonts = XFontsOfFontSet(statusWindow->fontset,
&font_struct_list, &font_name_list);
+for(cntFonts = 0; cntFonts < numFonts; cntFonts++) {
+fprintf(stderr, "[L][%d] %s\n", cntFonts,
font_name_list[cntFonts]);
+}
+}
 /* In case we didn't find the font set, release the list of
missing characters */
 if (mccr > 0) {
 XFreeStringList(mclr);
===

I tested it on RHEL7.
I thought since window id was assigned, but it was gone on current 
code.

===
$ java -jar Notepad.jar
status window id = 0x455
...
$ xwininfo -id 0x455
X Error: 9: Bad Drawable: 0x455
  Request Major code: 14
  Request serial number: 3
xwininfo: error: No such window with id 0x455.
===

===
$ java -jar Notepad.jar
status window id = 0x4CA
...
$ xwininfo -id 0x4CA

xwininfo: Window id: 0x4ca (has no name)

  Absolute upper-left X:  0
  Absolute upper-left Y:  600
  Relative upper-left X:  0
  Relative upper-left Y:  600
  Width: 80
  Height: 22
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsUnMapped
  Override Redirect State: yes
  Corners:  +0+600  -944+600  -944-146  +0-146
  -geometry 80x22+0+600
===

According to main window: (Left side: without fix, right side: with 
fix)

===
xwininfo: Window id: 0x409 " (failure   |   xwininfo: Window id:
0x460007e " (failure

  Absolute upper-left X:  4   Absolute upper-left 
X:  4
  Absolute upper-left Y:  25  Absolute upper-left 
Y:  25
  Relative upper-left X:  0   Relative upper-left 
X:  0
  Relative upper-left Y:  0   Relative upper-left 
Y:  0

  Width: 492  Width: 492
  Height: 571 Height: 571
  Depth: 24   Depth: 24
  Visual: 0x169 | Visual: 0x21
  Visual Class: TrueColor Visual Class: 
TrueColor

  Border width: 0 Border width: 0
  Class: InputOutput  Class: InputOutput
  Colormap: 0x408 (not installed)   | Colormap: 0x20 
(installed)

  Bit Gravity State: NorthWestGravity Bit Gravity State:
NorthWestGravity
  Window Gravity State: NorthWestGravity  Window Gravity
State: NorthWestGravity
  Backing Store State: NotUseful  Backing Store State: 
NotUseful

  Save Under State: noSave Under State: no
  Map State: IsViewable   Map State: IsViewable
  Override Redirect State: no Override Redirect 
State: no

  Corners:  +4+25  -528+25  -528-172  +4-1Corners:  +4+25
-528+25  -528-172  +4-1
  -geometry 492x571+0+0   -geometry 492x571+0+0
===

So main window's visual also changed by this fix.


Similarly for the fontset change .. this might change what others get.
The fontset spec. there seems very loose to me ..