Re: Wrapped GdkWindow* resize issues



I found some info at https://developer.gnome.org/gdk2/2.24/ and subpages. Don't know if it's relevant.

#define gdk_window_get_size            gdk_drawable_get_size

From the description of gdk_drawable_get_size():

On the X11 platform, if drawable is a GdkWindow, the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server.

From the description of gdk_window_get_geometry():

On the X11 platform, the geometry is obtained from the X server, so reflects the latest position of window; this may be out-of-sync with the position of window delivered in the most-recently-processed GdkEventConfigure. gdk_window_get_position() in contrast gets the position from the most recent configure event.

Kjell

2014-03-10 03:14, Carl Nygard skrev:

      // Spit out window dimensions whenever we get an event.
      for(;;) {
            XEvent e;
            Window root;
            int x, y, xret, yret;
            unsigned int widthret,heightret,borderwidthret,depthret;

            XNextEvent(dpy, &e);
            XGetGeometry(dpy, w,
                         &root, &xret, &yret,
                         &widthret, &heightret, &borderwidthret, &depthret);
            printf("Window dims: (%d, %d) pos: (%d, %d)\n",
                   widthret, heightret, xret, yret);
            // Re-initializing gdk_win doesn't even help
            gdk_win = gdk_window_foreign_new((guint32)w);
            gdk_window_get_size(gdk_win, &x, &y);
            printf("GdkWindow dims: (%d, %d)\n", x, y);
      }

      // Wait for 10 seconds
      sleep(10);
}



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