Open Bug 898736 Opened 7 years ago Updated 2 years ago

Extension written in XUL can't move window (window.moveTo) to other screen on Linux


(Core :: DOM: Core & HTML, defect, P5)

22 Branch





(Reporter: lukasz.chelmicki, Unassigned)


(Keywords: testcase)


(1 file)

Steps to reproduce:

I'm writing an extension which handles specific site by moving pop-upped window to second screen. I'm moving window to all possible positions out of main screen and stop moving when the position of the screen changes.

      //Moving window to other screen
      var left = window.screen.left, top =;
      var moves = [
        {left:left + window.screen.availWidth,top:top},
        {left:left - window.screen.availWidth,top:top},
        {left:left,top:top - window.screen.availHeight},
        {left:left,top:top + window.screen.availHeight}
      for(var i in moves){
        if(left !== window.screen.left || top !=={

What happens:
on Window: Works like a charm.
on Linux (Ubuntu 12.10 with GNOME 3): it show on the other screen for a split of a second and moves back to position of main window.

What should happen:
on Window: should stay as it is.
on Linux (Ubuntu 12.10 with GNOME 3): should move same way as on Windows.

Configurations tested:
Main screen on the left and second screen on the right.
Main screen on the right and second screen on the left.
Could you attach a minimal extension to reproduce the issue, please.
Flags: needinfo?(lukasz.chelmicki)
Keywords: testcase-wanted
Flags: needinfo?(lukasz.chelmicki)
One more step I missed. The main window needs to be started maximized. Is there a restriction for maximized windows?
Attachment #782482 - Attachment mime type: application/octet-stream → application/x-xpinstall
Component: Extension Compatibility → DOM
Product: Firefox → Core
I found the reason of the jumping window. 
After applying window.moveTo() the window.screen doesn't have the new position until the end of event loop. 
My work around was to make this loop in setTimeout(fun...,1); and it finally started to work properly.
Can we close it? (no bug)
Flags: needinfo?(lukasz.chelmicki)
I believe that window.screen should be up to date all the time, so that is the bug.
Flags: needinfo?(lukasz.chelmicki)
So maybe can you rephrase the bug title to explain the issue better, please.

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.