Window Placement

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
gargoyle666uk

Window Placement

Unread post by gargoyle666uk » 2018-07-07, 20:00

When I open a new window PaleMoon appears at a random location, usually to the far left of my screen, which I don't want.
Each new window opens slightly to the left of the current one (even after I have centered it).
I find this behaviour irritating.

Is there a way to get the browser to open centrally or better still at the same position as the last session or even a predfined position (x,y)?

I have looked in about:config but I couldn't find a matching setting to achieve the above preferred behaviour.

Thanks.
---
Linux Mint 18.3 Cinnamon 64-bit

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2183
Joined: 2018-05-05, 13:29

Re: Window Placement

Unread post by vannilla » 2018-07-07, 22:20

This is the window manager's behaviour, the browser has no power over its position on the screen.
People more familiar with Mint and/or Cinnamon can probably help you with that (or ask on Mint's forum).

tooshorttoolong
Fanatic
Fanatic
Posts: 137
Joined: 2017-09-11, 14:28

Re: Window Placement

Unread post by tooshorttoolong » 2018-07-07, 22:33

You could use devilspie2 to force the windows positions, with a config like:

Code: Select all

app = get_application_name()
sw, sh = get_screen_geometry()
x, y, w, h = get_window_geometry()
if app == "Pale Moon" then
 set_window_position( (sw-w)/2, (sh-h)/2 )
end
Put the above in for example "~/.config/devilspie2/center-pale-moon.lua" and devilspie2 should automatically center PM’s window every time.

tooshorttoolong
Fanatic
Fanatic
Posts: 137
Joined: 2017-09-11, 14:28

Re: Window Placement

Unread post by tooshorttoolong » 2018-07-07, 22:35

vannilla wrote:This is the window manager's behaviour, the browser has no power over its position on the screen.
A program can choose the position of its windows instead of letting the window manager do it.

Walter Dnes
Astronaut
Astronaut
Posts: 650
Joined: 2015-07-30, 20:29
Location: Vaughan, ON, Canada

Re: Window Placement

Unread post by Walter Dnes » 2018-07-09, 03:15

tooshorttoolong wrote:
vannilla wrote:This is the window manager's behaviour, the browser has no power over its position on the screen.
A program can choose the position of its windows instead of letting the window manager do it.
You're both right. Years ago, linux Netscape (YES!) did support a "-geometry" option, but it has not worked for many years https://bugzilla.mozilla.org/show_bug.cgi?id=20573. You can specify width and height, but not location, e.g.

palemoon -no-remote -width 800 -height 500 -p test
There's a right way
There's a wrong way
And then there's my way

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Window Placement

Unread post by Moonchild » 2018-07-09, 06:53

A solution would be to use a window management tool (I'd expect those exist on Linux) that will allow you to place any application window at specific screens and screen coordinates on statrtup.
Another solution would be to write a XUL extension that will manipulate window positions.

I looked at the bug linked, and I don't see this happening as an internal solution. Netscape 4 never properly supported it (same issue with positioning) and I'd rather keep this kind of extremely specific corner-case workflow out of the browser core, especially considering solutions already exist. Before the argument is made "but X applications accept -geometry": keep in mind that Pale Moon is a unified cross-platform application and not your basic X application; many things are custom-implemented to be cross-platform, and not handed off to whatever OS-specific library that would only work on one class of platform.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2183
Joined: 2018-05-05, 13:29

Re: Window Placement

Unread post by vannilla » 2018-07-09, 07:08

Walter Dnes wrote:
tooshorttoolong wrote:A program can choose the position of its windows instead of letting the window manager do it.
You're both right. Years ago, linux Netscape (YES!) did support a "-geometry" option, but it has not worked for many years https://bugzilla.mozilla.org/show_bug.cgi?id=20573. You can specify width and height, but not location, e.g.

palemoon -no-remote -width 800 -height 500 -p test
Programs using the Xt library can specify the geometry with the common "-geometry" option, but that only provides hints to the window manager.
The window manager is free to ignore the hints. For example, a tiling window manager will probably ignore the x and y coordinates since windows are positioned so that they never overlap.
Stacking window managers (which are the most common) can also ignore those values if they have some settings that take priority over the application's desired position.
Also, Pale Moon is based on GTK which doesn't have a -geometry option (as far as I know...) so it's not strange that it doesn't work, as it would have to be implemented by Pale Moon itself, rather than the toolkit library.

gargoyle666uk

Re: Window Placement

Unread post by gargoyle666uk » 2018-07-09, 08:01

As far as I can see in Linux Mint Cinnamon the window manager user-tool (i.e. in the system settings) doesn't have a specific option for window placement, unless it's somewhere else.
I seem to recall an option in another distro (can't remember which one) that allowed placement centrally or based on the mouse cursor position. I don't know if that option still exists or has been deprecated.
I shall ask around in a Linux forum.
Last edited by gargoyle666uk on 2018-07-09, 08:01, edited 1 time in total.

Walter Dnes
Astronaut
Astronaut
Posts: 650
Joined: 2015-07-30, 20:29
Location: Vaughan, ON, Canada

Re: Window Placement

Unread post by Walter Dnes » 2018-07-09, 08:16

Moonchild wrote:A solution would be to use a window management tool (I'd expect those exist on Linux) that will allow you to place any application window at specific screens and screen coordinates on statrtup.
I think wmctrl is the tool. The man page at https://linux.die.net/man/1/wmctrl and a Linux Journal aricle at https://www.linuxjournal.com/magazine/hack-and-automate-your-desktop-wmctrl provide info to get started. It can also move/resize a currently open window.
There's a right way
There's a wrong way
And then there's my way

User avatar
Night Wing
Knows the dark side
Knows the dark side
Posts: 5151
Joined: 2011-10-03, 10:19
Location: Piney Woods of Southeast Texas, USA

Re: Window Placement

Unread post by Night Wing » 2018-07-09, 08:27

gargoyle666uk wrote:When I open a new window PaleMoon appears at a random location, usually to the far left of my screen, which I don't want.
Each new window opens slightly to the left of the current one (even after I have centered it).

Is there a way to get the browser to open centrally or better still at the same position as the last session or even a predfined position (x,y)?

Linux Mint 18.3 Cinnamon 64-bit
I use 64 bit linux Mint 19 (Tara) Xfce.

My windows open up in the middle of my 27" monitor. In Xfce, under Settings, the Windows Manager is listed. In the WM, under the Advanced tab, there is Windows Snapping and by default, it is checkmarked for "To screen borders" and there is also a default checkmark for "To other windows". I just uncheck those two default settings and all of my windows open up in the center of my monitor.

Since you use the Cinnamon DE, see if you have the Windows Manager in your settings and if you do, hopefully they will act the same as mine do in Xfce.
Linux Mint 21.3 (Virginia) Xfce w/ Linux Pale Moon, Linux Waterfox, Linux SeaLion, Linux Firefox
MX Linux 23.2 (Libretto) Xfce w/ Linux Pale Moon, Linux Waterfox, Linux SeaLion, Linux Firefox
Linux Debian 12.5 (Bookworm) Xfce w/ Linux Pale Moon, Linux Waterfox, Linux SeaLion, Linux Firefox

racorbin2010

Re: Window Placement

Unread post by racorbin2010 » 2018-07-09, 15:47

I use Palemoon 27.9.3 on three machines. One is on a Windows 7 64-bit laptop; one is on a 32-bit laptop running Linux Mint 17.2 KDE; one is on a 64-bit PC running Debian Stretch KDE. On all three machines Palemoon remembers the last size and position it had when I closed it. On the two KDE systems I manage it in the Windows Behavior section of the Systems Settings. On the Windows 7 laptop, I dont recall doing anything special to get Palemoon to remember its last size and position. On the Windows 7 laptop, I run two separate profiles for Palemoon. Each profile remembers its own last position and size.

Locked