# Off screen display windows placement when using P3D or P2D

**URL:** <https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405>\
**Category:** Coding Questions\
**Created:** [October 20, 2025, 2:24am UTC](https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405 "2025-10-20T02:24:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkemp](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dkemp](https://discourse.processing.org/u/dkemp)\
**Post date:** [October 20, 2025, 2:24am UTC](https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405/1 "2025-10-20T02:24:27Z")

</div>

When using P2D or P3d my display window appears partially off-screen in the upper left – this even happens when using fullscreen or present mode, which do not actually fill the whole screen anymore. I have a feeling this has something to do with my windows display scaling (currently at 225% for my small laptop sceen), but I am not sure how to fix it.  
There is no issues when using the default renderer so not sure what to do. Is this a bug, or something I need to adjust in my display settings or something?

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 20, 2025, 8:56am UTC](https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405/2 "2025-10-20T08:56:35Z")

</div>

Hello @dkemp ,

Try this and change x and y as required:

```auto
void setup()
  {
  size(300, 300, P2D);
  int x = 600;
  int y = 600;
  surface.setLocation(x, y);
  }
  
void draw()
  {
  }

```

Reference:

> **[setLocation() / Reference](https://processing.org/reference/setlocation_)**
>
> The setLocation() function defines the position of the Processing sketch in relation to the upper-left corner of the computer screen. There are more features of PSurface documented…

I know the scaling affects my sketch window size:

> [@Launcher for Multi-Renderer PApplets](https://discourse.processing.org/t/launcher-for-multi-renderer-papplets/46764):
>
> Hello folks! My exploration of a launcher for PApplets with different renderers. This was used primarily for testing Windows scaling on my W10 system and how it affects the sketch window. Code: /\*\* \* Launcher for Multi-Renderer PApplets \* \* Author: glv \* Date: 2025-07-07 \* \* Description: \* Launches four separate Processing sketches (PApplets) using different renderers: \* - JAVA2D \* - P2D \* - P3D \* - FX2D \* \* Each renderer runs in its own thread, with readiness flags for commu…

`:)`

---

<div class="post-metadata">

**Author:** ![dkemp](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dkemp](https://discourse.processing.org/u/dkemp)\
**Post date:** [October 21, 2025, 2:09pm UTC](https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405/3 "2025-10-21T14:09:04Z")

</div>

> [@glv](#):
>
> ` surface.setLocation(x, y);`

Thanks that really helps a lot and solves the issue when running the sketch normally; however, I’m still getting some weird behaviors when using fullScreen(P3D); or running the sketch in “present” mode.

Also wondering if this is a bug in the latest version as none of this occurred in earlier (4.3 and earlier) versions of processing.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 25, 2025, 9:00pm UTC](https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405/4 "2025-10-25T21:00:15Z")

</div>

Hello @dkemp ,

This may be of interest:

> [@DPI Renderer Scaling Override for JAVA2D](https://discourse.processing.org/t/dpi-renderer-scaling-override-for-java2d/47439):
>
> Hello folks! Forcing 1:1 Pixel Rendering for Different Renderers in Processing This sketch demonstrates how to force 1:1 pixel rendering by overriding DPI scaling for JAVA2D in Processing. The solution was a challenging process that required iterating through multiple approaches with both ChatGPT and Google Gemini to finally arrive at a working solution and comments. The key piece of the solution is this static block at the beginning of the sketch, which ensures that Java2D and FX2D renderers…

`:)`

---

<div class="post-metadata">

**Author:** ![dkemp](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dkemp](https://discourse.processing.org/u/dkemp)\
**Post date:** [October 31, 2025, 1:52pm UTC](https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405/5 "2025-10-31T13:52:45Z")

</div>

This is very interesting - Thanks!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 1, 2025, 12:40pm UTC](https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405/6 "2025-11-01T12:40:10Z")

</div>

> [@glv](#):
>
> ` surface.setLocation(x, y);`

doesn’t work for me when using fullScreen(P3D);

Seems to me to be a new error in 4.4.8

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [November 1, 2025, 1:48pm UTC](https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405/7 "2025-11-01T13:48:27Z")

</div>

> [@glv](#):
>
> surface.setLocation(x, y);

> [@dkemp](#):
>
> I’m still getting some weird behaviors when using fullScreen(P3D); or running the sketch in “present” mode.

I have never used ‘present’ mode but surely ‘fullscreen’ mode would override `setLocation` since the display would be forced to fill the rectangle [0,0] - [width, height].

I suspect it is related to the Windows display setting as suspected by OP, but again that is something I am not familiar with.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [November 1, 2025, 3:36pm UTC](https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405/8 "2025-11-01T15:36:12Z")

</div>

> [@quark](#):
>
> it is related to the Windows display setting

That actually solved it.

With `fullScreen(P3D);` the Sketch window was much smaller than the screen (it wasn’t the location as I first thought) and when I used `fullScreen(P3D, 0);` instead, it worked.

(but again this is new with 4.4.8 apparently, since this situation is since one year and was never an issue when using `fullScreen`)

My situation is that I have a laptop but use an external bigger screen on it.

So, thank you!

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [November 10, 2025, 10:21pm UTC](https://discourse.processing.org/t/off-screen-display-windows-placement-when-using-p3d-or-p2d/47405/9 "2025-11-10T22:21:48Z")

</div>

> [@Chrisir](#):
>
> With `fullScreen(P3D);` the Sketch window was much smaller than the screen (it wasn’t the location as I first thought) and when I used `fullScreen(P3D, 0);` instead, it worked

Similar issue with this on Windows with scaling of 125%:

> [@Renderers (and Windows scaling)](https://discourse.processing.org/t/renderers-and-windows-scaling/47524/3):
>
> Solution on my system with Windows 10 and Windows Scaling = 125% : [DPI Renderer Scaling Override for JAVA2D](https://discourse.processing.org/t/dpi-renderer-scaling-override-for-java2d/47439) This is a workaround on my system for fullscreen(P2D) : /\* \* Fullscreen P2D Workaround \* \* Author: glv \* Date: 2025-11-09 \* \*/ static { // Forces 1:1 pixel rendering by disabling OS-level DPI scaling System.setProperty("sun.java2d.uiScale", "1.01"); // If this is 1.0 it does NOT work! //System.setProperty("sun.java2d.DPIscaling", "false"); // No effect. …

`:)`
