-
Bug
-
Resolution: Unresolved
-
P5
-
8, 9
-
x86_64
-
linux
FULL PRODUCT VERSION :
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.10.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux MACHINE_NAME 4.8.0-59-generic #64-Ubuntu SMP Thu Jun 29 19:38:34 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
If the window is not maximized, setIconified works, but isIconified and isMaximized give false reporting at times. See simple code example
If the window is maximized, setIconified does not work as expected. Instead, it is a three-step process. The first call iconifies, the second call restores, and the third call doesn't make any visual changes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. call Stage.setIconified() a number of times, toggling the value each time. See example code.
2. Call isIconifed() just after calling setIconified()
3. Call isMaximized() just after calling setIconified()
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
1. For setIconified ( !stage.isIconified() ) to toggle the window iconified status. It does not.
2. For isIconified() to report correctly at all times
3. For isMaximized() to report correctly at all times.
ACTUAL -
(While Window not maximized)
Before call (Note: Window appears iconified)
isIconified(): true
isMaximized(): true
Setting iconified to false
After call (Note: Window now appears restored, not maximized)
isIconified(): true <-- The window is visually not iconified
isMaximized(): true <-- The window is visually not maximized
Before call (Note: Window still appears restored, not maximized)
isIconified(): false <-- One second later, the report is accurate
isMaximized(): false
Setting iconified to true
After call (Note: Window now appears iconified)
isIconified(): true
(While Window Maximized)
Before call (Note: Window appears iconified)
isIconified(): true
isMaximized(): true
Setting iconified to false
After call (Note: Window appears maximized)
isIconified(): true <-- Does not match visual
isMaximized(): true
Before call (Note: Window appears maximized)
isIconified(): true <-- Does not match visual
isMaximized(): true
Setting iconified to false
After call (Note: Window appears maximized)
isIconified(): false
isMaximized(): false <-- Does not match visual
Before call (Note: Window appears maximized)
isIconified(): false
isMaximized(): false <-- Does not match visual
Setting iconified to true
After call (Note: Window appears iconified)
isIconified(): true
isMaximized(): true
<Now it loops>
Before call (Note: Window appears iconified)
isIconified(): true
isMaximized(): true
Setting iconified to false
After call (Note: Window appears maximized)
isIconified(): true <-- Does not match visual
isMaximized(): true
...
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
mport javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
public class StageTest extends Application {
Stage stage;
public static void main ( String[] args ) {
launch ( args );
}
@Override
public void start ( Stage stage ) throws Exception {
this.stage = stage;
stage.setResizable( true );
stage.show( );
Thread thread = new Thread ( () -> {
while ( true ) {
Platform.runLater( () -> {
toggleMinimized();
} );
try {
Thread.sleep ( 1000 );
} catch ( InterruptedException e ) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
thread.setDaemon( true );
thread.start();
}
public void toggleMinimized() {
System.out.println ( "Before call" );
System.out.println ( "\tisIconified(): " + stage.isIconified() );
System.out.println ( "\tisMaximized(): " + stage.isIconified() );
System.out.println ();
if ( stage.isIconified() ) {
System.out.println ( "Setting iconified to false" );
System.out.println ();
stage.setIconified( false );
} else {
System.out.println ( "Setting iconified to true" );
System.out.println ();
stage.setIconified( true );
}
System.out.println ( "After call" );
System.out.println ( "\tisIconified(): " + stage.isIconified() );
System.out.println ( "\tisMaximized(): " + stage.isIconified() );
System.out.println ();
System.out.println ();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Cannot find one.
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.10.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux MACHINE_NAME 4.8.0-59-generic #64-Ubuntu SMP Thu Jun 29 19:38:34 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
If the window is not maximized, setIconified works, but isIconified and isMaximized give false reporting at times. See simple code example
If the window is maximized, setIconified does not work as expected. Instead, it is a three-step process. The first call iconifies, the second call restores, and the third call doesn't make any visual changes.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. call Stage.setIconified() a number of times, toggling the value each time. See example code.
2. Call isIconifed() just after calling setIconified()
3. Call isMaximized() just after calling setIconified()
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
1. For setIconified ( !stage.isIconified() ) to toggle the window iconified status. It does not.
2. For isIconified() to report correctly at all times
3. For isMaximized() to report correctly at all times.
ACTUAL -
(While Window not maximized)
Before call (Note: Window appears iconified)
isIconified(): true
isMaximized(): true
Setting iconified to false
After call (Note: Window now appears restored, not maximized)
isIconified(): true <-- The window is visually not iconified
isMaximized(): true <-- The window is visually not maximized
Before call (Note: Window still appears restored, not maximized)
isIconified(): false <-- One second later, the report is accurate
isMaximized(): false
Setting iconified to true
After call (Note: Window now appears iconified)
isIconified(): true
(While Window Maximized)
Before call (Note: Window appears iconified)
isIconified(): true
isMaximized(): true
Setting iconified to false
After call (Note: Window appears maximized)
isIconified(): true <-- Does not match visual
isMaximized(): true
Before call (Note: Window appears maximized)
isIconified(): true <-- Does not match visual
isMaximized(): true
Setting iconified to false
After call (Note: Window appears maximized)
isIconified(): false
isMaximized(): false <-- Does not match visual
Before call (Note: Window appears maximized)
isIconified(): false
isMaximized(): false <-- Does not match visual
Setting iconified to true
After call (Note: Window appears iconified)
isIconified(): true
isMaximized(): true
<Now it loops>
Before call (Note: Window appears iconified)
isIconified(): true
isMaximized(): true
Setting iconified to false
After call (Note: Window appears maximized)
isIconified(): true <-- Does not match visual
isMaximized(): true
...
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
mport javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
public class StageTest extends Application {
Stage stage;
public static void main ( String[] args ) {
launch ( args );
}
@Override
public void start ( Stage stage ) throws Exception {
this.stage = stage;
stage.setResizable( true );
stage.show( );
Thread thread = new Thread ( () -> {
while ( true ) {
Platform.runLater( () -> {
toggleMinimized();
} );
try {
Thread.sleep ( 1000 );
} catch ( InterruptedException e ) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
thread.setDaemon( true );
thread.start();
}
public void toggleMinimized() {
System.out.println ( "Before call" );
System.out.println ( "\tisIconified(): " + stage.isIconified() );
System.out.println ( "\tisMaximized(): " + stage.isIconified() );
System.out.println ();
if ( stage.isIconified() ) {
System.out.println ( "Setting iconified to false" );
System.out.println ();
stage.setIconified( false );
} else {
System.out.println ( "Setting iconified to true" );
System.out.println ();
stage.setIconified( true );
}
System.out.println ( "After call" );
System.out.println ( "\tisIconified(): " + stage.isIconified() );
System.out.println ( "\tisMaximized(): " + stage.isIconified() );
System.out.println ();
System.out.println ();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Cannot find one.