//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, ¢er_x, ¢er_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
}
#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"
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
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 );
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 ){
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 );
}
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 );
+ }
}
/*