Page 1 of 1

Window Placement

Posted: 2018-07-07, 20:00
by gargoyle666uk
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

Re: Window Placement

Posted: 2018-07-07, 22:20
by vannilla
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).

Re: Window Placement

Posted: 2018-07-07, 22:33
by tooshorttoolong
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.

Re: Window Placement

Posted: 2018-07-07, 22:35
by tooshorttoolong
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.

Re: Window Placement

Posted: 2018-07-09, 03:15
by Walter Dnes
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

Re: Window Placement

Posted: 2018-07-09, 06:53
by Moonchild
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.

Re: Window Placement

Posted: 2018-07-09, 07:08
by vannilla
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.

Re: Window Placement

Posted: 2018-07-09, 08:01
by gargoyle666uk
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.

Re: Window Placement

Posted: 2018-07-09, 08:16
by Walter Dnes
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.

Re: Window Placement

Posted: 2018-07-09, 08:27
by Night Wing
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.

Re: Window Placement

Posted: 2018-07-09, 15:47
by racorbin2010
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.