#1111366 wxhexeditor: hex panel not scrolling when using wayland

Package:
wxhexeditor
Source:
wxhexeditor
Description:
hexadecimal editor for massive files
Submitter:
Adam Chyła
Date:
2025-08-17 12:37:02 UTC
Severity:
normal
Tags:
#1111366#5
Date:
2025-08-17 12:18:40 UTC
From:
To:
Dear maintainer,

after opening a file, the hex panel does not update while moving over the file
content when using a wayland compositor. This makes the app unusable
in this setup.

The workaround is to run the wxHexEditor with x11 backend instead of wayland,
like this:

$ GDK_BACKEND=x11 wxHexEditor

The bug has already been reported (https://github.com/EUA/wxHexEditor/issues/143)
and fixed by the upstream with the git commit
01aa3aa460814a5bac74c14fa2894a4703c8e7b6, available at
https://github.com/EUA/wxHexEditor/commit/01aa3aa460814a5bac74c14fa2894a4703c8e7b6

Here is the patch that fixes the issue and applies cleanly
on the wxhexeditor_0.24+repack-2.debian:

diff -u wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.cpp wxhexeditor-0.24+repack-modified/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.cpp
--- wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.cpp	2025-08-17 07:02:46.000000000 -0400
+++ wxhexeditor-0.24+repack-modified/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.cpp	2025-08-17 07:30:20.704944137 -0400
@@ -72,6 +72,12 @@
  	//Need to create object before Draw operation.
  	ZebraStriping=new int;
  	*ZebraStriping=-1;
+	wxString waylandStr;
+
+	waylander = wxGetEnv( "WAYLAND_DISPLAY", &waylandStr );
+
+	if (waylander)
+		std::cout << "Wayland detected. You could have cosmetic cursor issues." << std::endl;

  	CtrlType=0;

@@ -654,6 +660,9 @@

  #define _Use_Graphics_Contex_x
  void wxHexCtrl::RePaint( void ){
+	if (waylander)
+		return this->Refresh();
+
  	PaintMutex.Lock();
  	wxCaretSuspend cs(this);

@@ -698,6 +707,7 @@

  void wxHexCtrl::OnPaint( wxPaintEvent &WXUNUSED(event) ){
  	PaintMutex.Lock();
+	wxCaretSuspend cs(this);
  	wxDC* dcTemp = UpdateDC(); // Prepare DC
  	if( dcTemp != NULL )
  		{
diff -u wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.h wxhexeditor-0.24+repack-modified/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.h
--- wxhexeditor-0.24+repack/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.h	2017-12-30 21:15:18.000000000 -0500
+++ wxhexeditor-0.24+repack-modified/src/HexEditorCtrl/wxHexCtrl/wxHexCtrl.h	2025-08-17 07:23:52.425057574 -0400
@@ -147,6 +147,7 @@
  		void OnTagHideAll( void );
  		bool *TagMutex;
  		int *ZebraStriping;
+		bool waylander;

  	protected:
  		wxDC* UpdateDC( wxDC* dc=NULL);


Best regards,
Adam.


$ dpkg -l mutter* xwayland*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name              Version      Architecture Description
+++-=================-============-============-=============================================
un  mutter            <none>       <none>       (no description available)
ii  mutter-common     48.4-2       all          shared files for the Mutter window manager
ii  mutter-common-bin 48.4-2       amd64        shared programs for the Mutter window manager
ii  xwayland          2:24.1.6-1   amd64        X server for running X clients under Wayland