Re: volunteer needed: event return values



i like this improvement (the 1.2 behavior was annoying), so i
will do what i can. so far i:

used gtk-reference to find all signals with return values
grep'd to find all occurrences of those signals in the .c's

here are the signals that i came up with.

GtkContainer::focus
GtkTipsQuery::widget-selected
GtkWidget::event
GtkWidget::button-press-event
GtkWidget::button-release-event
GtkWidget::motion-notify-event
GtkWidget::delete-event
GtkWidget::destroy-event
GtkWidget::expose-event
GtkWidget::key-press-event
GtkWidget::key-release-event
GtkWidget::enter-notify-event
GtkWidget::leave-notify-event
GtkWidget::configure-event
GtkWidget::focus-in-event
GtkWidget::focus-out-event
GtkWidget::map-event
GtkWidget::unmap-event
GtkWidget::property-notify-event
GtkWidget::selection-clear-event
GtkWidget::selection-request-event
GtkWidget::selection-notify-event
GtkWidget::proximity-in-event
GtkWidget::proximity-out-event
GtkWidget::drag-motion
GtkWidget::drag-drop
GtkWidget::client-event
GtkWidget::no-expose-event
GtkWidget::visibility-notify-event

i'm just going thru the .c's in alphabetic order. if anyone wants the
list of "this file contains these non-void-returning signals",
let me know.

a large percentage of the functions are expose_event handlers,
so an explanation of how that signal should work would probably
do a lot of good up front.

for a container, should it return TRUE if it drew a portion of the
expose event, or does it need to make sure that it has redrawn
the entire event->area. eg, this is what i think

static gint
gtk_bin_expose (GtkWidget      *widget,
                GdkEventExpose *event)
{
  GtkBin *bin;
  GdkEventExpose child_event;

  g_return_val_if_fail (widget != NULL, FALSE);
  g_return_val_if_fail (GTK_IS_BIN (widget), FALSE);
  g_return_val_if_fail (event != NULL, FALSE);

  if (GTK_WIDGET_DRAWABLE (widget))
    {
      bin = GTK_BIN (widget);

      child_event = *event;
      if (bin->child && GTK_WIDGET_DRAWABLE (bin->child) &&
          GTK_WIDGET_NO_WINDOW (bin->child) &&
          gtk_widget_intersect (bin->child, &event->area, &child_event.area)) 
-       gtk_widget_event (bin->child, (GdkEvent*) &child_event);
+       return gtk_widget_event (bin->child, (GdkEvent*) &child_event);
    }
  return FALSE;
}

it should be (ie, return TRUE, unless you do nothing), but i am less
certain for gtk_box_expose. anyone have any recommendations, or is my plan ok.

for things like key_press/etc, it seems a lot simpler.

seth

> So, the task is:
> 
>  Go through all the GTK+ widgets
> 
>   - Look for handlers for event signals.
>   - Determine if they are correctly returning TRUE when
>     handling events.
>   - Make up a patch fixing cases which are definitely wrong.
>   - Make a list of dubious cases that can be checked over
>     by people who know the widgets in detail.


> 
> If anybody is interested in doing this, (or doing this for
> some subset of the GTK+ widgets), please follow up here.




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