Hi,
My app while running on one X display has to be able to open a new window on
another X display. It contains a gtk_text_view packed in a gtk_scroll_window. As
soon as I type a key in that text widget, the app crashes with the following
error:
The program 'testing' received an X Window System error.
This probably reflects a bug in the program.
The error was '204'.
(Details: serial 510 error_code 204 request_code 157 minor_code 23)
(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.)
I came up with a small testing code that allows to open a new window on a
remote DISPLAY (see attached file).
When the window is on another DISPLAY, if I pack the text_view in the scroll
window using the gtk_container_add, I get the crash. In contrast, if I pack it
using gtk_scrolled_window_add_wit_viewport it does not crash, but the scroll
window does not scroll when the cursor is out of the view.
Am I missing something obvious? Is this a bug? Is there a workaround?
Please test the attached code. Usage is:
testing_code DISPLAY PACKING_MODE
where DISPLAY is something like :0 or :1
PACKING_MODE is 0 or 1,
0 being for packing text_view with gtk_container_add and 1 for packing with
gtk_scrolled_window_add_with_viewport
To trigger the crash: from a terminal on DISPLAY :0, run "testing_code :1 0".
This will open a window on DISPLAY :1, the text_view being packed with
gtk_container_add. Switch to that DISPLAY and type a key in that text. It
crashes. The only combination that crashes is running from one DISPLAY and
opening on another one and using the gtk_container_add. Note that running
"DISPLAY=:1 ./testingcode :1 0" from DISPLAY :0 does not trigger the crash.
I'm using cvs Gtk(from these days) and gcc-3.2.2 on XFree 4.3.0 with xfs font
server on a pentium2 linux-2.4.19. I'm running two Xservers on the same machine
and monitor and switch between them with ALT-CTRL-F7 and ALT-CTRL-F8.
Thanks in advance for any hint.
--
Melvin Hadasht
Attachment:
testing.c
Description: Text document