Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window shrinks on focus change #350

Closed
Smylers opened this issue May 13, 2020 · 18 comments · Fixed by #452
Closed

Window shrinks on focus change #350

Smylers opened this issue May 13, 2020 · 18 comments · Fixed by #452

Comments

@Smylers
Copy link

Smylers commented May 13, 2020

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
Copy link

dannf commented Apr 4, 2022

fyi, I bisected this down to commit 3b960c5

@yotamshtosselfg
Copy link

Reproduces in Ubuntu 22.04.1 LTS too.

@lukefromdc
Copy link
Member

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
Copy link

scottjl commented Oct 17, 2022

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
Copy link

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
Copy link

pauldoo commented Feb 4, 2023

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
Copy link

ludelle commented Mar 31, 2023

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
Copy link

pauldoo commented May 1, 2023

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
Copy link

Fyne5 commented Jun 25, 2023

I'm still waiting for the fixed version

@lukefromdc
Copy link
Member

lukefromdc commented Jun 25, 2023

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
Copy link
Member

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
Copy link
Member

lukefromdc commented Jun 25, 2023

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
Copy link

n0valis commented Jul 5, 2023

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

@Fyne5
Copy link

Fyne5 commented Jul 6, 2023

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
Copy link
Member

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

@Fyne5
Copy link

Fyne5 commented Jul 6, 2023

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 added a commit to computersforpeace/mate-terminal that referenced this issue Feb 16, 2024
It seems Wayland-based window managers provide additional decorations
that we're not tracking in our "preferred size" computations. This means
every geometry update shrinks the window by a bit.

Factor in the allocated dimensions, not just the preferred ones.

Borrows some ideas from
https://bugzilla.gnome.org/show_bug.cgi?id=769898

I also drop a few unused values leftover from gnome-terminal.

Fixes mate-desktop#350
@computersforpeace
Copy link
Contributor

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: #452

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

computersforpeace added a commit to computersforpeace/mate-terminal that referenced this issue Feb 16, 2024
It seems Wayland-based window managers provide additional decorations
that we're not tracking in our "preferred size" computations. This means
every geometry update shrinks the window by a bit.

Factor in the allocated dimensions, not just the preferred ones.

Borrows some ideas from
https://bugzilla.gnome.org/show_bug.cgi?id=769898

I also drop a few unused values leftover from gnome-terminal.

Fixes mate-desktop#350
raveit65 pushed a commit to computersforpeace/mate-terminal that referenced this issue Feb 18, 2024
It seems Wayland-based window managers provide additional decorations
that we're not tracking in our "preferred size" computations. This means
every geometry update shrinks the window by a bit.

Factor in the allocated dimensions, not just the preferred ones.

Borrows some ideas from
https://bugzilla.gnome.org/show_bug.cgi?id=769898

I also drop a few unused values leftover from gnome-terminal.

Fixes mate-desktop#350
@raveit65
Copy link
Member

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.

raveit65 pushed a commit that referenced this issue Feb 18, 2024
It seems Wayland-based window managers provide additional decorations
that we're not tracking in our "preferred size" computations. This means
every geometry update shrinks the window by a bit.

Factor in the allocated dimensions, not just the preferred ones.

Borrows some ideas from
https://bugzilla.gnome.org/show_bug.cgi?id=769898

I also drop a few unused values leftover from gnome-terminal.

Fixes #350
raveit65 pushed a commit that referenced this issue Feb 18, 2024
It seems Wayland-based window managers provide additional decorations
that we're not tracking in our "preferred size" computations. This means
every geometry update shrinks the window by a bit.

Factor in the allocated dimensions, not just the preferred ones.

Borrows some ideas from
https://bugzilla.gnome.org/show_bug.cgi?id=769898

I also drop a few unused values leftover from gnome-terminal.

Fixes #350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.