File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
app/src/processing/app/ui Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,18 @@ public abstract class Editor extends JFrame implements RunnerListener {
148148 protected Editor (final Base base , String path , final EditorState state ,
149149 final Mode mode ) throws EditorException {
150150 super ("Processing" , state .getConfig ());
151+ if (Platform .isLinux ()) {
152+ // If the frame is already displayable, dispose it to allow undecorated change
153+ if (isDisplayable ()) {
154+ dispose ();
155+ }
156+ try {
157+ setUndecorated (true );
158+ } catch (IllegalComponentStateException e ) {
159+ System .err .println ("Could not set undecorated: " + e .getMessage ());
160+ }
161+ getRootPane ().setWindowDecorationStyle (JRootPane .FRAME );
162+ }
151163 this .base = base ;
152164 this .state = state ;
153165 this .mode = mode ;
@@ -211,10 +223,7 @@ public void windowDeactivated(WindowEvent e) {
211223 spacer .setAlignmentX (Component .LEFT_ALIGNMENT );
212224 box .add (spacer );
213225 }
214- if (Platform .isLinux ()) {
215- if (!isDisplayable ()) setUndecorated (true );
216- getRootPane ().setWindowDecorationStyle (JRootPane .FRAME );
217- }
226+
218227
219228 rebuildModePopup ();
220229 toolbar = createToolbar ();
You can’t perform that action at this time.
0 commit comments