# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1324556452 0 # Node ID 559f434dcfbd06ed17e5f78e81c6d2ac4aa168a8 # Parent 1d414e81a099eff044bb963e17a922b82810de80 FIXME: Similar fix for GTK2 of the GTK3 fix for gdk_window_get_frame_extents() returning a bogus 200x200 result... Seems to be an issue with mutter the Gnome 3 window manager. Hopefully I can find a better way to workaround this issue. diff -r 1d414e81a099 -r 559f434dcfbd gtk/dw.c --- a/gtk/dw.c Thu Dec 22 12:09:43 2011 +0000 +++ b/gtk/dw.c Thu Dec 22 12:20:52 2011 +0000 @@ -10384,6 +10384,8 @@ #if GTK_MAJOR_VERSION > 1 int horz = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(handle), "_dw_grav_horz")); int vert = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(handle), "_dw_grav_vert")); + int cx = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(handle), "_dw_frame_width")); + int cy = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(handle), "_dw_frame_height")); int newx = x, newy = y, width = 0, height = 0; /* If the window is mapped */ @@ -10393,9 +10395,22 @@ if(horz || vert) { GdkRectangle frame; + int count = 0; /* Get the frame size */ gdk_window_get_frame_extents(handle->window, &frame); + + /* FIXME: Sometimes we get returned an invalid 200x200 + * result... so if we get this... try the call a second + * time and hope for a better result. + */ + while((frame.width == 200 || frame.width == (200 + cx)) && + (frame.height == 200 || frame.height == (200 + cy)) && count < 10) + { + dw_main_sleep(1); + count++; + gdk_window_get_frame_extents(handle->window, &frame); + } width = frame.width; height = frame.height; } @@ -10405,8 +10420,7 @@ int cx , cy; /* Check if we have cached frame size values */ - if(!((cx = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(handle), "_dw_frame_width"))) | - (cy = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(handle), "_dw_frame_height"))))) + if(!(cx | cy)) { /* If not try to ask the window manager for the estimated size... * and finally if all else fails, guess.