Re: [gnet-dev] Cross-compiling gnet for win32 from linux

On 3/13/06, ben levitt <benjie gmail com> wrote:
> On 3/13/06, Tim Müller <t i m zen co uk> wrote:
> > I have heard of problems with GNet + GLib-2.8 on win32, but don't know
> > what causes them or how to fix things unfortunately, and I'm myself not
> > a win32 developer nor even have a win32 setup so I'm not going to be
> > likely to be able to fix this myself.
> >
> > I've been pointed to this patch though:
> >
> >
> >
> > Apparently this (and a requirement on glib-2.8) might be the way forward
> > for GNet on win32. You could give the patch a shot and see if it changes
> > anything (test with both patch+gnet-2.0.7 and patch+gnet CVS would be
> > useful).
> >
> > Would be great if you could give it a shot.
> I tried that patch with cvs, but sadly, it made no difference.  For
> some reason I'm having more trouble getting 2.0.7 to compile, plus the
> patch doesn't apply cleanly, so I haven't tried that yet.
> I do find it odd that the only thing that's breaking my gtk/gnet apps
> is moving one of the app's windows.  Other dragging/clicking/typing
> input is fine.  That makes me think that gtk's handling of dragging
> windows could be to blame...
> Ben

Well, I switched from TcpSockets to GConn and GServer, and now my
window-dragging problems are magically fixed.  I don't understand why,
but I'm not arguing.

This however brought up another problem, although I did find a workaround.

I'm keeping my app single-threaded, so I periodically let my gtk
mainloop iterate while one part of my app is busy.  This lets the app
continue to process events so it doesn't look frozen.  This works fine
using TcpSockets, but when I use GConn and GServer, and am busy
processing a GConn event, iterating the mainloop seems to make the
same GConn event get sent out again and again recursively.

I worked around this by setting up a glib timeout for 1ms that gets
called from the GConn event callback, and which calls the actual event
processing code.  After doing this, the mainloop iteration no longer
finds the same GConn event again.

So my code is now working great on linux and windows, and I'm very happy.  :)


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