JDK-8211007 : [Linux] TableView setMouseTransparent method does not make mouse transparent
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 8u202,openjfx11
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86_64
  • Submitted: 2018-09-19
  • Updated: 2021-12-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Description
ADDITIONAL SYSTEM INFORMATION :
Java 11 and JavaFX built from source. JavaFX is integrated with the JDK. This bug can be reproduced with the standalone SDK, however.

A DESCRIPTION OF THE PROBLEM :
Setting Tableview's setMouseTransparent method does not make the window transparent in the current version of JavaFX. 

REGRESSION : Last worked in version 10

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Using JavaFX 11, Create any TableView and set setMouseTransparent to true. 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Mouse transparency(mouse ignores the window and instead acts as if the window doesn't exist).
ACTUAL -
No mouse transparency.

---------- BEGIN SOURCE ----------
Unable to provide due to Netbeans being unable to locate main class in a modular project(for some reason) and refusing to compile in a non modular environment because of JavaFX Deployment not being included in the JDK. However, here is the code that I am using:

public class OSDStage extends Stage
{
    public static boolean OSD_ENABLED = false;
    
    
    private final Scene scene;
    
    public OSDStage()
    {
        super();
        super.setTitle("Goliath Overclocking Utility OSD");
        super.setResizable(false);
        super.setX(0);
        super.setY(0);
        super.initStyle(StageStyle.TRANSPARENT);
        super.setAlwaysOnTop(true);
        
        scene = new Scene(new OsdTable());
        scene.setFill(Color.TRANSPARENT);
        
        
        OSD_ENABLED = true;
        
        super.setScene(scene);
        super.show();
    }
    
    @Override
    public void close()
    {
        OSD_ENABLED = false;
        super.close();
    }
    
    private class OsdTable extends TableView<NvAttribute>
    {
        private final TableColumn<NvAttribute, String> colOne, colTwo;
        
        public OsdTable()
        {
            super();
            super.setPrefWidth(352);
            super.setColumnResizePolicy(TableView.UNCONSTRAINED_RESIZE_POLICY);
            super.setEditable(false);
            super.setMouseTransparent(true);
            super.setTableMenuButtonVisible(false);
            super.getStylesheets().add("goliathoufx/css/osd.css");
            super.setItems(FXCollections.observableArrayList(InstanceProvider.getOSDAttributes()));
            
            colOne = new TableColumn<>();
            colOne.setMinWidth(200);
            colOne.setMaxWidth(200);
            colOne.setStyle("-fx-text-fill: #00FF00;");
            colOne.setCellValueFactory(new PropertyValueFactory<>("displayName"));
        
            colTwo = new TableColumn<>();
            colTwo.setMinWidth(150);
            colTwo.setMaxWidth(150);
            colTwo.setStyle("-fx-text-fill: #00FF00;");
            colTwo.setCellValueFactory(new PropertyValueFactory<>("displayValue"));
            
            super.getColumns().add(colOne);
            super.getColumns().add(colTwo);
        }
    }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Use Oracle JDK 9 or 10.

FREQUENCY : always



Comments
I have tested this bug on linux, windows and mac with jdk8-192-b35 Windows: Calling setMouseTransparent with true or false does not have any impact. This window is always transparent to MouseEvents and he events are always passed to window below. Mac: Calling setMouseTransparent with true or false does not have any impact. This window is never transparent to MouseEvents and he events are never passed to window below. Linux (jdk-202 with gtk2) or jdk-192b35: Calling setMouseTransparent with true or false does not have any impact. This window is always transparent to MouseEvents and he events are always passed to window below. Linux (jdk-202 with gtk3): Calling setMouseTransparent with true or false does not have any impact. This window is never transparent to MouseEvents and he events are never passed to window below. So this looks like a platform independent bug and we need to evaluate this and fix it for window, mac and linux (gkt2) first and then move to gtk3
08-04-2019

I tested this on jdk8-192-b35, I see the same behaviour with gtk2. Calling setMouseTransparent with true or false does not have any impact and the window is always transparent to the Mouse Events.
27-03-2019

If I set the setMouseTransparent to false and run this with gtk2, the behavior is same as if the setMouseTransparent is set to true. The events are passed to the underlying window and the TableView behaves like it does not exist for mouse. so for me, for gtk2, the Window is always ignored whether the setMouseTransparent is true or false and for gtk3, the Winodw is never ignored whether the setMouseTransparent is set to true ot false. What is the correct expected from this?
20-03-2019

I am able to reproduce it with javafx12 latest code.
20-11-2018

Thanks for the confirmation. This shows that this is a glass GTK 3 bug. Assigning to Pankaj and changing the subcomponent to window-toolkit.
21-09-2018

Again checked with "-Djdk.gtk.version" option :: Running JDK 11 with -Djdk.gtk.version=2 : Pass Running JDK 10 with -Djdk.gtk.version=3 : Fail
21-09-2018

One thing that changed in FX 11 is that GTK 3 is now the default. In JDK 10 and earlier, GTK 2 was the default. Running JDK 11 with -Djdk.gtk.version=2 will force the use of GTK 2. If that works, then it points to GTK 3 as the problem. Conversely, running JDK 10 with -Djdk.gtk.version=3 will force the use of GTK 3. If that fails, then it also points to GTK 3.
21-09-2018

Received reproducible test case from Submitter and issue is reproducible only in Linux. Its a regression in JDK 11. 10.0.2+13 : Pass 11+13 : Fail
21-09-2018

Could not reproduce the issue in Windows 10 (using latest openjfx) and Ubuntu 18.04.1 LTS using JDK 11+13. Prepared simple test case where setting 'mouseTransparent' property of TableView to true. Requested Submitter to check prepared test case (PFA Main.java) and provide reproducible test case as the one provided in bug description has dependency on some user-defined classes (NvAttribute).
20-09-2018

This was mentioned on the openjfx-dev list here: http://mail.openjdk.java.net/pipermail/openjfx-dev/2018-September/022496.html
19-09-2018