Re: Window gravity bug?



A Ter, 2003-08-19 ās 16:05, Havoc Pennington escreveu:
> On Tue, Aug 19, 2003 at 03:33:21PM +0100, Gustavo J A M Carneiro wrote: 
> >   Just did a quick test, changing GTK_WINDOW_POPUP to
> > GTK_WINDOW_TOPLEVEL, and the result is the same :(
> 
> Try test-gravity from the metacity source tree, it will let you test 
> without GTK being involved, and if you look at its source code you'll
> see how things are supposed to work. Maybe you can debug from there.

> Also there's the "window sizing" test in testgtk.
> 
> 
  So, here's what I concluded from these 2 tests:
	1- Gtk sets the gravity hint correctly (it appears with xprop on the
windows);
	2- Metacity honors the gravity correctly when the window resizes itself
(no user intervention);
	3- But, the coordinate system is all screwed up for gravities !=
NorthWest.  To assert this, try with the "window sizing" test to create
a window with East gravity and then try moving it to the X coordinate
equal to the screen width.  Then, the window goes partially outside the
screen.

  The metacity test seems to be ok, both regarding window resizing and
coordinates.  So, I'm blaming this on Gtk. ;)

  Looking at the gtk+ test program:

-----------(....)--------
  gtk_window_get_size (GTK_WINDOW (window), &w, &h);

  switch (gtk_window_get_gravity (window))
    {
    case GDK_GRAVITY_SOUTH_EAST:
      *x = gdk_screen_get_width (screen) - w;
      *y = gdk_screen_get_height (screen) - h;
      break;
-----------(....)--------

We can see from this extract that the gtk test is working around the
coordinate bug.  It should be:

    case GDK_GRAVITY_SOUTH_EAST:
      *x = gdk_screen_get_width (screen);
      *y = gdk_screen_get_height (screen);



-- 
Gustavo J. A. M. Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>




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