UndecoratorBis icon indicating copy to clipboard operation
UndecoratorBis copied to clipboard

Cannot drag scene across display boundary on dual display setup.

Open mikedavison opened this issue 8 years ago • 5 comments

Problem with dragging across screen boundary in dual screen setup. Using sample application (UndecoratorSceneDemoTouch.java and UndecoratorSceneDemo.java) to test with both apps can be resized and dragged within the primary screen the app launched in but I cannot drag scene from one display to another. With second screen set to above primary screen, when dragging to second screen window seems to dock on primary and go to full screen.Note: I can use simple app with a decorated scene and drag across displays. FYI. Test environment is Windows 10, Netbeans 8.1, jdk 1,8, dual displays.

mikedavison avatar Apr 11 '16 15:04 mikedavison

Same here. I've got a four screen setup with three screens horiztonal and one display under the last one. I can drag, resize and do whatever I want as long as I don't try to drag the window down to the fourth display. Environment Win 10, JRE 1.8.0x64, IDEA 2016.1.3

ghost avatar Jun 12 '16 11:06 ghost

Hi thejeed. I have a cludge workaround that should do until a formal patch. Patch the undecoratedcontroller with the modified method below. Comment in line.

void setStageY(Stage stage, double y) {
        try {
            ObservableList<Screen> screensForRectangle = Screen.getScreensForRectangle(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
            if (screensForRectangle.size() > 0) {
                Screen screen = screensForRectangle.get(0);
                Rectangle2D visualBounds = screen.getVisualBounds();
                if (y < visualBounds.getHeight() - 30 && y + SHADOW_WIDTH >= visualBounds.getMinY()) {
                    stage.setY(y);
                }
                if (!isMacOS) stage.setY(y); // TO DO MJD: this is cludge to make it work on windows 10 multi screen

            }
        } catch (Exception e) {
            FancyFrame.LOGGER.log(Level.SEVERE, "setStageY issue", e);
        }
    }

mikedavison avatar Jun 13 '16 02:06 mikedavison

Currently the setStageY method just checks for the current display. I've proposed a change to fix it.

void setStageY(Stage stage, double y) {
        try {
            ObservableList<Screen> screensForRectangle = Screen.getScreensForRectangle(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
            for (Screen screen : screensForRectangle) {
                Rectangle2D visualBounds = screen.getVisualBounds();
                if (y < visualBounds.getHeight() - 30 && y + SHADOW_WIDTH >= visualBounds.getMinY()) {
                    stage.setY(y);
                }
                if (!isMacOS) stage.setY(y); // TO DO MJD: this is cludge to make it work on windows 10 multi screen

            }
        } catch (Exception e) {
            FancyFrame.LOGGER.log(Level.SEVERE, "setStageY issue", e);
        }
    }

Starkus avatar Sep 16 '17 20:09 Starkus

Has this change been proposed in a PR and merged, I am facing the same issue on a Win7 machine :)

anakinak avatar Apr 06 '18 02:04 anakinak

I don't think this project is being maintained anymore, I had to do quite some bugfixing to implement it in my project. You can check my fork but it might have some things specific to what I was trying to do. https://github.com/Starkus/Undecorator

Starkus avatar Apr 06 '18 03:04 Starkus