adriantr09 / gecko-mediaplayer

Automatically exported from code.google.com/p/gecko-mediaplayer
GNU General Public License v2.0
0 stars 0 forks source link

After fullscreen, window won't back to right position #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
in apple trailers (http://www.apple.com/trailers), gecko-mediaplayer window
wont back to the right position, the position always in x=0 y=0

never try in another site, but i think it would be same

my box is debian etchnhalf, gtk 2.10 (backports)

Original issue reported on code.google.com by antro.cr...@gmail.com on 18 Mar 2009 at 1:24

GoogleCodeExporter commented 8 years ago
I tested several sites at apple.com and was unable to duplicate this issue. What
version of gecko-mediaplayer are you using?

Original comment by kdeko...@gmail.com on 18 Mar 2009 at 10:46

GoogleCodeExporter commented 8 years ago
The newest (0.9.5) and before both for gecko-mediaplayer and gnome-mplayer.
Is it because of the GTK+2 one ? Im using GTK 2.10 backports.
Never try on another machine or higher version of GTK

I will try in another box later. I guess this because the version of GTK.
But i'm already try your mplayerplug-in, it doesn't produce the same problem.

Original comment by antro.cr...@gmail.com on 19 Mar 2009 at 2:47

GoogleCodeExporter commented 8 years ago
I too have this issue, the player window does not embed back into firefox after
leaving full screen. Tried with versions 0.6.3 and 0.9.5.

Might this have something to do with the window manager in use?

The problem occurs on systems with KDE window manager (version 3.5.9) and on my
system with the ION3 window manager.

Some software versions:
The KDE system uses GTK+ 2.14.7, cairo 1.8.6, Firefox 3.0.10.
The ION3 system uses GTK+ 2.12.11, cairo 1.6.4, Firefox 3.0.10.

After leaving fullscreen the player window is at the top left corner, without 
any
window decoration. Under KDE the window can be moved while holding down the alt 
key.

Original comment by m.c.huij...@gmail.com on 13 May 2009 at 9:50

GoogleCodeExporter commented 8 years ago
Very likely to be a window manager issue. Since the code is not doing anything
unusual. You might try with metacity and see if the problem persists there.

Original comment by kdeko...@gmail.com on 13 May 2009 at 1:14

GoogleCodeExporter commented 8 years ago
im using KDE too
upgrading gtk still produce the issue

can u make it work without changing the window manager
im very comfort with KDE window manager

KDE     3.5.7
GTK+    2.12.12
cairo2  1.6.4
firefox 3.0.6

Original comment by antro.cr...@gmail.com on 13 May 2009 at 1:33

GoogleCodeExporter commented 8 years ago
In the old mplayerplug-in the re-embedding works as expected, could that method 
of
re-embedding be used for this plugin too? Or are there architectural differences
between the two preventing this.

Original comment by m.c.huij...@gmail.com on 13 May 2009 at 2:20

GoogleCodeExporter commented 8 years ago
It is pretty much the same code... I'm asking around to some other KDE people, 
cause
I do know that this worked at one point, and I expect it to work now.

Original comment by kdeko...@gmail.com on 13 May 2009 at 2:31

GoogleCodeExporter commented 8 years ago
I tested this site
http://www.apple.com/trailers/paramount/startrek/startrek_trailer1_small.html

With my Fedora 11 system, running under gnome, but with the fvwm window manager
instead of metacity and everything was working perfectly. I could go to 
fullscreen
and back with no problems. It also worked fine with metacity.

Original comment by kdeko...@gmail.com on 13 May 2009 at 2:41

GoogleCodeExporter commented 8 years ago
On my ION3 window manager that site also experiences the problem.

My kde3 system has 64bit mplayer installed atm, and it looks like the 
plugin/player
crahses. The embedded object just vanishes (becomes black and right click menu 
is
that of firefox in stead of the plugin). I did test stand alone mplayer on the 
movie
url 
(http://movies.apple.com/movies/paramount/star_trek/star_trek-tlr1_h.320.mov) 
and
that seems to work. I'll turn debug mode on to see whats happening here, but 
that
will have to wait till tomorrow.

The site I've tested earlier today is
http://www.beleefdelente.nl/slechtvalk
but so far all sites have the same problem here.

Original comment by m.c.huij...@gmail.com on 13 May 2009 at 2:51

GoogleCodeExporter commented 8 years ago
 I am experiencing the same problem for a while. The problem does not depend on the
website, it just happens under KDE (I haven't tried with other WM) after you 
switch
from fullscreen mode. The behaviour changed from KDE3 to KDE4 though, under 
KDE3 the
video was not embedding back to Firefox and became a borderless/window 
decorationless
video moving to top left of the screen as another window. Now I am running 
under KDE4
and video is totally gone when I switch back from fullscreen, though it is still
playing since I can hear the sound and see mplayer running in process table.

 I have tried with 
 GTK from 2.12 to 2.16.1
 Firefox 3.0 to 3.5beta4
 KDE 3.5.9 to 4.2.3
 SVN versions of MPlayer from about a year ago up to few days ago,with different ao
and vo settings
 With many kinds video cards (just to eliminate the possibility)
 etc.

 None of them changed behaviour / fixed the problem for me, though switching from
KDE3 to KDE4 changed the symptom, so I am almost sure it is a
Firefox/Gecko-mediaplayer/KDE problem. Don't know where the problem lies or how 
can
be fixed though.

 HTH

Original comment by zab...@gmail.com on 13 May 2009 at 9:40

GoogleCodeExporter commented 8 years ago
I was able to duplicate the bug running kwin as my window manager in Gnome. So 
I'll
see if I can put in a workaround... 

Original comment by kdeko...@gmail.com on 13 May 2009 at 10:10

GoogleCodeExporter commented 8 years ago
Looking more like a bug in kwin, specifically with the gdk_window_reparent call.
Gonna try a couple of other window managers. I also tried switching the code to
XReparentWindow, which is what mplayerplug-in uses and it fails with that as 
well.

window managers
metacity: ok
fvwm: ok
xfwm4: ok
kwin: broke
blackbox: broke, fullscreen is across both displays (which is wrong), and window
disappears on reparent.
icewm: broken differently than kwin, window comes back, but not embedded and 
desktop
is black

So I'm 3 for 6.... I still believe the window manager needs to give a reason as 
to
why the reparent is failing, since the initial reparent works, the reparent to 
NULL
works (pops us out of the window)

my kwin is
kwin --version
Qt: 4.5.0
KDE: 4.2.2 (KDE 4.2.2)
KWin: 4.2.2 (KDE 4.2.2)

I a get the effect where the plugin window disappears as well.

Original comment by kdeko...@gmail.com on 13 May 2009 at 11:10

GoogleCodeExporter commented 8 years ago
What other differences are there between the gecko-mediaplayer and 
mplayerplug-in
that could cause this?

Could this have to do with the fact mplayer-plugin which runs inside the firefox
process, so it embeds an external window into itself. In contrast to 
gnome-mplayer
which runs as a separate process that is trying to embed itself into a window
(firefox) it does not own?

I've also tried the XReparentWindow in gnome-mplayer in the ION3 window manager 
and
it fails to embed in the same way (end up with a separate movie window).

Am I correct that these are the functions that implement the (un)fullscreen in 
both
plugins?
gnome-mplayer-0.9.5/src/gui.c: void menuitem_fs_callback(GtkMenuItem * 
menuitem, void
*data)
mplayerplug-in-3.55/Source/plugin.cpp: void 
nsPluginInstance::SetFullscreen(PRBool value)

Original comment by m.c.huij...@gmail.com on 14 May 2009 at 12:18

GoogleCodeExporter commented 8 years ago
Yes you are in the right spot, and you probably saw that the code using
XReparentWindow was there but commented out. Being in process may have 
something to
do with it. However, the fact that the window is initially embedded properly 
means
that it should work. It just means that the second embed/reparent is failing.

Original comment by kdeko...@gmail.com on 14 May 2009 at 1:01

GoogleCodeExporter commented 8 years ago
Another difference between both plugins is the way they go into full screen 
mode.

mplayerplug-in first creates a new toplevel window and reparents the movie 
window
into the newly created window

gnome-mplayer just reparents with new_parent NULL

The behaviour for new_parent=NULL does not seem to be documented in the GDK 
reference
(http://library.gnome.org/devel/gdk/stable/gdk-Windows.html#gdk-window-reparent)
 from
what I can find. Neither does the man page of XReparentWindow describe the 
behaviour.

xwininfo -root -tree does list a window with id = 0x0, but I can't seem to get 
any
properties of it with xwininfo -id 0x0 or xprop -id 0x0.

Original comment by m.c.huij...@gmail.com on 14 May 2009 at 2:18

GoogleCodeExporter commented 8 years ago
Apparently new_parent == NULL is valid from looking in the implementation of
gdk_window_reparent in the gtk toolkit (gtk+-2.12.12/gdk/x11/gdkwindow-x11.c):

  if (!new_parent)
    new_parent = gdk_screen_get_root_window (GDK_WINDOW_SCREEN (window));

Original comment by m.c.huij...@gmail.com on 14 May 2009 at 2:37

GoogleCodeExporter commented 8 years ago
I also tried changing the code to this, one the switch to fullscreen

gdk_window_reparent(window->window,
gdk_window_lookup(gdk_x11_get_default_root_xwindow()), 0, 0);

And that worked ok with metacity, but failed with kwin... 

Original comment by kdeko...@gmail.com on 14 May 2009 at 2:46

GoogleCodeExporter commented 8 years ago
Attaching test program, so you can use a local file and don't have to test in 
the
browser.

You will need to edit the code to point to gnome-mplayer, you can remove the 
path on
the executable to load it from the path.

Also, change the line to point to a valid video file.

I also found when using this test program if you use the 'f' key to go 
fullscreen and
then back. Under kwin if you hit it again, the fullscreen window appears, but 
it is
iconized, so for some reason the kwin is thinking the window is being iconized 
when
being reparented, so perhaps that is a feature of another window swallowing 
another
window under kwin. Need to know how to undo that.

Original comment by kdeko...@gmail.com on 14 May 2009 at 2:56

Attachments:

GoogleCodeExporter commented 8 years ago
There was some discussion on the mailing list awhile ago about this issue.. 
Might be
related to this gtk issue

http://bugzilla.gnome.org/attachment.cgi?id=107983

Original comment by kdeko...@gmail.com on 14 May 2009 at 4:39

GoogleCodeExporter commented 8 years ago
ok, After a long day of working with this I finally solved it. I used the code 
from
mplayerplug-in, but a little extra stuff to fix this. None of this work around 
should
have been needed, but it appears it was.

Committed to SVN

Original comment by kdeko...@gmail.com on 14 May 2009 at 11:05

GoogleCodeExporter commented 8 years ago
Great work Kevin! This change also solves the problem for the ION3 window 
manager.

Original comment by m.c.huij...@gmail.com on 15 May 2009 at 10:14

GoogleCodeExporter commented 8 years ago
Works great on KDE 4.2.3 with Firefox 3.5beta4, thank you :)

Original comment by zab...@gmail.com on 17 May 2009 at 10:46