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

Owner: CAC [...]
Requestors: CAC [...]

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


Subject: focusFollowsMouse not supported
Download (untitled) / with headers
text/plain 1.4k
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/ line 336. at /opt/local/lib/perl5/site_perl/5.26/Tcl/pTk/ 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/ line 2835 Tcl::pTk::Widget::__ANON__[/opt/local/lib/perl5/site_perl/5.26/Tcl/pTk/](Tcl::pTk::MainWindow=HASH(0x7fa43f249640)) called at /opt/local/lib/perl5/site_perl/5.26/Tcl/pTk/ line 2870 Tcl::pTk::Widget::AUTOLOAD called at /opt/local/lib/perl5/site_perl/5.26/Tcl/pTk/ line 14 Tcl::pTk::MainWindow::AUTOLOAD(Tcl::pTk::MainWindow=HASH(0x7fa43f249640)) called at /Users/christopherchavez/git/HSW12/Perl/ line 414 hsw12_gui::create_main_window(hsw12_gui=HASH(0x7fa43e20d590)) called at /Users/christopherchavez/git/HSW12/Perl/ line 4585 hsw12_gui::build_gui(hsw12_gui=HASH(0x7fa43e20d590)) called at /Users/christopherchavez/git/HSW12/Perl/ line 358 hsw12_gui::new("hsw12_gui", undef) called at 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 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
--- 2018-06-20 22:32:46.000000000 -0500 +++ 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;

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to