Skip to content

Commit

Permalink
Eliminate PREFER_MOST_SPECIALIZED_EVENT, since it's always 1 and not …
Browse files Browse the repository at this point in the history
…documented
  • Loading branch information
jan.nijtmans committed Dec 11, 2024
2 parents f138587 + 4a81592 commit 2d5fef1
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions generic/tkBind.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@
* Non-package-specific helpers.
*/

/*
* In old implementation (the one that used an event ring), <Double-1> and <1><1> were
* equivalent sequences. However it is logical to give <Double-1> higher precedence
* since it is more specific. Indeed <Double-1> includes time and space requirements,
* which is not the case for <1><1>.
* This is achieved by setting PREFER_MOST_SPECIALIZED_EVENT to 1.
*/

#ifndef PREFER_MOST_SPECIALIZED_EVENT
# define PREFER_MOST_SPECIALIZED_EVENT 1
#endif

/*
* Traditionally motion events can be combined with buttons in this way: <B1-B2-Motion>.
* However it should be allowed to express this as <Motion-1-2> in addition. This is achieved
Expand Down Expand Up @@ -2131,13 +2119,12 @@ IsBetterMatch(
if (diff > 0) { return 1; }
if (diff < 0) { return 0; }

#if PREFER_MOST_SPECIALIZED_EVENT
{ /* local scope */
#define M (Tcl_WideUInt)1000000
static const Tcl_WideUInt weight[5] = { 0, 1, M, M*M, M*M*M };
#define M 1000000ULL
static const unsigned long long weight[5] = { 0, 1, M, M*M, M*M*M };
#undef M
Tcl_WideUInt fstCount = 0;
Tcl_WideUInt sndCount = 0;
unsigned long long fstCount = 0;
unsigned long long sndCount = 0;
unsigned i;

/*
Expand All @@ -2159,7 +2146,6 @@ IsBetterMatch(
if (sndCount > fstCount) { return 1; }
if (sndCount < fstCount) { return 0; }
}
#endif

return sndMatchPtr->number > fstMatchPtr->number;
}
Expand Down

0 comments on commit 2d5fef1

Please sign in to comment.