IRC Log Viewer » #firebreath » 2011-06-06

IRC Nick Time (GMT-7) Message
taxilian 00:06 kalev: Not sure I follow
There is a timer call on Mac of debatable stability and a "call on main thread", then there is invalidatewindow; can't think of anything else that would come close to fitting your description
the plugin itself doesn't really have an event loop
unless it is a platform specific one, in which case you'd need platform specific calls
for example, on Windows you can use PostMessage to send a message to the event loop
kalev 00:06 taxilian: let me try to explain what I am doing
plugins are mostly asynchronous.
For example, from JS I can call a function on a plugin, the plugin does something and also sends back an asyncronous event to JS.
The plugin finishes doing its work and returns control to the browser.
Then the browser runs an iteration of its event loop, notices that there's a new asyncronous message to JS (from the plugin), and dispatches it.
Next the browser runs another iteration of its event loop, notices that it needs to deliver e.g. a timer event, and does it.
Next the browser runs another iteration of its event loop, notices that someone pressed a button on the page, and executes the javascript.
Now what I am doing is that I am running a busy-wait loop on my plugin's main thread, blocking the javascript call.
(yes I know it's not nice, but I cannot change the JS API)
I was wondering if there was a way to call back into the browser, to get it to do one iteration of its event loop from withing my busy-wait loop.
right now I am calling the underlying platform's native message processing functions directly.
oh and regarding the "timer call on Mac of debatable stability": I copy-pasted the code to Firebreath's X11 code and it appeared to work fine, at least on some browsers (Firefox); with some lesser used browser's it didn't do anything
I ended up not using it though, but perhaps you'd like to still have it in Firebreath?
http://fpaste.org/3NDc/
_pq_ 02:06 i'm having a strange issue: when I load my plugin right mouse button won't work in the whole browser window
gargle 08:06 hi ll
all
neilg_ 08:06 Morning all!
gargle 08:06 hi neilg_
taxilian 08:06 kalev: I dont think there is any way to do that; definitely not with npapi
gargle 08:06 hi taxilian, I have a little error : i try to return a variant based on wstring in a firefox plugin, but the text is scrambled. When i try with std::string instead, text is ok. it's not possible to return std::wstring ?
taxilian 09:06 What browser, what OS?
gargle 09:06 firefox on mac OS X 10.6
taxilian 09:06 Hmm. It should work
It converts them to utf8 and returns as a utf8 string
gargle 09:06 std::string tmp("hello"); FB::variant val(tmp); return val; work
std::wstring tmp(L"hello"); FB::variant val(tmp); return val; doesn't
i make something wrong ?
taxilian 09:06 Strange. It was working. Please file an
An issue
gargle 09:06 ??
taxilian 09:06 Jira.firebreath.org
gargle 09:06 ok, thanks
gargle 09:06 i have the 1.5.1 version, do you think i have to upgrade ?
FireBreathBot 09:06 JIRA issue http://jira.firebreath.org/browse/FIREBREATH-94 issue created by gargle
taxilian 09:06 gargle: I don't think it will help with that problem, but I would definitely recommend upgrading
gargle 09:06 ok, i will. thx
sabotaged|wk 10:06 so i was able to reproduce that MyCALayer issue with BasicMediaPlayer example project
taxilian 10:06 Did you ever try putting an autorelease pool in PluginWindowMacCA like I suggested?
sabotaged|wk 10:06 yes: if i surround creation of MyCALayer in my own autorelease pool, my plugin crashes in some drawing code. but the example doesn't. though i don't think the example is doing any drawing
taxilian 10:06 it shouldn't matter; if the issue is what you were hypothesizing that would make it crash every time
so it must be something else
what did you do with BasicMediaPlayer to reproduce the crash?
sabotaged|wk 10:06 just create a full screen window when i invoke a method on the plugin
taxilian 10:06 well, zip up the example and send it to me; I'll see if Eric can look at it
I'm about 90% certain this has something to do with your code rather than FireBreath
neilg_ 11:06 Wow, upgrading from 1.5RC to 1.5.2 has been one of the most involved upgrades so far! :-/
taxilian 11:06 really? why is that?
neilg_ 11:06 Though that's mostly because of the new dependency on boost::regex
And the fact that I'm using a system boost and things like the scriptingcore unit test is now dependent on boost regex and (apparently) isn't looking in the right place
Not sure where to configure that
taxilian 11:06 new dependency on boost::regex??
neilg_ 11:06 Yep, there wasn't one before
taxilian 11:06 what is dependent on boost::regex?
neilg_ 11:06 That's for sure... since I didn't have the boost regex library installed
And now it requires it
taxilian 11:06 what is "it"?
neilg_ 11:06 Well, the unit test for scriptingcore for one
taxilian 11:06 where?
there really shouldn't be any dependency on boost::regex
I have no idea why there would be
neilg_ 11:06 I don't know because of the annoying pragma feature that boost does
It just tries to link against it... :-/
But only on Windows
taxilian 11:06 strange
neilg_ 11:06 Because it builds fine on the mac!
taxilian 11:06 we're definitely not linking against it with firebreath-boost
so it doesn't actually need to link against it
but boost must think it does
neilg_ 11:06 Right, it's just by including a certain boost header. I just don't know which one (yet)!
Hmm, something in precompiled_headers.h
taxilian 11:06 trange
wait
you're not on 1.5.2 if you've got precompiled_headers
you're on the dev branch
which will be 1.6
Radicand 11:06 taxilian: i'm running 1.4 branch, safe to change to 1.5 without breaking much for me?
taxilian 11:06 there are breaking changes; shouldn't be a major task to upgrade, however
look at the Version History page
neilg_ 11:06 I'm on master. So that's not 1.5.2? Hmm. That's not right!
taxilian 11:06 no, that's not 1.5.2
1.5.2 is in…. the firebreath-1.5 branch!
they were the same for awhile, but no longer
master is always dev
neilg_ 11:06 Makes sense that master isn't 1.5.2 now I think about it. Though that means 1.6 isn't quite right ;)
taxilian 11:06 sometimes dev and stable coexist, however
exactly. 1.6 is not considered "stable" yet
neilg_ 11:06 I'll try that branch first to see whether it's just 1.6 or not
taxilian 11:06 though honestly it's pretty good
neilg_ 11:06 The problem is also in variant_test.h
But that incluses other things that it needs so... Doing some investigating!
taxilian 11:06 1.6 has proxy detection support and precompiled headers on windows
neilg_ 11:06 *includes
taxilian 11:06 which *really* speeds up the build on windows
if it's easy to fix, let me know
neilg_ 12:06 So this line makes it try and link against boost::regex:
a.convert_cast<std::string>() == "23.23"
Where a is declared as:
variant a = 23.23;
So either variant, convert_cast or the == operator are doing something bizarre
taxilian 12:06 that line?
err...
strange...
maybe boost has some way of adding a link lib if a particular template is instantiated?
neilg_ 12:06 Right. Very bizarre!
It does, it uses #pragma comment(lib, "boost*.lib")
And it annoys the heck out of me for doing that
Especially right now :)
taxilian 12:06 lol
I believe you
neilg_ 12:06 But I also have no idea how this can work if FB uses its own cut-down version of boost.
taxilian 12:06 well, FB disables auto linking
neilg_ 12:06 I'm... confuzzled. Both confused and puzzled. :)
How does it do that?
taxilian 12:06 basically I #ifdef'd out the auto_link.hpp file
very elegant… honest
(the neat thing about "owning" a channel is that I can define what words like "elegant" mean)
neilg_ 12:06 ;)
Damnit, I really hate boost sometimes. It's a great library and simplifies a lot of things... but sometimes they choose to do things in ways that are IMO pretty terrible. :)
taxilian 12:06 agreed
unfortunately there really isn't a better option
I really wish there was an easy way to turn off boost autolinking
or if there is I wish I knew it
neilg_ 12:06 Hmm, we can do it by defining BOOST_ALL_NO_LIB
And then manually link against the libs. But that's fine, I already do that for the mac build!
taxilian 12:06 that would be why it works on mac!
hmm. I should try that with FireBreath
might be possible to not modify the boost files that way
neilg_ 12:06 Well, I'll let you know if this changes anything for me :)
It's easy to change in the buildconfig.cmake file anyway!
taxilian 12:06 yep
I'm really thinking of doing a FireBreath 2.0 and turning the cmake structure on it's head
we don't really need an easy way to build multiple plugin projects together anymore now that we have support for multiple mimetypes
neilg_ 12:06 Thank god - yes, that fixes it
taxilian 12:06 it would be nice to open "ProjectName.sln" instead of "FireBreath.sln" and run cmake on the project dir instead of the firebreath dir
neilg_ 12:06 You're right
You're absolutely right, that would be nicer
taxilian 12:06 the problem is finding time to do it all myself
neilg_ 12:06 I recently discovered that CMake can actually build too which is very cool
taxilian 12:06 yep
cmake --build
as of 2.89
2.8
neilg_ 12:06 Yep!
I definitely understand that feeling... I'll help as much as I can. :)
taxilian 12:06 I appreciate that
neilg_ 12:06 ...which is why I was trying to track down that error for a while before reporting it. And finding a solution too!
I hate just reporting bugs. :)
taxilian 12:06 and let me tell you, it's a nice change from the norm ;-)
neilg_ 12:06 Oh, you're welcome. I know you started the project but the whole point (to me!) of Open Source is that more people can help work on it!
taxilian 12:06 yeah, that's always been my theory. Some days it works better than others, though =]
FireBreathBot 14:06 JIRA issue http://jira.firebreath.org/browse/FIREBREATH-53 issue commented by jzablot "I've modified the BasicMediaPlayer sample to reproduce this issue. Had to modify the sample a lit..."
taxilian 14:06 sabotaged|wk: could you create a new issue for that and attach the file directly to the issue in Jira?
sabotaged|wk 14:06 ok
FireBreathBot 14:06 JIRA issue http://jira.firebreath.org/browse/FIREBREATH-95 issue created by [email protected]
neilg_ 14:06 Hmm. On the Mac I'm finding that if (in Chromium) I hit the back button or reload then my plugin will cleanup and shutdown but StaticDeinitialize() is never called...
taxilian 14:06 never called ever, or just not called until the browser process actually shuts down?
neilg_ 15:06 Hmm, good question. All I know is that StaticInitialize is called the next time the plugin loads!
taxilian 15:06 strange
neilg_ 15:06 Well, actually, the plugin is unloaded - so the answer is "never"
Yes.
taxilian 15:06 see if you can figure out if NP_Shutdown is being called
neilg_ 15:06 Sure, I'll look into it some more. I'm trying to track down a bizarre error with CoreAnimation where the second instance of a plugin tends to not work (but you can hit refresh and it will probably start working again). Seems to be a timing thing!
I'll be looking into it some more tomorrow for sure, I'll be leaving in the next half hour in any case
taxilian 15:06 anyone have any experience with offscreen NSViews?
starakaj 16:06 hi all
so anyone know if it's possible to set focus to an <object> programmatically?
if you did, and you were to tell me how, oh man would that be great
taxilian 16:06 what platform?
starakaj 16:06 document['objectID'].focus seems promising
but doesn't work
any
taxilian 16:06 lol
are you using windowless on windows?
starakaj 16:06 well
eventually yes
taxilian 16:06 http://msdn.microsoft.com/en-us/library/ms646312%28v=vs.85%29.aspx
starakaj 16:06 this is on the path to that
taxilian 16:06 that might work for now, then
starakaj 16:06 but I can't get any osx browser to work
taxilian 16:06 I'm not sure
starakaj 16:06 hmm
any way to programmatically grab focus from the plugin?
because it's sweet to be able to draw DOM objects over the plugin
but it's sad that clicking them takes focus from the plugin
it makes me feel as if the html5 specification wasn't designed with my needs explicitly in mind
which is crazy
taxilian 16:06 lol
yeah,I have no idea
on Mac all your events are coming from the browser
so it's hard to predict exactly what the browser's poslicy is
it really has nothing to do with html5
starakaj 16:06 <- sad
taxilian 16:06 it could be worse. you could be trying to figure out how to simulate mouse move events to an NSView
(which so far isn't working so well for me)
starakaj 16:06 ha
taxilian 16:06 I got mouse down and mouseup events working
starakaj 16:06 safari is mean
taxilian 16:06 lol
well, I now how my mousemove events working
starakaj 17:06 hooray!
I now am considering doing some dark things
it looks like I can't actually focus the plugin programmatically
so I'm going to focus a DOM element near the plugin
and pass keyboard events from that element to the plugin
mhilmi 18:06 I'm trying to build a plugin that links to a hardware driver via a .lib file. The DLLs are in the appropiate system locations and the project compiles fine but when I try to register the compiled DLL, it fails saying Failed to Load, make sure appropiate dependant DLLs are available blah blah. Any ideas?
taxilian 18:06 define "the appropriate system locations"
mhilmi 18:06 system32?
where the project is being buitl
tried everywhere
taxilian 18:06 hmm. have you tried opening it in dependency walker?
mhilmi 18:06 not familiar with that, I'll check that out, ty
FireBreathBot 18:06 JIRA issue http://jira.firebreath.org/browse/FIREBREATH-96 issue created by richard
Commit 9ce1b3a on master by Richard Bateman: "FIREBREATH-96: Fleshed out the coco events a bit" http://goo.gl/ky1oJ
mhilmi 18:06 Thanks taxilian, that helped
figured it out
didn't realize that tool was built right into vstudio either...
taxilian 18:06 really? I didn't realize it came with VS iether
I always download it
mhilmi 18:06 actually its in the windows platform sdk
my bad
just saw that I had it installed already lol
was wondering where it came from hehe