After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 745859 - Fails to show AskPassword dialog
Fails to show AskPassword dialog
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-08 22:30 UTC by Ross Lagerwall
Modified: 2015-03-11 23:06 UTC
See Also:
GNOME target: 3.16
GNOME version: ---


Attachments
Register double-click on button release (3.62 KB, patch)
2015-03-09 18:28 UTC, Ross Lagerwall
none Details | Review
Register double-click on button release (3.72 KB, patch)
2015-03-11 07:58 UTC, Ross Lagerwall
none Details | Review
Register double-click on button release (3.58 KB, patch)
2015-03-11 18:29 UTC, Ross Lagerwall
committed Details | Review

Description Ross Lagerwall 2015-03-08 22:30:51 UTC
To reproduce:
Enable gnome-user-share with a password.
Click on "Browse Network" in Nautilus and then double-click on the share (e.g. "ross's public files on ...").

The Gnome shell does not show the password dialog like it is supposed to and the share is not mounted.

The shell outputs:
gnome-session[20151]: Gjs-Message: JS LOG: pushModal: invocation of begin_modal failed

The problem is that sometimes when you double click (especially if you release the mouse slowly), gtk may still be grabbing the pointer when the shell tries to run begin_modal, which fails causing the dialog not to be shown.

I'm not sure what the best solution is here, but clearly the current behavior is not good :-(
Comment 1 Ross Lagerwall 2015-03-08 22:31:27 UTC
Also see bug 737891 where this came up in a slightly different form.
Comment 2 Giovanni Campagna 2015-03-08 22:44:35 UTC
A possibility would be to run the mount on double click release instead of double click press.
Then the gtk grab would be already gone by the time the shell tries to obtain one.
Comment 3 Carlos Garnacho 2015-03-09 06:27:56 UTC
It would be worth checking too what is creating the grab at this time. Surely GTK+ alone won't create an active grab on button press. If nautilus is creating it for selection/DnD purposes, it should be doing it at the right time (GTK+ grabs suffice for the former, and the active grab on the latter should only happen past the threshold)
Comment 4 Giovanni Campagna 2015-03-09 08:09:30 UTC
Could it be the implicit X11 grab?
Comment 5 Carlos Garnacho 2015-03-09 12:27:22 UTC
(In reply to Giovanni Campagna from comment #4)
> Could it be the implicit X11 grab?

No, don't think so... the implicit grab is "passive", X(I)AlreadyGrabbed should only be returned if the grab is actively grabbed elsewhere, this sounds like XIGrabDevice is called somewhere along the way.

Although, trying nautilus on gdb, this seems to be true when clicking on blank areas (starting rubberbanding to be precise), but not when clicking on an item, unless you start dragging it, here's a backtrace of the former:

  • #0 XIGrabDevice
  • #1 gdk_x11_device_xi2_grab
    at gdkdevice-xi2.c line 452
  • #2 gdk_device_grab
    at gdkdevice.c line 1364
  • #3 eel_canvas_item_grab
    at eel-canvas.c line 871
  • #4 button_press_event
    at nautilus-canvas-container.c line 2485
  • #5 button_press_event
    at nautilus-canvas-container.c line 4024
  • #6 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 130
  • #7 _g_closure_invoke_va
  • #8 g_signal_emit_valist
  • #9 g_signal_emit
  • #10 gtk_widget_event_internal
    at gtkwidget.c line 7787
  • #11 propagate_event
    at gtkmain.c line 2422
  • #12 propagate_event
    at gtkmain.c line 2524
  • #13 gtk_main_do_event
    at gtkmain.c line 1756
  • #14 gdk_event_source_dispatch
    at gdkeventsource.c line 364
  • #15 g_main_context_dispatch
  • #16 g_main_context_iterate.isra
  • #17 g_main_context_iteration
  • #18 g_application_run
  • #19 main
    at nautilus-main.c line 103

Comment 6 Carlos Garnacho 2015-03-09 13:21:51 UTC
(In reply to Carlos Garnacho from comment #5)
> (In reply to Giovanni Campagna from comment #4)
> > Could it be the implicit X11 grab?
> 
> No, don't think so... the implicit grab is "passive", X(I)AlreadyGrabbed
> should only be returned if the grab is actively grabbed elsewhere, this
> sounds like XIGrabDevice is called somewhere along the way.

Ok, ditch this. XIAlreadyGrabbed can be returned on the implicit grab if it is currently held by other client. /me gets more coffee
Comment 7 Ross Lagerwall 2015-03-09 18:28:52 UTC
Created attachment 298906 [details] [review]
Register double-click on button release

Only perform the double-click action when the second click is released.
This fixes a strange problem where double-clicking on a
password-protected webdav share (as exported by gnome-user-share) fails
to show the password dialog (which gnome-shell does) due to Nautilus
holding a grab. By only taking action when the click is released,
Nautilus is not holding a grab and the password dialog is shown.

When it fails, the following is shown in the log:
gnome-session[20151]: Gjs-Message: JS LOG: pushModal: invocation of begin_modal failed
Comment 8 Ross Lagerwall 2015-03-09 18:30:05 UTC
Well there's the approach mentioned in comment 2. Not sure if it is the right one but...

To test it with a webdav share exported by gnome-user-share, you may need the patches from bug 629345.
Comment 9 Florian Müllner 2015-03-10 15:14:21 UTC
(In reply to Ross Lagerwall from comment #8)
> Not sure if it is the right one but...

If it is, should we reassign to nautilus? I can't think off-hand of anything we could do on the shell side other than retrying once after a little timeout before giving up ...
Comment 10 Cosimo Cecchi 2015-03-11 01:17:46 UTC
Review of attachment 298906 [details] [review]:

This approach looks fine to me, but I'm concerned that the details->double_clicked state is not cleared correctly on all the code paths.
It should only ever be TRUE during the interval of time between the second button press being registered and the same button being released. Any other event should probably reset the state.
Comment 11 Ross Lagerwall 2015-03-11 07:58:06 UTC
Created attachment 299072 [details] [review]
Register double-click on button release

Only perform the double-click action when the second click is released.
This fixes a strange problem where double-clicking on a
password-protected webdav share (as exported by gnome-user-share) fails
to show the password dialog (which gnome-shell does) due to Nautilus
holding a grab. By only taking action when the click is released,
Nautilus is not holding a grab and the password dialog is shown.

When it fails, the following is shown in the log:
gnome-session[20151]: Gjs-Message: JS LOG: pushModal: invocation of begin_modal failed
Comment 12 Ross Lagerwall 2015-03-11 07:59:48 UTC
(In reply to Cosimo Cecchi from comment #10)
> Review of attachment 298906 [details] [review] [review]:
> 
> This approach looks fine to me, but I'm concerned that the
> details->double_clicked state is not cleared correctly on all the code paths.
> It should only ever be TRUE during the interval of time between the second
> button press being registered and the same button being released. Any other
> event should probably reset the state.

OK, I've updated the patch but I'm not entirely sure of all the code paths etc.
Comment 13 Cosimo Cecchi 2015-03-11 17:15:21 UTC
Review of attachment 299072 [details] [review]:

::: libnautilus-private/nautilus-canvas-container.c
@@ +5466,3 @@
+			}
+		}
+			if (!button_event_modifies_selection (event_button)) {

Either add a comment about falling through here, or return FALSE after this.
Comment 14 Ross Lagerwall 2015-03-11 18:29:23 UTC
Created attachment 299120 [details] [review]
Register double-click on button release

Only perform the double-click action when the second click is released.
This fixes a strange problem where double-clicking on a
password-protected webdav share (as exported by gnome-user-share) fails
to show the password dialog (which gnome-shell does) due to Nautilus
holding a grab. By only taking action when the click is released,
Nautilus is not holding a grab and the password dialog is shown.

When it fails, the following is shown in the log:
gnome-session[20151]: Gjs-Message: JS LOG: pushModal: invocation of begin_modal failed
Comment 15 Cosimo Cecchi 2015-03-11 18:44:10 UTC
Review of attachment 299120 [details] [review]:

Looks good to me.
Comment 16 Ross Lagerwall 2015-03-11 23:06:22 UTC
Pushed to master as 3fe654aad79cdc549950018f2cff9bc87128ee83. Thanks for the reviews.