Пример #1
0
static gboolean
drag_motion_cb (GtkWidget	   *widget,
		GdkDragContext     *context,
		gint                x,
		gint                y,
		guint               time)
{
	PanelToplevel *toplevel;
	PanelWidget   *panel_widget;
	guint          info;

	g_return_val_if_fail (PANEL_IS_TOPLEVEL (widget), FALSE);

	if (!panel_check_dnd_target_data (widget, context, &info, NULL))
		return FALSE;

	toplevel = PANEL_TOPLEVEL (widget);
	panel_widget = panel_toplevel_get_panel_widget (toplevel);

	if (!panel_check_drop_forbidden (panel_widget, context, info, time))
		return FALSE;

	do_highlight (widget, TRUE);

	panel_toplevel_unhide (toplevel);

	return TRUE;
}
Пример #2
0
static gboolean
drag_motion_cb (GtkWidget          *widget,
                GdkDragContext     *context,
                int                 x,
                int                 y,
                guint               time_,
                Drawer             *drawer)
{
    PanelWidget *panel_widget;
    guint        info = 0;

    if (!panel_check_dnd_target_data (widget, context, &info, NULL))
        return FALSE;

    panel_widget = panel_toplevel_get_panel_widget (drawer->toplevel);

    if (!panel_check_drop_forbidden (panel_widget, context, info, time_))
        return FALSE;

    if (drawer->close_timeout_id)
        g_source_remove (drawer->close_timeout_id);

    drawer->close_timeout_id = 0;

    button_widget_set_dnd_highlight (BUTTON_WIDGET (widget), TRUE);

    if (panel_toplevel_get_is_hidden (drawer->toplevel)) {
        panel_toplevel_unhide (drawer->toplevel);
        drawer->opened_for_drag = TRUE;
    }

    return TRUE;
}