Problems with wxWidgets under wayland

"'Jouk Jansen' via wx-users" <[email protected]> Thu, 15 Jan 2026 09:54:36 +0100 (CET)
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
Hi all,

When I try to run a program, that works fine under
Xorg, DecWindows & Msoftwindows, using wayland I do not see everything
displayed on the screen. Below is an example of the problem code. I try to
catch mouse-movements and write the coordinates (note that actually filling
"text" is omitted in the example) to the screen. When using wayland
everyting that is assigned to the dc (wxClientDC) is not visible. I tried to
"this->Refresh()" on the canvas, but that did not help. What am I missing?
And why is this a problem only when using wayland?


I use wxGTK 3.2.8 on a Fedora 43 system.


Code example :

void wxecanvas::OnMouse(wxMouseEvent& event )
{
   wxPoint pos = event.GetPosition();
   wxClientDC dc( this );

   printf( "Mouse position : %d %d\n" , pos.x , pos.y );
   if ( event.Moving() | event.Dragging() )
     {
	char* text;
	
	printf( "Moving event\n" );
	     text = (char*) malloc( 30 );
	     // clear area and write text
	     // colour is defined in main()
	     dc.SetLogicalFunction( wxCOPY );
	     dc.SetPen( wxPen( colour , 1 , wxTRANSPARENT ) );
	     dc.SetBrush( wxBrush( colour , wxSOLID ) );
	     dc.DrawRectangle( 790 , 590 , 225 , 50 );
	     dc.SetTextForeground( wxColour( "RED" ) );
	     dc.DrawText( text , 800 , 600 );
	     dc.SetTextForeground( wxColour( "BLACK" ) );
	     dc.SetPen( wxPen( "BLACK" , 1 , wxSOLID ) );
	     free( text );
	  }
}



         Kind regards
	     Jouk


Pax, vel iniusta, utilior est quam iustissimum bellum.
    (free after Marcus Tullius Cicero (106 b.Chr.-46 b.Chr.)
     Epistularum ad Atticum 7.1.4.3)


               Touch not the cat bot a glove

>------------------------------------------------------------------------------<

  Jouk Jansen
		 
  [email protected]

  Technische Universiteit Delft        tttttttttt  uu     uu  ddddddd
  Kavli Institute of Nanoscience       tttttttttt  uu     uu  dd    dd
  Nationaal centrum voor HREM              tt      uu     uu  dd     dd
  Lorentzweg 1                             tt      uu     uu  dd     dd
  2628 CJ Delft                            tt      uu     uu  dd     dd
  Nederland                                tt      uu     uu  dd    dd
  tel. +31-15-2782272                      tt       uuuuuuu   ddddddd

>------------------------------------------------------------------------------<

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/wx-users/26011509543690_41A00464%40hrem.nano.tudelft.nl.