forked from mirrors/gecko-dev
Bug 1048230 - Global indicator inaccessible when taskbar is on top of the screen, r=Enn.
This commit is contained in:
parent
2f5ceab2a1
commit
c2cfac10fd
1 changed files with 9 additions and 4 deletions
|
|
@ -131,10 +131,15 @@ let PositionHandler = {
|
|||
// Center the window horizontally on the screen (not the available area).
|
||||
// Until we have moved the window to y=0, 'screen.width' may give a value
|
||||
// for a secondary screen, so use values from the screen manager instead.
|
||||
let primaryScreen = Cc["@mozilla.org/gfx/screenmanager;1"]
|
||||
.getService(Ci.nsIScreenManager)
|
||||
.primaryScreen;
|
||||
let width = {};
|
||||
Cc["@mozilla.org/gfx/screenmanager;1"].getService(Ci.nsIScreenManager)
|
||||
.primaryScreen.GetRectDisplayPix({}, {}, width, {});
|
||||
window.moveTo((width.value - document.documentElement.clientWidth) / 2, 0);
|
||||
primaryScreen.GetRectDisplayPix({}, {}, width, {});
|
||||
let availTop = {};
|
||||
primaryScreen.GetAvailRectDisplayPix({}, availTop, {}, {});
|
||||
window.moveTo((width.value - document.documentElement.clientWidth) / 2,
|
||||
availTop.value);
|
||||
} else {
|
||||
// This will ensure we're at y=0.
|
||||
this.setXPosition(window.screenX);
|
||||
|
|
@ -145,7 +150,7 @@ let PositionHandler = {
|
|||
let desiredX = Math.max(desiredX, screen.availLeft);
|
||||
let maxX =
|
||||
screen.availLeft + screen.availWidth - document.documentElement.clientWidth;
|
||||
window.moveTo(Math.min(desiredX, maxX), 0);
|
||||
window.moveTo(Math.min(desiredX, maxX), screen.availTop);
|
||||
},
|
||||
handleEvent: function(aEvent) {
|
||||
switch (aEvent.type) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue