problem in gtk_widget_set_uposition



Hi,

I found a problem in gtk_widget_set_uposition. It doesn't allow
to set negative values for x/y. Here is the code:

 if (x > -2)
    aux_info->x = x;
  if (y > -2)
    aux_info->y = y;

  if (GTK_WIDGET_REALIZED (widget) && GTK_IS_WINDOW (widget) &&
      (aux_info->x != -1) && (aux_info->y != -1))
    {
      gdk_window_set_hints (widget->window, aux_info->x, aux_info->y, 0,
0, 0, 0, GDK_HINT_POS);
      gdk_window_move (widget->window, aux_info->x, aux_info->y);
    }

This means that a window can't be moved beyond 
the upper left corner, although it can beyond the others. 
This can be tried by the shaped windows test.

The real problem lies in the api: A value of -1 for x/y means
"don't change". If a window needs to be moved to, say, -1/-1,
there is a semantic clash. 

I think this api is broken and should be changed. In a function
where negative values must be valid, -1 can't be magic value.
Maybe there could be functions to set x and y separately.

bye
Stefan



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