Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Fullscreen and Linux once again...  (Read 4759 times)
0 Members and 1 Guest are viewing this topic.
Offline turquoise3232

Junior Devvie




Java (games) rock!


« Posted 2006-11-28 07:42:08 »

Hi all,

I tried to use fullscreen mode with jdk 6 b104 on a Fedora Core 6 Linux thinking that with the nice improvements sun mades in fullscreen support on Linux it would roll easily.
So I was a little disappointed seeing that my application (and a small test borrowed on the internet ) was displayed in fullscreen BUT below the window manager task bar. Cry  Cry  Cry

I browsed a little, found some relevant supposed corrected bug in the database...
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6364134
It talks about a _NET_WM_FULLSCREEN thing but it sounds to me like a way to do the trick in jdk source code...

I am missing something (high probability here I guess) or is there a little regression in java 6 ?
Did someone experienced this kind of trouble?

Thanks for any help or hint.

PS : I know that I can hide the taskbar but that not really a good solution for me, sorry  Wink
Offline campbell

Junior Devvie




Java games rock!


« Reply #1 - Posted 2006-11-28 19:47:33 »

Sigh.  Fullscreen in JDK 6 was working great on all the Linux distros we tried.  The whole point of the _NET_WM_FULLSCREEN hint is to allow the WM to determine how/when to place a fullscreen window over the taskbar, so if the WM isn't honoring that hint, there's not much we can do.  There may have been some change in FC6 that causes the problem you're seeing.  Please file a bug report at bugs.sun.com, and include your fullscreen testcase as well as any other details that might be helpful.

Chris
Offline turquoise3232

Junior Devvie




Java (games) rock!


« Reply #2 - Posted 2006-11-29 15:42:42 »

Hi,
Thanks for the tips chris, I'm going to narrow down a small test case to provide and fill a bug...
But if it's due to the WM I'll try the task bar hiding trick... not a good solution as I said but a solution nevertheless.

Thanks again.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline turquoise3232

Junior Devvie




Java (games) rock!


« Reply #3 - Posted 2006-12-04 08:53:16 »

Hello,
Trying to send a small test case as a bug I found something interresting.
If I forget to call setResizable( false ) on the JFrame going to be "fullscreened" it do appears on top of the task bar.
BUT if the JFrame is not resizable it appears below the task bar.
In the fullscreen tutorial, it's strongly recommended to use unresizable frames...

So, I'll try to fill a bug report with these remarks.
Offline Linuxhippy

Senior Devvie


Medals: 1


Java games rock!


« Reply #4 - Posted 2006-12-04 12:01:13 »

This is most likely a problem with your windowmanager and not with java....

lg Clemens
Offline turquoise3232

Junior Devvie




Java (games) rock!


« Reply #5 - Posted 2006-12-04 15:11:40 »

This is most likely a problem with your windowmanager and not with java....

Well, yes i though so but what is strange is that the behaviour changes depending on resizable property. Not a big deal but it should not should it?
Offline Linuxhippy

Senior Devvie


Medals: 1


Java games rock!


« Reply #6 - Posted 2006-12-04 16:55:01 »

Well if you window-manager is doing the wrong thing if the window is resizeable ... theres not a lot that can be done.
Either you can work arround (as you did) or better the window manager should been fixed...

lg Clemens
Offline campbell

Junior Devvie




Java games rock!


« Reply #7 - Posted 2006-12-05 16:44:27 »

Well if you window-manager is doing the wrong thing if the window is resizeable ... theres not a lot that can be done.
Either you can work arround (as you did) or better the window manager should been fixed...

Let's wait till the bug report is filed before we jump to any conclusions.  I'll need to do some testing on FC6 and see if the WM is behaving differently than other releases; it may just be that we'd want to workaround this case on the JDK side.

Chris
Offline turquoise3232

Junior Devvie




Java (games) rock!


« Reply #8 - Posted 2006-12-05 21:02:33 »

Hi, I filled the bug report yesterday and it was accepted today.
The bug id was sent to my work so I'll update this post with this id when I go back to the office.

Thanks Chris for your future investigations.

EDIT : Here is the bug number  (not already present on the web site, but will be soon) :
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6500686
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #9 - Posted 2006-12-10 00:35:36 »

Just FYI: I've seen issues with fullscreen mode on Windows if
resizing is disabled on the fullscreen frame. Especially if
the frame is first show on the screen, and later used
as full screen window.

So I would suggest not to disable resizing.

Dmitri
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline fletchergames

Senior Devvie





« Reply #10 - Posted 2006-12-12 20:06:00 »

The following code worked fine for me in Java 5.  I just installed Java 6, and the task bar flickers on the screen.  If I click on the task bar (which minimizes the program) and then restore the program, it works fine.  I'm using Windows and have not tried my code on any other Operating System.

I've tried not calling setResizable, and I've fiddled around with it a bit.  But nothing seems to help.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
   //determine the display mode
   DisplayMode displayMode = new DisplayMode(width, height, colorDepth,
      DisplayMode.REFRESH_RATE_UNKNOWN);
   
   //create the full screen JFrame
   GraphicsDevice device = GraphicsEnvironment.
      getLocalGraphicsEnvironment().getDefaultScreenDevice();
   GameFrame gameFrame = new GameFrame(device.getDefaultConfiguration());
   gameFrame.setResizable(false);
   gameFrame.setUndecorated(true);

   //initialize fullscreen mode
   device.setFullScreenWindow(gameFrame);
   if(device.isDisplayChangeSupported()) {
      try {
         device.setDisplayMode(displayMode);
      } catch(IllegalArgumentException exception) {
         //Java emulates the unsupported full screen mode
      }
   
      //required for mac os x
      gameFrame.setSize(width, height);
   } else { //else the display couldn't be changed
      ErrorLog.output(ErrorList.fullScreenGameFrameScreenModeNotSupported);
      System.exit(0);
   } //end else the display couldn't be changed
   
   //disable "input methods"
   gameFrame.enableInputMethods(false);
   
   //regular GameFrame stuff
   gameFrame.initializeBufferStrategy();


P.S. Class GameFrame is just an extended JFrame with a few extra methods (such as initializeBufferStrategy).
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #11 - Posted 2007-01-14 02:00:07 »

The code looks fine to me, so this must be a bug (I would still remove the setResizable(false)).

Also, if you're using fullscreen/active rendering (especially for games) I would
not use swing components, just awt.

Also, try running with -Dsun.java2d.d3d=false , see if it helps.

Thanks,
  Dmitri
Offline fletchergames

Senior Devvie





« Reply #12 - Posted 2007-01-15 16:48:53 »

Forgot that I posted this.  Sad

I figured out that it wasn't a problem with the code I posted.  It was from a line of code that I had elsewhere from when the game was in a window instead of full-screen.  I called "pack" on the main JFrame after all the Swing components were added, and removing that stopped the problem.  Since it resizes a Window, it makes sense that it shouldn't be called on a full-screen exclusive mode window.

I had thought that the problem was with my class that went FSEM mode because I moved it into another program, which caused the same problem.  But that program was calling pack on the main frame too.

I believe it only started occurring after I refactored a custom component I made, though it wasn't immediately apparent.  I also see no reason why changing how two classes pass events around has any relation to the pack method.

Also, if you're using fullscreen/active rendering (especially for games) I would
not use swing components, just awt.
Out of curiosity, what's the problem with Swing components?  They seem to work fine in FSEM to me.
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #13 - Posted 2007-01-22 17:59:03 »


OK, glad that the mystery was solved.

> Out of curiosity, what's the problem with Swing components?  They seem to work fine in FSEM to me.

They do, it's just that they have their own back-buffer, and updating mechanism, and they
pull a lot of classes, so unless you really need them, I'd use awt.

Thanks,
  Dmitri
Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (108 views)
2017-09-30 02:57:34

theagentd (135 views)
2017-09-26 18:23:31

cybrmynd (245 views)
2017-08-02 12:28:51

cybrmynd (239 views)
2017-08-02 12:19:43

cybrmynd (238 views)
2017-08-02 12:18:09

Sralse (252 views)
2017-07-25 17:13:48

Archive (864 views)
2017-04-27 17:45:51

buddyBro (1007 views)
2017-04-05 03:38:00

CopyableCougar4 (1566 views)
2017-03-24 15:39:42

theagentd (1373 views)
2017-03-24 15:32:08
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!