eserte / perl-tk

the perl module Tk
https://metacpan.org/release/Tk
Other
44 stars 31 forks source link

Fix for conflicting symbols in X.h and Windows.h #89

Open chrstphrchvz opened 1 year ago

chrstphrchvz commented 1 year ago

Backported from Tcl/Tk 8.6.10: see https://core.tcl-lang.org/tk/info/9e31fd944934

Fixes #87 Alternative to #88

eserte commented 10 months ago

Hi @chrstphrchvz @mauke to resolve this issue I think it's best to use commit 517fb27 and additionally define the ControlMask+None macros for _WIN32 only, as @mauke suggested. Additionally I think there could be a small test for Tk::X to check that ControlMask+None are available on Windows, and also in other "controlled" systems (linux, freebsd) --- I also don't know if any of the constants may be missing on some platforms.

The proposed changes: https://github.com/eserte/perl-tk/compare/master...gh-87

chrstphrchvz commented 10 months ago

Hi @chrstphrchvz @mauke to resolve this issue I think it's best to use commit 517fb27 and additionally define the ControlMask+None macros for _WIN32 only, as @mauke suggested. Additionally I think there could be a small test for Tk::X to check that ControlMask+None are available on Windows, and also in other "controlled" systems (linux, freebsd) --- I also don't know if any of the constants may be missing on some platforms.

The proposed changes: master...gh-87

Those proposed changes seem fine. I notified upstream Tcl/Tk about this approach, and they accepted it: https://core.tcl-lang.org/tk/info/593eb0227cfa

jgpuckering commented 6 months ago

I applied the changes proposed in https://github.com/eserte/perl-tk/compare/master...gh-87 in situ but Tk would not launch a window. A simple script that instantiates a MainWindow and then creates a Label and Button ran for a brief moment, then silently exited.

I also downloaded Tk-804.036.tar.gz and applied the changes inside it. This allowed the build to complete, though the tests failed. I didn't apply the proposed changes to t\X.t so maybe those would have allowed it to complete. Instead I just ran cpanm --force Tk-804.036.tar.gz and let it install Tk despite the test failures. Same result.

Tk builds and installs and runs just fine in Strawberry perl 5.32, but not in 5.36 or 5.38.

A ticket for this problem has been submitted to RT Tracker https://rt.cpan.org/Ticket/Display.html?id=151625 but no one has taken it and its priority is set to Low. I think it should be a higher priority than that. Tk is a pretty important package, and as it stands it's completely unusable in Strawberry perl above 5.32. I haven't checked ActiveState.