window.restore() doesn't work

NEW
Unassigned

Status

()

P4
normal
2 years ago
2 years ago

People

(Reporter: billm, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: tpi:+)

STR:
1. Run the browser_minimize.js test. It fails for me 100% of the time.

Alternatively:
1. Open the devtools scratchpad.
2. Set the environment to "Browser". You may need to configure devtools to allow debugging chrome code.
3. Enter "window.minimize()" and hit run. The main window should minimize.
4. Enter "window.restore()" and hit run. The main window should restore. For me it doesn't in Linux. It does in Windows.

The browser_minimize.js test passes on tinderbox, so I guess this isn't a problem for everyone. I'm running Ubuntu 15.10 with the Gnome 3 window manager (mutter I guess).
(In reply to Bill McCloskey (:billm) from comment #0)
> 4. Enter "window.restore()" and hit run.

Is this in the same process as the main window?

If not, focus stealing prevention would prevent another process stealing focus, though usually it would flag the window as wanting attention.
(In reply to Karl Tomlinson (:karlt) from comment #1)
> (In reply to Bill McCloskey (:billm) from comment #0)
> > 4. Enter "window.restore()" and hit run.
> 
> Is this in the same process as the main window?

Yeah, it's all in the main process.

What I noticed is that, in the test, if I call window.focus() after window.restore(), it passes. I traced into gtk, and the call that actually causes the window to unminimize is here:
https://github.com/GNOME/gtk/blob/master/gdk/x11/gdkwindow-x11.c#L2280

What's strange is that window.focus() has no effect when I use it in the devtools scratchpad.

Updated

2 years ago
Priority: -- → P4
Whiteboard: tpi:+
You need to log in before you can comment on or make changes to this bug.