Off screen display windows placement when using P3D or P2D

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?

1 Like

Hello @dkemp ,

Try this and change x and y as required:

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

Reference:

I know the scaling affects my sketch window size:

:)

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.

1 Like

Hello @dkemp ,

This may be of interest:

:)

This is very interesting - Thanks!

1 Like

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

Seems to me to be a new error in 4.4.8

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.

1 Like

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!

1 Like

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

:)