Modify

Opened 15 years ago

Closed 15 years ago

#2279 closed enhancement (fixed)

[PATCH] Add option to full screen JOSM to View menu

Reported by: avarab@… 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)

FullScreen.patch (2.7 KB ) - added by avarab@… 15 years ago.
Add option to full screen JOSM to the main menu
FullScreen-2.patch (2.5 KB ) - added by avarab@… 15 years ago.
Add option to full screen JOSM to the main menu: Improved patch
FullScreen-3.patch (2.4 KB ) - added by avarab@… 15 years ago.
Only add "Full Screen" to view menu if on Unix && gd.isFullScreenSupported()

Download all attachments as: .zip

Change History (12)

by avarab@…, 15 years ago

Attachment: FullScreen.patch added

Add option to full screen JOSM to the main menu

comment:1 by stoecker, 15 years ago

We already have OS specific hooks. Please use these for OS determination.

in reply to:  1 comment:2 by avarab@…, 15 years ago

Replying to stoecker:

We already have OS specific hooks. Please use these for OS determination.

Is this patch (attached) acceptable?

by avarab@…, 15 years ago

Attachment: FullScreen-2.patch added

Add option to full screen JOSM to the main menu: Improved patch

comment:3 by stoecker, 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.

in reply to:  3 ; comment:4 by anonymous, 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:

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?

in reply to:  4 comment:5 by avarab@…, 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:

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

in reply to:  4 comment:6 by avarab@…, 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).

comment:7 by stoecker, 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 avarab@…, 15 years ago

Attachment: FullScreen-3.patch added

Only add "Full Screen" to view menu if on Unix && gd.isFullScreenSupported()

in reply to:  7 comment:8 by avarab@…, 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 stoecker, 15 years ago

Resolution: fixed
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.