The 'geometry' option



I've been using vim (www.vim.org) for a few years now. The most recent
version can use GTK+ for its GUI mode. I've noticed a small bug with
this though, and I'm trying to fix it. Since the bug seems to be more of
a GTK+ coding problem than a VIM specific problem, that's why I'm
asking here.

I normally have gvim come up in the top-right. I used to say:

gvim -geom -0+0

That was back when I was using the Athena version of gvim (the 'g'
stands for GUI, not GTK+). Now, with the GTK+ version of gvim:

gvim -geometry -0+0  # (yes, it's -geometry, not --geometry in GTK gvim)

It goes in the top-left instead of the top-right. Looking at the code
for gvim, I can see that it never checks if the XNegative and YNegative
flags are set by XParseGeometry. I've added code to do this, and it
almost works. The one problem is, I don't know how to accomodate the
borders of the window manager.

Is there any simple way to find out the widths of the borders added by
the window manager, or maybe a GDK/GTK+ hint that says "the x position
is relative to the right side" (and a similar hint for the y)?


Incidently, I've noticed that most GNOME/GTK+ apps don't seem to support
the '--geometry' option, and the few I've found that do, don't seem to
support negative offsets correctly. For example:

gless --geometry +0+0   # works, puts window in top-left
gless --geometry -0+0   # doesn't work, should put window in top-right

It seems like perhaps either gdk or gtk needs better support for this,
if so many apps either don't implement the geometry argument at all, or
only partially implement it.

-- 
  C. Laurence Gonsalves            "Any sufficiently advanced
  clgonsal@kami.com                 technology is indistinguishable
  http://www.cryogen.com/clgonsal/  from magic." -- Arthur C. Clarke



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]