Horizontal/vertical-maximized window shrinks a few pixels when losing focus, upsets gnome-terminal

Bug #772972 reported by spbike
38
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Unity
Fix Released
Undecided
Unassigned
light-themes
Fix Released
Undecided
Daniel van Vugt
light-themes (Ubuntu)
Fix Released
Low
Daniel van Vugt
unity (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: unity

If you open a Terminal, maximize vertically, then run screen every time that window gets or loses focus the window changes size by a line of text. So without focus I end up with an 80x66 window, with I end up with 80x67. It's quite annoying since the entire window remaps and scrolls by 1 line. This worked fine in 10.10.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: unity 3.8.10-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Uname: Linux 2.6.38-8-generic x86_64
NonfreeKernelModules: fglrx
Architecture: amd64
CompizPlugins: [core,bailer,detection,composite,opengl,decor,mousepoll,vpswitch,regex,animation,snap,expo,move,compiztoolbox,place,grid,imgpng,gnomecompat,wall,ezoom,workarounds,staticswitcher,resize,fade,unitymtgrabhandles,scale,session,unityshell]
Date: Thu Apr 28 23:30:44 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
ProcEnviron:
 LANGUAGE=en_US:en
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: unity
UpgradeStatus: Upgraded to natty on 2011-04-29 (0 days ago)

Revision history for this message
spbike (bill-broadley) wrote :
Revision history for this message
Bill Broadley (bill-cse) wrote :

Sorry, I didn't realize until later that any terminal will do. But you have to generate enough content to start scrolling. Seems like the last line of the window has to have text. Just do a ls or even just hit return until it scrolls.

Then as you gain/lose focus the window will resize by a line and scroll by a line.

So basically unity, terminal, and vertical maximize are broken. Screen is not needed.

Revision history for this message
bededog (bededog) wrote :

This has to do with the padding size in the metacity theme settings. When a window is focused it as a padding of 5 at the bottom. When a window is unfocused it has a padding of 7. I believe the padding is there for the "invisible" resize handles at the bottom, left, and right of a window. As I don't have any need for the "invisible" resize handles (I use Alt + Middle Click) I just set the padding to always be zero.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Confirmed. Here are my original steps to reproduce from a duplicate of this bug:

Use the middle or right mouse buttons to maximize a gnome-terminal window either vertically or horizontally. Now click on the desktop or another window. Notice the gnome-terminal window shrinks by 2-4 pixels in the direction it was maximized.

If you do this with a "full" terminal window (one that has text on every line) and vertically maximize then the vertical shrinkage on loss of focus also causes the terminal text to jump as it has to shrink by a whole line of text to adjust.

Changed in unity (Ubuntu):
status: New → Confirmed
summary: - Compiz Unitiy, screen, and vertical maximize incompatibility
+ Horizontal/vertical-maximized window shrinks a few pixels when losing
+ focus, upsets gnome-terminal
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Here's a partial solution for bug 772972 and bug 735677.

Functionally it solves the vertical (or horizontal) maximization problems, but it still has a small bug where the window does not redraw into the correct size until refocused.

Changed in unity:
assignee: nobody → Daniel van Vugt (vanvugt)
status: New → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes bededog is right. A good workaround is to edit /usr/share/themes/Ambiance/metacity-1/metacity-theme-1.xml

Just need to change the padding of frame_style to be equal values for name="normal_unfocused" and name="normal_focused". Then change theme to something else and back again to Ambiance to enable the change.

While it looks like a mistake in the Ambiance theme that these padding values are different, it's not really the root cause of the bug. The root cause is a code issue because this invisible padding area is not meant to affect the visible size of the window. You should be able to have any values for padding and the window size should not change magically by itself.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I'm logging the theme bug separately, assuming it is a bug. See bug 786850.

Changed in unity:
assignee: Daniel van Vugt (vanvugt) → nobody
status: In Progress → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Merged bug 786850 with this one, since the symptoms are the same. And a fix to either light-themes or unity will visibly resolve the bug.

Changed in light-themes:
assignee: nobody → Daniel van Vugt (vanvugt)
status: New → In Progress
Changed in light-themes (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
status: New → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in light-themes:
status: In Progress → Fix Committed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Found the fix has been committed to oneiric (without a bug ID):
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/oneiric/light-themes/oneiric/revision/39

Changed in light-themes (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The fix appears to be released for oneiric now:
https://launchpad.net/ubuntu/+source/light-themes/0.1.8.19.1

Changed in light-themes (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix Released (for oneiric) already.

Changed in light-themes:
status: Fix Committed → Fix Released
Changed in unity:
status: Confirmed → Invalid
Changed in unity (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Confirmed: The root cause of this bug is still unity-window-decorator. And that hasn't been fixed yet. We're only hiding the bug by tweaking the settings in light-themes.

Changed in unity:
status: Invalid → Confirmed
Changed in unity (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Omer Akram (om26er) wrote : Re: [Bug 772972] Re: Horizontal/vertical-maximized window shrinks a few pixels when losing focus, upsets gnome-terminal

(unity-window-decorator is being re-written so we might see it fixed
with the new magic ;)

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

To clarify, this bug is somewhat different from 735677

The fix was in the grid plugin, well, more of a hack to ignore the forced size limits that some windows have (for example gnome-terminal) through some magic with window manager hooks.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I know this bug is different to bug 735677. It just happened that my hack in comment #5 seemed to solve both bugs (almost).

Changed in unity (Ubuntu):
status: Confirmed → Fix Released
Changed in unity:
status: Confirmed → Fix Released
Changed in light-themes (Ubuntu):
importance: Undecided → Low
Changed in unity (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.