freshplayerplugin
freshplayerplugin copied to clipboard
Sometimes rightclick fails in windowed mode
I have VMware vCenter and VMware vCloud applications running, which are both flash based UIs. With version 0.2.4 and windowed mode enabled, right-clicking an object in vCloud does not bring out the application context menu like it should. Instead the flash-plugin menu is displayed. In vCenter, the context menu is displayed as expected. Disabling windowed mode, makes things work normally in both applications.
Is there any way to acquire that UIs for testing?
For now I found http://www.emanueleferonato.com/2012/06/04/easily-handle-right-mouse-button-in-flash-movies/ where right clicks are handled. That movie works fine, it successfully disables context menu. Is it working for you?
Yeah, that movie works fine here too... I'm trying to find a publicly available resource that exhibits the same behaviour... I'll be back :-)
I'm having some trouble, presenting this app to the outside world as it is. Is there a way I can gather some debugging information locally, that you could use?
First though is to check whenever Chrome generates PP_INPUTEVENT_TYPE_CONTEXTMENU
event if right mouse button was pressed. Usually I use https://github.com/i-rinat/ppapi-trace, but manually change generated .c
file to add parameter values to output.
Hello again. In which type of vCloud appliances do you have issue with rightclicks?
I've tested web interface of vShield in Chrome. It definitely uses Flash, right clicks trigger Flash context menu there. So it's something outside of freshwrapper control.
The problem is only with vCloud Director, as I have seen it. The rest of the stuff seems to work okay, even in windowed mode.
As a wild guess: try to change browser User-Agent header, remove any mention of "Linux" from it.
Does this seem plausible, even with things working fine in non-windowed mode?
I didn't find existing ova of vCloud Director, only installer. Installer demanded Oracle or MSSQL database, neither of which I have, so I ended up trying to deploy web application itself. At the moment I have no success, Tomcat doesn't like the app, while Karaf is still unfamiliar to me. It's a whole new world of Java web-applications... So I don't have working webapp yet.
But in the process I found interesting pieces in index.jsp
code:
<%
// On Ubuntu having wmode=opaque breaks flash right click menu and can hang the browser elsewhere
// Since this mode (used to enable right-click menus) is not supported on Linux we disable it
if (request.getHeader("User-Agent").indexOf("Linux") < 0) {
%>
{ wmode: "opaque", allowScriptAccess: "sameDomain" },
<% } else { %>
{ allowScriptAccess: "sameDomain" },
<% } %>
If one doesn't have "Linux" in User-Agent header, webapp will enable "opaque" wmode, which in turn will force freshwrapper to use windowless mode.
Wow! Fantastic find. Kudos!
Let me try to play a little with the User-Agent today. I'll get right back to you.
Amazing. This was indeed the culprit. Changing User-Agent to Firefox on Windows and suddenly it just works... Thank you so much for your help in this matter.
By the way, I figured out how to compile own example — requirement was player version 11.2, while default version in Flex SDK is 11.1. Here it is: https://i-rinat.github.io/flash-test-cases/RightClickHandling/index.html
There are three instances of the same Flash movie, but with different wmode
. All three works on my machine. So right click handling is not strongly related to mode used. Perhaps, vCloud Director webapp have own restrictions? Or maybe it's actually a bug in freshwrapper. (If latter is the case, I'd like to have it fixed.)
Did you try same webapp in Chrome? How right click works there?
In the 3 test-cases, right click works on all, regardless of the "enable_windowed_mode" setting. In Chrome (actually Chromium), right-click works as expected in the vCloud app.
I have compared the generated source on Firefox and Chromium, to make sure that we don't get the wmode: "opaque" set in one, but not the other. We don't. wmode: "opaque" is left out in both.
So could this be related to "defaults"? The jsp code clearly says, if not linux, set the wmode explicitly, which in turns mean, if is linux, use defaults. I don't know what the defaults would be here, but it feels as if perhaps "enable_windowed_mode" could be doing something to the defaults?
what the defaults would be here
wmode
is a parameter which is used by Flash player to determine how it will draw. Default value is window
(see https://helpx.adobe.com/flash/kb/flash-object-embed-tag-attributes.html for details).
Aside from that, NPAPI have own modes: windowed and windowless. They are different from Flash modes, but still related. (Note, they are not part of a single enumeration. It's more like properties of an object: color and size, for example.)
In windowed mode an X11 Window is passed to a plugin to draw to. In that mode plugin is responsible for event handling, drawing, and so on. (There is also optional XEmbed support, where plugin itself creates Window and plugs it into a socket provided by browser). That mode is used by NPAPI Flash for all wmode
other than opaque
and transparent
.
In windowless mode browser gives plugin a Drawable to draw to. It can be different each time. Also browser calls plugin's NPP_HandleEvent()
for each event intended for a plugin. That mode is used by NPAPI Flash for opaque and transparent instances. To support transparency, browser pre-fills Drawable by rendered page content. Plugin then paints over it, with alpha blending if necessary. One can't use windowed mode, as there would be no way to support transparency. Same for opaque
wmode, when one wants to shade plugin with other DOM elements on a webpage.
NPAPI Flash tries to use windowed mode because it's the only mode where VDPAU could be used. VDPAU context requires a single Drawable known at creation time. One have a single Window in windowed mode, but in windowless mode one gets a new Drawable only when browser asks plugin to paint. On the other hand, windowless mode is required because Flash must support transparency too.
That's the reason why some Flash movies (on Youtube, for example) have good performance, while others eat a lot CPU. No hardware acceleration is used in the latter case.
I initially used windowless mode for all wmode
s. No VDPAU was used (then and now), instead I use OpenGL to draw to an off-screen pixmap, which is then copied to Drawable by means of XCopyArea()
or XRender extension. That method benefits from hardware acceleration, and generally good, but...
No mouse wheel events are supported in windowless mode — Firefox doesn't pass wheel event to a plugin. Input method editors (IME) are also broken. Input methods are working via event filtering. To make them work, one need filter raw events though a special function provided by IME. But since browser also supports input methods (as a GTK application), it filters events through it before events are passed to a plugin. That's why own window is required — to get raw X events.
This is where enable_windowed_mode
comes in. If set to 1, freshwrapper starts using windowed mode whenever possible. For wmode=window
(default value) windowed mode is used, for wmode=opaque
windowless mode is used.
If enable_windowed_mode=0
, for both wmode=window
and wmode=opaque
windowless mode will be used.
I finally have found out what was happening there. That page have javascript that intersect mousedown
events and filters right clicks. Context menu events are still passed further, and plugin gets first contextmenu
event, then mouseup
event. PPAPI doesn't have notion of windowed or windowless plugins, so plugin always get filtered events from browser. That's why no matter which value wmode
has, everything works as expected.
In Firefox however, windowed plugin receives its events directly from operating system. That's why javascript filters have no effect, plugin gets all mousedown
, contextmenu
, mouseup
bundle.
I don't see a sane way to fix that kind of issues. If there is no way to affect page itself (like User-Agent trick here), the only choice left is to disable windowed mode in configuration file.
Awesome - Thank you for your effort in clearing this up!
For vCloud Director, this is happening again (0.3.5 and 21.0.0.213), but now in full-screen mode as well. Both the flash menu and the application right-click menu is shown (flash menu on top), so clicking a bit around makes it possible (yet frustrating) to work with. Please let me know if I should report as separate issue. Thanks.
I think it's kind of inevitable issue. Even if windowed mode is disabled in configuration file, fullscreen window is still a separate window. There are tricks used to pretend that browser itself goes to fullscreen, but in fact it's a new X window that plugin creates.
By the way, which version of vCloud Director do you use? I'll try to find a preinstalled VM image of a similar version to test on own machine.
I'm currently on the ubuntu(16.04)-provided version of freshplayerplugin and vCloud director 8.10 with no issues... The vCloud installation was updated since this problem so perhaps it's gone. I'll try a newer version of freshplayerplugin tomorrow
I don't think I'll be able to find vCloud Director 8.10 for testing in any observable future. The latest I found is version 6, I think. Also making it work will involve a lot of frustration moments (that's why I postponed the issue so long).
So it would be nice if you test whenever newer freshplayerplugin versions have the bug you reported.
Got access to vSphere web client 6.0. Obviously, it's not the vCloud Director, and not version 8.10, but I believe it uses same technology for its web interface. Flash+Flex. Right click works fine there, I didn't need to change User-Agent, as I thought. Wmode
parameter is set to opaque
, so mouse clicks are passed through javascript code, as intended.
I didn't see any ways to switch to full screen mode other than F11 in Firefox. That way context menus are working fine too.
So I guess, I need to wait for you to test it on your setup.
Alright - Updated to 0.3.5 with 22.0.0.192. Still no problem... So I'm unsure what has happened, but I seem unable to reproduce at this point
Darn... Found a few... So with the mentioned combo, some parts of the interface works and some does not. I haven't seen the double context menu as previous but in certain parts of the interface, the plugin context menu is shown rather than the application context menu
I can't find an explanation for that, since UI.swf
(actual UI for vSphere Web Client) spans over whole browser client space, without borders. So mouse event are either filtered for the whole swf movie, or not.
Do you have an access to vSphere Web Client? Are there similar places? I found no places so far, where Flash own context menu is shown. But perhaps I didn't check thoroughly enough.