<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39825 >

> [EMAIL PROTECTED] - Sa 03. Nov 2007, 12:51:14]:
> 
> On Nov 3, 2007 3:10 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> >
> > <URL: http://bugs.freeciv.org/Ticket/Display.html?id=39825 >
> >
> > Erik Johansson wrote:
> > > <URL: http://bugs.freeciv.org/Ticket/Display.html?id=39825 >
> > >
> > > On Nov 2, 2007 12:02 AM, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> > >
> > >> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=39825 >
> > >>
> > >> game crashes when disbanding a unit and outputs Segmentation
> fault core
> > >> dump
> > >>
> > >
> > > Hi Weston
> > >
> > > can you tell us what, OS, version of freeciv, you are using.
> Please
> > > tell us when this happens, and if you can reproduce it send us the
> > > savegame..
> > >
> > > I tried on 2.1 SDL and it seems to handle disbands fine.
> > >
> > > Have fun /Erik
> > >
> > >
> > >
> > im sorry i was kinda doing alot of things at once
> > Ubuntu 7.10 and 2.1.0 i built it from source
> > and if i disband some of the in-city units freeciv crashes
> 
> Hi Again
> 
> I have the same system and I can't reproduce this on Ubuntu, can you
> tell me exactly what you do to get the crash?
> 

It crashed when the city was entered by cycling through the city list at
the bottom of the city dialog and one of the previous
cities had built improvements and the city with the unit to disband
didn't have any. Patch attached.

> I found another bug that I really need someone to confirm for me..
> 
> 1. open a city window (needs to have units present)
> 2. move mouse to present units box.
> 3. hover mouse over unit, notive it gets highlighted
> 4. move mouse away from unit but keep with in the present units box
> 5. left click
> 6. try to hover over the same unit again
> 
> expected results:
> * the unit gets highlighted, and can be activated
> 
> actual results
> * the unit isn't highlighted and can't be activated
> 

Confirmed and patch attached.

Index: client/gui-sdl/citydlg.c
===================================================================
--- client/gui-sdl/citydlg.c	(revision 13945)
+++ client/gui-sdl/citydlg.c	(working copy)
@@ -220,9 +220,17 @@
       
     }
     
-    if(!pCityDlg->lock &&
-          sellect_window_group_dialog(pCityDlg->pBeginCityWidgetList, pWindow)) {
-      widget_flush(pWindow);
+    if (!pCityDlg->lock) {
+      if (pCityDlg->pPanel) {      
+        sellect_window_group_dialog(pCityDlg->pBeginCityWidgetList, pWindow);
+        sellect_window_group_dialog(pCityDlg->pPanel->pBeginWidgetList,
+                                    pCityDlg->pPanel->pEndWidgetList);
+        widget_flush(pWindow);
+      } else {
+        if (sellect_window_group_dialog(pCityDlg->pBeginCityWidgetList, pWindow)) {
+          widget_flush(pWindow);
+        }
+      }
     }      
   }
   return -1;
Index: client/gui-sdl/gui_main.c
===================================================================
--- client/gui-sdl/gui_main.c	(revision 13945)
+++ client/gui-sdl/gui_main.c	(working copy)
@@ -328,7 +328,9 @@
 {
   static struct widget *pWidget;
   if ((pWidget = MainWidgetListScaner(pButtonEvent->x, pButtonEvent->y)) != NULL) {
-    return widget_pressed_action(pWidget);
+    if (!(get_wstate(pWidget) == FC_WS_DISABLED)) {
+      return widget_pressed_action(pWidget);
+    }
   } else {
 #ifdef UNDER_CE
     if (!check_scroll_area(pButtonEvent->x, pButtonEvent->y)) {
@@ -400,7 +402,9 @@
 
   if ((pWidget = MainWidgetListScaner(pMotionEvent->x, pMotionEvent->y)) != NULL) {
     update_mouse_cursor(CURSOR_DEFAULT);
-    widget_sellected_action(pWidget);
+    if (!(get_wstate(pWidget) == FC_WS_DISABLED)) {
+      widget_sellected_action(pWidget);
+    }
   } else {
     if (pSellected_Widget) {
       unsellect_widget_action();
Index: client/gui-sdl/widget.c
===================================================================
--- client/gui-sdl/widget.c	(revision 13945)
+++ client/gui-sdl/widget.c	(working copy)
@@ -231,8 +231,7 @@
     area.w = pGUI_List->size.w;
     area.h = pGUI_List->size.h;
     if (is_in_rect_area(x, y, area)
-       && !((get_wstate(pGUI_List) == FC_WS_DISABLED) ||
-	    ((get_wflags(pGUI_List) & WF_HIDDEN) == WF_HIDDEN))) {
+       && !((get_wflags(pGUI_List) & WF_HIDDEN) == WF_HIDDEN)) {
       return (struct widget *) pGUI_List;
     }
     pGUI_List = pGUI_List->next;
Index: client/gui-sdl/citydlg.c
===================================================================
--- client/gui-sdl/citydlg.c	(revision 13945)
+++ client/gui-sdl/citydlg.c	(working copy)
@@ -3514,6 +3522,8 @@
 				       pCityDlg->pImprv->pEndWidgetList);
     pCityDlg->pImprv->pEndWidgetList = NULL;
     pCityDlg->pImprv->pBeginWidgetList = NULL;
+    pCityDlg->pImprv->pEndActiveWidgetList = NULL;
+    pCityDlg->pImprv->pBeginActiveWidgetList = NULL;
     pCityDlg->pImprv->pActiveWidgetList = NULL;
     FC_FREE(pCityDlg->pImprv->pScroll);
   } 
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to