GNOME Bugzilla – Bug 785607
Geometry spec not correctly implemented
Last modified: 2017-09-25 11:08:31 UTC
The usual spec of --geometry is that the first offset correspond to the west/east position and the second one to the north/south position. For instance, for the first offset, a +offset mean to position the left edge of the window at offset from the left edge of the screen. So a --geometry +-10 should place the left edge of the window 10 pixels to the right of the left edge of the screen. With gnome-terminal version 3.24, --geometry +10 works correctly but not --geometry +-10. Even stranger is the behaviour of the second offset, which handles the north/south placement. Here `gnome-terminal --geometry +0-10` acts as a '+0+-10' according to the spec. That is rather than placing the bottom edge of the window 10 pixel above the bottom edge of the screen (like we would expect --geometry +0-10 to do), it places the top edge of the window 10 pixel above the top edge of the screen (like we would expect --geometry +0+-10 to do).
For me, gnome-terminal's --geometry option works the same way as xterm's -geometry. I don't think gnome-terminal parses the --geometry option itself, I think it passes it down to standard Gtk+ methods. Could you please check your behavior with other Gtk+ apps? Also I'm really unsure about that "+-10" thingy, why should that work? It's not a valid number. Could you please link the spec where it's stated how this non-number needs to be handled? To me it sounds like an invalid value.
For me 'xterm -geometry +10-10' puts the window 10 pixels above right the bottom left corner, while 'gnome-terminal --geometry +10-10' puts the window 10 pixels above right the top left corner. The '+-10' thingy is specified for example here: https://www.x.org/archive/X11R6.7.0/doc/X.7.html#sect6 +XOFF The left edge of the window is to be placed XOFF pixels in from the left edge of the screen (i.e., the X coordinate of the window's origin will be XOFF). XOFF may be negative, in which case the window's left edge will be off the screen.
This is on an up to date archlinux, with gnome-terminal version 3.24.2 by the way. Sorry about the long delay for my answer.
(In reply to Damien.Olivier.Robert+bugzilla from comment #2) > For me 'xterm -geometry +10-10' puts the window 10 pixels above right the > bottom left corner, while 'gnome-terminal --geometry +10-10' puts the window > 10 pixels above right the top left corner. For me, both work as 'xterm' works for you (places near the bottom left, completely onscreen). > The '+-10' thingy is specified for example here: > https://www.x.org/archive/X11R6.7.0/doc/X.7.html#sect6 Interesting, good to know, thanks :) I'm on Ubuntu Zesty (e.g. libx11 1.6.4, gtk 3.22), plus vte and gnome-terminal from git master (that is, 0.50 / 3.26). I'll upgrade to Artful final beta late Sep or early Oct to test that. Probably you have a newer gtk, maybe newer x11 as well. I'm really unsure which component is responsible, but we might be facing e.g. a regression in gtk. I wanted to ask you to try other gnome apps, but at this moment it comes as a surprise to me that the ones I've tried don't support --geometry at all :(
I've upgraded to Artful beta (plus vte and gnome-terminal from git master), still running Unity7 on X11. I still get the same behavior as previously. gnome-terminal and xterm interpret their (-)-geometry option the same way. I'm yet to try GNOME Shell as well as Wayland (no clue what --geometry is supposed to do on Wayland, probably it's a no-op there).
Ok thanks for the tests! So I have compiled vte3-git and gnome-terminal-git and 'gnome-terminal --geometry +10-10' does indeed work correctly (the window is 10 pixels above right the bottom left corner). So it seems like there was a regression in gnome-terminal 3.24 which has been fixed in git. Note that "gnome-terminal --geometry '+-10-0'" is still interpreted as "gnome-terminal --geometry '+0-0" while 'xterm -geometry +-10-0' does put the window 10 pixels to the left of the bottom left corner. But to be fair I have never needed to use the '+-10' feature, and probably gnome-terminal never had this feature either so this is not a regression. Thanks again for your help, I consider this bug closed.