Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2000:
[Freeciv-Dev] Re: focus lost irrevocably on game startup (PR#506)
Home

[Freeciv-Dev] Re: focus lost irrevocably on game startup (PR#506)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: focus lost irrevocably on game startup (PR#506)
From: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Date: Sat, 19 Aug 2000 12:49:45 -0700 (PDT)

On Sat, 19 Aug 2000, Vincent Ugenti wrote:

> Thue wrote:
> 
> > On Fri, 18 Aug 2000 22:17:39 Vincent Ugenti wrote:
> > > Thue wrote:
(snip... snip...)

> No, for 2 reasons. First, I have not looked at the code to confirm that this 
> is
> the source of the problem (and I have no intentions of doing so!). Secondly, 
> even
> if the bug were as I suspect it, that would not imply any problem with GTK, 
> as a
> GUI tool kit it probably isn't and never was, nor will ever be thread safe.
> Meaning, all acess to GUI objects needs to be made by the same thread. I would
> attribute this bug to a race condition between two threads while accessing the
> GUI.
> 
> Once again, I have not looked at the code but simply based on the behavior of 
> the
> GUI under these circumstances reminds me of things I often see when 
> programming
> under Java and violating multithreading rules. I don't know for 100% sure if
> GTK is not thread-safe, either - it's just an assumption I am making based on 
> the
> symptoms I observed and without checking the code (although I enjoy freeciv 
> alot
> I barely have enough time to play it, let alone assist in the development
> process!).


Like Thue said, the client isn't multithreaded.  In fact, freeciv doesn't
use threads anywhere, client & server...  And no, it doesn't fork()
either.

This is IMO a gtk+ problem.  The bug is, if you have the mouse focus
grabbed somehow (be it by selecting menus, moving scrollbars, etc) and
some gtk+ event is trigged while you have the mouse focus grabbed, gtk+
doesn't ungrab the mouse before messing with it again.  This can result in
various things, many people have reported X-Server crashes and/or lockups
in the past.  I guess you were just lucky X didn't crash on you.

Once again, in my view, this should be fixed in gtk+ not in the client.
This could happen in any app - if the mouse was grabed by gtk+ internally
or by user code grabbing the mouse.

P.S: When the mouse is grabbed, X usually changes the bitmap of the mouse
cursor to a diferent orientation (the bitmap is mirrored around the
Y-axis).

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa






[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: focus lost irrevocably on game startup (PR#506), Vasco Alexandre Da Silva Costa <=