! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Negative geometry offset do not position the correct corner
Status:
RESOLVED: FIXED
Product:
Xfce4-terminal
Component:
General

Comments

Description Damien.Olivier.Robert+bugzilla 2017-07-30 23:19:34 CEST
`xfce4-terminal --geometry +0+0` position the top left corner of the terminal on the top left corner of the screen, this is expected.
However `xfce4-terminal --geometry -0-0` position the top left corner of the terminal on the bottom right corner of the screen, whereas it is expected that the bottom right corner of the termial should be placed on the bottom right corner of the screen.
(Similarly `xfce4-terminal --geometry -0+0` position the top left corner on the top right of the screen rather than the top right corner on the top right of the screen.

This is a new bug (from the last fewish months), it was working fine for a long time. I am using an up to date archlinux:
- xfce4-terminal 0.8.6 (Xfce 4.12)
- libvte-2.91.so.0 from the package vte3 0.48.3-1

Maybe related to this bug: https://bugzilla.xfce.org/show_bug.cgi?id=12791
It is probably related to this commit: 93e0123f8b586e07a3fb205cb9c2d1035442d85a

But I admit that I don't understand how this is possible, this commit introduces the handling of gravity by gdk in xfce4-terminal, so it should have fixed the bug I am seeing, whereas in practice
it was working fine before, and now it is now not working correctly anymore.

According to the documentation of gtk-window-move: https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-move:

"To position a window at the bottom right corner of the screen, you would set GDK_GRAVITY_SOUTH_EAST, which means that the reference point is at x + the window width and y + the window height, and the bottom-right corner of the window border will be placed at that reference point. So, to place a window in the bottom right corner you would first set gravity to south east, then write: gtk_window_move (window, gdk_screen_width() - window_width, gdk_screen_height() - window_height)"

the current code

            if (mask & XNegative)
              {
                x = screen_width - window_width + x;
                gravity = GDK_GRAVITY_NORTH_EAST;
              }
            if (mask & YNegative)
              {
                y = screen_height - window_height + y;
                gravity = (mask & XNegative) ? GDK_GRAVITY_SOUTH_EAST : GDK_GRAVITY_SOUTH_WEST;
              }
            gtk_window_set_gravity (GTK_WINDOW (window), gravity);
            gtk_window_move (GTK_WINDOW (window), x, y);
should be correct.

So it may be a bug in libvte/gdk. I tried to test with gnome-terminal, but gnome-terminal is buggy too: the west/east negative offset works as expected, but the north/south one has a different bug: a -30 offset is interpreted as a +-30, ie place the top of the window -30 pixels above the top of the screen. So gnome-terminal --geometry -10-10 will be interpreted as a --geometry -10+-10 and place the top right corner of the terminal 10 pixels on the left and above the top right corner.
Comment 1 Damien.Olivier.Robert+bugzilla 2017-07-30 23:42:33 CEST
I submitted the gnome-terminal bug here:
https://bugzilla.gnome.org/show_bug.cgi?id=785607

On my computer, both xfce-terminal and gnome-terminal uses the same version of libvte, libgtk and libgdk so maybe the solution for gnome-terminal would work for xfce-terminal. (gnome-terminal behaviour is half correct :))
Comment 2 Igor editbugs 2017-08-03 16:13:45 CEST
Hi, and thanks for the report!

The issue seems to be caused by this commit: https://git.xfce.org/apps/xfce4-terminal/commit/?id=159676d89c24d4b61c972da28db73645525cf051
It adds tabs to the window after parsing its geometry in order to prevent resizing of the window, But, this made impossible to calculate window dimensions as no tabs that would dictate those dimensions have been added yet.

I will into fixing this issue without making additional window resizes.
Comment 3 Git Bot editbugs 2017-08-04 02:52:17 CEST
Igor referenced this bugreport in commit 2b543e2bd6bcedc7aa252881803ed27dcec7b59e

Fix negative offsets handling

https://git.xfce.org/apps/xfce4-terminal/commit?id=2b543e2bd6bcedc7aa252881803ed27dcec7b59e
Comment 4 Igor editbugs 2017-08-04 02:53:34 CEST
Fixed  by the commit referenced above.
Comment 5 Alistair Buxton 2018-02-24 12:37:30 CET
*** Bug 14238 has been marked as a duplicate of this bug. ***

Bug #13753

Reported by:
Damien.Olivier.Robert+bugzilla
Reported on: 2017-07-30
Last modified on: 2018-02-24
Duplicates (1):
  • 14238 Positioning from --geometry is broken again.

People

CC List:
1 user

Version

Attachments

Additional information