[gtk+/gtk-3-4] gtk: Fix warnings for some uses of GtkLinkButton
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-4] gtk: Fix warnings for some uses of GtkLinkButton
- Date: Fri, 11 May 2012 22:12:08 +0000 (UTC)
commit c2d436bafbbe8447e6eb4598b360abfc7a7f1e89
Author: Bastien Nocera <hadess hadess net>
Date: Thu May 10 15:15:43 2012 +0100
gtk: Fix warnings for some uses of GtkLinkButton
Not setting a URI but catching the activate-link signal is a
valid use of GtkLinkButton, but we shouldn't allow showing a
popup menu which offers to copy the URI if there's none.
gtk/gtklinkbutton.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c
index 15a52f6..b5981c7 100644
--- a/gtk/gtklinkbutton.c
+++ b/gtk/gtklinkbutton.c
@@ -526,7 +526,10 @@ gtk_link_button_button_press (GtkWidget *widget,
if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
- if (gdk_event_triggers_context_menu ((GdkEvent *) event))
+ /* Don't popup the menu if there's no URI set,
+ * otherwise the menu item will trigger a warning */
+ if (gdk_event_triggers_context_menu ((GdkEvent *) event) &&
+ GTK_LINK_BUTTON (widget)->priv->uri != NULL)
{
gtk_link_button_do_popup (GTK_LINK_BUTTON (widget), event);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]