Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title [v3]

2021-06-09 Thread Sergey Bylokhov
On Mon, 7 Jun 2021 10:30:33 GMT, Maxim Kartashev 
 wrote:

>> This commit introduces a new client property xawt.mwm_decor_title 
>> implementing JDK-8267307. The property can be set prior to showing a window 
>> or after the window has been displayed, in which case the window will have 
>> to be hidden/shown (re-mapped) for the property to take effect.
>> 
>> The general idea is to provide control over the "decorations" part of the 
>> X11 window property called _MOTIF_WM_HINTS. Those "decoration" bits are set 
>> to 1 (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
>> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
>> decorate with anything, even borders or resize handles. With 
>> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
>> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
>> take as "decorate with only a border", thus effectively removing the 
>> window's title bar, but still leaving the resize capability.
>> 
>> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
>> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
>> where it did not have any effect; these two WMs have limited respected for 
>> the "decorations" bits of the _MOTIF_WM_HINTS window property.
>
> Maxim Kartashev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Changed the check for the XDecoratedPeer target being 
> javax.swing.RootPaneContainer in
>   order to avoid unnecessary class loading if it isn't.

Marked as reviewed by serb (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title [v3]

2021-06-08 Thread Sergey Bylokhov
On Mon, 7 Jun 2021 10:30:33 GMT, Maxim Kartashev 
 wrote:

>> This commit introduces a new client property xawt.mwm_decor_title 
>> implementing JDK-8267307. The property can be set prior to showing a window 
>> or after the window has been displayed, in which case the window will have 
>> to be hidden/shown (re-mapped) for the property to take effect.
>> 
>> The general idea is to provide control over the "decorations" part of the 
>> X11 window property called _MOTIF_WM_HINTS. Those "decoration" bits are set 
>> to 1 (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
>> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
>> decorate with anything, even borders or resize handles. With 
>> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
>> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
>> take as "decorate with only a border", thus effectively removing the 
>> window's title bar, but still leaving the resize capability.
>> 
>> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
>> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
>> where it did not have any effect; these two WMs have limited respected for 
>> the "decorations" bits of the _MOTIF_WM_HINTS window property.
>
> Maxim Kartashev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Changed the check for the XDecoratedPeer target being 
> javax.swing.RootPaneContainer in
>   order to avoid unnecessary class loading if it isn't.

Looks fine, I'll run the tests.

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title [v2]

2021-06-07 Thread Maxim Kartashev
On Fri, 4 Jun 2021 21:36:03 GMT, Sergey Bylokhov  wrote:

>> Maxim Kartashev has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Changed the check for the XFramePeer target being 
>> javax.swing.RootPaneContainer in
>>   order to avoid unnecessary class loading if it isn't.
>>   
>>   Also updated the test such that robot.createScreenCapture() is not
>>   executed on EDT.
>
> src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java line 1327:
> 
>> 1325: Optional res = Optional.empty();
>> 1326: 
>> 1327: if (target instanceof javax.swing.RootPaneContainer) {
> 
> Looks like this instanceof will load the Swing as well.

Sorry, missed that one the first time. Corrected now.

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title [v3]

2021-06-07 Thread Maxim Kartashev
> This commit introduces a new client property xawt.mwm_decor_title 
> implementing JDK-8267307. The property can be set prior to showing a window 
> or after the window has been displayed, in which case the window will have to 
> be hidden/shown (re-mapped) for the property to take effect.
> 
> The general idea is to provide control over the "decorations" part of the X11 
> window property called _MOTIF_WM_HINTS. Those "decoration" bits are set to 1 
> (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
> decorate with anything, even borders or resize handles. With 
> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
> take as "decorate with only a border", thus effectively removing the window's 
> title bar, but still leaving the resize capability.
> 
> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
> where it did not have any effect; these two WMs have limited respected for 
> the "decorations" bits of the _MOTIF_WM_HINTS window property.

Maxim Kartashev has updated the pull request incrementally with one additional 
commit since the last revision:

  Changed the check for the XDecoratedPeer target being 
javax.swing.RootPaneContainer in
  order to avoid unnecessary class loading if it isn't.

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4113/files
  - new: https://git.openjdk.java.net/jdk/pull/4113/files/da9fbfd8..c83c7216

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=4113=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=4113=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4113.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4113/head:pull/4113

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title [v2]

2021-06-04 Thread Sergey Bylokhov
On Fri, 4 Jun 2021 08:44:22 GMT, Maxim Kartashev 
 wrote:

>> This commit introduces a new client property xawt.mwm_decor_title 
>> implementing JDK-8267307. The property can be set prior to showing a window 
>> or after the window has been displayed, in which case the window will have 
>> to be hidden/shown (re-mapped) for the property to take effect.
>> 
>> The general idea is to provide control over the "decorations" part of the 
>> X11 window property called _MOTIF_WM_HINTS. Those "decoration" bits are set 
>> to 1 (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
>> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
>> decorate with anything, even borders or resize handles. With 
>> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
>> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
>> take as "decorate with only a border", thus effectively removing the 
>> window's title bar, but still leaving the resize capability.
>> 
>> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
>> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
>> where it did not have any effect; these two WMs have limited respected for 
>> the "decorations" bits of the _MOTIF_WM_HINTS window property.
>
> Maxim Kartashev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Changed the check for the XFramePeer target being 
> javax.swing.RootPaneContainer in
>   order to avoid unnecessary class loading if it isn't.
>   
>   Also updated the test such that robot.createScreenCapture() is not
>   executed on EDT.

src/java.desktop/unix/classes/sun/awt/X11/XDecoratedPeer.java line 1327:

> 1325: Optional res = Optional.empty();
> 1326: 
> 1327: if (target instanceof javax.swing.RootPaneContainer) {

Looks like this instanceof will load the Swing as well.

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title [v2]

2021-06-04 Thread Alexander Zvegintsev
On Fri, 4 Jun 2021 08:44:22 GMT, Maxim Kartashev 
 wrote:

>> This commit introduces a new client property xawt.mwm_decor_title 
>> implementing JDK-8267307. The property can be set prior to showing a window 
>> or after the window has been displayed, in which case the window will have 
>> to be hidden/shown (re-mapped) for the property to take effect.
>> 
>> The general idea is to provide control over the "decorations" part of the 
>> X11 window property called _MOTIF_WM_HINTS. Those "decoration" bits are set 
>> to 1 (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
>> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
>> decorate with anything, even borders or resize handles. With 
>> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
>> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
>> take as "decorate with only a border", thus effectively removing the 
>> window's title bar, but still leaving the resize capability.
>> 
>> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
>> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
>> where it did not have any effect; these two WMs have limited respected for 
>> the "decorations" bits of the _MOTIF_WM_HINTS window property.
>
> Maxim Kartashev has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Changed the check for the XFramePeer target being 
> javax.swing.RootPaneContainer in
>   order to avoid unnecessary class loading if it isn't.
>   
>   Also updated the test such that robot.createScreenCapture() is not
>   executed on EDT.

Marked as reviewed by azvegint (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title [v2]

2021-06-04 Thread Maxim Kartashev
On Tue, 1 Jun 2021 11:31:59 GMT, Alexander Zvegintsev  
wrote:

>> Maxim Kartashev has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Changed the check for the XFramePeer target being 
>> javax.swing.RootPaneContainer in
>>   order to avoid unnecessary class loading if it isn't.
>>   
>>   Also updated the test such that robot.createScreenCapture() is not
>>   executed on EDT.
>
> test/jdk/java/awt/Window/WindowTitleVisibleTest/WindowTitleVisibleTestLinuxGnome.java
>  line 111:
> 
>> 109: private void captureTitleBarNotVisible() {
>> 110: runSwing( () -> {
>> 111: titleBarImageNotVisible = 
>> robot.createScreenCapture(titleBarBounds);
> 
> `createScreenCapture` does not require to be called on EDT.

Thanks! Moved `createScreenCapture()` out of EDT. Please, have a look at the 
updated code.

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title [v2]

2021-06-04 Thread Maxim Kartashev
On Fri, 4 Jun 2021 06:49:13 GMT, Sergey Bylokhov  wrote:

>> Maxim Kartashev has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Changed the check for the XFramePeer target being 
>> javax.swing.RootPaneContainer in
>>   order to avoid unnecessary class loading if it isn't.
>>   
>>   Also updated the test such that robot.createScreenCapture() is not
>>   executed on EDT.
>
> src/java.desktop/unix/classes/sun/awt/X11/XFramePeer.java line 84:
> 
>> 82: 
>> 83: private void registerWindowDecorationChangeListener() {
>> 84: if (target instanceof javax.swing.RootPaneContainer) {
> 
> Probably this should be done via runtime check? Overwise the swing classes 
> will be always loaded even if swing is not used. see the usage of 
> SunToolkit.isInstanceOf in java.awt.WIndow.java:3965

Thanks! Updated the code; please, have a look.

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title [v2]

2021-06-04 Thread Maxim Kartashev
> This commit introduces a new client property xawt.mwm_decor_title 
> implementing JDK-8267307. The property can be set prior to showing a window 
> or after the window has been displayed, in which case the window will have to 
> be hidden/shown (re-mapped) for the property to take effect.
> 
> The general idea is to provide control over the "decorations" part of the X11 
> window property called _MOTIF_WM_HINTS. Those "decoration" bits are set to 1 
> (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
> decorate with anything, even borders or resize handles. With 
> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
> take as "decorate with only a border", thus effectively removing the window's 
> title bar, but still leaving the resize capability.
> 
> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
> where it did not have any effect; these two WMs have limited respected for 
> the "decorations" bits of the _MOTIF_WM_HINTS window property.

Maxim Kartashev has updated the pull request incrementally with one additional 
commit since the last revision:

  Changed the check for the XFramePeer target being 
javax.swing.RootPaneContainer in
  order to avoid unnecessary class loading if it isn't.
  
  Also updated the test such that robot.createScreenCapture() is not
  executed on EDT.

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4113/files
  - new: https://git.openjdk.java.net/jdk/pull/4113/files/d2586618..da9fbfd8

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=4113=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=4113=00-01

  Stats: 8 lines in 2 files changed: 1 ins; 4 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4113.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4113/head:pull/4113

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-06-04 Thread Sergey Bylokhov
On Wed, 19 May 2021 10:23:01 GMT, Maxim Kartashev 
 wrote:

> This commit introduces a new client property xawt.mwm_decor_title 
> implementing JDK-8267307. The property can be set prior to showing a window 
> or after the window has been displayed, in which case the window will have to 
> be hidden/shown (re-mapped) for the property to take effect.
> 
> The general idea is to provide control over the "decorations" part of the X11 
> window property called _MOTIF_WM_HINTS. Those "decoration" bits are set to 1 
> (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
> decorate with anything, even borders or resize handles. With 
> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
> take as "decorate with only a border", thus effectively removing the window's 
> title bar, but still leaving the resize capability.
> 
> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
> where it did not have any effect; these two WMs have limited respected for 
> the "decorations" bits of the _MOTIF_WM_HINTS window property.

src/java.desktop/unix/classes/sun/awt/X11/XFramePeer.java line 84:

> 82: 
> 83: private void registerWindowDecorationChangeListener() {
> 84: if (target instanceof javax.swing.RootPaneContainer) {

Probably this should be done via runtime check? Overwise the swing classes will 
be always loaded even if swing is not used. see the usage of 
SunToolkit.isInstanceOf in java.awt.WIndow.java:3965

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-06-03 Thread Alexey Ushakov
Could anyone from the dev team review my CSR request for this change: 
https://bugs.openjdk.java.net/browse/JDK-8267308 
 ?

Best Regards,
Alexey

> On 1 Jun 2021, at 19:27, Alexander Zvegintsev  
> wrote:
> 
> On Wed, 19 May 2021 10:23:01 GMT, Maxim Kartashev 
>  wrote:
> 
>> This commit introduces a new client property xawt.mwm_decor_title 
>> implementing JDK-8267307. The property can be set prior to showing a window 
>> or after the window has been displayed, in which case the window will have 
>> to be hidden/shown (re-mapped) for the property to take effect.
>> 
>> The general idea is to provide control over the "decorations" part of the 
>> X11 window property called _MOTIF_WM_HINTS. Those "decoration" bits are set 
>> to 1 (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
>> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
>> decorate with anything, even borders or resize handles. With 
>> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
>> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
>> take as "decorate with only a border", thus effectively removing the 
>> window's title bar, but still leaving the resize capability.
>> 
>> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
>> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
>> where it did not have any effect; these two WMs have limited respected for 
>> the "decorations" bits of the _MOTIF_WM_HINTS window property.
> 
> Marked as reviewed by azvegint (Reviewer).
> 
> -
> 
> PR: https://git.openjdk.java.net/jdk/pull/4113



Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-06-02 Thread Sergey Bylokhov
On Wed, 19 May 2021 10:23:01 GMT, Maxim Kartashev 
 wrote:

> This commit introduces a new client property xawt.mwm_decor_title 
> implementing JDK-8267307. The property can be set prior to showing a window 
> or after the window has been displayed, in which case the window will have to 
> be hidden/shown (re-mapped) for the property to take effect.
> 
> The general idea is to provide control over the "decorations" part of the X11 
> window property called _MOTIF_WM_HINTS. Those "decoration" bits are set to 1 
> (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
> decorate with anything, even borders or resize handles. With 
> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
> take as "decorate with only a border", thus effectively removing the window's 
> title bar, but still leaving the resize capability.
> 
> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
> where it did not have any effect; these two WMs have limited respected for 
> the "decorations" bits of the _MOTIF_WM_HINTS window property.

You can reuse that test or create the new one, I just pointed out how the 
"same" feature was tested on mac.

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-06-02 Thread Maxim Kartashev
On Tue, 1 Jun 2021 19:24:20 GMT, Sergey Bylokhov  wrote:

> Please check that the test code added in the JDK-8265005 can be adapted to 
> verify this fix as well.

@mrserb Please clarify: do you suggest to have one common test code for this 
feature and JDK-8265005? This is certainly possible, but will contaminate the 
Mac test with Linux-specific window manager checking stuff, making it harder to 
debug failures, I think.

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-06-01 Thread Sergey Bylokhov
On Wed, 19 May 2021 10:23:01 GMT, Maxim Kartashev 
 wrote:

> This commit introduces a new client property xawt.mwm_decor_title 
> implementing JDK-8267307. The property can be set prior to showing a window 
> or after the window has been displayed, in which case the window will have to 
> be hidden/shown (re-mapped) for the property to take effect.
> 
> The general idea is to provide control over the "decorations" part of the X11 
> window property called _MOTIF_WM_HINTS. Those "decoration" bits are set to 1 
> (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
> decorate with anything, even borders or resize handles. With 
> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
> take as "decorate with only a border", thus effectively removing the window's 
> title bar, but still leaving the resize capability.
> 
> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
> where it did not have any effect; these two WMs have limited respected for 
> the "decorations" bits of the _MOTIF_WM_HINTS window property.

Please check that the test code added in the JDK-8265005 can be adapted to 
verify this fix as well.

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-06-01 Thread Alexander Zvegintsev
On Wed, 19 May 2021 10:23:01 GMT, Maxim Kartashev 
 wrote:

> This commit introduces a new client property xawt.mwm_decor_title 
> implementing JDK-8267307. The property can be set prior to showing a window 
> or after the window has been displayed, in which case the window will have to 
> be hidden/shown (re-mapped) for the property to take effect.
> 
> The general idea is to provide control over the "decorations" part of the X11 
> window property called _MOTIF_WM_HINTS. Those "decoration" bits are set to 1 
> (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
> decorate with anything, even borders or resize handles. With 
> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
> take as "decorate with only a border", thus effectively removing the window's 
> title bar, but still leaving the resize capability.
> 
> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
> where it did not have any effect; these two WMs have limited respected for 
> the "decorations" bits of the _MOTIF_WM_HINTS window property.

Marked as reviewed by azvegint (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-06-01 Thread Maxim Kartashev
On Tue, 1 Jun 2021 11:38:49 GMT, Alexander Zvegintsev  
wrote:

> This fix most likely will require a CSR

There already is one linked from the enhancement: 
[JDK-8267308](https://bugs.openjdk.java.net/browse/JDK-8267308)

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-06-01 Thread Alexander Zvegintsev
On Wed, 19 May 2021 10:23:01 GMT, Maxim Kartashev 
 wrote:

> This commit introduces a new client property xawt.mwm_decor_title 
> implementing JDK-8267307. The property can be set prior to showing a window 
> or after the window has been displayed, in which case the window will have to 
> be hidden/shown (re-mapped) for the property to take effect.
> 
> The general idea is to provide control over the "decorations" part of the X11 
> window property called _MOTIF_WM_HINTS. Those "decoration" bits are set to 1 
> (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
> decorate with anything, even borders or resize handles. With 
> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
> take as "decorate with only a border", thus effectively removing the window's 
> title bar, but still leaving the resize capability.
> 
> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
> where it did not have any effect; these two WMs have limited respected for 
> the "decorations" bits of the _MOTIF_WM_HINTS window property.

This fix most likely will require a CSR

test/jdk/java/awt/Window/WindowTitleVisibleTest/WindowTitleVisibleTestLinuxGnome.java
 line 111:

> 109: private void captureTitleBarNotVisible() {
> 110: runSwing( () -> {
> 111: titleBarImageNotVisible = 
> robot.createScreenCapture(titleBarBounds);

`createScreenCapture` does not require to be called on EDT.

-

PR: https://git.openjdk.java.net/jdk/pull/4113


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-05-31 Thread Maxim Kartashev
Hello All,

I'd appreciate it very much if someone could find time to look at this pull
request.
Thanks a bunch!

On Fri, May 21, 2021 at 11:01 AM Maxim Kartashev <
maxim.kartas...@jetbrains.com> wrote:

>
>
> On Fri, May 21, 2021 at 12:33 AM Sergey Bylokhov 
> wrote:
>
>> On Wed, 19 May 2021 10:23:01 GMT, Maxim Kartashev > 28651297+mkartas...@openjdk.org> wrote:
>>
>> > This commit introduces a new client property xawt.mwm_decor_title
>> implementing JDK-8267307. The property can be set prior to showing a window
>> or after the window has been displayed, in which case the window will have
>> to be hidden/shown (re-mapped) for the property to take effect.
>> >
>> > The general idea is to provide control over the "decorations" part of
>> the X11 window property called _MOTIF_WM_HINTS. Those "decoration" bits are
>> set to 1 (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations
>> or 0 (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM)
>> not to decorate with anything, even borders or resize handles. With
>> xawt.mwm_decor_title property set to "true", this commit adds the ability
>> to set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some
>> WMs take as "decorate with only a border", thus effectively removing the
>> window's title bar, but still leaving the resize capability.
>> >
>> > This feature was tested and works correctly on "vanilla" Ubuntu 20.04
>> with the "GNOME Shell" window manager. It was also tested with Xfwm4 and
>> KDE, where it did not have any effect; these two WMs have limited respected
>> for the "decorations" bits of the _MOTIF_WM_HINTS window property.
>>
>> Hello, thank you for your contribution, One initial question: what the
>> name "mwm_" of this property actually means?
>>
> The name's historical: it's from the _MOTIF_WM_HINTS property of X11 that
> has "decorations" bits in it (the 3rd word of the structure). For instance,
> this is from a Firefox window in GNOME that does not have a title bar:
>
> $ xprop -id 0x263 | grep -i MOTIF_WM_HINTS
> _MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x2, 0x0, 0x0
>
>  Despite the name ("motif"), this property has apparently become a
> de-facto standard way to communicate client wishes about its window
> decoration to any window manager currently in charge.
>
>>
>> -
>>
>> PR: https://git.openjdk.java.net/jdk/pull/4113
>>
>


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-05-21 Thread Maxim Kartashev
On Fri, May 21, 2021 at 12:33 AM Sergey Bylokhov 
wrote:

> On Wed, 19 May 2021 10:23:01 GMT, Maxim Kartashev  28651297+mkartas...@openjdk.org> wrote:
>
> > This commit introduces a new client property xawt.mwm_decor_title
> implementing JDK-8267307. The property can be set prior to showing a window
> or after the window has been displayed, in which case the window will have
> to be hidden/shown (re-mapped) for the property to take effect.
> >
> > The general idea is to provide control over the "decorations" part of
> the X11 window property called _MOTIF_WM_HINTS. Those "decoration" bits are
> set to 1 (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations
> or 0 (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM)
> not to decorate with anything, even borders or resize handles. With
> xawt.mwm_decor_title property set to "true", this commit adds the ability
> to set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some
> WMs take as "decorate with only a border", thus effectively removing the
> window's title bar, but still leaving the resize capability.
> >
> > This feature was tested and works correctly on "vanilla" Ubuntu 20.04
> with the "GNOME Shell" window manager. It was also tested with Xfwm4 and
> KDE, where it did not have any effect; these two WMs have limited respected
> for the "decorations" bits of the _MOTIF_WM_HINTS window property.
>
> Hello, thank you for your contribution, One initial question: what the
> name "mwm_" of this property actually means?
>
The name's historical: it's from the _MOTIF_WM_HINTS property of X11 that
has "decorations" bits in it (the 3rd word of the structure). For instance,
this is from a Firefox window in GNOME that does not have a title bar:

$ xprop -id 0x263 | grep -i MOTIF_WM_HINTS
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x2, 0x0, 0x0

 Despite the name ("motif"), this property has apparently become a de-facto
standard way to communicate client wishes about its window decoration to
any window manager currently in charge.

>
> -
>
> PR: https://git.openjdk.java.net/jdk/pull/4113
>


Re: RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-05-20 Thread Sergey Bylokhov
On Wed, 19 May 2021 10:23:01 GMT, Maxim Kartashev 
 wrote:

> This commit introduces a new client property xawt.mwm_decor_title 
> implementing JDK-8267307. The property can be set prior to showing a window 
> or after the window has been displayed, in which case the window will have to 
> be hidden/shown (re-mapped) for the property to take effect.
> 
> The general idea is to provide control over the "decorations" part of the X11 
> window property called _MOTIF_WM_HINTS. Those "decoration" bits are set to 1 
> (XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
> (XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
> decorate with anything, even borders or resize handles. With 
> xawt.mwm_decor_title property set to "true", this commit adds the ability to 
> set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs 
> take as "decorate with only a border", thus effectively removing the window's 
> title bar, but still leaving the resize capability.
> 
> This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with 
> the "GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, 
> where it did not have any effect; these two WMs have limited respected for 
> the "decorations" bits of the _MOTIF_WM_HINTS window property.

Hello, thank you for your contribution, One initial question: what the name 
"mwm_" of this property actually means?

-

PR: https://git.openjdk.java.net/jdk/pull/4113


RFR: 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

2021-05-19 Thread Maxim Kartashev
This commit introduces a new client property xawt.mwm_decor_title implementing 
JDK-8267307. The property can be set prior to showing a window or after the 
window has been displayed, in which case the window will have to be 
hidden/shown (re-mapped) for the property to take effect.

The general idea is to provide control over the "decorations" part of the X11 
window property called _MOTIF_WM_HINTS. Those "decoration" bits are set to 1 
(XWindowAttributesData.AWT_DECOR_ALL) to show all the decorations or 0 
(XWindowAttributesData.AWT_DECOR_NONE) to ask the window manager (WM) not to 
decorate with anything, even borders or resize handles. With 
xawt.mwm_decor_title property set to "true", this commit adds the ability to 
set the bits to 2 (XWindowAttributesData.AWT_DECOR_BORDER), which some WMs take 
as "decorate with only a border", thus effectively removing the window's title 
bar, but still leaving the resize capability.

This feature was tested and works correctly on "vanilla" Ubuntu 20.04 with the 
"GNOME Shell" window manager. It was also tested with Xfwm4 and KDE, where it 
did not have any effect; these two WMs have limited respected for the 
"decorations" bits of the _MOTIF_WM_HINTS window property.

-

Commit messages:
 - 8267307: Introduce new client property for XAWT: xawt.mwm_decor_title

Changes: https://git.openjdk.java.net/jdk/pull/4113/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=4113=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8267307
  Stats: 271 lines in 3 files changed: 265 ins; 4 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4113.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4113/head:pull/4113

PR: https://git.openjdk.java.net/jdk/pull/4113