1

Question

How can I restrict the auto-placement of all windows by metacity? Either by restricting to Monitor0 or to avoid the "dead space" of my display?

The Problem

I'm running CentOS 5.3 with metacity v2.16.0 for a window manager.

I have two monitors hooked up to a single nVidia card, the larger (0) is to the left of the smaller one (1), tops aligned -- so X11 reports my display size as the sum of the widths by the larger height. My display maps to the two monitors like this:

000000000000011111111
000000000000011111111
000000000000011111111
000000000000011111111
0000000000000........
0000000000000........

My problem is that there is an area, shown by dots (".") at the bottom right that is not mapped to either monitor, and metacity tries to put new windows there, since there are no windows placed there.

I'm using "TwinView" mode and nVidia's driver.


EDIT: After a reboot, I find that functionality has changed:

  • The dead (".") section of the screen is no longer used -- great!
  • If I maxmize a window it fills one of the monitors ("0" or "1") -- good!

So I'd still like an answer to restrict window placement, to monitor "0" but I can live w/o an answer.


However... now Gnome Panel will draw the icons for a "drawer" in the wrong place, but this sounds like a variation on a known bug - https://bugzilla.gnome.org/show_bug.cgi?id=587944

2
  • So you are not using compiz, just straight metacity?
    – Alvin Row
    Sep 13, 2009 at 2:34
  • I thought they were different programs. ps lists "metacity" and I haven't done anything to switch from the default. So unless I could be running metacity w/o trying, it's straight metacity.
    – NVRAM
    Sep 14, 2009 at 15:42

1 Answer 1

0

My original "dead space" problem was fixed after the reboot. It seems Metacity refuses any restrict window placement, so I can either:

  1. Stop using Metacity, or
  2. Keep a window opened on the 2nd monitor to encourage placement on the primary monitor (I do this anyhow).

Apparently, the Gnome Metacity developers thought that placing windows on only one monitor is "just silly" (see quote below).


From the Gnome desktop-devel-list from a few years back:

Currently metacity works very very hard to do the right thing in window
placement for xinerama.  It works more or less as follows:

1) Try to find a place for the window on the current xinerama
2) Construct a "natural xinerama ordering" which is a breadth-first
   traversal of the xinerama graph from the xinerama containing the mouse
   point, with preference to left, then right, then up, then down.
3) walk the natural xinerama ordering to find a nearby xinerama with an
   empty space that could contain the window
4) if the window is big enough to be maximized, try to find an empty
   xinerama where it could go
5) if there is nowhere the window can fit, fall back to a cascade on the
   xinerama containing the pointer

I find that this algorithm makes it exceedingly easy to make good use of
all the space available on both screens.  A simple "always on current
xinerama" policy would simply encourage users to use only one xinerama,
which is really just silly.  If you have two monitors, why not use them?

The one improvement that I'd like to make here is to improve the cascade
algorithm so that it doesn't ever just place window at the upper left
corner of the screen.

-Rob
1
  • Note that in resolving #145503, this commit in 2007 removed the xinerama window placement that Rob Adams wrote and replaced it with one that only places windows on the xinerama screen that the current focus window is on. This is exactly what uws in that list message was requesting.
    – Dan D.
    Mar 29, 2014 at 13:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .