diff --git a/contrib/gtkgensurf/view.cpp b/contrib/gtkgensurf/view.cpp index e1e94e17..c513db9b 100644 --- a/contrib/gtkgensurf/view.cpp +++ b/contrib/gtkgensurf/view.cpp @@ -101,7 +101,9 @@ void ShowPreview(){ } static void draw_preview(){ - int width = g_pPreviewWidget->allocation.width, height = g_pPreviewWidget->allocation.height; + GtkAllocation allocation; + gtk_widget_get_allocation( g_pPreviewWidget, &allocation ); + int width = allocation.width, height = allocation.height; g_GLTable.m_pfn_qglClearColor( 0, 0, 0, 1 ); g_GLTable.m_pfn_qglViewport( 0, 0, width, height ); @@ -181,7 +183,9 @@ static gint expose( GtkWidget *widget, GdkEventExpose *event, gpointer data ){ } static void button_press( GtkWidget *widget, GdkEventButton *event, gpointer data ){ - Point pt = { (long)event->x, widget->allocation.height - (long)event->y }; + GtkAllocation allocation; + gtk_widget_get_allocation( widget, &allocation ); + Point pt = { (long)event->x, allocation.height - (long)event->y }; bool Selected; double x,y; int i, j, k, ks; @@ -290,7 +294,9 @@ static void button_press( GtkWidget *widget, GdkEventButton *event, gpointer dat } static void motion( GtkWidget *widget, GdkEventMotion *event, gpointer data ){ - Point pt = { (long)event->x, widget->allocation.height - (long)event->y }; + GtkAllocation allocation; + gtk_widget_get_allocation( widget, &allocation ); + Point pt = { (long)event->x, allocation.height - (long)event->y }; if ( !VertexMode ) { return; diff --git a/libs/gtkutil/cursor.h b/libs/gtkutil/cursor.h index 1c70a1d7..5ba9d994 100644 --- a/libs/gtkutil/cursor.h +++ b/libs/gtkutil/cursor.h @@ -193,8 +193,10 @@ void freeze_pointer( GtkWindow* window, GtkWidget* widget, MotionDeltaFunction f /* using center for tracking for max safety */ gdk_window_get_origin( gtk_widget_get_window( widget ), ¢er_x, ¢er_y ); - center_y += widget->allocation.height / 2; - center_x += widget->allocation.width / 2; + GtkAllocation allocation; + gtk_widget_get_allocation( widget, &allocation ); + center_y += allocation.height / 2; + center_x += allocation.width / 2; Sys_SetCursorPos( window, center_x, center_y ); diff --git a/plugins/textool/TexTool.cpp b/plugins/textool/TexTool.cpp index 0aaabe50..c9e60ce8 100644 --- a/plugins/textool/TexTool.cpp +++ b/plugins/textool/TexTool.cpp @@ -588,8 +588,10 @@ static gint expose( GtkWidget *widget, GdkEventExpose *event, gpointer data ){ } if ( g_bTexViewReady ) { - g_2DView.m_rect.bottom = widget->allocation.height; - g_2DView.m_rect.right = widget->allocation.width; + GtkAllocation allocation; + gtk_widget_get_allocation( widget, &allocation ); + g_2DView.m_rect.bottom = allocation.height; + g_2DView.m_rect.right = allocation.width; if ( !g_QglTable.m_pfn_glwidget_make_current( g_pToolWidget ) ) { Sys_Printf( "TexTool: glMakeCurrent failed\n" ); diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 811836ac..a76ef38d 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -1216,7 +1216,9 @@ gboolean disable_freelook_button_release( GtkWidget* widget, GdkEventButton* eve #if 0 gboolean mousecontrol_button_press( GtkWidget* widget, GdkEventButton* event, CamWnd* camwnd ){ if ( event->type == GDK_BUTTON_PRESS && event->button == 3 ) { - Cam_MouseControl( camwnd->getCamera(), event->x, widget->allocation.height - 1 - event->y ); + GtkAllocation allocation; + gtk_widget_get_allocation( widget, &allocation ); + Cam_MouseControl( camwnd->getCamera(), event->x, allocation.height - 1 - event->y ); } return FALSE; } @@ -1266,7 +1268,9 @@ void selection_motion( gdouble x, gdouble y, guint state, void* data ){ } inline WindowVector windowvector_for_widget_centre( GtkWidget* widget ){ - return WindowVector( static_cast( widget->allocation.width / 2 ), static_cast( widget->allocation.height / 2 ) ); + GtkAllocation allocation; + gtk_widget_get_allocation( widget, &allocation ); + return WindowVector( static_cast( allocation.width / 2 ), static_cast( allocation.height / 2 ) ); } gboolean selection_button_press_freemove( GtkWidget* widget, GdkEventButton* event, WindowObserver* observer ){