pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

fltk14-devel: Add upstream patch for Issue 935.



Module Name:	pkgsrc-wip
Committed By:	Michael Baeuerle <micha%NetBSD.org@localhost>
Pushed By:	micha
Date:		Mon Mar 18 13:01:22 2024 +0100
Changeset:	11b795e99ad89d68bbaf5bde29f8f2980de73835

Modified Files:
	fltk14-devel/Makefile
	fltk14-devel/distinfo
Added Files:
	fltk14-devel/patches/patch-src_Fl__x.cxx

Log Message:
fltk14-devel: Add upstream patch for Issue 935.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=11b795e99ad89d68bbaf5bde29f8f2980de73835

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 fltk14-devel/Makefile                    |  2 +-
 fltk14-devel/distinfo                    |  7 ++--
 fltk14-devel/patches/patch-src_Fl__x.cxx | 62 ++++++++++++++++++++++++++++++++
 3 files changed, 67 insertions(+), 4 deletions(-)

diffs:
diff --git a/fltk14-devel/Makefile b/fltk14-devel/Makefile
index 678ee271f1..6ce986f4dd 100644
--- a/fltk14-devel/Makefile
+++ b/fltk14-devel/Makefile
@@ -3,7 +3,7 @@
 DISTNAME=	fltk-1.4.x
 CATEGORIES=	x11
 MASTER_SITES=	${MASTER_SITE_GITHUB:=fltk/}
-GITHUB_TAG=	cc15700bdb918699b6977140f27f6183efc3ac76
+GITHUB_TAG=	036e0334dc9190c37766153bd8c74ce31dedfcf2
 EXTRACT_SUFX=	.zip
 
 MAINTAINER=	micha%NetBSD.org@localhost
diff --git a/fltk14-devel/distinfo b/fltk14-devel/distinfo
index 0dfe7602b8..e843a1e8ab 100644
--- a/fltk14-devel/distinfo
+++ b/fltk14-devel/distinfo
@@ -1,8 +1,9 @@
 $NetBSD$
 
-BLAKE2s (fltk-1.4.x-cc15700bdb918699b6977140f27f6183efc3ac76.zip) = f0d237e3936e4faf1f1262cb361b91cff9eb5a25b91bc2aa8f98b5093a5c8e42
-SHA512 (fltk-1.4.x-cc15700bdb918699b6977140f27f6183efc3ac76.zip) = 51e6a3b2027d06f8bb62539bb46239aaa6bd8954826eb67c1001f9c5eb91af9e3d5e37fe2f1e70e2960ba431252fb027416e31374f7eb524b16dd79572a3e0ea
-Size (fltk-1.4.x-cc15700bdb918699b6977140f27f6183efc3ac76.zip) = 9325097 bytes
+BLAKE2s (fltk-1.4.x-036e0334dc9190c37766153bd8c74ce31dedfcf2.zip) = 8a31faa44bcaac605f4e5748fe8dff993e39cda84aee1ed7adff9d21f797e0b9
+SHA512 (fltk-1.4.x-036e0334dc9190c37766153bd8c74ce31dedfcf2.zip) = 4f2002cda26aeeeecce89ca8198ae7a1b4ba33803115420827074de2bbef442c634c5553d215e4a2324d23c759b4499d6022f925baa09e27453513715435eb76
+Size (fltk-1.4.x-036e0334dc9190c37766153bd8c74ce31dedfcf2.zip) = 9335237 bytes
 SHA1 (patch-Makefile) = 6ee1ce87974ccc307c6213ffc7cb5d989cc463d4
 SHA1 (patch-documentation_Makefile) = 2bf2bdcb808ed75bee22d9587a5fc5edb5f22e35
+SHA1 (patch-src_Fl__x.cxx) = 7cc66c24867c3ad38b0a23286e533680044576e9
 SHA1 (patch-test_Makefile) = fe53f4571ac0388866e719dd15628a2648319aa9
diff --git a/fltk14-devel/patches/patch-src_Fl__x.cxx b/fltk14-devel/patches/patch-src_Fl__x.cxx
new file mode 100644
index 0000000000..32b6744809
--- /dev/null
+++ b/fltk14-devel/patches/patch-src_Fl__x.cxx
@@ -0,0 +1,62 @@
+$NetBSD$
+
+Upstream patch for slow menubar on NetBSD with Unicode locales:
+https://github.com/fltk/fltk/issues/935
+
+--- src/Fl_x.cxx.orig	2024-03-17 02:16:19.000000000 +0000
++++ src/Fl_x.cxx
+@@ -1232,17 +1232,45 @@ static void after_display_rescale(float 
+ }
+ #endif // USE_XFT
+ 
++#  include "Fl_Int_Vector.H"
++static Fl_Int_Vector xid_vector; // for list of FLTK-created xid's
++
++static bool remove_int_vector(Fl_Int_Vector& v, int val) {
++  unsigned pos;
++  for (pos = 0; pos < v.size(); pos++) {
++    if (v[pos] == val) break;
++  }
++  if (pos >= v.size()) return false;
++  int last = v.pop_back();
++  if (last != val) v[pos] = last;
++  return true;
++}
++
+ int fl_handle(const XEvent& thisevent)
+ {
+   XEvent xevent = thisevent;
+   fl_xevent = &thisevent;
+   Window xid = xevent.xany.window;
++  
++  // For each DestroyNotify event, determine whether an FLTK-created window
++  // is being destroyed. 
++  // It's true if xid is in xid_vector containing all FLTK-created xid's.
++  bool xid_is_from_fltk_win = false;
++  if (xevent.type == DestroyNotify) {
++    // set whether xid belongs to vector of FLTK-created xid's
++    xid_is_from_fltk_win = remove_int_vector(xid_vector, (int)xid);
++//printf("xid=%ld is_from_fltk_win=%d\n",xid,xid_is_from_fltk_win);
++  }
+ 
+   if (Fl_X11_Screen_Driver::xim_ic && xevent.type == DestroyNotify &&
+-        xid != Fl_X11_Screen_Driver::xim_win && !fl_find(xid))
++        xid != Fl_X11_Screen_Driver::xim_win && !fl_find(xid) && !xid_is_from_fltk_win)
+   {
++// when using menus: xid is a closed FLTK win, xim_win is non-FLTK
++// after XIM crash: xid is non-FLTK
++// provoke XIM crash: kill process "ibus-daemon --panel disable --xim"
+     XIM xim_im;
+     xim_im = XOpenIM(fl_display, NULL, NULL, NULL);
++//printf("xid=%lu xim_win=%lu XOpenIM->%p\n", xid,Fl_X11_Screen_Driver::xim_win,xim_im);
+     if (!xim_im) {
+       /*  XIM server has crashed */
+       XSetLocaleModifiers("");
+@@ -2372,6 +2400,7 @@ void Fl_X11_Window_Driver::un_maximize()
+ void fl_fix_focus(); // in Fl.cxx
+ 
+ Fl_X* Fl_X::set_xid(Fl_Window* win, Window winxid) {
++  xid_vector.push_back(winxid);
+   Fl_X *xp = new Fl_X;
+   xp->xid = winxid;
+   Fl_Window_Driver::driver(win)->other_xid = 0;


Home | Main Index | Thread Index | Old Index