Calling libnotify functions from GTK



Hi,
I wrote a small GTK+ app. where I have a GtkEntry box & a button. When
I type something in the text box and click the button, I call notify_notification_show() and it works fine. 
Then I added code to regiester with X server to give a KEYPRESS event on a hotkey press (XGrabKey). I added 
gdk_window_add_filter to check for the KEYPRESS event by X.

When I the message, I get the current clipboard selection (PRIMARY), set it to
the text box and send a button click signal using g_signal_emit_by_name(), which shows the current the
selection as notification. This too works perfectly fine.

The problem is when I select the text in my own GtkEntry box and press the
hotkey combo, the whole system hangs for about 5 secs and then I see
the notification. And the return value of notify_notification_show() is
FALSE with error message: "Did
not receive a reply. Possible causes include: the remote application
did not send a reply, the message bus security policy blocked the
reply, the reply timeout expired, or the network connection was broken." When I comment the code 
notify_notification_show() inside the button click() then it doesn't hang.

Question
is, when the same button_click() function is called in both the above cases, in former, when I press the 
keycombo selecting some text in any x, y, z, etc. window, latter is my own Gtk App and GtkEntry; why does the 
later hang? Please throw somw light on this.

Thanks
Regards,
Sundar



      


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