Going nuts with window positioning



Back in November or so, some folks were kind enough to help me get
window position and size remembering to work. Well, size works great,
but positioning is a bit flaky. So I'm hoping someone can help me fix
this for good.

  my ($h, $w) = $win->window->get_size;
  my ($x, $y) = $win->window->get_position;

This is what I'm doing now. The 

  my ($x, $y, $w, $h) = @{$win->allocation};

stuff seemed less reliable than using get_position.

Any way, I've found that if the window fires up and the user moves it,
get_position will return good values and life is good. But if the user
doesn't not move the window at all it return x:4 y:20 (maybe these
numbers are non-zero due to a bug my window manager theme).

So to try to compensate for this problem, I've been trying to synthesize
a "configure" event right before my window exit function is called.
"configure" is the only event that fires when a window is moved
(discovered by connecting the window to the "event" signal and printing
out the type). However, it seems that the equivalent of
gtk_main_do_event is not supported in Gtk-Perl?

Can anyone suggest a method to help me fix this? I will be extremely
thankful.

-- 

Steve Fox
http://k-lug.org



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