diff options
author | 2007-12-18 13:41:35 +0000 | |
---|---|---|
committer | 2007-12-18 13:41:35 +0000 | |
commit | 9e0b6104f84803c623b75685d98b88487618808f (patch) | |
tree | 57a4cf0ce888550bc7c7dca1bf0aca0589f19001 /x11-libs/fltk | |
parent | added 2.2.8 (diff) | |
download | gentoo-2-9e0b6104f84803c623b75685d98b88487618808f.tar.gz gentoo-2-9e0b6104f84803c623b75685d98b88487618808f.tar.bz2 gentoo-2-9e0b6104f84803c623b75685d98b88487618808f.zip |
Fix xft patch when xft is disabled, see #202625
(Portage version: 2.1.3.19)
Diffstat (limited to 'x11-libs/fltk')
-rw-r--r-- | x11-libs/fltk/ChangeLog | 6 | ||||
-rw-r--r-- | x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch | 575 |
2 files changed, 304 insertions, 277 deletions
diff --git a/x11-libs/fltk/ChangeLog b/x11-libs/fltk/ChangeLog index 16ff8fb0a6d6..f70226f140ac 100644 --- a/x11-libs/fltk/ChangeLog +++ b/x11-libs/fltk/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for x11-libs/fltk # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-libs/fltk/ChangeLog,v 1.95 2007/12/15 21:12:22 coldwind Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-libs/fltk/ChangeLog,v 1.96 2007/12/18 13:41:34 coldwind Exp $ + + 18 Dec 2007; Santiago M. Mola <coldwind@gentoo.org> + files/fltk-1.1.7-xft-and-misc.patch: + Fix xft patch when xft is disabled, see #202625 *fltk-1.1.7-r3 (15 Dec 2007) diff --git a/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch b/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch index 6f695b46b646..e4e393a2cfb6 100644 --- a/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch +++ b/x11-libs/fltk/files/fltk-1.1.7-xft-and-misc.patch @@ -1,9 +1,33 @@ ---- FL/x.H -+++ FL/x.H -@@ -65,10 +65,30 @@ +diff -ur fltk-1.1.7/FL/Fl_Browser_.H fltk-1.1.7.new/FL/Fl_Browser_.H +--- fltk-1.1.7/FL/Fl_Browser_.H 2005-04-16 02:13:17.000000000 +0200 ++++ fltk-1.1.7.new/FL/Fl_Browser_.H 2007-12-18 14:13:41.000000000 +0100 +@@ -88,6 +88,7 @@ + void new_list(); // completely clobber all data, as though list replaced + void deleting(void *a); // get rid of any pointers to a + void replacing(void *a,void *b); // change a pointers to b ++ void swapping(void *a,void *b); // exchange pointers a and b + void inserting(void *a,void *b); // insert b near a + int displayed(void *) const ; // true if this line is visible + void redraw_line(void *); // minimal update, no change in size +diff -ur fltk-1.1.7/FL/Fl_File_Chooser.H fltk-1.1.7.new/FL/Fl_File_Chooser.H +--- fltk-1.1.7/FL/Fl_File_Chooser.H 2005-08-08 02:50:02.000000000 +0200 ++++ fltk-1.1.7.new/FL/Fl_File_Chooser.H 2007-12-18 14:13:41.000000000 +0100 +@@ -145,6 +145,7 @@ + void preview(int e); + int preview() const { return previewButton->value(); }; + void rescan(); ++ void rescan_keep_filename(); + void show(); + int shown(); + void textcolor(Fl_Color c); +diff -ur fltk-1.1.7/FL/x.H fltk-1.1.7.new/FL/x.H +--- fltk-1.1.7/FL/x.H 2005-04-16 02:13:17.000000000 +0200 ++++ fltk-1.1.7.new/FL/x.H 2007-12-18 14:25:47.000000000 +0100 +@@ -65,10 +65,34 @@ extern FL_EXPORT XVisualInfo *fl_visual; extern FL_EXPORT Colormap fl_colormap; ++#if USE_XFT +// access to core fonts +FL_EXPORT XFontStruct* fl_xxfont(); +class Fl_XFont_On_Demand @@ -24,6 +48,9 @@ + XFontStruct* ptr; +}; +extern FL_EXPORT Fl_XFont_On_Demand fl_xfont; ++#else ++extern FL_EXPORT XFontStruct* fl_xfont; ++#endif + // drawing functions: extern FL_EXPORT GC fl_gc; @@ -32,39 +59,28 @@ FL_EXPORT ulong fl_xpixel(Fl_Color i); FL_EXPORT ulong fl_xpixel(uchar r, uchar g, uchar b); FL_EXPORT void fl_clip_region(Fl_Region); ---- FL/Fl_Browser_.H -+++ FL/Fl_Browser_.H -@@ -88,6 +88,7 @@ - void new_list(); // completely clobber all data, as though list replaced - void deleting(void *a); // get rid of any pointers to a - void replacing(void *a,void *b); // change a pointers to b -+ void swapping(void *a,void *b); // exchange pointers a and b - void inserting(void *a,void *b); // insert b near a - int displayed(void *) const ; // true if this line is visible - void redraw_line(void *); // minimal update, no change in size ---- FL/Fl_File_Chooser.H -+++ FL/Fl_File_Chooser.H -@@ -145,6 +145,7 @@ - void preview(int e); - int preview() const { return previewButton->value(); }; - void rescan(); -+ void rescan_keep_filename(); - void show(); - int shown(); - void textcolor(Fl_Color c); ---- src/Fl_File_Chooser.cxx -+++ src/Fl_File_Chooser.cxx -@@ -375,7 +375,7 @@ - window->show(); - Fl::flush(); - fl_cursor(FL_CURSOR_WAIT); --rescan(); -+rescan_keep_filename(); - fl_cursor(FL_CURSOR_DEFAULT); - fileName->take_focus(); +diff -ur fltk-1.1.7/src/Fl_Browser_.cxx fltk-1.1.7.new/src/Fl_Browser_.cxx +--- fltk-1.1.7/src/Fl_Browser_.cxx 2005-12-31 19:26:01.000000000 +0100 ++++ fltk-1.1.7.new/src/Fl_Browser_.cxx 2007-12-18 14:13:41.000000000 +0100 +@@ -470,6 +470,15 @@ + if (a == max_width_item) {max_width_item = 0; max_width = 0;} } ---- src/Fl_Browser.cxx -+++ src/Fl_Browser.cxx + ++void Fl_Browser_::swapping(void* a, void* b) { ++ redraw_line(a); ++ redraw_line(b); ++ if (a == selection_) selection_ = b; ++ else if (b == selection_) selection_ = a; ++ if (a == top_) top_ = b; ++ else if (b == top_) top_ = a; ++} ++ + void Fl_Browser_::inserting(void* a, void* b) { + if (displayed(a)) redraw_lines(); + if (a == top_) top_ = b; +diff -ur fltk-1.1.7/src/Fl_Browser.cxx fltk-1.1.7.new/src/Fl_Browser.cxx +--- fltk-1.1.7/src/Fl_Browser.cxx 2005-04-16 02:13:17.000000000 +0200 ++++ fltk-1.1.7.new/src/Fl_Browser.cxx 2007-12-18 14:13:41.000000000 +0100 @@ -503,6 +503,7 @@ void Fl_Browser::swap(FL_BLINE *a, FL_BLINE *b) { @@ -82,134 +98,21 @@ } void Fl_Browser::swap(int ai, int bi) { ---- src/Fl_Window.cxx -+++ src/Fl_Window.cxx -@@ -36,7 +36,7 @@ - #include "flstring.h" - - #ifdef __APPLE_QUARTZ__ --#include <FL/fl_draw.h> -+#include <FL/fl_draw.H> - #endif - - void Fl_Window::_Fl_Window() { ---- src/Fl_Font.H -+++ src/Fl_Font.H -@@ -40,9 +40,9 @@ - - #include <config.h> - --# if USE_XFT -+# if USE_XFT && !SUPPRESS_XFT - typedef struct _XftFont XftFont; --# endif // USE_XFT -+# endif // USE_XFT && !SUPPRESS_XFT - - class Fl_FontSize { - public: -@@ -63,7 +63,7 @@ - char *q_name; - int size; - short ascent, descent, q_width; --# elif USE_XFT -+# elif USE_XFT && !SUPPRESS_XFT - XftFont* font; - const char* encoding; - int size; ---- src/Fl_mac.cxx -+++ src/Fl_mac.cxx -@@ -121,7 +121,7 @@ - static unsigned short macKeyLookUp[128] = - { - 'a', 's', 'd', 'f', 'h', 'g', 'z', 'x', -- 'c', 'v', 0/*ISO extra ('#' on German keyboard)*/, 'b', 'q', 'w', 'e', 'r', -+ 'c', 'v', '^', 'b', 'q', 'w', 'e', 'r', - - 'y', 't', '1', '2', '3', '4', '6', '5', - '=', '9', '7', '-', '8', '0', ']', 'o', -@@ -2159,14 +2159,15 @@ - Size len = 0; - if (GetCurrentScrap(&scrap) == noErr && scrap != myScrap && - GetScrapFlavorSize(scrap, kScrapFlavorTypeText, &len) == noErr) { -- if ( len > fl_selection_buffer_length[1] ) { -+ if ( len >= fl_selection_buffer_length[1] ) { - fl_selection_buffer_length[1] = len + 32; - delete[] fl_selection_buffer[1]; -- fl_selection_buffer[1] = new char[len]; -+ fl_selection_buffer[1] = new char[len + 32]; - } -+ fl_selection_length[1] = len; len++; - GetScrapFlavorData( scrap, kScrapFlavorTypeText, &len, - fl_selection_buffer[1] ); -- fl_selection_length[1] = len; -+ fl_selection_buffer[1][fl_selection_length[1]] = 0; - // turn all \r characters into \n: - for (int x = 0; x < len; x++) { - if (fl_selection_buffer[1][x] == '\r') ---- src/Fl_File_Chooser.fl -+++ src/Fl_File_Chooser.fl -@@ -61,7 +61,7 @@ - fileList->deselect(); - Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this); - window->hide();} -- private xywh {387 242 490 380} type Double resizable -+ private xywh {368 285 490 380} type Double resizable - code0 {if (title) window->label(title);} - code1 {\#include <stdio.h>} - code2 {\#include <stdlib.h>} -@@ -138,7 +138,7 @@ - if (callback_) - (*callback_)(this, data_); - --window->hide();} selected -+window->hide();} - private xywh {313 345 85 25} - code0 {\#include <FL/fl_ask.H>} - code1 {okButton->label(fl_ok);} -@@ -160,7 +160,7 @@ - } - Fl_Window favWindow { - label {Manage Favorites} -- private xywh {437 187 355 150} type Double resizable -+ private xywh {421 56 355 150} type Double resizable - code0 {favWindow->label(manage_favorites_label);} modal size_range {181 150 0 0} visible - } { - Fl_File_Browser favList { -@@ -299,15 +299,18 @@ - } - decl {void rescan();} {public - } -- Function {show()} {return_type void -+ decl {void rescan_keep_filename();} {public -+ } -+ Function {show()} {open return_type void - } { - code {window->hotspot(fileList); - window->show(); - Fl::flush(); - fl_cursor(FL_CURSOR_WAIT); --rescan(); -+rescan_keep_filename(); - fl_cursor(FL_CURSOR_DEFAULT); --fileName->take_focus();} {} -+fileName->take_focus();} {selected -+ } - } - Function {shown()} {return_type int - } { ---- src/Fl_Shared_Image.cxx -+++ src/Fl_Shared_Image.cxx -@@ -227,7 +227,7 @@ - fread(header, 1, sizeof(header), fp); - fclose(fp); - } else { -- memset(header, 0, sizeof(header)); -+ return; - } +diff -ur fltk-1.1.7/src/Fl_File_Browser.cxx fltk-1.1.7.new/src/Fl_File_Browser.cxx +--- fltk-1.1.7/src/Fl_File_Browser.cxx 2005-08-18 16:08:17.000000000 +0200 ++++ fltk-1.1.7.new/src/Fl_File_Browser.cxx 2007-12-18 14:13:41.000000000 +0100 +@@ -467,7 +467,7 @@ + { + sprintf(filename, "%c:/", i); - // Load the image as appropriate... ---- src/Fl_File_Chooser2.cxx -+++ src/Fl_File_Chooser2.cxx +- if (i < 'C') ++ if (i < 'C') // see also: GetDriveType and GetVolumeInformation in WIN32 + add(filename, icon); + else + add(filename, icon); +diff -ur fltk-1.1.7/src/Fl_File_Chooser2.cxx fltk-1.1.7.new/src/Fl_File_Chooser2.cxx +--- fltk-1.1.7/src/Fl_File_Chooser2.cxx 2005-11-27 15:45:48.000000000 +0100 ++++ fltk-1.1.7.new/src/Fl_File_Chooser2.cxx 2007-12-18 14:13:41.000000000 +0100 @@ -854,6 +854,57 @@ update_preview(); } @@ -277,113 +180,97 @@ } } ---- src/fl_scroll_area.cxx -+++ src/fl_scroll_area.cxx -@@ -32,6 +32,7 @@ - #include <config.h> - #include <FL/Fl.H> - #include <FL/x.H> -+#include <FL/fl_draw.H> - - // scroll a rectangle and redraw the newly exposed portions: - void fl_scroll(int X, int Y, int W, int H, int dx, int dy, ---- src/Fl_Menu.cxx -+++ src/Fl_Menu.cxx -@@ -107,6 +107,7 @@ - int titlex(int); - void autoscroll(int); - void position(int x, int y); -+ int is_inside(int x, int y); - }; - - #define LEADING 4 // extra vertical leading -@@ -458,6 +459,15 @@ - return xx; +diff -ur fltk-1.1.7/src/Fl_File_Chooser.cxx fltk-1.1.7.new/src/Fl_File_Chooser.cxx +--- fltk-1.1.7/src/Fl_File_Chooser.cxx 2005-12-30 11:13:17.000000000 +0100 ++++ fltk-1.1.7.new/src/Fl_File_Chooser.cxx 2007-12-18 14:13:41.000000000 +0100 +@@ -375,7 +375,7 @@ + window->show(); + Fl::flush(); + fl_cursor(FL_CURSOR_WAIT); +-rescan(); ++rescan_keep_filename(); + fl_cursor(FL_CURSOR_DEFAULT); + fileName->take_focus(); } +diff -ur fltk-1.1.7/src/Fl_File_Chooser.fl fltk-1.1.7.new/src/Fl_File_Chooser.fl +--- fltk-1.1.7/src/Fl_File_Chooser.fl 2005-12-30 11:13:17.000000000 +0100 ++++ fltk-1.1.7.new/src/Fl_File_Chooser.fl 2007-12-18 14:13:41.000000000 +0100 +@@ -61,7 +61,7 @@ + fileList->deselect(); + Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this); + window->hide();} +- private xywh {387 242 490 380} type Double resizable ++ private xywh {368 285 490 380} type Double resizable + code0 {if (title) window->label(title);} + code1 {\#include <stdio.h>} + code2 {\#include <stdlib.h>} +@@ -138,7 +138,7 @@ + if (callback_) + (*callback_)(this, data_); -+// return 1, if the given root coordinates are inside the window -+int menuwindow::is_inside(int mx, int my) { -+ if ( mx < x_root() || mx >= x_root() + w() || -+ my < y_root() || my >= y_root() + h()) { -+ return 0; +-window->hide();} selected ++window->hide();} + private xywh {313 345 85 25} + code0 {\#include <FL/fl_ask.H>} + code1 {okButton->label(fl_ok);} +@@ -160,7 +160,7 @@ + } + Fl_Window favWindow { + label {Manage Favorites} +- private xywh {437 187 355 150} type Double resizable ++ private xywh {421 56 355 150} type Double resizable + code0 {favWindow->label(manage_favorites_label);} modal size_range {181 150 0 0} visible + } { + Fl_File_Browser favList { +@@ -299,15 +299,18 @@ + } + decl {void rescan();} {public + } +- Function {show()} {return_type void ++ decl {void rescan_keep_filename();} {public + } -+ return 1; -+} -+ - //////////////////////////////////////////////////////////////// - // Fl_Menu_Item::popup(...) - -@@ -488,9 +498,20 @@ - int nummenus; - int menubar; // if true p[0] is a menubar - int state; -+ int is_inside(int mx, int my); - }; - static menustate* p; ++ Function {show()} {open return_type void + } { + code {window->hotspot(fileList); + window->show(); + Fl::flush(); + fl_cursor(FL_CURSOR_WAIT); +-rescan(); ++rescan_keep_filename(); + fl_cursor(FL_CURSOR_DEFAULT); +-fileName->take_focus();} {} ++fileName->take_focus();} {selected ++ } + } + Function {shown()} {return_type int + } { +diff -ur fltk-1.1.7/src/Fl_Font.H fltk-1.1.7.new/src/Fl_Font.H +--- fltk-1.1.7/src/Fl_Font.H 2005-04-16 02:13:17.000000000 +0200 ++++ fltk-1.1.7.new/src/Fl_Font.H 2007-12-18 14:13:41.000000000 +0100 +@@ -40,9 +40,9 @@ -+// return 1 if the coordinates are inside any of the menuwindows -+int menustate::is_inside(int mx, int my) { -+ int i; -+ for (i=nummenus-1; i>=0; i--) { -+ if (p[i]->is_inside(mx, my)) -+ return 1; -+ } -+ return 0; -+} -+ - static inline void setitem(const Fl_Menu_Item* i, int m, int n) { - p->current_item = i; - p->menu_number = m; -@@ -595,14 +616,11 @@ - int mx = Fl::event_x_root(); - int my = Fl::event_y_root(); - int item=0; int mymenu = pp.nummenus-1; -- if (e == FL_PUSH && (!pp.menubar || mymenu) && -- (mx < pp.p[mymenu]->x_root() || -- mx >= (pp.p[mymenu]->x_root() + pp.p[mymenu]->w()) || -- my < pp.p[mymenu]->y_root() || -- my >= (pp.p[mymenu]->y_root() + pp.p[mymenu]->h()))) { -- // Clicking outside menu cancels it... -+ // Clicking or dragging outside menu cancels it... -+ if ((!pp.menubar || mymenu) && !pp.is_inside(mx, my)) { - setitem(0, -1, 0); -- pp.state = DONE_STATE; -+ if (e==FL_PUSH) -+ pp.state = DONE_STATE; - return 1; - } - for (mymenu = pp.nummenus-1; ; mymenu--) { ---- src/Fl_Browser_.cxx -+++ src/Fl_Browser_.cxx -@@ -470,6 +470,15 @@ - if (a == max_width_item) {max_width_item = 0; max_width = 0;} - } + #include <config.h> -+void Fl_Browser_::swapping(void* a, void* b) { -+ redraw_line(a); -+ redraw_line(b); -+ if (a == selection_) selection_ = b; -+ else if (b == selection_) selection_ = a; -+ if (a == top_) top_ = b; -+ else if (b == top_) top_ = a; -+} -+ - void Fl_Browser_::inserting(void* a, void* b) { - if (displayed(a)) redraw_lines(); - if (a == top_) top_ = b; ---- src/Fl_File_Browser.cxx -+++ src/Fl_File_Browser.cxx -@@ -467,7 +467,7 @@ - { - sprintf(filename, "%c:/", i); +-# if USE_XFT ++# if USE_XFT && !SUPPRESS_XFT + typedef struct _XftFont XftFont; +-# endif // USE_XFT ++# endif // USE_XFT && !SUPPRESS_XFT -- if (i < 'C') -+ if (i < 'C') // see also: GetDriveType and GetVolumeInformation in WIN32 - add(filename, icon); - else - add(filename, icon); ---- src/fl_font_xft.cxx -+++ src/fl_font_xft.cxx + class Fl_FontSize { + public: +@@ -63,7 +63,7 @@ + char *q_name; + int size; + short ascent, descent, q_width; +-# elif USE_XFT ++# elif USE_XFT && !SUPPRESS_XFT + XftFont* font; + const char* encoding; + int size; +diff -ur fltk-1.1.7/src/fl_font_xft.cxx fltk-1.1.7.new/src/fl_font_xft.cxx +--- fltk-1.1.7/src/fl_font_xft.cxx 2005-04-16 02:13:17.000000000 +0200 ++++ fltk-1.1.7.new/src/fl_font_xft.cxx 2007-12-18 14:29:56.000000000 +0100 @@ -62,6 +62,52 @@ // are several web pages of information on how to do this. // @@ -437,19 +324,20 @@ #include <X11/Xft/Xft.h> // The predefined fonts that FLTK has: -@@ -90,9 +136,10 @@ +@@ -90,7 +136,12 @@ int fl_font_ = 0; int fl_size_ = 0; --XFontStruct* fl_xfont = 0; ++#if USE_XFT +Fl_XFont_On_Demand fl_xfont; ++XFontStruct* fl_xxfont(); ++#else + XFontStruct* fl_xfont = 0; ++#endif const char* fl_encoding_ = "iso8859-1"; Fl_FontSize* fl_fontsize = 0; -+XFontStruct* fl_xxfont(); - void fl_font(int fnum, int size) { - if (fnum == fl_font_ && size == fl_size_ && -@@ -112,7 +159,9 @@ +@@ -112,7 +163,9 @@ font->first = f; } fl_fontsize = f; @@ -460,7 +348,7 @@ fl_xfont = f->font->u.core.font; #endif // XFT_MAJOR < 2 } -@@ -176,7 +225,6 @@ +@@ -176,7 +229,6 @@ return fl_width((const char *)(&c), 1); } @@ -468,7 +356,7 @@ // This call is used by opengl to get a bitmapped font. XFontStruct* fl_xxfont() { # if XFT_MAJOR > 1 -@@ -192,7 +240,6 @@ +@@ -192,7 +244,6 @@ return xftfont->u.core.font; # endif // XFT_MAJOR > 1 } @@ -476,7 +364,7 @@ #if USE_OVERLAY // Currently Xft does not work with colormapped visuals, so this probably -@@ -223,6 +270,15 @@ +@@ -223,6 +274,15 @@ } void fl_draw(const char *str, int n, int x, int y) { @@ -492,8 +380,142 @@ #if USE_OVERLAY XftDraw*& draw = fl_overlay ? draw_overlay : ::draw; if (fl_overlay) { ---- test/preferences.fl -+++ test/preferences.fl +diff -ur fltk-1.1.7/src/Fl_mac.cxx fltk-1.1.7.new/src/Fl_mac.cxx +--- fltk-1.1.7/src/Fl_mac.cxx 2006-01-15 03:26:54.000000000 +0100 ++++ fltk-1.1.7.new/src/Fl_mac.cxx 2007-12-18 14:13:41.000000000 +0100 +@@ -121,7 +121,7 @@ + static unsigned short macKeyLookUp[128] = + { + 'a', 's', 'd', 'f', 'h', 'g', 'z', 'x', +- 'c', 'v', 0/*ISO extra ('#' on German keyboard)*/, 'b', 'q', 'w', 'e', 'r', ++ 'c', 'v', '^', 'b', 'q', 'w', 'e', 'r', + + 'y', 't', '1', '2', '3', '4', '6', '5', + '=', '9', '7', '-', '8', '0', ']', 'o', +@@ -2159,14 +2159,15 @@ + Size len = 0; + if (GetCurrentScrap(&scrap) == noErr && scrap != myScrap && + GetScrapFlavorSize(scrap, kScrapFlavorTypeText, &len) == noErr) { +- if ( len > fl_selection_buffer_length[1] ) { ++ if ( len >= fl_selection_buffer_length[1] ) { + fl_selection_buffer_length[1] = len + 32; + delete[] fl_selection_buffer[1]; +- fl_selection_buffer[1] = new char[len]; ++ fl_selection_buffer[1] = new char[len + 32]; + } ++ fl_selection_length[1] = len; len++; + GetScrapFlavorData( scrap, kScrapFlavorTypeText, &len, + fl_selection_buffer[1] ); +- fl_selection_length[1] = len; ++ fl_selection_buffer[1][fl_selection_length[1]] = 0; + // turn all \r characters into \n: + for (int x = 0; x < len; x++) { + if (fl_selection_buffer[1][x] == '\r') +diff -ur fltk-1.1.7/src/Fl_Menu.cxx fltk-1.1.7.new/src/Fl_Menu.cxx +--- fltk-1.1.7/src/Fl_Menu.cxx 2006-01-17 22:04:55.000000000 +0100 ++++ fltk-1.1.7.new/src/Fl_Menu.cxx 2007-12-18 14:13:41.000000000 +0100 +@@ -107,6 +107,7 @@ + int titlex(int); + void autoscroll(int); + void position(int x, int y); ++ int is_inside(int x, int y); + }; + + #define LEADING 4 // extra vertical leading +@@ -458,6 +459,15 @@ + return xx; + } + ++// return 1, if the given root coordinates are inside the window ++int menuwindow::is_inside(int mx, int my) { ++ if ( mx < x_root() || mx >= x_root() + w() || ++ my < y_root() || my >= y_root() + h()) { ++ return 0; ++ } ++ return 1; ++} ++ + //////////////////////////////////////////////////////////////// + // Fl_Menu_Item::popup(...) + +@@ -488,9 +498,20 @@ + int nummenus; + int menubar; // if true p[0] is a menubar + int state; ++ int is_inside(int mx, int my); + }; + static menustate* p; + ++// return 1 if the coordinates are inside any of the menuwindows ++int menustate::is_inside(int mx, int my) { ++ int i; ++ for (i=nummenus-1; i>=0; i--) { ++ if (p[i]->is_inside(mx, my)) ++ return 1; ++ } ++ return 0; ++} ++ + static inline void setitem(const Fl_Menu_Item* i, int m, int n) { + p->current_item = i; + p->menu_number = m; +@@ -595,14 +616,11 @@ + int mx = Fl::event_x_root(); + int my = Fl::event_y_root(); + int item=0; int mymenu = pp.nummenus-1; +- if (e == FL_PUSH && (!pp.menubar || mymenu) && +- (mx < pp.p[mymenu]->x_root() || +- mx >= (pp.p[mymenu]->x_root() + pp.p[mymenu]->w()) || +- my < pp.p[mymenu]->y_root() || +- my >= (pp.p[mymenu]->y_root() + pp.p[mymenu]->h()))) { +- // Clicking outside menu cancels it... ++ // Clicking or dragging outside menu cancels it... ++ if ((!pp.menubar || mymenu) && !pp.is_inside(mx, my)) { + setitem(0, -1, 0); +- pp.state = DONE_STATE; ++ if (e==FL_PUSH) ++ pp.state = DONE_STATE; + return 1; + } + for (mymenu = pp.nummenus-1; ; mymenu--) { +diff -ur fltk-1.1.7/src/fl_scroll_area.cxx fltk-1.1.7.new/src/fl_scroll_area.cxx +--- fltk-1.1.7/src/fl_scroll_area.cxx 2005-04-16 02:13:17.000000000 +0200 ++++ fltk-1.1.7.new/src/fl_scroll_area.cxx 2007-12-18 14:13:41.000000000 +0100 +@@ -32,6 +32,7 @@ + #include <config.h> + #include <FL/Fl.H> + #include <FL/x.H> ++#include <FL/fl_draw.H> + + // scroll a rectangle and redraw the newly exposed portions: + void fl_scroll(int X, int Y, int W, int H, int dx, int dy, +diff -ur fltk-1.1.7/src/Fl_Shared_Image.cxx fltk-1.1.7.new/src/Fl_Shared_Image.cxx +--- fltk-1.1.7/src/Fl_Shared_Image.cxx 2005-04-16 02:13:17.000000000 +0200 ++++ fltk-1.1.7.new/src/Fl_Shared_Image.cxx 2007-12-18 14:13:41.000000000 +0100 +@@ -227,7 +227,7 @@ + fread(header, 1, sizeof(header), fp); + fclose(fp); + } else { +- memset(header, 0, sizeof(header)); ++ return; + } + + // Load the image as appropriate... +diff -ur fltk-1.1.7/src/Fl_Window.cxx fltk-1.1.7.new/src/Fl_Window.cxx +--- fltk-1.1.7/src/Fl_Window.cxx 2005-12-14 14:51:51.000000000 +0100 ++++ fltk-1.1.7.new/src/Fl_Window.cxx 2007-12-18 14:13:41.000000000 +0100 +@@ -36,7 +36,7 @@ + #include "flstring.h" + + #ifdef __APPLE_QUARTZ__ +-#include <FL/fl_draw.h> ++#include <FL/fl_draw.H> + #endif + + void Fl_Window::_Fl_Window() { +diff -ur fltk-1.1.7/test/preferences.fl fltk-1.1.7.new/test/preferences.fl +--- fltk-1.1.7/test/preferences.fl 2005-04-08 20:18:26.000000000 +0200 ++++ fltk-1.1.7.new/test/preferences.fl 2007-12-18 14:13:41.000000000 +0100 @@ -69,7 +69,7 @@ } } @@ -522,8 +544,9 @@ xywh {38 160 95 20} } } ---- test/sudoku.cxx -+++ test/sudoku.cxx +diff -ur fltk-1.1.7/test/sudoku.cxx fltk-1.1.7.new/test/sudoku.cxx +--- fltk-1.1.7/test/sudoku.cxx 2006-01-13 23:46:30.000000000 +0100 ++++ fltk-1.1.7.new/test/sudoku.cxx 2007-12-18 14:13:41.000000000 +0100 @@ -547,7 +547,7 @@ break; |