Bug 948644

Summary: Gtk::FileChooserButton behaves strange
Product: [Fedora] Fedora Reporter: Martin Sourada <martin.sourada>
Component: gtk2Assignee: Matthias Clasen <mclasen>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: kalevlember, mclasen, mtasaka
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gtk2-2.24.18-1.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-28 01:03:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Sample test case in ruby
none
Sample test case in C none

Description Martin Sourada 2013-04-04 23:03:03 UTC
Created attachment 731762 [details]
Sample test case in ruby

Description of problem:
Using Gtk::FileChooserButton to select folders is broken in multiple ways: 
1. Choosing from the drop-down list (home, filesystem, bookmarked folders, ..) does not change #filename
2. Canceling directory choose via dialog sets label to Other... which isn't working
3. Sometimes prints (probably harmless) assertion failure:
 Gtk-CRITICAL **:_gtk_file_system_model_get_iter_for_file: assertion `GTK_IS_FILE_SYSTEM_MODEL (model)' failed


Version-Release number of selected component (if applicable):
rubygem-gtk2-1.2.4-1.fc18.i686

How reproducible:
Always

Steps to Reproduce:
1. Use Gtk:FileChooserButton with Gtk::FileChooser::ACTION_SELECT_FOLDER action in a ruby/gtk2 app
2. Run the app
3. Try to select a folder from the drop-down list
4. Try to check the folder was actually selected
  
Actual results:
#filename is nil, #current_dir as well, file-set signal is not emitted.

Expected results:
#filename is set to the selected directory, #current_dir to its parent, file-set signal is emitted.

Additional info:
I haven't tried yet the same with pure C app, I might get some spare time to try it tomorrow. Ruby sample test case is attached, run with 
$ ruby ./test.rb
(I didn't add shebang)

Comment 1 Martin Sourada 2013-04-04 23:58:09 UTC
Created attachment 731783 [details]
Sample test case in C

So I've just made a C test case and it seems the bug's in gtk2. Build this test case with
$ gcc `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0` -o test test.c

It's notable that when the same source is compiled against gtk3 it works as expected (only the file-set signal isn't emitted when changing the directory via the drop-down list).

Comment 2 Martin Sourada 2013-04-05 00:04:59 UTC
(In reply to comment #1)
> Created attachment 731783 [details]
> Sample test case in C
> 
> So I've just made a C test case and it seems the bug's in gtk2. Build this
> test case with
> $ gcc `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0` -o test
> test.c
> 
> It's notable that when the same source is compiled against gtk3 it works as
> expected (only the file-set signal isn't emitted when changing the directory
> via the drop-down list).

Reassigning to gtk2 WRT above.

gtk2-2.24.16-1.fc18.i686
gtk3-3.6.4-1.fc18.i686

Comment 3 Kalev Lember 2013-05-26 00:05:06 UTC
Should be fixed in gtk2 2.24.18. Can you give it a try, please?

Comment 4 Fedora Update System 2013-05-26 00:08:17 UTC
gtk2-2.24.18-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/gtk2-2.24.18-1.fc18

Comment 5 Fedora Update System 2013-05-27 00:33:00 UTC
Package gtk2-2.24.18-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gtk2-2.24.18-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-9336/gtk2-2.24.18-1.fc18
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-05-28 01:03:40 UTC
gtk2-2.24.18-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.