How to get the post id (of the parent custom custom type) in a loop inside a widget?

Don’t use query_posts. As noted in the Codex:

Not for Secondary Loops You should not use query_posts() to create
secondary listings (for example, a list of related posts at the bottom
of the page, or a list of links in a sidebar widget).

You should use WP_Query instead. E.g.

$args = array(
    'post_type' => 'topic',
    'posts_per_page' => '3',
    'post_parent' => get_the_ID(),
    'gdsr_sort' => 'thumbs',
    'gdsr_ftvmin' => '1',
    'gdsr_order' => 'desc',
    'order' => 'DESC'
);

$query = new WP_Query($args);


if($query->have_posts()) :
    while ( $query->have_posts() ) : $query->the_post();
        // do your stuff
    endwhile;
endif;