IRC Log Viewer » #firebreath » 2014-08-06

IRC Nick Time (GMT-7) Message
Venkat_ 23:08 Hi folks..
I have a basic doubt about NPAPI plugin..
or rather issue..
I am trying to build an NPAPI plugin to integrate an application that I have to google chrome..
taxilian 23:08 and you're wondering about Chrome dropping support?
Venkat_ 23:08 The application that I have can render things when given a HWND..
The application that I have can render things when given a HWND..
taxilian 23:08 okay
Venkat_ 23:08 hi. thats lease of my worries :)
hi. thats lease of my worries :)
taxilian 23:08 hehe
hehe
go on
go on
Venkat_ 23:08 i am trying both windowed and windowless plugins..
all i have to do is to get the hwnd from chrome and pass it on to my application..
first i tired to set the plugin as windowed
first i tired to set the plugin as windowed
and got the hwnd from setWindow..
and passed this on to my app..
in this case my app doesnt draw on the browser's window.
it creates an another window on top of the original chrome window..
it creates an another window on top of the original chrome window..
is this expected?
is this expected?
taxilian 23:08 is your app running in the plugin, or a separate process?
Venkat_ 23:08 my app is a multi process application..
its actually the CEF app
taxilian 23:08 don't know what the CEF app is
Venkat_ 23:08 Chromium embeded framework ..
Chromium embeded framework ..
taxilian 23:08 so a couple of things, though: 1) you definitely cannot do what you want with a windowless app
so a couple of things, though: 1) you definitely cannot do what you want with a windowless app
Venkat_ 23:08 I am trying to add some features to chromium browser (since chromme is not open source) and tie it to google chrome useing CEF
oh
taxilian 23:08 2) you need to understand that you don't own the window that is given to you as a plugin; the browser does. The browser gets to do whatever it wants to do and can take that window from you at any time
windowless plugin, I mean
windowless plugin, I mean
windowed *might* work
3) You must never block the main thread
Venkat_ 23:08 ok..
ok..
taxilian 23:08 I would definitely recommend that your app create its own window as a child window of the plugin's window
I would definitely recommend that your app create its own window as a child window of the plugin's window
that makes a lot of sense and is likely the best (possibly only) option that will work
but make sure that when the plugin's window goes away, your app cleans everything up as well
Venkat_ 23:08 yeah it does create a child window to the provided hwnd and draws on it..
taxilian 23:08 and keep in mind that you don't get to decide when that is
you can't prevent the plugin from shutting down while you finish a download, etc
you can't prevent the plugin from shutting down while you finish a download, etc
Venkat_ 23:08 oh ok ok..
my problem is much fundamental than these..
i am not able to draw on the browser's window..
got it?
taxilian 23:08 not really. you created a child window and drew in that… if that child window is correctly created, it will be in the browser window
you mean it's actually a seperate " I can drag this around" window?
Venkat_ 23:08 yeah i think so..
taxilian 23:08 okay, this means you aren't correctly creating the child window
Venkat_ 23:08 for ex if i hover over the chrome icon in the task bar it shows two windows..
taxilian 23:08 in windows, practically everything is a window. a button is a window, and it's just a child window of the window its in
Venkat_ 23:08 one is an empty untitled window.. and my app draws to that..
one is an empty untitled window.. and my app draws to that..
taxilian 23:08 so that's your issue. your app isn't creating the child window correctly
so that's your issue. your app isn't creating the child window correctly
Venkat_ 23:08 oh..
taxilian 23:08 or rather, it's not creating the correct kind of child window
or rather, it's not creating the correct kind of child window
to be more precise
to be more precise
Venkat_ 23:08 i did the following exp..
taxilian 23:08 (don't paste code in IRC, use a pastebin)
fpaste.org, gist.github.com, pastebin.com, etc
Venkat_ 23:08 took a hello world npapi plugin https://code.google.com/p/npapi-chrome-plugin-helloworld-example/source/checkout
taxilian 23:08 code links are good =]
Venkat_ 23:08 and in the Invoke() function of the scriptableObject, i fetch the HWND that it had saved via setWindow and did showWindow(hwnd)
ok.. sure
ok.. sure
1 sec
taxilian 23:08 you mean the windows API call ShowWindow?
you mean the windows API call ShowWindow?
or your own code showWindow?
or your own code showWindow?
Venkat_ 23:08 http://ur1.ca/hxci9
yeah..
this shows a new window that is other than the chrome's window..
taxilian 23:08 yeah, you should *never* be calling something like ShowWindow on the plugin's HWND
Venkat_ 23:08 oh..
taxilian 23:08 nor HideWindow
nor HideWindow
nor anything of hte sort
Venkat_ 23:08 oh ok ok..
taxilian 23:08 it isn't your window =] you don't control any of that stuff
Venkat_ 23:08 ok got it..
taxilian 23:08 think of it as a container that is lent to you. You can do anything you want inside it, but you can't change it in any meaningful way
Venkat_ 23:08 oh ok ok..
oh ok ok..
the CEF takes a HWND and an URL as parameter and renders the page on the provided hwnd..
so what shall I do?
currenlty I am doint showWindow on the plugin
taxilian 23:08 there is no reason you should need to call ShowWindow to do that
there is no reason you should need to call ShowWindow to do that
Venkat_ 23:08 's hwnd and provide that to the CEF
's hwnd and provide that to the CEF
taxilian 23:08 the window is visible if it's visible in the browser
and not if it isn't
Venkat_ 23:08 ok
so you advise me to remove the showWindow and just pass on the plugin's HWND to CEF?
so you advise me to remove the showWindow and just pass on the plugin's HWND to CEF?
taxilian 23:08 that would be the first thing I'd try
note that CEF may not be plugin-friendly enough that it will even work
Venkat_ 23:08 CEF asks for "parent hwnd"
taxilian 23:08 I don't know anythign about it
then *hopefully* it's just going to make its own window inside that one and everything will just work
Venkat_ 23:08 it creates another window using createWindowEx and attaches that as a child to the provided hwnd
it creates another window using createWindowEx and attaches that as a child to the provided hwnd
taxilian 23:08 but the ShowWindow should definitely not be there
that should probably work
Venkat_ 23:08 thanks..
taxilian 23:08 I hope it helps
I hope it helps
I'll be going to bed soon; it's almost midnight here
Venkat_ 23:08 all what you said are very usefull.. that too when there are too little docs around npapi..
thanks.. bye..