After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 685507 - Tabbed windows resize themselves when unfocused
Tabbed windows resize themselves when unfocused
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: gnome-3-8
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
: 686950 688373 688959 695064 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-10-04 17:12 UTC by Mantas Mikulėnas (grawity)
Modified: 2014-07-01 22:06 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
resize log (397.37 KB, text/plain)
2013-01-09 13:25 UTC, Johannes Berg
Details

Description Mantas Mikulėnas (grawity) 2012-10-04 17:12:26 UTC
If I have a gnome-terminal window with two or more tabs, resize it, then focus another window, gnome-terminal instantly snaps back to the old size.

As far as I can see, only happens with gnome-shell (not plain mutter or metacity), only with gnome-terminal (not roxterm or sakura or other terminal emulators), and only when the terminal window has tabs.

gnome-terminal 3.6.0
vte 0.28.2
mutter 3.6.0
gnome-shell 3.6.0
Comment 1 Christian Persch 2012-10-04 17:29:37 UTC
Hmm. gtk+ bug or gnome-shell bug ?
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-10-04 18:47:53 UTC
We get a ConfigureRequest, so I'm guessing it's a GTK+ or vte bug.
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-10-04 18:48:40 UTC
(Sorry, it could also be a _NET_MOVERESIZE_WINDOW, not just a ConfigureRequest. No idea which is it actually is)
Comment 4 awilliam 2012-10-23 13:58:38 UTC
I see this bug as well.

gnome-terminal-3.6.0-95.2.x86_64
mutter-3.6.0-112.2.x86_64
gnome-shell-3.6.0-141.2.x86_64
Comment 5 Christian Persch 2012-10-26 17:18:26 UTC
*** Bug 686950 has been marked as a duplicate of this bug. ***
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-11-05 20:43:11 UTC
Punting back over to gnome-terminal.
Comment 7 Christian Persch 2012-11-05 20:54:49 UTC
Works here (g-t 3.4 with metacity); no related changes in g-t since 3.4 => not a g-t bug either.

Trying gtk+.

The bug report is lacking info, e.g. which distribution is being used. Is this only ubuntu, or has anyone seen this on fedora?
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-11-05 20:59:16 UTC
I've reproduced the behavior with mutter and gnome-terminal 3.6. As I said, we get a ConfigureNotify from the client, so they're asking us to resize.
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-11-05 20:59:57 UTC
er, ConfigureRequest
Comment 10 Christian Persch 2012-11-05 21:05:13 UTC
I guess this is because in 3.6 unfocusing causes a re-style to apply the 'onfocused' effect?
Comment 11 Mantas Mikulėnas (grawity) 2012-11-05 21:24:02 UTC
(In reply to comment #7)
> The bug report is lacking info, e.g. which distribution is being used. Is this
> only ubuntu, or has anyone seen this on fedora?

It's Arch Linux. (Sorry for not mentioning that.)
Comment 12 awilliam 2012-11-05 21:44:19 UTC
I am seeing it on openSUSE 12.2 


gnome-terminal-3.6.0-95.2.x86_64
mutter-3.6.0-112.2.x86_64
gnome-shell-3.6.0-141.2.x86_64
Comment 13 Jasper St. Pierre (not reading bugmail) 2012-11-05 21:52:47 UTC
(In reply to comment #10)
> I guess this is because in 3.6 unfocusing causes a re-style to apply the
> 'onfocused' effect?

Wait a minute... I wonder if this is the re-realizing code designed to flip back and forth between metacity and mutter that's screwing us over. Are you connecting to the style-changed signal?
Comment 14 Christian Persch 2012-11-05 22:11:31 UTC
The unrealize + re-realize only happens on composite-changed, not on focus-out. 

There are a few style-set handlers in 3-6 / style-updated handlers on master, but that has been there forever and never caused this problem. And why would that only cause problems on gnome-shell, not on metacity (I can't repro the problem here using g-t master with matacity from f17) ?
Comment 15 Johannes Berg 2012-11-15 12:32:19 UTC
*** Bug 688373 has been marked as a duplicate of this bug. ***
Comment 16 Jeremy Nickurak 2012-11-15 21:35:53 UTC
This also appears to occur with gnome-terminal under compiz/unity:

https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1040885
Comment 17 Jasper St. Pierre (not reading bugmail) 2012-11-15 21:37:30 UTC
(In reply to comment #14)
> There are a few style-set handlers in 3-6 / style-updated handlers on master,
> but that has been there forever and never caused this problem. And why would
> that only cause problems on gnome-shell, not on metacity (I can't repro the
> problem here using g-t master with matacity from f17) ?

Maybe because metacity doesn't support BACKDROP state?
Comment 18 Jeremy Nickurak 2012-11-24 00:15:33 UTC
*** Bug 688959 has been marked as a duplicate of this bug. ***
Comment 19 Jeremy Nickurak 2012-11-24 00:16:15 UTC
Dupe 388959 includes a purported workaround patch.
Comment 20 Jasper St. Pierre (not reading bugmail) 2012-11-24 00:19:42 UTC
(In reply to comment #19)
> Dupe 388959 includes a purported workaround patch.

http://bugzilla.gnome.org/show_bug.cgi?id=388959 ?
Comment 21 Jasper St. Pierre (not reading bugmail) 2012-11-24 00:20:59 UTC
Punting back to gnome-terminal; it's clear this is not a GTK+ bug.
Comment 22 Jeremy Nickurak 2012-11-24 00:30:53 UTC
Sorry, https://bugzilla.gnome.org/show_bug.cgi?id=688959
Comment 23 Christian Persch 2012-11-24 12:13:23 UTC
(In reply to comment #21)
> Punting back to gnome-terminal; it's clear this is not a GTK+ bug.

Is it? It's not happening with gtk 3.4, so clearly something in gtk+ has changed.
Comment 24 Jasper St. Pierre (not reading bugmail) 2012-11-24 15:05:44 UTC
(In reply to comment #23)
> Is it? It's not happening with gtk 3.4, so clearly something in gtk+ has
> changed.

It's not happening in gtk 3.4 with gnome-shell/mutter?
Comment 25 Evan Nemerson 2013-01-03 07:32:50 UTC
(In reply to comment #24)
> (In reply to comment #23)
> > Is it? It's not happening with gtk 3.4, so clearly something in gtk+ has
> > changed.
> 
> It's not happening in gtk 3.4 with gnome-shell/mutter?

It's not happening on gtk+-3.4 with gnome-terminal-3.4.  gnome-terminal from git requires gtk+ >= 3.6.0.
Comment 26 Matthias Clasen 2013-01-04 14:02:48 UTC
This should be a 3.8 blocker, I think. Makes working with terminals pretty impossible.
Comment 27 Christian Persch 2013-01-08 16:39:03 UTC
So I think what is happening here is that some widget somewhere in our UI is requesting a different size when the window is unfocused than when it's focused. Someone who can repro the bug could try to find which widget that is.
Comment 28 Johannes Berg 2013-01-08 16:40:20 UTC
If you ask me it's the first tab requesting a smaller size than the current tab ;-)

How would you find out?
Comment 29 Evan Nemerson 2013-01-08 20:00:30 UTC
(In reply to comment #27)
> So I think what is happening here is that some widget somewhere in our UI is
> requesting a different size when the window is unfocused than when it's
> focused. Someone who can repro the bug could try to find which widget that is.

It's easy to reproduce with Fedora 18; launch gnome-terminal, maximize it, create a new tab, restore the window, focus on a different window.
Comment 30 Christian Persch 2013-01-09 13:09:21 UTC
GTK_DEBUG=size-request gnome-terminal --disable-factory (on g-t version 3.6) resp. GTK_DEBUG=size-request ./gnome-terminal-server (for g-t master, then use the client to open a terminal)?
Comment 31 Johannes Berg 2013-01-09 13:25:06 UTC
Created attachment 233066 [details]
resize log

resize log showing the problem -- I create a tab and resize the window, then I wait almost a minute (from 14:22:23 to 14:23:16) and then unfocus
Comment 32 Christian Persch 2013-01-09 13:41:30 UTC
Hmm. I had hoped that the difference would be trivial in a diff, but (after removing the timestamps) the diff is highly nontrivial :/
Comment 33 Christian Persch 2013-01-16 21:54:59 UTC
I have committed a patch to master that should fix this; please test. Thanks to Jasper on IRC for his analysis of the problem!
Comment 34 Evan Nemerson 2013-01-17 03:42:25 UTC
(In reply to comment #33)
> I have committed a patch to master that should fix this; please test. Thanks to
> Jasper on IRC for his analysis of the problem!

Looks like that fixed it.  I can no longer reproduce the issue using the steps I mentioned in comment #29.
Comment 35 Egmont Koblinger 2013-01-17 12:23:45 UTC
Works for me too, thanks!
Comment 36 Christian Persch 2013-03-03 17:06:20 UTC
*** Bug 695064 has been marked as a duplicate of this bug. ***
Comment 37 Daniel 2014-07-01 18:51:47 UTC
I see a gnome-terminal resizing issue that is similar and might be related to this bug:

Open gnome-terminal
- add another tab (CTRL-Shift-T)
- start Midnight-commander in tab (mc)
- use cursor keys to navigate to a directory
- press enter to enter directory
- press enter to exit directory again

Observed behavior: The gnome-terminal window size shrinks by one.
Expected behavior: The gnome-terminal window size stays the same.

The bug does not appear if there is only a single tab in the window.

I am happy to file a new bug; it seems all the duplicate of this one have the terminal snap to an "original" size, which is different here. However, the problem seems to be fairly recent.

gnome-terminal: 3.6.2-0ubuntu1
mc: 3:4.8.11-1
gnome-shell-common: 3.10.4-0ubuntu5.1
Comment 38 Egmont Koblinger 2014-07-01 18:57:27 UTC
At which step does it shrink? It really sounds weird if it shrinks while using mc.

3.6.2 is an ancient version. Please upgrade from gnome3 staging (https://launchpad.net/~gnome3-team/+archive/gnome3-staging/+packages) and complain at Ubuntu so that they upgrade g-t to a recent version.
Comment 39 Daniel 2014-07-01 18:59:15 UTC
Oh, it shrinks when you switch to the parent directory. Switching in and out of a directory again will have it shrink by another line. The window will get shorter and shorter. I can make a movie.
Comment 40 Egmont Koblinger 2014-07-01 19:27:25 UTC
This sounds truly unbelievable :)

Are you using gnome-shell, or Ubuntu's default unity desktop?

Please upgrade vte and g-t from gnome3 staging, and upload a video if the problem persists.
Comment 41 Daniel 2014-07-01 19:52:45 UTC
Thank you! 

I am using the default unity desktop.

I updated gnome-terminal and some libvte's to the versions below from the staging area:

libvte-2.90-9                                               1:0.36.3-1ubuntu1~trusty1
libvte-2.90-common                                          1:0.36.3-1ubuntu1~trusty1
libvte-common                                               1:0.28.2-5ubuntu1        
libvte9                                                     1:0.28.2-5ubuntu1        
python-vte                                                  1:0.28.2-5ubuntu1       

I am not sure if this includes the "vte" you mentioned. I killed-all "gnome-terminal-server" and started gnome-terminal again. The problem is still there. Will upload a movie soon.
Comment 42 Daniel 2014-07-01 19:54:30 UTC
ah, gnome-terminal version is: 3.12.1-0ubuntu1~trusty1
Comment 43 Egmont Koblinger 2014-07-01 19:58:46 UTC
It's probably a different bug then.  Could you please open a new bugreport?  Please CC me.  I also use Ubuntu Trusty, so I'll try to reproduce the problem.  But I'm leaving for a vacation right now, so please be patient.
Comment 44 Daniel 2014-07-01 20:07:42 UTC
Will do. Thank you! I can always just not use tabs :)
Comment 45 Egmont Koblinger 2014-07-01 20:22:34 UTC
One thing that I suspect: mc sets the window/tab title to reflect the current directory.  Maybe this string has special characters with bigger ascent/descent that causes the tab label to grow vertically (maybe just by 1 pixel).

You could try to disable updating the window title (mc -> F9 -> Options -> Layout -> Xterm window title – I assume gnome-terminal would no longer shrink for you), or manually set the window title to what mc would set it (echo -ne '\e]0;This is the new title\a' – I assume you could trigger the window size change by this command, substituting the actual title with what mc sets it to).
Comment 46 Christian Persch 2014-07-01 20:27:34 UTC
For the new bug, please also attach a script(1) transcript of reproducing the problem.
Comment 47 Egmont Koblinger 2014-07-01 20:32:22 UTC
Geez, I can also reproduce it (should've tried before writing my previos comment).

for i in {1..10}; do echo -ne '\e]0;䈀\a'; sleep 0.1; echo -ne '\e]0;x\a'; sleep 0.1; done
Comment 48 Daniel 2014-07-01 20:33:36 UTC
Disabling updating the window-title "fixes" the issue. The tab title mc is setting looks garbled. Maybe it is some locale setting that is messed up. Do you think it is still worth writing a bug report?
Comment 49 Egmont Koblinger 2014-07-01 20:38:05 UTC
The window size change is definitely a bug in gnome-terminal which deserves its own bug entry.  Apparently we need to re-compute the style/size/grid/wmhint/idontknowwhat on tab title change.

The garbled looking title also sounds like an issue (might be gnome-terminal or mc bug, depending on how it looks like, a screenshot could help us tell).
Comment 50 Egmont Koblinger 2014-07-01 21:11:00 UTC
Does the garbled window title look something like this?
└␌ [␊±└⎺┼├@°⎺⎺]:/├└⎻/┴├␊

In this case it's bug 732586.
Comment 51 Daniel 2014-07-01 21:20:00 UTC
It does, so thank you for the pointer!
Comment 52 Egmont Koblinger 2014-07-01 22:06:14 UTC
I've filed bug 732588 for your main issue, let's continue there :)