Opened 15 years ago
Closed 15 years ago
#2279 closed enhancement (fixed)
[PATCH] Add option to full screen JOSM to View menu
Reported by: | Owned by: | team | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | Cc: |
Description
This patch only works on under X11 due to the caveats described in this mailing list post but the Full Screen feature won't appear in the View menu anywhere else so this should be acceptable for now.
Attachments (3)
Change History (12)
by , 15 years ago
Attachment: | FullScreen.patch added |
---|
follow-up: 2 comment:1 by , 15 years ago
We already have OS specific hooks. Please use these for OS determination.
comment:2 by , 15 years ago
Replying to stoecker:
We already have OS specific hooks. Please use these for OS determination.
Is this patch (attached) acceptable?
by , 15 years ago
Attachment: | FullScreen-2.patch added |
---|
Add option to full screen JOSM to the main menu: Improved patch
follow-up: 4 comment:3 by , 15 years ago
I had a look at this a bit deeper. This is only to toggle the normal full-screen option, not to have a new borderless variant? Then why so complicated? We already have this in MainApplication.java:
mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
You may make this a JosmAction, so it can be toggled using a key or icon in toolbar. Also notice, that the checkbox in front of the menu gets out of sync when using the normal maximize button.
JOSM remembers the last state, so a fullscreen window will be opened fullscreen next time again.
follow-ups: 5 6 comment:4 by , 15 years ago
Replying to stoecker:
I had a look at this a bit deeper. This is only to toggle the normal full-screen option, not to have a new borderless variant? Then why so complicated? We already have this in MainApplication.java:
mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
If I'm not mistaken this only maximizes the main window, but my patch adds an option to full-screen the program, i.e. remove all window decorations, of course depending on your Window Manager this may not work as the WM has ultimate power over what its windows are allowed to do:
- JOSM fullscreened: http://www.flickr.com/photos/avarab/3330748992/
- JOSM maximized: http://www.flickr.com/photos/avarab/3330749160/
You may make this a JosmAction, so it can be toggled using a key or icon in toolbar. Also notice, that the checkbox in front of the menu gets out of sync when using the normal maximize button.
You mean the [X] Full Screen checkbox? If so does the [X] Wireframe Mode checkbox also suffer from this problem? As I just copied the code it used.
JOSM remembers the last state, so a fullscreen window will be opened fullscreen next time again.
Don't you mean it remembers its maximized state?
comment:5 by , 15 years ago
Replying to anonymous:
Replying to stoecker:
I had a look at this a bit deeper. This is only to toggle the normal full-screen option, not to have a new borderless variant? Then why so complicated? We already have this in MainApplication.java:
mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
If I'm not mistaken this only maximizes the main window. but my patch adds an option to full-screen the program.
This is indeed the case, see:
- The java.awt.Frame documentation for MAXIMIZED_BOTH
- The java.awt.GraphicsDevice documentation for setFullScreenWindow
Maximization is just automatic resizing of a window with decorations to take up maximum screen space, while fullscreening is a different thing entirely, as documented in setFullScreenWindow. Consequently the --fullscreen command line option should be renamed, see ticket:2286
comment:6 by , 15 years ago
Replying to anonymous:
You may make this a JosmAction, so it can be toggled using a key or icon in toolbar. Also notice, that the checkbox in front of the menu gets out of sync when using the normal maximize button.
You mean the [X] Full Screen checkbox? If so does the [X] Wireframe Mode checkbox also suffer from this problem? As I just copied the code it used.
To answer my own question. Yes it does, because the checkbox is tracking full-screened state, not maximized state (see comment#5).
follow-up: 8 comment:7 by , 15 years ago
So please somehow try to find out if fullscreen is really available. Checkboxes getting out of sync are not nice. At least you should be able to keep them in sync on the systems without fullscreen possibilities.
by , 15 years ago
Attachment: | FullScreen-3.patch added |
---|
Only add "Full Screen" to view menu if on Unix && gd.isFullScreenSupported()
comment:8 by , 15 years ago
Replying to stoecker:
So please somehow try to find out if fullscreen is really available. Checkboxes getting out of sync are not nice. At least you should be able to keep them in sync on the systems without fullscreen possibilities.
With attachment:FullScreen-3.patch the "Full Screen" option in the view menu will only be added if on Unix and if gd.isFullScreenSupported() is true. Theoretically the latter should be sufficient but in practice it's not.
The "[X] Full Screen" checkbox will only be ticked if gd.setFullScreenWindow(frame) has been called, then the main frame should be in full screen as far as Java is concerned, even if that's not what really happened. That's not something that can be solved in JOSM however without adding Window Manager detection to it as far as I can tell.
Can you try this and see if you can make the checkbox go out of sync? If so, how?
comment:9 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In r1498.
I still can get it out of sync when I use the normal maximize-button. For me the fullscreen stuff results in normal maximize.
Add option to full screen JOSM to the main menu