it was a little difficult to trigger the problem, but finally I made it. It's not LazReport related, it is a X11 error triggered by gtk (had to guess that too as my IDE was compiled for qt5 and it compiles qt5 apps by default), but I found an easier way to expose the problem using only the IDE (that must be compiled for GTK), do this:
1. Open a file that has some repeated words, for example any pascal file for the word "begin"
2. CTRL+R or open the replace dialog
3. In the "Text to find" field type 'begin' without '
4. In the "Replace with" field type 'Begin' again without '
5. The "Prompt on replace" option must be checked, all other option checkboxes should be clear, all radio options default.
6. Press the button "Replace all"
It will do an annoying blink of windows and will find the first instance showing a confirmation dialog, from there press the "Yes" button and Lazarus will vanish in the ether. If you run Lazarus in a terminal, it will show this:
The program 'lazarus' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 293718 error_code 3 request_code 12 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
This is the same error that kills your program.
If you can reproduce this problem with the given instructions then try this:
NOTE: "Remember your changes so your can restore the original code"
1. Open your application
2. Open the project inspector (menu Project->Project inspector);
3. Under "Required Package" double click the LCL package
4. In the new window, under "Files" find and open the gtk2widgetset.inc file
5. Find this function "TGtk2WidgetSet.AppRemoveStayOnTopFlags"
6. Replace this code:
if Assigned(nact) then
begin
gdk_window_restack(W^.Window, act, False);
nact:=W^.Window;
end
else begin
gdk_window_lower(W^.Window); // send to the bottom
gdk_window_raise(W^.Window); // restore back
end;
with this ( or by nothing, not tested but it was the original code before that change)
gdk_window_lower(W^.Window); // flush it to the bottom, some WMs keep it above
gdk_window_raise(W^.Window); // bring it back immediatly. But it should keep below the top app
Save the file and recompile your program, I was not able to crash it after this, please test and comment.
By the way, I did my tests with current Lazarus (Lazarus 2.3.0 rmain-2_3-255-gfd378d5 FPC 3.2.2 x86_64-linux-gtk2)