Open Bug 898736 Opened 11 years ago Updated 2 years ago

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

Categories

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

22 Branch
x86_64
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: lukasz.chelmicki, Unassigned)

Details

(Keywords: testcase)

Attachments

(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 = window.screen.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){
        window.moveTo(moves[i].left,moves[i].top);
        if(left !== window.screen.left || top !== window.screen.top){
          break;
        }
      }

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.
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

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
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: