Re: [Testcase] Re: 32bit scrolling problems in Gtk+ 1.3.1



"David A. Bartold" <foxx mail utexas edu> writes:

> On 7 Sep 2000, Owen Taylor wrote:
> 
> > Forgive my skeptism, but I don't believe that this is possible.
> > 
> > If you are using a recent version of XFree86 for your X server,
> > gdk_window_gravity_works(), is simply not going to fail.
> > 
> > You are saying that if you apply the appended patch, set the initial
> > window size in your test case program to 1, run your program, and
> > move the slider to the middle, it prints:
> > 
> >  Gravity works: NO
> > 
> > ?
> 
> That's correct.  But I think I see the location of the problem now,
> assuming I am understanding static gravity: the gdk_window_gravity_works
> function is calling gdk_window_move (). That wouldn't be a problem except
> for the fact that gdk_window_move () performs it's work by calling
> gdk_window_move_resize () and that function was making a call to
> XMoveResizeWindow ().  So calling gdk_window_move () is causing behavior
> contrary to what one would expect from a XMoveWindow call.

And, of course, you are using 1.3.1, so you don't have the diff
below.

I guess the moral of the story here is  "in case of difficulties
with 1.3.x, get the latest version from CVS before trying to
debug."

Thanks for your patience in figuring out what is going on here.

                                        Owen


Fri Sep  1 15:34:46 2000  Owen Taylor  <otaylor redhat com>

        * gdk/x11/gdkwindow-x11.c (gdk_window_move): Fix bug where
        moving a toplevel window immediately after sizing it would
        result in it being sized back to the old size since 
        impl->width, impl->height aren't updated until we hear
        back from the server. There is still a (longstanding) bug
        here that gdk_window_get_size() will give the wrong size
        until we do hear back.

$ cvs diff -r 1.94 -r 1.95 gdkwindow-x11.c
Index: gdkwindow-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkwindow-x11.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- gdkwindow-x11.c     2000/07/26 11:32:33     1.94
+++ gdkwindow-x11.c     2000/09/01 20:10:58     1.95
@@ -749,9 +749,19 @@
   g_return_if_fail (GDK_IS_WINDOW (window));
 
   impl = GDK_WINDOW_IMPL_X11 (private->impl);
-  
-  gdk_window_move_resize (window, x, y,
-                         impl->width, impl->height);
+
+  if (!GDK_WINDOW_DESTROYED (window))
+    {
+      if (GDK_WINDOW_TYPE (private) == GDK_WINDOW_CHILD)
+       _gdk_window_move_resize_child (window, x, y,
+                                      impl->width, impl->height);
+      else
+       {
+         XMoveWindow (GDK_WINDOW_XDISPLAY (window),
+                      GDK_WINDOW_XID (window),
+                      x, y);
+       }
+    }
 }
 
 void
@@ -814,6 +824,7 @@
          XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
                             GDK_WINDOW_XID (window),
                             x, y, width, height);
+         private->resize_count += 1;
        }
     }
 }
 




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