! 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 !
Screen Geometry - Columns and Rows
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-terminal
Component:
General

Comments

Description poma 2016-08-26 21:31:42 CEST
Created attachment 6791 
Screen "character" geometry info

Display terminal screen geometry (columns x rows), including during pointer aided resizing of the terminal window - holding left pointer button down on resize box.

The usability value is - it shows, in the quickest and least disruptive way, the quantity of the actual elements of the geometry of the terminal screen, in every way use.
Comment 1 Igor editbugs 2016-08-27 09:37:21 CEST
Yeah, the thing is that it was shown by vte itself, not the terminal.
Compare running `vte` and `vte-2.91` and changing their sizes - the first one shows its geometry while the latter one does not.
Comment 2 poma 2016-08-27 12:55:03 CEST
Indeed, this nice feature seems lost in the meantime

Terminal emulator widget used by GTK+ based terminals
https://developer.gnome.org/vte
https://git.gnome.org/browse/vte
https://download.gnome.org/sources/vte


 = Resize info =

 - vte -

$ rpm -qf /usr/bin/vte
vte-devel-0.28.2-14.fc22.x86_64
 - OK -

$ rpm -qf /usr/bin/vte
vte-devel-0.28.2-16.fc23.x86_64
 - OK -

$ rpm -qf /usr/bin/vte
vte-devel-0.28.2-17.fc24.x86_64
 - OK -

~~~~~~~~~

 - vte3 -

$ rpm -qf /usr/bin/vte2_90
vte3-devel-0.36.5-1.fc22.x86_64
 - OK -

$ rpm -qf /usr/bin/vte2_90
vte3-devel-0.36.5-1.fc23.x86_64
 - OK -

$ rpm -qf /usr/bin/vte2_90
vte3-devel-0.36.5-2.fc24.x86_64
 - NONE -

~~~~~~~~~~~

 - vte291 -

$ rpm -qf /usr/bin/vte-2.91
vte291-devel-0.40.3-1.fc22.x86_64
 - OK -

$ rpm -qf /usr/bin/vte-2.91
vte291-devel-0.42.5-1.fc23.x86_64
 - OK -

$ rpm -qf /usr/bin/vte-2.91
vte291-devel-0.44.2-1.fc24.x86_64
 - NONE -
Comment 3 poma 2016-08-29 07:58:14 CEST
Created attachment 6798 
VTEs Resize info comparance

In fact, "Resize info" feature -is- present in version 0.45.90 - API vte-2.91

$ rpm -qf /usr/bin/vte-2.91
vte291-devel-0.45.90-1.fc26.x86_64

It is interesting to compare,
despite the absence of this feature within previous vte-2.91 version - 0.44.2 (1a),
mate-terminal (1b) still reveals this functionality, as it is self-sustained.

As opposed to that, xfce4-terminal (2b) does not show it,
although vte-2.91 version - 0.45.90 (2a) to which it relates,
supports this feature.
Comment 4 Igor editbugs 2016-08-29 10:43:33 CEST
(In reply to poma from comment #3)
> Created attachment 6798 
> VTEs Resize info comparance
> 
> In fact, "Resize info" feature -is- present in version 0.45.90 - API vte-2.91

poma, how do you see that it's supported? what is the API name?

> As opposed to that, xfce4-terminal (2b) does not show it,
> although vte-2.91 version - 0.45.90 (2a) to which it relates,
> supports this feature.

0.45.90 is a development version; development versions are not supported by (most of) the distributions.
However, if 0.46.0 will offer new features , it is possible add an early support of them now.
Comment 5 poma 2016-08-29 20:37:20 CEST
(In reply to Igor from comment #4)
> (In reply to poma from comment #3)
> > Created attachment 6798 
> > VTEs Resize info comparance
> > 
> > In fact, "Resize info" feature -is- present in version 0.45.90 - API vte-2.91
> 
> poma, how do you see that it's supported? what is the API name?
> 


If it is still not clear from the accompanying illustrations and comments,
vte-2.91 ver. 0.45.90 supports it, and consequently gnome-terminal relays it,
the Resize info.

https://git.gnome.org/browse/vte/tree/configure.ac?h=0.45.90#n40
VTE_API_MAJOR_VERSION=2
VTE_API_MINOR_VERSION=91

https://bugzilla.redhat.com/show_bug.cgi?id=1126860#c7
"It is quite confusing, indeed, and you are not the first one. :)

There are vte, vte3 and vte291 packages in Fedora:
 * vte is the (ancient) GTK+ 2.x widget, which is unmaintained upstream.
 * vte3 is the GTK+ 3.x widget with the vte-2.90 API/ABI. ie. the vte-0.36.x series of tarballs. It still receives bug-fixes.
 * vte291 is the GTK+ 3.x widget with the vte-2.91 API/ABI. ie. everything newer than the vte-0.36.x series. It is under active development and bug-fixes."

> > As opposed to that, xfce4-terminal (2b) does not show it,
> > although vte-2.91 version - 0.45.90 (2a) to which it relates,
> > supports this feature.
> 
> 0.45.90 is a development version; development versions are not supported by
> (most of) the distributions.
> However, if 0.46.0 will offer new features , it is possible add an early
> support of them now.

s/0.45.90/xfce4-terminal/
consider this, and you'll get the point.;)

Besides ...
Comment 6 poma 2016-08-29 20:42:29 CEST
Created attachment 6803 
VTEs Resize info relay - vte-2.91 and gnome-terminal

to "paraphrase",
... it's better to see once than hear a hundred times ;)
Comment 7 poma 2016-08-30 06:25:55 CEST
- Reintroduces Resize info for the gnome-terminal
  window: Make geometry work better with gtk 3.20
  https://git.gnome.org/browse/gnome-terminal/commit/?id=88bd325

- Reintroduces Resize info for the vte-2.91
  widget: gtk: Pass NULL for geometry widget
  https://git.gnome.org/browse/vte/commit/?id=28871b3

Ref.
resizing and geometry (snap to character cells) regressed with Gtk 3.19+
https://bugzilla.gnome.org/show_bug.cgi?id=760944
Comment 8 Igor editbugs 2016-08-30 11:02:38 CEST
poma, thanks for the info.
Indeed, a small change similar to https://git.gnome.org/browse/vte/commit/?h=0.45.90&id=28871b33b03d2f7e2df8c065189547add12f673d makes vte show the geometry info.

But, it also makes the geometry setting inaccurate: the size shown does not match the actual size, and the actual size is smaller than requested.
It seems I will have to see how to fix those geometry hints.
Comment 9 poma 2016-08-30 17:21:26 CEST
Created attachment 6808 
Resize info test


Resize info test

---
 terminal/terminal-screen.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 23f4d92..7e8f796 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1791,7 +1791,12 @@ terminal_screen_set_window_geometry_hints (TerminalScreen *screen,
   hints.min_height = hints.base_height + hints.height_inc * 2;
 
   gtk_window_set_geometry_hints (GTK_WINDOW (window),
+
+#if GTK_CHECK_VERSION (3, 19, 5)
+                                 NULL,
+#else
                                  screen->terminal,
+#endif
                                  &hints,
                                  GDK_HINT_RESIZE_INC
                                  | GDK_HINT_MIN_SIZE
-- 
2.7.4
Comment 10 poma 2016-08-30 17:23:24 CEST
Should the Xfce Terminal switch from "pixel-based" geometry

$ man 1 xfce4-terminal
   ...
   Window Options
       ...
       --geometry=geometry
           Sets the geometry of the last-specified window to geometry. Read X(7) for more information on how to specify window geometries.


to "character-based" geometry

$ man 1 mate-terminal
   ...
   Window options...
       ...
       --geometry=GEOMETRY
              Set the window size; for example: 80x24, or 80x24+200+200 (COLSxROWS+X+Y)


Ref.
vte291: Fix geometry issues 
https://github.com/mate-desktop/mate-terminal/commit/387af1f
Comment 11 Igor editbugs 2016-08-30 17:43:14 CEST
(In reply to poma from comment #10)
> Should the Xfce Terminal switch from "pixel-based" geometry
> 
> $ man 1 xfce4-terminal
>    ...
>    Window Options
>        ...
>        --geometry=geometry
>            Sets the geometry of the last-specified window to geometry. Read
> X(7) for more information on how to specify window geometries.
> 
> 
> to "character-based" geometry
> 
> $ man 1 mate-terminal
>    ...
>    Window options...
>        ...
>        --geometry=GEOMETRY
>               Set the window size; for example: 80x24, or 80x24+200+200
> (COLSxROWS+X+Y)

Geometry is already taken as columns x rows +- Xoff +- Yoff. Columns and rows are in "characters", Xoff and Yoff are in pixels.
Comment 12 poma 2016-08-31 21:19:14 CEST
(In reply to Igor from comment #11)
> (In reply to poma from comment #10)
> > Should the Xfce Terminal switch from "pixel-based" geometry
> > 
> > $ man 1 xfce4-terminal
> >    ...
> >    Window Options
> >        ...
> >        --geometry=geometry
> >            Sets the geometry of the last-specified window to geometry. Read
> > X(7) for more information on how to specify window geometries.
> > 
> > 
> > to "character-based" geometry
> > 
> > $ man 1 mate-terminal
> >    ...
> >    Window options...
> >        ...
> >        --geometry=GEOMETRY
> >               Set the window size; for example: 80x24, or 80x24+200+200
> > (COLSxROWS+X+Y)
> 
> Geometry is already taken as columns x rows +- Xoff +- Yoff. Columns and
> rows are in "characters", Xoff and Yoff are in pixels.


That's right, but unfortunately only in theory, 

geometry looks like a broken everywhere within VTE GTK+ 3 and it's applications.
No wonder Clasen wants to remove this feature, one way or another. :)
https://bugzilla.gnome.org/show_bug.cgi?id=760944#c2

Apropos mate-terminal's geometry

$ rpm -qf /usr/share/man/man1/mate-terminal.1.gz
mate-terminal-1.12.1-1.fc22.x86_64

$ man /usr/share/man/man1/mate-terminal.1.gz | grep geometry -A1
       --geometry=GEOMETRY
              Set the window size; for example: 80x24, or 80x24+200+200 (ROWSxCOLS+X+Y)

$ ldd /usr/bin/mate-terminal | grep vte
	libvte.so.9 => /lib64/libvte.so.9 (0x00007fe5db7c9000)

$ rpm -qf /lib64/libvte.so.9
vte-0.28.2-14.fc22.x86_64

$ ./mate-terminal-1.12.1/configure --help | grep gtk
  --with-gtk=2.0|3.0      which gtk+ version to compile against (default: 2.0)

vte291: Fix geometry issues
https://github.com/mate-desktop/mate-terminal/commit/387af1f
+/* width and height are character-based in vte 0.38, pixel-based in previous versions */
2015-15-11

drop old code for VTE < 0.38 (it was used in GTK+2 build)
https://github.com/mate-desktop/mate-terminal/commit/b2919d2
-/* width and height are character-based in vte 0.38, pixel-based in previous versions */
2016-26-05


Reading all this, one can conclude
"character-based" -is- within vte-0.28 version,

and should always be as VTE's geometric method according to
Geometry Specifications
https://www.x.org/archive/X11R6.7.0/doc/X.7.html#sect6

"The WIDTH and HEIGHT parts of the geometry specification are usually measured in either pixels or characters, depending on the application."

So the question remains, where the "pixel-based" geometry came from and whether it actually ever used.
Comment 13 poma 2016-08-31 21:24:56 CEST
Created attachment 6813 
VTEs geometry comparance

VTEs theoretical and practical geometry comparance

xterm geometry is 100% correct.

xfce4-terminal geometry:
- specified as 20x10 characters i.e. columns x rows
- realized as 31x9 characters i.e. columns x rows
- presented as 32x11 characters i.e. columns x rows
Comment 14 Igor editbugs 2016-08-31 21:32:51 CEST
(In reply to poma from comment #13)
> Created attachment 6813 
> VTEs geometry comparance
> 
> VTEs theoretical and practical geometry comparance
> 
> xterm geometry is 100% correct.
> 
> xfce4-terminal geometry:
> - specified as 20x10 characters i.e. columns x rows
> - realized as 31x9 characters i.e. columns x rows
> - presented as 32x11 characters i.e. columns x rows

Looks like you are using this patch, right?

   gtk_window_set_geometry_hints (GTK_WINDOW (window),
+
+#if GTK_CHECK_VERSION (3, 19, 5)
+                                 NULL,
+#else
                                  screen->terminal,
+#endif
                                  &hints,
                                  GDK_HINT_RESIZE_INC
                                  | GDK_HINT_MIN_SIZE

As I've said, it makes geometry setting inaccurate, and the geometry shown is also inaccurate.

Please check --geometry parameter on a clean git version - it's working very precisely for me, at least under X (not so sure about wayland).
Comment 15 poma 2016-09-01 07:11:13 CEST
(In reply to Igor from comment #14)
> (In reply to poma from comment #13)
> > Created attachment 6813 
> > VTEs geometry comparance
> > 
> > VTEs theoretical and practical geometry comparance
> > 
> > xterm geometry is 100% correct.
> > 
> > xfce4-terminal geometry:
> > - specified as 20x10 characters i.e. columns x rows
> > - realized as 31x9 characters i.e. columns x rows
> > - presented as 32x11 characters i.e. columns x rows
> 
> Looks like you are using this patch, right?
> 

True

>    gtk_window_set_geometry_hints (GTK_WINDOW (window),
> +
> +#if GTK_CHECK_VERSION (3, 19, 5)
> +                                 NULL,
> +#else
>                                   screen->terminal,
> +#endif
>                                   &hints,
>                                   GDK_HINT_RESIZE_INC
>                                   | GDK_HINT_MIN_SIZE
> 
> As I've said, it makes geometry setting inaccurate, and the geometry shown
> is also inaccurate.
> 

True

> Please check --geometry parameter on a clean git version - it's working very
> precisely for me, at least under X (not so sure about wayland).

False :)

Without "Resize info test" patch:
31x10 is not really 20x10
Comment 16 poma 2016-09-01 07:16:10 CEST
Created attachment 6815 
VTEs geometry comparance 2

VTEs theoretical and practical geometry comparance 2

All geometries are incorrect.

xfce4-terminal geometry:
- specified as 20x10 characters i.e. columns x rows
- realized as 31x10 characters i.e. columns x rows

gnome/mate-terminal geometry:
- specified as 20x10 characters i.e. columns x rows
- realized as 33x10 characters i.e. columns x rows
Comment 17 poma 2016-09-01 07:19:04 CEST
Of course, testing is done within Xorg/xfce4-session.
Comment 18 Igor editbugs 2016-09-01 10:39:46 CEST
(In reply to poma from comment #17)
> Of course, testing is done within Xorg/xfce4-session.

That's strange, I'm not seeing anything like this neither on Arch with Cinnamon, nor on Debian with Xfce and nor on Fedora with Gnome. What is your system?

But, I'm seeing something similar on Fedora under wayland.
Please try the following patch - does it resolve the issue for you? Seems to work for wayland.
Thanks.

https://github.com/f2404/xfce4-terminal3/commit/6320c5b6c50ddca5c70d2555b8daf415b856cae1
Comment 19 poma 2016-09-01 15:29:40 CEST
Created attachment 6817 
xfce4-terminal3 geometry test

xfce4-terminal3 geometry:
- specified as 20x10 characters i.e. columns x rows
- realized as 31x10 characters i.e. columns x rows
Comment 20 Igor editbugs 2016-09-01 15:37:00 CEST
(In reply to poma from comment #19)
> Created attachment 6817 
> xfce4-terminal3 geometry test
> 
> xfce4-terminal3 geometry:
> - specified as 20x10 characters i.e. columns x rows
> - realized as 31x10 characters i.e. columns x rows

Please try sizes bigger than 31 columns - the menubar won't allow to show a smaller window. This is something that I've learned just now.

And please also disregard the patch from comment 18 - it's wrong.

Do you have any issues with the git version when specifying geometry bigger than say 35 columns?
Comment 21 poma 2016-09-01 16:53:48 CEST
Created attachment 6819 
xfce4-terminal geometry test 2 (min. 31 columns)

xfce4-terminal geometry:
- specified as 31x10 characters i.e. columns x rows
- realized as 31x10 characters i.e. columns x rows
Comment 22 Igor editbugs 2016-09-01 16:58:44 CEST
(In reply to poma from comment #21)
> Created attachment 6819 
> xfce4-terminal geometry test 2 (min. 31 columns)
> 
> xfce4-terminal geometry:
> - specified as 31x10 characters i.e. columns x rows
> - realized as 31x10 characters i.e. columns x rows

Great!
Please confirm you have no geometry issues with columns number >= 31.
Comment 23 poma 2016-09-01 17:41:51 CEST
(In reply to Igor from comment #22)
> (In reply to poma from comment #21)
> > Created attachment 6819 
> > xfce4-terminal geometry test 2 (min. 31 columns)
> > 
> > xfce4-terminal geometry:
> > - specified as 31x10 characters i.e. columns x rows
> > - realized as 31x10 characters i.e. columns x rows
> 
> Great!
> Please confirm you have no geometry issues with columns number >= 31.

Specified min. amount of columns to achieve geometric accuracy is also dependent on both - DPI and Font Size values, therefore it is variable.

Pro tempore, min. 31 columns is for: DPI=120 and Font Size=12

It is never easy ;)
Comment 24 Igor editbugs 2016-09-01 17:50:22 CEST
(In reply to poma from comment #23)
> (In reply to Igor from comment #22)
> > (In reply to poma from comment #21)
> > > Created attachment 6819 
> > > xfce4-terminal geometry test 2 (min. 31 columns)
> > > 
> > > xfce4-terminal geometry:
> > > - specified as 31x10 characters i.e. columns x rows
> > > - realized as 31x10 characters i.e. columns x rows
> > 
> > Great!
> > Please confirm you have no geometry issues with columns number >= 31.
> 
> Specified min. amount of columns to achieve geometric accuracy is also
> dependent on both - DPI and Font Size values, therefore it is variable.
> 
> Pro tempore, min. 31 columns is for: DPI=120 and Font Size=12
> 
> It is never easy ;)

Yes I know :)
You can the menubar though - this would allow to shrink the window up to a few chars in width.
Comment 25 Igor editbugs 2016-09-01 17:50:47 CEST
disable the menubar, I mean.
Comment 26 poma 2016-09-01 20:12:54 CEST
Created attachment 6820 
VTEs geometry comparance - COLS20 (--hide-menubar) OK

- xterm geometry is 100% correct
- xfce4-terminal geometry is 120% correct (--hide-menubar)
Comment 27 poma 2016-09-01 21:52:15 CEST
The necessary minimum amount of columns, and the font sizes, to achieve geometric accuracy, with the menubar ENABLED

DPI  F.SIZE  M.COLS

120    12      31
        9      32
        6      36

 96    12      30
        9      37 *
        6      39

 72    12      37
        9      44
        6      44

F.SIZE = Font Size: Terminal Font (Monospace)
                    &
                    Default UI Font (Sans)

M.COLS = minimal amount of columns
Comment 29 poma 2016-10-19 17:10:33 CEST
Thanks!
Comment 30 Igor editbugs 2016-10-19 17:38:02 CEST
(In reply to poma from comment #29)
> Thanks!

You're welcome!
Comment 31 Olivier Duchateau 2016-10-31 17:31:21 CET
(In reply to Igor from comment #28)
> Fixed by
> https://git.xfce.org/apps/xfce4-terminal/commit/
> ?id=980003baf92afed64c7958dbaf1a92c3aca402cb

Tested with xfce4-terminal-0.8.1 (with Gtk 3.18 and Vte 0.42.4) it's broken.

Default size is not enabled.
Comment 32 Igor editbugs 2016-10-31 19:27:35 CET
(In reply to duchateau.olivier from comment #31)
> (In reply to Igor from comment #28)
> > Fixed by
> > https://git.xfce.org/apps/xfce4-terminal/commit/
> > ?id=980003baf92afed64c7958dbaf1a92c3aca402cb
> 
> Tested with xfce4-terminal-0.8.1 (with Gtk 3.18 and Vte 0.42.4) it's broken.
> 
> Default size is not enabled.

Sorry - looks like I should have added a check for Gtk version, like this one: https://github.com/GNOME/vte/blob/master/src/vtegtk.cc#L3230

Would you like me to release 0.8.2 with the fix?
Comment 33 Olivier Duchateau 2016-10-31 20:37:59 CET
(In reply to Igor from comment #32)
> (In reply to duchateau.olivier from comment #31)
> > (In reply to Igor from comment #28)
> > > Fixed by
> > > https://git.xfce.org/apps/xfce4-terminal/commit/
> > > ?id=980003baf92afed64c7958dbaf1a92c3aca402cb
> > 
> > Tested with xfce4-terminal-0.8.1 (with Gtk 3.18 and Vte 0.42.4) it's broken.
> > 
> > Default size is not enabled.
> 
> Sorry - looks like I should have added a check for Gtk version, like this
> one: https://github.com/GNOME/vte/blob/master/src/vtegtk.cc#L3230
> 
> Would you like me to release 0.8.2 with the fix?

Not necessary, currently I removed your changes for FreeBSD users, but I can apply your fix (build package is not yet started).
Comment 34 Igor editbugs 2016-11-01 11:50:49 CET
Olivier, please take this patch: https://git.xfce.org/apps/xfce4-terminal/commit/?id=d8bd5f116ba05d7a6067f621f04c9a5e51de5fe8
Sorry for inconvenience.
Comment 35 Olivier Duchateau 2016-11-01 21:19:15 CET
(In reply to Igor from comment #34)
> Olivier, please take this patch:
> https://git.xfce.org/apps/xfce4-terminal/commit/
> ?id=d8bd5f116ba05d7a6067f621f04c9a5e51de5fe8
> Sorry for inconvenience.

It's ok, thanks!

Bug #12793

Reported by:
poma
Reported on: 2016-08-26
Last modified on: 2016-11-01

People

CC List:
2 users

Version

Version:
unspecified

Attachments

Additional information