Bugs item #677661, was opened at 2003-01-30 20:06
Message generated for change (Comment added) made by bradleyhughes
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428680&aid=677661&group_id=40696

Category: Behaviour
Group: CVS
>Status: Closed
>Resolution: Fixed
Priority: 9
Submitted By: Sean 'Shaleh' Perry (shaleh)
Assigned to: Bradley T. Hughes (bradleyhughes)
Summary: resizing a window too small leads to assert

Initial Comment:
take any window and resize it as small as possible.  blackbox will 
then hit an assert in the imaging code because we send it a 
negative window width. 
 
Enclosed is a patch which solves this problem by setting the 
client.min_width variable to (button_w * 4) + 5 which gives enough 
room for the toolbar buttons and the title.  it is a bit of a hack right 
now, but the idea is sound. 
 
The patch also updates the XColorTable::pixel() to assert(0) when 
the switch would hit an unknown number and hit the return 0 line. 
 
That last piece is a bit of slop but harmless. 

----------------------------------------------------------------------

>Comment By: Bradley T. Hughes (bradleyhughes)
Date: 2004-01-02 16:03

Message:
Logged In: YES 
user_id=459209

fixed in cvs a while back... 

----------------------------------------------------------------------

Comment By: Sean 'Shaleh' Perry (shaleh)
Date: 2003-01-30 20:08

Message:
Logged In: YES 
user_id=37132

joy, sf.net is not handling patch uploads.  grr. 
 
diff --exclude CVS -pru blackbox-off/lib/Image.cc 
blackbox-cvs/lib/Image.cc 
--- blackbox-off/lib/Image.cc   2003-01-15 03:34:18.000000000 -0800 
+++ blackbox-cvs/lib/Image.cc   2003-01-30 10:50:42.000000000 
-0800 
@@ -433,6 +433,8 @@ unsigned long bt::XColorTable::pixel(uns 
     return ((red   << red_offset) | 
             (green << green_offset) | 
             (blue  << blue_offset)); 
+  default: 
+    assert(0); 
   } 
  
   // not reached 
@@ -442,7 +444,7 @@ unsigned long bt::XColorTable::pixel(uns 
  
 bt::Image::Image(unsigned int w, unsigned int h) 
   :  width(w), height(h) { 
-  assert(width > 0  && width  < maximumWidth); 
+  assert(width  > 0 && width  < maximumWidth); 
   assert(height > 0 && height < maximumHeight); 
  
   data = (RGB *) malloc( width * height * sizeof(RGB) ); 
diff --exclude CVS -pru blackbox-off/src/Window.cc 
blackbox-cvs/src/Window.cc 
--- blackbox-off/src/Window.cc  2003-01-30 10:49:29.000000000 
-0800 
+++ blackbox-cvs/src/Window.cc  2003-01-30 10:49:12.000000000 
-0800 
@@ -1095,8 +1095,8 @@ void 
BlackboxWindow::getWMNormalHints(vo 
   long icccm_mask; 
   XSizeHints sizehint; 
  
-  client.min_width = client.min_height = 
-    client.width_inc = client.height_inc = 1; 
+  client.min_width = client.min_height = 5; 
+  client.width_inc = client.height_inc = 1; 
   client.base_width = client.base_height = 0; 
   client.win_gravity = NorthWestGravity; 
   client.min_aspect_x = client.min_aspect_y = 
@@ -3057,6 +3057,7 @@ void BlackboxWindow::upsize(void) { 
     // set the top frame margin 
     frame.margin.top = frame.border_w + frame.title_h + 
                        frame.border_w + frame.mwm_border_w; 
+    client.min_width = (frame.button_w * 4) + 5; 
   } else { 
     frame.label_h = 0; 
     frame.title_h = 0; 
 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428680&aid=677661&group_id=40696

-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
List archives:  http://asgardsrealm.net/lurker/splash/index.html
Trouble? Contact [EMAIL PROTECTED]

Reply via email to