mate-desktop / mate-terminal

The MATE Terminal Emulator
http://www.mate-desktop.org
GNU General Public License v3.0
134 stars 73 forks source link

Window shrinks on focus change #350

Closed Smylers closed 9 months ago

Smylers commented 4 years ago

Expected behaviour

Switching to and from a MATE Terminal window leaves it the same size.

Actual behaviour

Switching between the terminal and another window (by clicking with the mouse or pressing Alt+Tab) makes the terminal shrink each time, losing 1 line and 1 column.

Here's a screen recording demonstrating it: https://imgur.com/a/kLZYUgh MATE Terminal is on the left; GNOME Terminal (retaining its size) is on the right.

Steps to reproduce the behaviour

  1. Upgrade to Ubuntu 20.04 LTS.
  2. Allow client-side decorations (that is, windows to elect not to have title bars). I did this by editing /etc/X11/Xsession.d/01gtk3-nocsd and setting export GTK_CSD=1 (default is 0).
  3. In a MATE desktop session, open MATE Terminal and some other window. One way of permitting CSD just for the terminal is to press Alt+F2 then run env GTK_CSD=1 mate-terminal.
  4. Switch between the terminal and the other window, by clicking between them or pressing Alt+Tab. See the terminal window strink each time.

I used a newly created user (called demo), to eliminate any of my user's customizations from being the cause.

I appreciate that MATE isn't a fan of CSD, but with it enabled windows should just look different; they shouldn't keep changing their size!

MATE general version

mate-desktop package version 1.24.0-2

Package version

mate-terminal package version 1.24.0-2ubuntu1 marco package version 1.24.0-1ubuntu1

Linux Distribution

Distributor ID: Ubuntu
Description:    Ubuntu Focal Fossa (development branch)
Release:    20.04
Codename:   focal

Link to downstream report of your Distribution

https://bugs.launchpad.net/ubuntu/+source/mate-terminal/+bug/1878457

dannf commented 2 years ago

fyi, I bisected this down to commit 3b960c5eaba05fa914488cbf5b3d8262cbed25c3

yotamshtosselfg commented 2 years ago

Reproduces in Ubuntu 22.04.1 LTS too.

lukefromdc commented 2 years ago

Odd that that commit would change any behavior in an x11 session given that all it does is remove gdk_set_allowed_backends ("x11"); and place g_hash_table_replace (env_table, g_strdup ("WINDOWID"), g_strdup_printf ("%ld", GDK_WINDOW_XID (gtk_widget_get_window (window)))); behind an x11-only runtime conditional

scottjl commented 2 years ago

Same problem here with Ubuntu 22.04.1 LTS (Wayland). Bringing terminal to focus, either click on dock, or direct click on window, causes the terminal window to shrink approximately 1 row each time. Frustrating.

MichaelJCole commented 1 year ago

Freshly installed ubuntu 22.04 w/ cinnamon doesn't have this problem. I noticed it after it was removing a couple lines from the terminal on each focus and blur.

Workaround is to Menu -> View-> Normal Size, and the problem went away.

I think this has something to do with zooming text.

pauldoo commented 1 year ago

In addition to happening when changing focus to/from the terminal window, it also happens for me when switching between tabs within the same terminal window. To reproduce open a 2nd tab within the terminal (Ctrl+Shift+T, or File -> Open Tab), then switch back and forth between tabs.

Ubuntu 22.04, GNOME Wayland, MATE Terminal 1.26.0 (1.26.0-1ubuntu2).

ludelle commented 1 year ago

Hello there, Got the problem folowing an upgrade from 20.04 to 22.04 last summer. Windows shrink one line and one column on every alt-tab. It start to be really annoying now i got 4K screen with lot of mate terrminal. I need to constantly resize them. Full-screen terminal are not affected.

Did not seen any update/assigne on this problem. Is someone looking at it?

pauldoo commented 1 year ago

For the time being I've switched to using XFCE's terminal. On Ubuntu this is provided by the xfce4-terminal package. It's similar enough to the MATE terminal for me.

Fyne5 commented 1 year ago

I'm still waiting for the fixed version

lukefromdc commented 1 year ago

Note that we are a small team maintaining a DE with a lot of users. We really need both more testers(which you are helping with, thanks) and more coders. For my own part, I don't know enough about the inner workings of VTE to work on this. If gnome-terminal doesn't do this though, there might be a commit in it's history addressing this

lukefromdc commented 1 year ago

I was just unable to duplicate that, terminal window stayed constant size while clicking in and out of it. Using mate-terminal from git master (1.27.0+) over Debian unstable with locally compiled GTK3 and the history trashing commit to libvte reverted

lukefromdc commented 1 year ago

Speaking of wayland, just tested that. Mate-terminal didn't resize itself on wayland on clicking in and out of a terminal window on wayfire either on my system.

n0valis commented 1 year ago

I have just installed Debian 12/GNOME Desktop/gdm3 and have the same problem with the MATE terminal.

Fyne5 commented 1 year ago

I have just installed Debian 12/GNOME Desktop/gdm3 and have the same problem with the MATE terminal.

Yes, you are right, me too. So, I switched from Wayland back to XORG, you can try by 2 options: Option 1: Disable wayland via edit config like that https://www.thegeekdiary.com/how-to-enable-disable-wayland-on-ubuntu-20-04/

Option 2 (like me): Disable wayland at the login screen, select Xorg then login

In case your Ubuntu is running on VMware, disable 3D accelerate and then disable Wayland

lukefromdc commented 1 year ago

So the question becomes: what is different? Why does this happen to some users and not others?

Fyne5 commented 1 year ago

So the question becomes: what is different? Why does this happen to some users and not others?

I guess this happened when use mate-terminal on gnome 43 (default environment is wayland) only, and if switch wayland to xorg will be ok (vmware need disable 3D Accelerate also).

computersforpeace commented 9 months ago

I hacked around and found that gnome-terminal had some semi-similar issues: https://bugzilla.gnome.org/show_bug.cgi?id=769898

I made some similar-ish fixes, and it all works for me now: https://github.com/mate-desktop/mate-terminal/pull/452

Disclaimer: I'm not a GTK, Wayland, or terminal-emulator expert.

raveit65 commented 9 months ago

The shrink issue is only reproducible with adwaita theme and the tons of plagiarism of adwaita. From Mate themes only YaruGreen and YaruOk are affected.