diff --git a/contrib/gtkgensurf/view.cpp b/contrib/gtkgensurf/view.cpp index ba0c43d5..8d8460a4 100644 --- a/contrib/gtkgensurf/view.cpp +++ b/contrib/gtkgensurf/view.cpp @@ -308,7 +308,7 @@ static void motion( GtkWidget *widget, GdkEventMotion *event, gpointer data ){ if ( PtInRect( &rcGrid,pt ) ) { GdkCursor *cursor = gdk_cursor_new( GDK_CROSS ); - gdk_window_set_cursor( g_pWndPreview->window, cursor ); + gdk_window_set_cursor( gtk_widget_get_window( g_pWndPreview ), cursor ); gdk_cursor_unref( cursor ); char Text[32]; @@ -334,7 +334,7 @@ static void motion( GtkWidget *widget, GdkEventMotion *event, gpointer data ){ } else { - gdk_window_set_cursor( g_pWndPreview->window, NULL ); + gdk_window_set_cursor( gtk_widget_get_window( g_pWndPreview ), NULL ); } g_UIGtkTable.m_pfn_glwidget_swap_buffers( g_pPreviewWidget ); diff --git a/contrib/meshtex/GenericDialog.cpp b/contrib/meshtex/GenericDialog.cpp index b70f9823..ce62b2b9 100644 --- a/contrib/meshtex/GenericDialog.cpp +++ b/contrib/meshtex/GenericDialog.cpp @@ -100,7 +100,7 @@ GenericDialog::Raise() // Don't bother if not visible. if (gtk_widget_get_visible(_dialog)) { - gdk_window_raise(_dialog->window); + gdk_window_raise(gtk_widget_get_window( _dialog )); } } @@ -142,7 +142,7 @@ GenericDialog::Hide() { return; } - gdk_window_raise(_window->window); + gdk_window_raise(gtk_widget_get_window(_window)); } /** diff --git a/libs/gtkutil/cursor.cpp b/libs/gtkutil/cursor.cpp index ae19afe0..87a0e615 100644 --- a/libs/gtkutil/cursor.cpp +++ b/libs/gtkutil/cursor.cpp @@ -46,12 +46,12 @@ GdkCursor* create_blank_cursor(){ void blank_cursor( GtkWidget* widget ){ GdkCursor* cursor = create_blank_cursor(); - gdk_window_set_cursor( widget->window, cursor ); + gdk_window_set_cursor( gtk_widget_get_window( widget ), cursor ); gdk_cursor_unref( cursor ); } void default_cursor( GtkWidget* widget ){ - gdk_window_set_cursor( widget->window, 0 ); + gdk_window_set_cursor( gtk_widget_get_window( widget ), 0 ); } #endif diff --git a/libs/gtkutil/cursor.h b/libs/gtkutil/cursor.h index 8677f8c5..2ddfb658 100644 --- a/libs/gtkutil/cursor.h +++ b/libs/gtkutil/cursor.h @@ -182,8 +182,8 @@ void freeze_pointer( GtkWindow* window, GtkWidget* widget, MotionDeltaFunction f //GdkGrabStatus status = /* fixes cursor runaways during srsly quick drags in camera drags with pressed buttons have no problem at all w/o this */ - gdk_pointer_grab( GTK_WIDGET( window )->window, TRUE, mask, 0, cursor, GDK_CURRENT_TIME ); - //gdk_window_set_cursor ( GTK_WIDGET( window )->window, cursor ); + gdk_pointer_grab( gtk_widget_get_window( GTK_WIDGET( window ) ), TRUE, mask, 0, cursor, GDK_CURRENT_TIME ); + //gdk_window_set_cursor ( gtk_widget_get_window( GTK_WIDGET( window ) ), cursor ); /* is needed to fix activating neighbor widgets, that happens, if using upper one */ gtk_grab_add( widget ); @@ -192,7 +192,7 @@ void freeze_pointer( GtkWindow* window, GtkWidget* widget, MotionDeltaFunction f Sys_GetCursorPos( window, &recorded_x, &recorded_y ); /* using center for tracking for max safety */ - gdk_window_get_origin( widget->window, ¢er_x, ¢er_y ); + 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; @@ -224,7 +224,7 @@ void unfreeze_pointer( bool centerize ){ else{ Sys_SetCursorPos( m_window, recorded_x, recorded_y ); } -// gdk_window_set_cursor( GTK_WIDGET( m_window )->window, 0 ); +// gdk_window_set_cursor( gtk_widget_get_window( GTK_WIDGET( m_window ) ), 0 ); gdk_pointer_ungrab( GDK_CURRENT_TIME ); gtk_grab_remove( m_widget ); diff --git a/libs/gtkutil/window.cpp b/libs/gtkutil/window.cpp index aae9d2c6..cf491b29 100644 --- a/libs/gtkutil/window.cpp +++ b/libs/gtkutil/window.cpp @@ -123,7 +123,7 @@ void destroy_floating_window( GtkWindow* window ){ } gint window_realize_remove_sysmenu( GtkWidget* widget, gpointer data ){ - gdk_window_set_decorations( widget->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU ) ); + gdk_window_set_decorations( gtk_widget_get_window( widget ), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU ) ); return FALSE; } @@ -150,7 +150,7 @@ GtkWindow* create_persistent_floating_window( const char* title, GtkWindow* main } gint window_realize_remove_minmax( GtkWidget* widget, gpointer data ){ - gdk_window_set_decorations( widget->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) ); + gdk_window_set_decorations( gtk_widget_get_window( widget ), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) ); return FALSE; } diff --git a/radiant/clippertool.cpp b/radiant/clippertool.cpp index 99c0a2a6..f11ec677 100644 --- a/radiant/clippertool.cpp +++ b/radiant/clippertool.cpp @@ -98,11 +98,11 @@ void Clipper_modeChanged( bool isClipper ){ if( g_pParentWnd ){ g_pParentWnd->forEachXYWnd( [&cursor]( XYWnd* xywnd ){ - gdk_window_set_cursor( xywnd->GetWidget()->window, cursor ); + gdk_window_set_cursor( gtk_widget_get_window( xywnd->GetWidget() ), cursor ); } ); if( g_pParentWnd->GetCamWnd() ) if( !isClipper || gdk_pointer_is_grabbed() == FALSE ) /* prevent cursor change `GDK_BLANK_CURSOR->g_clipper_cursor` during freelook */ - gdk_window_set_cursor( CamWnd_getWidget( *g_pParentWnd->GetCamWnd() )->window, cursor ); + gdk_window_set_cursor( gtk_widget_get_window( CamWnd_getWidget( *g_pParentWnd->GetCamWnd() ) ), cursor ); } if( g_clipper_resetFlip ) diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 32ca8761..65908df6 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -1091,7 +1091,7 @@ void DoShaderView( const char *shaderFileName, const char *shaderName, bool exte else if( external_editor && pathIsDir ){ if( g_TextEditor_editorCommand.empty() ){ #ifdef WIN32 - ShellExecute( (HWND)GDK_WINDOW_HWND( GTK_WIDGET( MainFrame_getWindow() )->window ), 0, pathFull.c_str(), 0, 0, SW_SHOWNORMAL ); + ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( GTK_WIDGET( MainFrame_getWindow() ) ) ), 0, pathFull.c_str(), 0, 0, SW_SHOWNORMAL ); #else globalWarningStream() << "Failed to open '" << pathFull.c_str() << "'\nSet Shader Editor Command in preferences\n"; #endif diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 9d975e5f..d394e378 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -1833,7 +1833,7 @@ void EverySecondTimer_disable(){ } gint window_realize_remove_decoration( GtkWidget* widget, gpointer data ){ - gdk_window_set_decorations( widget->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) ); + gdk_window_set_decorations( gtk_widget_get_window( widget ), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) ); return FALSE; } @@ -2832,9 +2832,9 @@ void MainFrame::SetActiveXY( XYWnd* p ){ void MainFrame_toggleFullscreen(){ GtkWindow* wnd = MainFrame_getWindow(); - if( gdk_window_get_state( GTK_WIDGET( wnd )->window ) & GDK_WINDOW_STATE_FULLSCREEN ){ + if( gdk_window_get_state( gtk_widget_get_window( GTK_WIDGET( wnd ) ) ) & GDK_WINDOW_STATE_FULLSCREEN ){ //some portion of buttsex, because gtk_window_unfullscreen doesn't work correctly after calling some modal window - bool maximized = ( gdk_window_get_state( GTK_WIDGET( wnd )->window ) & GDK_WINDOW_STATE_MAXIMIZED ); + bool maximized = ( gdk_window_get_state( gtk_widget_get_window( GTK_WIDGET( wnd ) ) ) & GDK_WINDOW_STATE_MAXIMIZED ); gtk_window_unfullscreen( wnd ); if( maximized ){ gtk_window_unmaximize( wnd ); @@ -2881,9 +2881,9 @@ private: m_hSplitPos = gtk_paned_get_position( GTK_PANED( g_pParentWnd->m_hSplit ) ); int vSplitX, vSplitY, vSplit2X, vSplit2Y, hSplitX, hSplitY; - gdk_window_get_origin( g_pParentWnd->m_vSplit->window, &vSplitX, &vSplitY ); - gdk_window_get_origin( g_pParentWnd->m_vSplit2->window, &vSplit2X, &vSplit2Y ); - gdk_window_get_origin( g_pParentWnd->m_hSplit->window, &hSplitX, &hSplitY ); + gdk_window_get_origin( gtk_widget_get_window( g_pParentWnd->m_vSplit ), &vSplitX, &vSplitY ); + gdk_window_get_origin( gtk_widget_get_window( g_pParentWnd->m_vSplit2 ), &vSplit2X, &vSplit2Y ); + gdk_window_get_origin( gtk_widget_get_window( g_pParentWnd->m_hSplit ), &hSplitX, &hSplitY ); vSplitY += m_vSplitPos; vSplit2Y += m_vSplit2Pos; @@ -3357,7 +3357,7 @@ void MainFrame::Create(){ void MainFrame::SaveWindowInfo(){ //restore good state first - if( gdk_window_get_state( GTK_WIDGET( m_window )->window ) & GDK_WINDOW_STATE_ICONIFIED ){ + if( gdk_window_get_state( gtk_widget_get_window( GTK_WIDGET( m_window ) ) ) & GDK_WINDOW_STATE_ICONIFIED ){ gtk_window_deiconify( m_window ); } if( g_maximizeview.isMaximized() ){ @@ -3378,11 +3378,11 @@ void MainFrame::SaveWindowInfo(){ g_layout_globals.nCamHeight = gtk_paned_get_position( GTK_PANED( m_vSplit2 ) ); } - if( gdk_window_get_state( GTK_WIDGET( m_window )->window ) == 0 ){ + if( gdk_window_get_state( gtk_widget_get_window( GTK_WIDGET( m_window ) ) ) == 0 ){ g_layout_globals.m_position = m_position_tracker.getPosition(); } - g_layout_globals.nState = gdk_window_get_state( GTK_WIDGET( m_window )->window ); + g_layout_globals.nState = gdk_window_get_state( gtk_widget_get_window( GTK_WIDGET( m_window ) ) ); } void MainFrame::Shutdown(){ diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index 8831d2cc..71c18ecc 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -356,14 +356,14 @@ bool g_bWaitCursor = false; void Sys_BeginWait( void ){ ScreenUpdates_Disable( "Processing...", "Please Wait" ); GdkCursor *cursor = gdk_cursor_new( GDK_WATCH ); - gdk_window_set_cursor( GTK_WIDGET( MainFrame_getWindow() )->window, cursor ); + gdk_window_set_cursor( gtk_widget_get_window( GTK_WIDGET( MainFrame_getWindow() ) ), cursor ); gdk_cursor_unref( cursor ); g_bWaitCursor = true; } void Sys_EndWait( void ){ ScreenUpdates_Enable(); - gdk_window_set_cursor( GTK_WIDGET( MainFrame_getWindow() )->window, 0 ); + gdk_window_set_cursor( gtk_widget_get_window( GTK_WIDGET( MainFrame_getWindow() ) ), 0 ); g_bWaitCursor = false; } diff --git a/radiant/url.cpp b/radiant/url.cpp index aecfa1ac..60535d85 100644 --- a/radiant/url.cpp +++ b/radiant/url.cpp @@ -28,7 +28,7 @@ #include #include bool open_url( const char* url ){ - return ShellExecute( (HWND)GDK_WINDOW_HWND( GTK_WIDGET( MainFrame_getWindow() )->window ), "open", url, 0, 0, SW_SHOW ) > (HINSTANCE)32; + return ShellExecute( (HWND)GDK_WINDOW_HWND( gtk_widget_get_window( GTK_WIDGET( MainFrame_getWindow() ) ) ), "open", url, 0, 0, SW_SHOW ) > (HINSTANCE)32; } #endif