]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge commit '020d0244e4239b21dc804d630edff926386ea34f' into master-merge
authorThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 02:21:38 +0000 (04:21 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 21 Jun 2022 02:21:38 +0000 (04:21 +0200)
1  2 
libs/gtkutil/cursor.cpp
libs/gtkutil/cursor.h
radiant/camwindow.cpp
radiant/mainframe.cpp
radiant/texwindow.cpp
radiant/xywindow.cpp
radiant/xywindow.h
tools/quake3/common/vfs.c
tools/quake3/common/vfs.h
tools/quake3/q3map2/main.c

index b2e1e53e95de0f3ad9027d31018812fd5afa3b6a,8f38722032b0a292f283598cc5f64afccc9d4076..445fb18361e34bcc230a886a89dd84acaf24b505
@@@ -234,18 -105,12 +234,18 @@@ void FreezePointer::freeze_pointer(ui::
        //gdk_window_set_cursor ( GTK_WIDGET( window )->window, cursor );
        /*      is needed to fix activating neighbour widgets, that happens, if using upper one */
        gtk_grab_add( widget );
-       weedjet = widget;
+       m_weedjet = widget;
 -
 +#else
 +      GdkCursor* cursor = create_blank_cursor();
 +      //GdkGrabStatus status =
 +      gdk_pointer_grab( gtk_widget_get_window( widget ), TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
        gdk_cursor_unref( cursor );
 +#endif
 +#endif
  
 -      Sys_GetCursorPos( window, &recorded_x, &recorded_y );
 +      Sys_GetCursorPos( widget, &recorded_x, &recorded_y );
  
 +#if 0 // NetRadiantCustom
        /*      using center for tracking for max safety        */
        gdk_window_get_origin( GTK_WIDGET( widget )->window, &center_x, &center_y );
        auto allocation = widget.dimensions();
        m_function = function;
        m_data = data;
  
 -      handle_motion = window.connect( "motion_notify_event", G_CALLBACK( motion_delta ), this );
 +      handle_motion = widget.connect( "motion_notify_event", G_CALLBACK( motion_delta ), this );
  }
  
- void FreezePointer::unfreeze_pointer(ui::Widget widget)
 -void FreezePointer::unfreeze_pointer(ui::Window window, bool centerize )
++// Only NetRadiantCustom uses centerize code.
++void FreezePointer::unfreeze_pointer(ui::Widget widget, bool centerize)
  {
 -      g_signal_handler_disconnect( G_OBJECT( window ), handle_motion );
 +      g_signal_handler_disconnect( G_OBJECT( widget ), handle_motion );
  
        m_function = 0;
        m_data = 0;
  
-       Sys_SetCursorPos( window, recorded_x, recorded_y );
 +#if defined(WORKAROUND_MACOS_GTK2_LAGGYPOINTER)
 +      /* The pointer was visible during all the move operation,
 +      so, keep the current position. */
 +#else
 +      // NetRadiantCustom still uses window instead of widget.
 +#if 0 // NetRadiantCustom
+       if ( centerize ){
+               Sys_SetCursorPos( window, center_x, center_y );
+       }
+       else{
+               Sys_SetCursorPos( window, recorded_x, recorded_y );
+       }
 +#else
 +      Sys_SetCursorPos( widget, recorded_x, recorded_y );
 +#endif
 +#endif
  
  //    gdk_window_set_cursor( GTK_WIDGET( window )->window, 0 );
        gdk_pointer_ungrab( GDK_CURRENT_TIME );
-       gtk_grab_remove( weedjet );
 +#if 0 // NetRadiantCustom
+       if ( m_weedjet )
+       {
+               gtk_grab_remove( m_weedjet );
+       }
 +#endif
  }
index f7a66a37d3b193f99e913229f39973a9d2c0da3a,89c6f72b4703911b3a2d9cb1954cc5f02a0d8808..0a19fab14dda0a158389f15351b831fde47d2c06
@@@ -22,7 -22,6 +22,8 @@@
  #if !defined( INCLUDED_GTKUTIL_CURSOR_H )
  #define INCLUDED_GTKUTIL_CURSOR_H
  
++// This is probably removable if set_cursor is not used.
 +#include <gdk/gdk.h>
  #include <uilib/uilib.h>
  
  #include "debugging/debugging.h"
@@@ -118,17 -117,11 +119,17 @@@ void* m_data
  public:
  FreezePointer() : handle_motion( 0 ), m_function( 0 ), m_data( 0 ){
  }
 -static gboolean motion_delta( ui::Window widget, GdkEventMotion *event, FreezePointer* self );
 +/* NetRadiantCustom does this instead:
 +static gboolean motion_delta( ui::Window widget, GdkEventMotion *event, FreezePointer* self ); */
 +static gboolean motion_delta( ui::Widget widget, GdkEventMotion *event, FreezePointer* self );
  
 -void freeze_pointer( ui::Window window, ui::Widget widget, MotionDeltaFunction function, void* data );
 +/* NetRadiantCustom does this instead:
 +void freeze_pointer( ui::Window window, ui::Widget widget, MotionDeltaFunction function, void* data ); */
 +void freeze_pointer( ui::Widget widget, MotionDeltaFunction function, void* data );
  
 -void unfreeze_pointer( ui::Window window, bool centerize );
 +/* NetRadiantCustom does this instead:
- void unfreeze_pointer( ui::Window window ); */
- void unfreeze_pointer( ui::Widget widget );
++void unfreeze_pointer( ui::Window window, bool centerize ); */
++void unfreeze_pointer( ui::Widget widget, bool centerize );
  };
  
  #endif
index accdb30ae9dd2a1aef910ede359fecdacf7459b2,e08458ebcfee38a2b344064c49e5e8c9523d913c..9f6beb1a74281a9e6e38b4ac56100945f9ed1733
@@@ -1344,7 -1337,7 +1344,8 @@@ void CamWnd::DisableFreeMove()
        CamWnd_Remove_Handlers_FreeMove( *this );
        CamWnd_Add_Handlers_Move( *this );
  
-       m_freezePointer.unfreeze_pointer( m_gl_widget );
 -      m_freezePointer.unfreeze_pointer( m_parent, true );
++      m_freezePointer.unfreeze_pointer( m_gl_widget, true );
++
        g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_freemove_handle_focusout );
  
        CamWnd_Update( *this );
Simple merge
index 34a31b1efb008b84d9d77aba657a7b3fe955d8a9,240901552b29e914328346df32ef78c75c98486a..7670d20c61b08543aa4a4388c70aeb09bf854808
@@@ -1176,10 -1123,7 +1176,9 @@@ void TextureBrowser_trackingDelta( int 
  
  void TextureBrowser_Tracking_MouseUp( TextureBrowser& textureBrowser ){
        textureBrowser.m_move_started = false;
 -      textureBrowser.m_freezePointer.unfreeze_pointer( textureBrowser.m_parent, false );
 +      /* NetRadiantCustom did this instead:
-       textureBrowser.m_freezePointer.unfreeze_pointer( textureBrowser.m_gl_widget ); */
-       textureBrowser.m_freezePointer.unfreeze_pointer( textureBrowser.m_gl_widget );
++      textureBrowser.m_freezePointer.unfreeze_pointer( textureBrowser.m_parent, false ); */
++      textureBrowser.m_freezePointer.unfreeze_pointer( textureBrowser.m_gl_widget, false );
  }
  
  void TextureBrowser_Tracking_MouseDown( TextureBrowser& textureBrowser ){
index db3802bd90e5d2b97fb983b5d7ba727ccbd0740b,1a176bfd242bf86bce78ab84abe83f48a77e79fd..e2a2d5069a0409b570bef23c484e0c034903eacc
@@@ -1236,7 -1245,7 +1252,9 @@@ void XYWnd::Move_Begin()
  
  void XYWnd::Move_End(){
        m_move_started = false;
-       g_xywnd_freezePointer.unfreeze_pointer( m_gl_widget );
 -      g_xywnd_freezePointer.unfreeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), false );
++      /* NetRadiant did this instead:
++      g_xywnd_freezePointer.unfreeze_pointer( m_parent ? m_parent : MainFrame_getWindow(), false ); */
++      g_xywnd_freezePointer.unfreeze_pointer( m_gl_widget, false );
        g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_move_focusOut );
  }
  
@@@ -2187,13 -2193,11 +2212,13 @@@ void XYWnd::updateProjection( bool reco
  
        m_projection[15] = 1.0f;
  
-               m_view.Construct( m_projection, m_modelview, m_nWidth, m_nHeight );
-       }
 +      if (reconstruct) {
+       m_view.Construct( m_projection, m_modelview, m_nWidth, m_nHeight );
+ }
 +}
  
  // note: modelview matrix must have a uniform scale, otherwise strange things happen when rendering the rotation manipulator.
 -void XYWnd::updateModelview(){
 +void XYWnd::updateModelview( bool reconstruct ){
        int nDim1 = ( m_viewType == YZ ) ? 1 : 0;
        int nDim2 = ( m_viewType == XY ) ? 1 : 2;
  
        m_modelview[3] = m_modelview[7] = m_modelview[11] = 0;
        m_modelview[15] = 1;
  
-               m_view.Construct( m_projection, m_modelview, m_nWidth, m_nHeight );
 +      if (reconstruct) {
+       m_view.Construct( m_projection, m_modelview, m_nWidth, m_nHeight );
 +      }
  }
  
  /*
Simple merge
Simple merge
Simple merge
Simple merge