I have fixed it on Linux:

https://github.com/openjdk/jfx/pull/77


Can be ported to the current code:

void WindowContext::set_maximized(bool maximize) {
    is_maximized = maximize;
    if (maximize) {
        // enable the functionality
        GdkWMFunction wmf = (GdkWMFunction)(gdk_windowManagerFunctions | 
GDK_FUNC_MAXIMIZE);
        gdk_window_set_functions(gdk_window, wmf);

        gtk_window_maximize(GTK_WINDOW(gtk_widget));
    } else {
        gtk_window_unmaximize(GTK_WINDOW(gtk_widget));
    }
}

________________________________
De: openjfx-dev <[email protected]> em nome de Abhinay 
Agarwal <[email protected]>
Enviado: segunda-feira, 13 de janeiro de 2020 02:45
Para: Kevin Rushforth <[email protected]>; 
[email protected] <[email protected]>
Assunto: Re: Maximized undecorated stage

Hi Kevin,

Sounds logical.

I will file an issue in the JBS.

Best regards,
Abhinay
________________________________
From: openjfx-dev <[email protected]> on behalf of Kevin 
Rushforth <[email protected]>
Sent: Wednesday, January 8, 2020 4:36 AM
To: [email protected] <[email protected]>
Subject: Re: Maximized undecorated stage

Ideally, we wouldn't have this sort of platform-specific behavior. I can
see why the underlying platform might not support the concept of
maximizing an undecorated stage, so we either need to disable it on
Windows, live with the behavior, or else find some solution on macOS and
Linux.

-- Kevin


On 1/6/2020 1:43 AM, Abhinay Agarwal wrote:
> Hi,
>
> If maximize property is set to true for an undecorated Stage, the following 
> behaviour is observed on different platforms:
>
>    *   Windows: Undecorated stage is maximized
>    *   MacOS: Undecorated stage is not maximized
>    *   Linux(Ubuntu): Undecorated stage is not maximized
>
> The following piece of code can be used to reproduce the behaviour:
>
> import javafx.application.Application;
> import javafx.scene.Scene;
> import javafx.scene.control.Label;
> import javafx.scene.layout.StackPane;
> import javafx.stage.Stage;
> import javafx.stage.StageStyle;
>
> public class MaximizedStage extends Application {
>      public void start (Stage stage) {
>          StackPane sp = new StackPane(new Label("Hello"));
>          stage.setScene(new Scene (sp, 500, 500));
>          stage.initStyle(StageStyle.UNDECORATED);
>          stage.show();
>          stage.setMaximized(true);
>      }
> }
>
>   Is there a reason why the stage gets maximized on Windows but fails on 
> other platforms?
>
> Regards,
> Abhinay

Reply via email to