34
34
import java .awt .image .*;
35
35
import java .util .Timer ;
36
36
import java .util .TimerTask ;
37
+ import java .util .logging .Level ;
38
+ import java .util .logging .Logger ;
37
39
import javax .swing .JFrame ;
38
40
import javax .swing .JPanel ;
39
41
import javax .swing .JWindow ;
@@ -504,11 +506,12 @@ public void setContentAlpha(float contentAlpha) {
504
506
this .contentAlpha = contentAlpha ;
505
507
contentChanged ();
506
508
}
507
-
508
- /****************************************************
509
- * !!! CAUTION: UGLY METHODS BELOW !!! *
510
- ****************************************************/
511
-
509
+ //
510
+ //****************************************************
511
+ //* !!! CAUTION: UGLY METHODS BELOW !!! *
512
+ //****************************************************
513
+ //
514
+
512
515
/**
513
516
* Initializes the internal window.
514
517
*/
@@ -521,24 +524,26 @@ private void initWindow() {
521
524
// this window does not have a title bar and is not visible (hopefully)
522
525
window .setVisible (true );
523
526
524
- // linux:
525
- // we must ensure that the window gets painted at least once with
526
- // width and height > 0
527
- window .setSize (1 , 1 );
528
-
529
- // I am so unhappy with this :(
530
- for (int i = 0 ; i < 15 ; i ++) {
531
- window .paint (window .getGraphics ());
527
+ // ati on linux sucks!
528
+ if (SysUtil .isLinux ()) {
529
+
530
+ // linux:
531
+ // we must ensure that the window gets painted at least once with
532
+ // width and height > 0
533
+ window .setSize (1 , 1 );
534
+
535
+ // I am so unhappy with this :(
536
+ for (int i = 0 ; i < 15 ; i ++) {
537
+ window .paint (window .getGraphics ());
538
+ try {
539
+ Thread .sleep (2 );
540
+ } catch (InterruptedException ex ) {
541
+ // we don't care
542
+ }
543
+ }
532
544
}
533
545
534
- // now we can hide the window
535
- GraphicsUtil .invokeLater (new Runnable () {
536
-
537
- @ Override
538
- public void run () {
539
- window .setVisible (false );
540
- }
541
- });
546
+ window .setVisible (false );
542
547
}
543
548
544
549
/**
0 commit comments