[Bug 56070] Can't click button after setting it sensitive.

gtk+ (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Sat Jan 12 12:23:49 UTC 2008


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=56070

  gtk+ | gtk | Ver: 2.12.x




------- Comment #127 from Mathias Hasselmann (IRC: tbf)  2008-01-12 12:23 UTC -------
Johan: IMHO this bug is open still for social, but not for technical reasons -
since there is a simple solution for the original problem. I am using it for
years now:

==== photobuch-com.h ===

#define gtk_widget_set_sensitive gtk_widget_set_sensitive_if_changed

==== photobuch-com.c ===

#undef gtk_widget_set_sensitive

static void
adjust_hover_state (GtkWidget *widget)
{
  /* GNOME-Bug 56070: Simulate MOUSE-ENTER effect when needed */

  if (GTK_IS_BUTTON (widget) && GTK_WIDGET_IS_SENSITIVE (widget)) 
    {
      gint x, y;

      gtk_widget_get_pointer (widget, &x, &y);

      GTK_BUTTON (widget)->in_button =
        x >= 0 && x < widget->allocation.width &&
        y >= 0 && y < widget->allocation.height;
    }
}

void 
gtk_widget_set_sensitive_if_changed (GtkWidget *widget,
                                     gboolean   sensitive)
{
  g_return_if_fail (GTK_IS_WIDGET (widget));

  if (GTK_WIDGET_IS_SENSITIVE (widget) != sensitive)
    {
      gtk_widget_set_sensitive (widget, sensitive);
      adjust_hover_state (widget);
    }
}

#define gtk_widget_set_sensitive gtk_widget_set_sensitive_if_changed

=======================

This trivial approach for solving the problem was rejected since
gtk_widget_get_pointer() causes an additional X server roundtrip.

So agreed: The patch isn't perfect. It is a hack, but it solves the problem.
Well, and this is were the social aspect of the problem kicks in: Rejecting a
working solution 'cause of its uglyness, without providing a better solution
within years, clearly is a social problem.

It's the social aspect, not the technical one, that qualifies this bug as
BLOCKER - IMHO.


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=56070.



More information about the pkg-gnome-maintainers mailing list