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
jo...@hrem.nano.tudelft.nl
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
>------------------------------------------------------------------------------<