I'm using Ubuntu 18.04 desktop and the default Image Viewer software.
There's a strange and really frustrating case when I open an image(s) with a specific size(960×960 for today), the window will always appear at the top-left of my secondary screen with the top bar(the one we use to drag it around, I don't remember the name) hiding like this
I use a pair of screens, the large as primary on the left and the small as secondary on the right. The sidebar is in the secondary screen.
What makes it strange is the other sizes like 400×400 or 1920×1200 are fine.
So my question is, is it possible to make it open in the current monitor without the top bar missing?
Best Answer
We can only guess what is the cause of the issue, but I have no clue of a real fix. We can however fix a bad window placement with a workaround.
The principle
The tiny daemon-like process will wait for creation of any window, on any of your monitors, with a "negative" placement (either x or y) on the monitor, and move it to a position of x=80px, y=80px on the corresponding monitor:
It does so by looking at the SE corner of newly created windows. SE is assumed to be the monitor it should have been fully placed on. The placement of the NW corner of the window is then the trigger to either act (move the window to a better position), or leave the window alone: it should not be at either the left or above the monitor SE is on.
In all other cases, the window is left alone completely. Note that:
The code
How to use
watchout.py
Test-run it from a terminal by the command:
Try to open application with a misbehaving placement, which should be pretty predictable, looking at your question.
If all works fine, add it to startup applications. Possibly you need to set a tiny break before starting up the process, to make sure it won't break on a uncompleted desktop-loading.