Closed Bug 717183 Opened 8 years ago Closed 2 years ago

Specified panel width ignored when firefox is maximized

Categories

(Add-on SDK Graveyard :: General, defect, P2)

x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: elias.naur, Unassigned)

References

Details

Attachments

(3 files)

The dimensions of a panel can be specified by the options given to the panel.Panel(). However, the specified panel width is ignored when firefox is maximized, at least on windows and linux. My minimal test case is this (most of it from cfx init):

const widgets = require("widget");
const tabs = require("tabs");
const data = require("self").data;

var panel = require("panel").Panel({
    width:100,
    height:100,
    contentURL: data.url('test.html'),
});

var widget = widgets.Widget({
  id: "mozilla-link",
  label: "Mozilla website",
  contentURL: "http://www.mozilla.org/favicon.ico",
  panel: panel
});

Where test.html contains a <div> with width 100px (98px + 1px border). When the firefox window is not maximized the panel window is 100px wide, but when maximized, the panel adjusts itself to the left and is squeezed (which can be seen from the panel getting a horizontal scrollbar)
I'll check this out later today.
Whiteboard: [triage:followup]
Hrm. I copy/pasted your code into an addon builder-hosted addon and am testing it from there (using a recent Firefox Nightly 12 build on the Windows 8 dev preview, for what it's worth): https://builder.addons.mozilla.org/addon/1033350/latest/

When I test it out with the window unmaximized, the panel appears to be square. I get a horizontal scrollbar appearing. 
If my unmaximized window is up against the right edge of my monitor, the panel's dropdown arrow thing is almost aligned with the widget. The panel does not overlap the window's frame for me on Windows.
If my unmaximized window is in the middle of my monitor and not touching the right edge the screen, the panel will overlap the window's frame, and the dropdown arrow thing will be properly aligned with the widget.

When I test it out with the window maximized, the panel appears to be less wide (the horizontal scrollbar's draggable piece is smaller, so it covers more scrollable area). Additionally, the little dropdown arrow is even further offset to the left of the widget than when the unmaximized window is up against the right edge of the monitor. The window's frame is not shown because the window is maximized. The widget is pushed up against the right edge of the screen because there's no window frame there. But the panel is still acting like the window frame is there, as there is a visible gap between the panel's border and the edge of the monitor.




This might be a bug within Firefox's arrowpanel code and not necessarily with the SDK's use of them.

I can try this out on Linux in a bit. It might not be noticeable on Mac (and recent Ubuntu releases that use Unity?) because IIRC, they don't have window frames like Windows does.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to Wes Kocher (:KWierso) (Jetpack Bugmaster) from comment #2)
> When I test it out with the window unmaximized, the panel appears to be
> square. I get a horizontal scrollbar appearing. 
> If my unmaximized window is up against the right edge of my monitor, the
> panel's dropdown arrow thing is almost aligned with the widget. The panel
> does not overlap the window's frame for me on Windows.
> If my unmaximized window is in the middle of my monitor and not touching the
> right edge the screen, the panel will overlap the window's frame, and the
> dropdown arrow thing will be properly aligned with the widget.
Upon further testing, if the window is unmaximized and against the right edge of the screen, I get the scrollbar. If the window is unmaximized and not against the edge of the screen, there is no scrollbar.
Alex, can you see if this is an SDK problem or if this should go to the platform guys?
Assignee: nobody → poirot.alex
Priority: -- → P2
Whiteboard: [triage:followup]
I'd say it is both SDK and platform issue!
Panel position seems buggy when the panel is on screen edges.
Here is a SDK fix that ensure keeping the specified size,
but at the end, the panel is croped on the screen edge.
This time it is a platform issue.

Here is a scratchpad test highlighting this platform issue:
var panel = document.createElement("panel");
panel.setAttribute("type", "arrow");
panel.setAttribute("flip", "both");
var box = document.createElement("label");
box.setAttribute("value", "0 1 2 3 4 5 6 7 8 9 10");
box.style.width="100px";
box.style.height="100px";
panel.appendChild(box);
setTimeout(function () {
  var anchor = document.getElementById("home-button");
  panel.openPopup(anchor, "bottomright topright");
}, 1000);
document.documentElement.appendChild(panel);


At the end I don't know if it makes sense to apply this patch or not?
In the meantime, do we prefer having a smaller width or a cropped panel?
Attached image Cropped panel
Here is how looks like Elias's example with this patch.
Component: Documentation → General
QA Contact: documentation → general
Assignee: poirot.alex → ejpbruel
This bug is still there. My panel has a width of 380 specified, but that goes to 370 when maximized or on the edges.
Assignee: ejpbruel → nobody
Assignee: nobody → zer0
Hey Matteo, are you working on this one? if not could you please unassign yourself.
Flags: needinfo?(zer0)
Assignee: zer0 → nobody
Flags: needinfo?(zer0)
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.