about summary refs log tree commit diff stats
path: root/src/libtools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-10-09 21:03:41 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-10-09 21:03:41 +0200
commit656a36061ae4c5a007a28a5dc24b366879814806 (patch)
tree5ea055fd4ccb5172e5478939a4e92affca7f4bb1 /src/libtools
parent05384f581feada51b7da638ab83f7ccbbd8193c9 (diff)
downloadbox64-656a36061ae4c5a007a28a5dc24b366879814806.tar.gz
box64-656a36061ae4c5a007a28a5dc24b366879814806.zip
[BOX32] More X11 wrapping fixes
Diffstat (limited to 'src/libtools')
-rw-r--r--src/libtools/my_x11_conv.c25
-rw-r--r--src/libtools/my_x11_conv.h15
2 files changed, 36 insertions, 4 deletions
diff --git a/src/libtools/my_x11_conv.c b/src/libtools/my_x11_conv.c
index 00978504..6b5cd549 100644
--- a/src/libtools/my_x11_conv.c
+++ b/src/libtools/my_x11_conv.c
@@ -459,6 +459,31 @@ void unconvertXEvent(my_XEvent_t* dst, my_XEvent_32_t* src)
     }
 }
 
+void convert_XErrorEvent_to_32(void* d, void* s)
+{
+    my_XErrorEvent_t* src = s;
+    my_XErrorEvent_32_t* dst = d;
+    dst->type = src->type;
+    dst->display = to_ptrv(FindDisplay(src->display));
+    dst->resourceid = to_ulong(src->resourceid);
+    dst->serial = to_ulong(src->serial);
+    dst->error_code = src->error_code;
+    dst->request_code = src->request_code;
+    dst->minor_code = src->minor_code;
+}
+void convert_XErrorEvent_to_64(void* d, void* s)
+{
+    my_XErrorEvent_32_t* src = s;
+    my_XErrorEvent_t* dst = d;
+    dst->minor_code = src->minor_code;
+    dst->request_code = src->request_code;
+    dst->error_code = src->error_code;
+    dst->serial = from_ulong(src->serial);
+    dst->resourceid = from_ulong(src->resourceid);
+    dst->display = getDisplay(from_ptrv(src->display));
+    dst->type = src->type;
+}
+
 #define N_DISPLAY 4
 #define N_SCREENS 16
 my_XDisplay_t* my32_Displays_64[N_DISPLAY] = {0};
diff --git a/src/libtools/my_x11_conv.h b/src/libtools/my_x11_conv.h
index e17073a1..142c0566 100644
--- a/src/libtools/my_x11_conv.h
+++ b/src/libtools/my_x11_conv.h
@@ -9,10 +9,17 @@
 
 void convertXEvent(my_XEvent_32_t* dst, my_XEvent_t* src);
 void unconvertXEvent(my_XEvent_t* dst, my_XEvent_32_t* src);
-void* addDisplay(void* d);  // Adde new Native Display*, return a 32bits one
-void* FindDisplay(void* d); // Find a Native Diplay* and return the 32bits one
-void* getDisplay(void* d); // return the Native Display from a 32bits one
-void delDisplay(void* d); // removed a 32bits Display and associated ressources
+void convert_XErrorEvent_to_32(void* d, void* s);
+void convert_XErrorEvent_to_64(void* d, void* s);
+
+// Add a new Native Display*, return a 32bits one
+void* addDisplay(void* d);
+// Find a Native Diplay* and return the 32bits one
+void* FindDisplay(void* d);
+// return the Native Display from a 32bits one
+void* getDisplay(void* d);
+// removed a 32bits Display and associated ressources
+void delDisplay(void* d);
 
 void convert_Screen_to_32(void* d, void* s);