Exemplo n.º 1
0
static gboolean
nova_center_preview_events (GtkWidget  *widget,
                            GdkEvent   *event,
                            NovaCenter *center)
{
  switch (event->type)
    {
    case GDK_MOTION_NOTIFY:
      {
        GdkEventMotion *mevent = (GdkEventMotion *) event;

        if (mevent->state & GDK_BUTTON1_MASK)
          {
            nova_center_update (widget, center, mevent->x, mevent->y);
            gdk_event_request_motions (mevent);

            return TRUE;
          }
      }
      break;

    case GDK_BUTTON_PRESS:
      {
        GdkEventButton *bevent = (GdkEventButton *) event;

        if (bevent->button == 1)
          {
            nova_center_update (widget, center, bevent->x, bevent->y);

            return TRUE;
          }
      }
      break;

    default:
      break;
    }

  return FALSE;
}
Exemplo n.º 2
0
static gboolean
nova_center_preview_events (GtkWidget  *widget,
                            GdkEvent   *event,
                            NovaCenter *center)
{
  switch (event->type)
    {
    case GDK_MOTION_NOTIFY:
      {
        GdkEventMotion *mevent = (GdkEventMotion *) event;

        if (mevent->state & GDK_BUTTON1_MASK)
          {
            GdkModifierType mask;
            gint            x, y;

            gdk_window_get_pointer (widget->window, &x, &y, &mask);

            return nova_center_update (widget, center, x, y);
          }
      }
      break;

    case GDK_BUTTON_PRESS:
      {
        GdkEventButton *bevent = (GdkEventButton *) event;

        if (bevent->button == 1)
          return nova_center_update (widget, center, bevent->x, bevent->y);
      }
      break;

    default:
      break;
    }

  return FALSE;
}