Window Placement

Support and discussions for the x86/x64 Linux version of Pale Moon.

Moderators: trava90, satrow

User avatar
gargoyle666uk
New to the forum
New to the forum
Posts: 2
Joined: Sat, 07 Jul 2018, 19:55

Window Placement

Unread postby gargoyle666uk » Sat, 07 Jul 2018, 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
Moonbather
Moonbather
Posts: 69
Joined: Sat, 05 May 2018, 13:29

Re: Window Placement

Unread postby vannilla » Sat, 07 Jul 2018, 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
Moon lover
Moon lover
Posts: 85
Joined: Mon, 11 Sep 2017, 14:28

Re: Window Placement

Unread postby tooshorttoolong » Sat, 07 Jul 2018, 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
Moon lover
Moon lover
Posts: 85
Joined: Mon, 11 Sep 2017, 14:28

Re: Window Placement

Unread postby tooshorttoolong » Sat, 07 Jul 2018, 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: 528
Joined: Thu, 30 Jul 2015, 20:29
Location: Vaughan, ON, Canada

Re: Window Placement

Unread postby Walter Dnes » Mon, 09 Jul 2018, 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: 21462
Joined: Sun, 28 Aug 2011, 17:27
Location: 58.5°N 15.5°E
Contact:

Re: Window Placement

Unread postby Moonchild » Mon, 09 Jul 2018, 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.
Improving Mozilla code: You know you're on the right track with code changes when you spend the majority of your time deleting code.

"If you want to build a better world for yourself, you have to be willing to build one for everybody." -- Coyote Osborne

vannilla
Moonbather
Moonbather
Posts: 69
Joined: Sat, 05 May 2018, 13:29

Re: Window Placement

Unread postby vannilla » Mon, 09 Jul 2018, 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.

User avatar
gargoyle666uk
New to the forum
New to the forum
Posts: 2
Joined: Sat, 07 Jul 2018, 19:55

Re: Window Placement

Unread postby gargoyle666uk » Mon, 09 Jul 2018, 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 Mon, 09 Jul 2018, 08:01, edited 1 time in total.

Walter Dnes
Astronaut
Astronaut
Posts: 528
Joined: Thu, 30 Jul 2015, 20:29
Location: Vaughan, ON, Canada

Re: Window Placement

Unread postby Walter Dnes » Mon, 09 Jul 2018, 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: 3294
Joined: Mon, 03 Oct 2011, 10:19
Location: Texas, USA

Re: Window Placement

Unread postby Night Wing » Mon, 09 Jul 2018, 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 19 (Tara) Xfce 64-Bit (Default OS) with 64-Bit linux Pale Moon
Windows 7 SP1 64 Bit (Backup OS) with 32-Bit windows Pale Moon

racorbin2010
Hobby Astronomer
Hobby Astronomer
Posts: 19
Joined: Sat, 07 Sep 2013, 19:59
Location: Warrenton, MO

Re: Window Placement

Unread postby racorbin2010 » Mon, 09 Jul 2018, 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.


Return to “Pale Moon for Linux”

Who is online

Users browsing this forum: No registered users and 10 guests