Can't resize Firefox 17.0 window with sawfish

Bug #1083260 reported by Håkon A. Hjortland
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
sawfish (Ubuntu)
Fix Released
High
Colin Watson
Precise
Fix Released
High
Colin Watson
Quantal
Won't Fix
High
Colin Watson

Bug Description

[Impact] It is impossible to resize windows of current browser versions when using the Sawfish WM. These browser versions have been delivered in stable updates, so we should fix this observable regression too.
[Test Case] Start a Sawfish session, start Firefox, and try to resize/maximize its window.
[Regression Potential] Not really sure I see any; I suppose it's worth making sure window operations continue to work sensibly in general.

Original report follows:

Starting with version 17.0 of Firefox, it is no longer possible to resize the browser window when using the Sawfish window manager. The bug also applies to Thunderbird 17.0. The maximize button is missing from the window, keyboard shortcuts to maximize are without effect, and attempts to manually resize by dragging the window border results in an extremely tiny window, about 1 pixel wide and a few tens of pixels high.

From "xwininfo -size" on the Firefox window:
--------------------------------------------------------------------------------
Normal window size hints:
    Program supplied minimum size: 18 by 89
    Program supplied maximum size: 1073741824 by 1073741824
--------------------------------------------------------------------------------
(1'073'741'824 = 0x40'00'00'00)

From librep-0.90.2/src/rep_lisp.h:
--------------------------------------------------------------------------------
#define rep_VALUE_IS_INT 2
#define rep_VALUE_INT_SHIFT 2
[...]
/* Convert a signed integer into a repv. */
#define rep_MAKE_INT(x) (((x) << rep_VALUE_INT_SHIFT) \
     | rep_VALUE_IS_INT)
--------------------------------------------------------------------------------

In other words, the top two bits in integers get discarded. I have a 64-bit system, but it seems 32-bit ints are used here anyway. The result is that the maximum-window-size value will be mangled and becomes 0, which obviously could cause problems.

Here is a fix which makes the maximum-window-size value use only 30 bits. 0x1f'ff'ff'ff is chosen as maximum value since that will keep the top three bits to 0. The third top-most bit has to be 0 too since the number would probably be interpreted as a negative number if it wasn't. The fix seems to work nicely - both Firefox and Thunderbird windows can now be resized again.

Patch for sawfish-1.5.3/src/windows.c (attachment maxsize.patch):
--------------------------------------------------------------------------------
--- a/src/windows.c 2009-11-12 21:02:10.000000000 +0100
+++ b/src/windows.c 2012-11-26 04:29:07.172933027 +0100
@@ -1307,9 +1307,9 @@
     }
     if (flags & PMaxSize)
     {
- ret = Fcons (Fcons (Qmax_width, rep_MAKE_INT(hints->max_width)),
+ ret = Fcons (Fcons (Qmax_width, rep_MAKE_INT(MIN(hints->max_width, 0x1fffffff))),
        Fcons (Fcons (Qmax_height,
- rep_MAKE_INT(hints->max_height)), ret));
+ rep_MAKE_INT(MIN(hints->max_height, 0x1fffffff))), ret));
     }
     if (flags & PResizeInc)
     {
--------------------------------------------------------------------------------

My system:
Ubuntu 12.04.1 LTS
amd64
sawfish 1:1.5.3-2build1
firefox 17.0+build2-0ubuntu0.12.04.1
thunderbird 17.0+build2-0ubuntu0.12.04.1

Revision history for this message
Håkon A. Hjortland (post-hakn) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "maxsize.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Håkon A. Hjortland (post-hakn) wrote :
Colin Watson (cjwatson)
Changed in sawfish (Ubuntu):
status: New → Triaged
importance: Undecided → High
Colin Watson (cjwatson)
Changed in sawfish (Ubuntu Precise):
status: New → Triaged
Changed in sawfish (Ubuntu Quantal):
status: New → Triaged
Changed in sawfish (Ubuntu Precise):
importance: Undecided → High
Changed in sawfish (Ubuntu Quantal):
importance: Undecided → High
Changed in sawfish (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
Colin Watson (cjwatson)
description: updated
Colin Watson (cjwatson)
Changed in sawfish (Ubuntu):
status: Triaged → In Progress
Changed in sawfish (Ubuntu Quantal):
status: Triaged → In Progress
Changed in sawfish (Ubuntu Precise):
assignee: nobody → Colin Watson (cjwatson)
Changed in sawfish (Ubuntu Quantal):
assignee: nobody → Colin Watson (cjwatson)
Changed in sawfish (Ubuntu Precise):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sawfish - 1:1.5.3-2.1ubuntu1

---------------
sawfish (1:1.5.3-2.1ubuntu1) raring; urgency=low

  * Backport upstream patch to cap the maximum size of a window to 32767,
    fixing inability to resize Firefox 17 browser windows (LP: #1083260).
 -- Colin Watson <email address hidden> Sun, 06 Jan 2013 22:32:44 +0000

Changed in sawfish (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Håkon, or anyone else affected,

Accepted sawfish into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/sawfish/1:1.5.3-2.1ubuntu0.12.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in sawfish (Ubuntu Quantal):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in sawfish (Ubuntu Precise):
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Håkon, or anyone else affected,

Accepted sawfish into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/sawfish/1:1.5.3-2ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Håkon A. Hjortland (post-hakn) wrote :

The trigger of the bug seems to have been fixed in Firefox 18.0, but it's still present in Thunderbird 17.0.2:

xwininfo -size for Firefox 18.0 gives:
Program supplied maximum size: 32767 by 32767

xwininfo -size for Thunderbird 17.0.2 gives:
Program supplied maximum size: 1073741824 by 1073741824

Behaviour of different sawfish versions in precise:

sawfish 1:1.5.3-2build1:
Firefox: GOOD (can be resized).
Thunderbird: BAD (can't be resized).

sawfish 1:1.5.3-2ubuntu1:
Firefox: GOOD (can be resized).
Thunderbird: GOOD (can be resized).
No side effects observed.

So, the updated sawfish package fixes the bug properly.

I have not tested it in quantal.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

tags: added: verification-done-precise
removed: verification-done
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sawfish - 1:1.5.3-2ubuntu1

---------------
sawfish (1:1.5.3-2ubuntu1) precise; urgency=low

  * Backport upstream patch to cap the maximum size of a window to 32767,
    fixing inability to resize Firefox 17 browser windows (LP: #1083260).
 -- Colin Watson <email address hidden> Sun, 06 Jan 2013 22:41:24 +0000

Changed in sawfish (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

This SRU has remained unverified for quantal after 294 days in the -proposed queue. I've removed it now from quantal-proposed and am marking this bug 'wontfix'.

Changed in sawfish (Ubuntu Quantal):
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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