[webkit-gtk] Handling the run-file-chooser signal

nn6eumtr nn6eumtr at gmail.com
Mon Nov 4 11:42:08 PST 2013

I've made some progress - it appears that initially I wasn't waiting 
long enough for the page to load and draw. I am now using a function 
that spins in the event loop for X seconds (which I want anyway to pace 
my interaction with the web servers), and that got things to the point 
where I can "click" on the control and get the run-file-chooser signal 
to fire.

I defined my handler as such:

	$view->signal_connect('run-file-chooser' => sub {
	  my ($view, $FileChooserRequest) = @_;

	  print "Inside run-file-chooser handler\n";


I see my text and and this keeps the native file chooser from appearing, 
and doesn't raise any errors -- however I don't see the input element 
update with the file name like I expect. After I send the click event I 
go into GTK events for X seconds loop, so this should not be another 
timing issue.

I am wondering if I am returning the right thing, or if I'm supposed to 
call a method to set the file list and then return success or failure. 
Looking at the C version of the docs it appears I should return an array 
of file names. Does anyone have any insights?

On 10/29/2013 5:58 AM, Mario Sanchez Prada wrote:
> Hi,
> I personally never try the perl environment you are describing, but it's
> strange it does not work since it works from a normal test GTK+ application
> written in C/C++ (such as the unit tests that are in place to check that
> behaviour).
> Could you please share a small (but complete) sample application like the
> one you're trying so I can check it locally?
> If you do, I'd be happy to give it a try and see if I can be of any help to
> you, since I was involved in the implementation of those signals and I have
> therefore a special interest on this topic.
> Thanks!
> Mario
>> -----Original Message-----
>> From: webkit-gtk-bounces at lists.webkit.org [mailto:webkit-gtk-
>> bounces at lists.webkit.org] On Behalf Of nn6eumtr
>> Sent: 27 October 2013 23:09
>> To: webkit-gtk at lists.webkit.org
>> Subject: [webkit-gtk] Handling the run-file-chooser signal
>> I'm trying to select a file for a "file" type input element with a
>> headless gtk3::webkit perl environment. I've setup a handler:
>>       $view->signal_connect('run-file-chooser' => sub {
>>         print "Inside run-file-chooser handler\n";
>>       });
>> And I've tried two methods of invoking the handler by clicking on the
>> element:
>>    (1) create_event('MouseEvent')/init_mouse_event/dispatch_event
>>    (2) XTestFakeMotionEvent/XTestFakeButtonEvent to move the mouse and
>> click on the widget
>> And neither seems to trigger the run-file-chooser event as I never see
>> the text.
>> I contacted the maintainer of the perl package and he confirms that the
>> callback isn't being invoked. He isn't sure why and thought I should
>> try this group.
>> Does anyone have any insights on what I may be doing wrong?
>> _______________________________________________
>> webkit-gtk mailing list
>> webkit-gtk at lists.webkit.org
>> https://lists.webkit.org/mailman/listinfo/webkit-gtk

More information about the webkit-gtk mailing list