"Decorated" Apps that Are Supposed to Launch as Fullscreen Don't in 44.1
Affected version
- Ubuntu 23.04
- Gnome 44.1 (also 44.0)
- XOrg
Bug summary
This problem does not ocur in GNOME 43 and lower.
Not sure if this affects all apps that launch in full screen but the ones i installed have this issue. To confirm this i created a small java program (see below) that creates a frame and tries to set this frame to full screen just before making it visible.
In GNOME 44.1 the app will NOT start in full screen. The same issue occurs in 44.0.
This problem is related to the frame's decoration. When undecorated the app will start as full screen just fine. I can set this via the java function JFrame.setUndecorated(true)
. But doing this I will lose the title bar of the frame.
So it appears when GNOME is told to give the app the standard decorations provided by the operating system it does that BUT GNOME then ignores the request to maximize the window (before it shows for the first time).
A work around is to manually set the frame's width/height manually to full screen but that is just hiding the problem. Alternatively, one can maximize the window just fine AFTER it is visible which unsurprisingly results in an ugly window resizing flash.
Steps to reproduce
Run the following short java code on Ubuntu using GNOME 44.1 or 44.0.
Note: this just creates a basic window frame and makes it start up maximized in size..it works correctly in GNOME 43 and lower. It does not maximize in 44.0 and 44.1)
import javax.swing.JFrame;
import java.awt.Toolkit;
public class FullScreenFrameExample {
public static void main(String[] args) {
JFrame frame = new JFrame("Full Screen Frame Example");
frame.setBounds(100, 100, 300, 300);
// Exit the application when the frame is closed
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Set the frame to full screen
frame.setExtendedState(frame.getExtendedState() | JFrame.MAXIMIZED_BOTH);
// Display the frame
frame.setVisible(true);
}
}
What happened
Doesnt go to full screen when an app wants to start in full screen mode, if it has its own title bar (ie. decorated)
What did you expect to happen
Expected the app to show in full screen
Relevant logs, screenshots, screencasts etc.
Note: In the following screencast, when you see the screen turn light-grey near the end it's just the frame going into full-screen mode on launch. This is correct. My screencast didnt capture the full window so u are only looking at the client region of the frame which is light grey. Full screen is working at this part because i had to use the lime "frame.setUndecorated(true)". This frame, due to the setUndecorated(..) however, no longer has a title bar.