From d350386bc21e9f95759e4f041d197fa7c5f5453c Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Tue, 21 Jun 2022 02:23:21 +0200 Subject: [PATCH] Add some notes about NetRadiantCustom alternative code --- libs/gtkutil/cursor.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/libs/gtkutil/cursor.cpp b/libs/gtkutil/cursor.cpp index a58c6cf0..46f227fc 100644 --- a/libs/gtkutil/cursor.cpp +++ b/libs/gtkutil/cursor.cpp @@ -29,6 +29,27 @@ // Note: NetRadiantCustom disables them but we still make use of them. #if 1 +/* Note: here is an alternative implementation, +it may be useful to try it on platforms were + gdk_cursor_new(GDK_BLANK_CURSOR) +does not work: + +GdkCursor* create_blank_cursor(){ + GdkPixmap *pixmap; + GdkBitmap *mask; + char buffer [( 32 * 32 ) / 8]; + memset( buffer, 0, ( 32 * 32 ) / 8 ); + GdkColor white = {0, 0xffff, 0xffff, 0xffff}; + GdkColor black = {0, 0x0000, 0x0000, 0x0000}; + pixmap = gdk_bitmap_create_from_data( 0, buffer, 32, 32 ); + mask = gdk_bitmap_create_from_data( 0, buffer, 32, 32 ); + GdkCursor *cursor = gdk_cursor_new_from_pixmap( pixmap, mask, &white, &black, 1, 1 ); + gdk_drawable_unref( pixmap ); + gdk_drawable_unref( mask ); + + return cursor; +} +*/ GdkCursor* create_blank_cursor(){ return gdk_cursor_new(GDK_BLANK_CURSOR); } @@ -152,6 +173,7 @@ gboolean FreezePointer::motion_delta(ui::Widget widget, GdkEventMotion *event, F return FALSE; } +// Note: NetRadiantCustom pass both parent and widget. void FreezePointer::freeze_pointer(ui::Widget widget, FreezePointer::MotionDeltaFunction function, void *data) { /* FIXME: This bug can happen if the pointer goes outside of the -- 2.39.2