GNOME Bugzilla – Bug 72212
View as Other dialog is modal and should not be
Last modified: 2004-12-22 21:47:04 UTC
1) Start Nautilus 2) Right click on any document or folder 3) Select Open with -> Other application 4) Once the dialog is up, try clicking on the original Nautilus window. Note that you can't do anything in the original window. The dialog is modal. Seth says that this is bad. I agree. Josh
Created attachment 8417 [details] [review] Fixes the modal behavior in "Open with ... Other application" dialog
Created attachment 8708 [details] [review] Patch to fix the modal behavior in the "Open with ... Other viewer" dialog
About the first patch: Wrong indentation here: +GnomeVFSMimeApplication *application; The patch breaks the second case (nautilus_mime_has_any_applications_for_file_type returns false). It also gives ownership problems due to the fact that the callback is called later. All callers must be changed to ref the callback data and unref it in the callback handler. The callback function must also handle the fact that stuff it uses may have been destroyed at that point.
Second patch: data_a = a; - data_b = a; + data_b = b Good catch! I'm committing that part. It has the same problems as the first one. There is also a problem with the hashtable part. If there is already a dialog open for the parent yo can't just return. If you don't call the callback you will leak. It also only removes the parent from the hash table in the no components case. Also, i'm not sure the hash table is right at all. Why only let the user have one dialog? they may be for different files/types? Of course, it may be interesting if they are for the same file... Basically, i think both these patches are to risky to target for gnome 2.0. They could destabilize things.
Created attachment 8839 [details] [review] Corrected patch to fix the modal behavior in "Open with ... Other Application" dialog
Thanks for review both patches ... I've attached the corrected first patch, now it takes care of the second case. As far as I saw, the data used by the callback function is created in the callers, and is destroyed by each callback function when is no longer needed. There are some data used in other places that is ref/unref properly inside the callers and the callbacks. I was trying to find out any leaks or potentially problems in this patch, unsuccessfully. Please if anyone finds something wrong and point me what to tweak, that would be great.
This is fixed. The dialog's no longer modal. Closing.
Reopening based on comments from Juan in an email: "I have installed the 2.0.7 version and the problem still happens." Juan, I can't duplicate the bug on 2.0.6, which is why I closed it.
This patch doesn't change the Open With->Other component dialog. Should that be nonmodal too? That is a bit more tricky, because a user might move on to viewing something else with the nautilus window that the dialog is controlling. Also, some of the comments in these functions need to be updated.
This is still not fixed in 2.4.x
Comment on attachment 8839 [details] [review] Corrected patch to fix the modal behavior in "Open with ... Other Application" dialog marking needs-work as per the comments earlier
This dialog is gone in 2.8, so closing.