Using org.gtk.MountOperationHandler



I would expect the following program to cause gnome-shell to prompt for 
a password:

#include <gtk/gtk.h>
#include <assert.h>
#include <string.h>

int main(void)
{
        GMountOperation *mount_op;
        GAskPasswordFlags flags;
        char *message;

        mount_op = gtk_mount_operation_new(NULL);
        flags = G_ASK_PASSWORD_NEED_PASSWORD | G_ASK_PASSWORD_SAVING_SUPPORTED;
        message = g_strdup("Enter password");

        g_signal_emit_by_name(mount_op, "ask-password", message, "test", "test", flags);

        g_free(message);
}

It does not. (In the full code I register a callback to capture the 
password.)

There is a conditional in GTK/gtkmountoperation.c's handler of 
"ask-password" that chooses between a direct GTK dialog box and a proxy 
that passes the request along using dbus. If I wrap this code in the 
necessary GTK boilerplate and adjust the flags to force GTK, then I get 
a password prompt. But I do not get a password prompt if execution 
follows the proxy path.

I am using gnome-shell-3.34.2 that happens to be running on Fedora 31. 
My GNOME shell seems to provide the org.freedesktop.DBus.ListNames 
service:

$ dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus 
org.freedesktop.DBus.ListNames | grep Mount
      [...]
      string "org.gtk.MountOperationHandler"

Does anyone know what might be wrong?

The reason for my question is that I am trying to fix a bug in 
Rhythmbox's DAAP plugin.

--
Mike

:wq


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]