Skip Menu |

This queue is for tickets about the Tcl-pTk CPAN distribution.

Report information
The Basics
Id: 125057
Status: resolved
Priority: 0/
Queue: Tcl-pTk

People
Owner: CAC [...] cpan.org
Requestors: CAC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.92
Fixed in: 0.93



Subject: focusFollowsMouse not supported
focusFollowsMouse does not seem to be supported by pTk. When a program tries to use it, a fatal error like the following results: bad option "focus": must be cget or configure at /opt/local/lib/perl5/site_perl/5.26/Tcl/pTk/Widget.pm line 336. at /opt/local/lib/perl5/site_perl/5.26/Tcl/pTk/Widget.pm line 336. Tcl::pTk::Widget::call(Tcl::pTk::MainWindow=HASH(0x7fa43f249640), ".", "focus", "follows", "mouse") called at /opt/local/lib/perl5/site_perl/5.26/Tcl/pTk/Widget.pm line 2835 Tcl::pTk::Widget::__ANON__[/opt/local/lib/perl5/site_perl/5.26/Tcl/pTk/Widget.pm:2836](Tcl::pTk::MainWindow=HASH(0x7fa43f249640)) called at /opt/local/lib/perl5/site_perl/5.26/Tcl/pTk/Widget.pm line 2870 Tcl::pTk::Widget::AUTOLOAD called at /opt/local/lib/perl5/site_perl/5.26/Tcl/pTk/MainWindow.pm line 14 Tcl::pTk::MainWindow::AUTOLOAD(Tcl::pTk::MainWindow=HASH(0x7fa43f249640)) called at /Users/christopherchavez/git/HSW12/Perl/hsw12_gui.pm line 414 hsw12_gui::create_main_window(hsw12_gui=HASH(0x7fa43e20d590)) called at /Users/christopherchavez/git/HSW12/Perl/hsw12_gui.pm line 4585 hsw12_gui::build_gui(hsw12_gui=HASH(0x7fa43e20d590)) called at /Users/christopherchavez/git/HSW12/Perl/hsw12_gui.pm line 358 hsw12_gui::new("hsw12_gui", undef) called at hsw12.pl line 71 I wonder if this is simply an issue with how focusFollowsMouse is being handled/translated somewhere in pTk.
On Mon Apr 09 14:13:21 2018, CAC wrote:
Show quoted text
> I wonder if this is simply an issue with how focusFollowsMouse is
> being handled/translated somewhere in pTk.

I followed where focusFollowsMouse was being handled, and saw that it was falling through to the camelCase method handling where it gets split into 'focus follows mouse'.

I thought it would make sense to try adding an entry "focusFollowsMouse" => [ qw(tk_focusFollowsMouse) ] to %ptk2tcltk_mapper since it doesn't take any arguments. But I found that it only works if icall is used rather than invoke. So instead I went ahead and added a sub focusFollowsMouse to Widget.pm that uses icall directly. I've attached a patch with this; it should now let existing programs use focusFollowsMouse.

With that now working, I've noticed that the implicit focusing behavior under aqua is somewhat different than under x11, usually such that windows and widgets are less likely to get focus in aqua than in x11.

Subject: tclptk-focusfollowsmouse.patch
--- Widget.pm.orig 2018-06-20 22:32:46.000000000 -0500 +++ Widget.pm.new 2018-06-20 22:34:44.000000000 -0500 @@ -970,6 +970,12 @@ return $val; } + +sub focusFollowsMouse { + my $self = shift; + my $interp = $self->interp; + $interp->icall('tk_focusFollowsMouse'); +} sub grabRelease { my $self = shift;