# Is setUndecorated() possible?

**URL:** <https://discourse.processing.org/t/is-setundecorated-possible/1097>\
**Category:** Processing\
**Created:** [June 19, 2018, 6:27pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097 "2018-06-19T18:27:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![deanomite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/deanomite/32/159_2.png) [@deanomite](https://discourse.processing.org/u/deanomite)\
**Post date:** [June 19, 2018, 6:27pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097/1 "2018-06-19T18:27:45Z")

</div>

I have 2 windows that I’m creating with the frames example of the controlP5 library. One works as the control window for sliders etc and the other the main sketch window where the artwork gets displayed.

I have 2 monitors. Using fullScreen(2) runs the main sketch window as fullscreen.  
However, the control window is much smaller say size(400,800);

I don’t want the title bar and close/minimize buttons at the top.

Has setUndecorated() been completely removed in processing 3?  
If so how may I achieve this.

I don’t want to make this control Window full screen. I wish it to remain at size(400,800).

Would really appreciate if someone could point me in the right direction as have been struggling for a while on this. Thanks!

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 19, 2018, 6:32pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097/2 "2018-06-19T18:32:42Z")

</div>

- [https://Forum.Processing.org/two/discussions/tagged?Tag=setUndecorated()](https://Forum.Processing.org/two/discussions/tagged?Tag=setUndecorated%28%29)

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [June 19, 2018, 6:39pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097/3 "2018-06-19T18:39:52Z")

</div>

@GoToLoop Can you please post explanations when you post links?

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [June 19, 2018, 6:43pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097/4 "2018-06-19T18:43:56Z")

</div>

You can get to the old `frame` variable and the `setUndecorated()` function, but you have to go through the `surface` variable and it depends on which renderer you’re using. Here’s an example for the default renderer:

```auto
import java.awt.Frame;
import processing.awt.PSurfaceAWT;
import processing.awt.PSurfaceAWT.SmoothCanvas;
 
void setup() {
  size(200, 200);
}
 
PSurface initSurface() {
  PSurface pSurface = super.initSurface();
  PSurfaceAWT awtSurface = (PSurfaceAWT) surface;
  SmoothCanvas smoothCanvas = (SmoothCanvas) awtSurface.getNative();
  Frame frame = smoothCanvas.getFrame();
  frame.setUndecorated(true);
  return pSurface;
}
 
void draw() {
  background(0);
  ellipse(mouseX, mouseY, 20, 20);
}

```

---

<div class="post-metadata">

**Author:** ![deanomite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/deanomite/32/159_2.png) [@deanomite](https://discourse.processing.org/u/deanomite)\
**Post date:** [June 19, 2018, 6:46pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097/5 "2018-06-19T18:46:40Z")

</div>

Cool Thanks Kevin. Let me try this out.

Issue was `surface.setResizable(true);` was working and ``surface.setunDecorated(true)`;` doesn’t exist

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [June 19, 2018, 6:56pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097/6 "2018-06-19T18:56:15Z")

</div>

Right, `surface` doesn’t have a `setUndecorated()` function, presumably because not every renderer supports it.

There are other approaches in the link posted by GoToLoop. [Here](https://forum.processing.org/two/discussion/12200/processing-3-how-to-setundecorated-true) is one that’s probably better than the one I posted above:

```auto
void settings() {
    fullScreen();
}
void setup() {
    surface.setSize(500,500);
}
 
void draw() {
  background(0);
  ellipse(mouseX, mouseY, 20, 20);
}

```

---

<div class="post-metadata">

**Author:** ![deanomite](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/deanomite/32/159_2.png) [@deanomite](https://discourse.processing.org/u/deanomite)\
**Post date:** [June 19, 2018, 7:13pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097/7 "2018-06-19T19:13:18Z")

</div>

Perfect!! It worked. So basically the fullScreen() removes the ‘frame decoration’ and setSize() and setLocation(); when used together can help you set the layout. Thanks Kevin… your example helped me understand this!

@GoToLoop Thanks! Am going through the old forum links as well. However, this one does the trick for immediate gratification 🙂

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [June 19, 2018, 10:51pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097/8 "2018-06-19T22:51:52Z")

</div>

That’s a terrible idea if you want something that works cross-renderer and cross-platform - don’t assume that fullScreen just makes the window undecorated.

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [June 20, 2018, 4:20pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097/9 "2018-06-20T16:20:07Z")

</div>

> [@neilcsmith](#):
>
> That’s a terrible idea

Yep, like I mentioned a few times: all of this depends on your renderer.

If you have a better solution I’d be curious to see it.

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [June 21, 2018, 3:48pm UTC](https://discourse.processing.org/t/is-setundecorated-possible/1097/10 "2018-06-21T15:48:13Z")

</div>

No, I agree with you, and your first answer - overriding `initSurface()` - is the way I do this. Depending on the renderer _and the OS_, `fullScreen()` can set flags on the window that you don’t want and can cause problems. The slightly longer-winded way you posted first is a safer bet. I only use the OpenGL renderers in PraxisLIVE. Interesting these return the window and not the canvas from `getNative()` so I override initSurface like (where wHints is my own config object) -

```auto
protected PSurface initSurface() {
    PSurface s = super.initSurface();
    s.setTitle(wHints.getTitle());
    GLWindow window = (GLWindow) surface.getNative();
    window.setAlwaysOnTop(wHints.isAlwaysOnTop());
    window.setUndecorated(wHints.isUndecorated());
    return s;
}

```
