Fatal IO error 104 when using Gtk::Context::show_text



See below for a small program to recreate the problem.

The window just flashes up and then I quickly get:
"Fatal IO error 104 (Connection reset by peer) on X server :0.0."

If I use a debugger the crash happens on the line with the show_text
call, but I don't seem to get a signal, the app just crashes.

I tried going through pango to draw text and see the same problem. I
sent this to a friend (who runs the same distro and version I do) and
he had the same problem. I also tried setting up all the font settings
like in example code that comes with libcairomm, but that didn't seem
to help.

Am I doing something wrong? or is this a bug?

I'm using Ubuntu 7.10, gtkmm 2.12.0, gtk 2.12.0, pango 1.18.3

#include <gtkmm.h>
#include <cairomm/cairomm.h>

class CairoDrawer : public Gtk::DrawingArea
{
public:
	virtual bool on_expose_event(GdkEventExpose*)
	{
		Cairo::RefPtr<Cairo::Context> c = get_window()->create_cairo_context();
		Gtk::Allocation allocation = get_allocation();
		c->scale(allocation.get_width(), allocation.get_height());
		c->move_to(0, 0);
		c->show_text("Crash Here");
		return true;
	}
};

int main(int argc, char *argv[])
{
	Gtk::Main kit(argc, argv);
	Gtk::Window window;
	CairoDrawer cairo_drawer;
	cairo_drawer.show();
	window.add(cairo_drawer);
	kit.run(window);
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]