Discussion:
Strange event handling problem with Xfce/LXDE - which pkg responsible?
(too old to reply)
Michael Lange
2019-05-15 09:00:02 UTC
Permalink
Hi,

it has been observed that when using Tk on Xfce or LXDE for some reason
pressing a mouse button inside a Tk window "phony" <Leave> and <Enter>
events are being triggered. Since not only one DE is affected, the
question arises which package a bug report should be filed against.

The issue has been discussed in more detail at:

https://mail.python.org/pipermail/tkinter-discuss/2019-May/004082.html
and
https://mail.python.org/pipermail/tkinter-discuss/2019-May/004091.html

Does anyone know if both Xfce and LXDE share some library that might be
responsible for that presumably faulty behavior?

Thanks in advance.

Michael

.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.

It would be illogical to assume that all conditions remain stable.
-- Spock, "The Enterprise Incident", stardate 5027.3
Thomas Schmitt
2019-05-15 16:40:01 UTC
Permalink
Hi,
Post by Michael Lange
Does anyone know if both Xfce and LXDE share some library that might be
responsible for that presumably faulty behavior?
Is it sure that not particular versions of tkinter are the common
property of the misbehaving systems ?

I.e. does a plain wish script instead of python+tkinter show the same
inappropriate events ?


Have a nice day :)

Thomas
Michael Lange
2019-05-15 18:20:02 UTC
Permalink
Hi,

thanks for the feedback.

On Wed, 15 May 2019 18:30:58 +0200
Post by Thomas Schmitt
Hi,
Post by Michael Lange
Does anyone know if both Xfce and LXDE share some library that might
be responsible for that presumably faulty behavior?
Is it sure that not particular versions of tkinter are the common
property of the misbehaving systems ?
I.e. does a plain wish script instead of python+tkinter show the same
inappropriate events ?
I am rather sure that this doesn't have anything to do with
Python/Tkinter, though I actually hadn't checked with wish before. Ok, so
I set up this little tcl script:

#############################################
frame .f -bg yellow -width 400 -height 300
pack .f -fill both -expand 1

bind .f <Button-1> {puts "Button-1 event"}
bind .f <Enter> {puts "Enter event"}
bind .f <Leave> {puts "Leave event"}
#############################################

As expected, it's the same as with Tkinter, when the mouse button is
pressed, Enter and Leave events are triggered. So far it has been
reported that this does _not_ happen with MacOs, Gnome, IceWm. It's been
observed so far on Xfce, Lxde and just now Openbox-session (no surprise
probably, since Lxde seems to use Openbox, too).

Other mouse buttons show the same behavior. The same thing happened on
various systems, like Stretch, Sid, Ubuntu 19.04, Ubuntu 18.04.
Since it only seems to happen with Xfce/Xfwm and Openbox/Lxde I think it
is more likely that it is the window manager's fault than that of Tk.

Regards

Michael


.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.

But Captain -- the engines can't take this much longer!
Thomas Schmitt
2019-05-15 19:00:01 UTC
Permalink
Hi,
Post by Michael Lange
So far it has been
reported that this does _not_ happen with MacOs, Gnome, IceWm.
I guess you can add Fvwm2 to this list. At least for me the script works
as it should.
Post by Michael Lange
Since it only seems to happen with Xfce/Xfwm and Openbox/Lxde I think it
is more likely that it is the window manager's fault than that of Tk.
But why then is this not a widespread problem ?
Xfce uses GTK like Gnome does. Originall events are a matter of the X Window
system. But this knowledge is meanwhile subject to bit rot.

So what do you get from programs like xev ?

Without argument it is very verbous about mouse movements. But i can
produce ButtonPress/Release events without interlaced FocusIn/Out
events:

ButtonPress event, serial 37, synthetic NO, window 0x12e00001,
...
ButtonRelease event, serial 37, synthetic NO, window 0x12e00001,
...
ButtonPress event, serial 37, synthetic NO, window 0x12e00001,
...
ButtonRelease event, serial 37, synthetic NO, window 0x12e00001,
...

One may run instead:

xev -event focus

which displays only Enter-Leave events. Those happen for me only when
i really enter and leave. Mouse buttons do not trigger such events.


Have a nice day :)

Thomas
Michael Lange
2019-05-15 20:10:02 UTC
Permalink
Hi,

On Wed, 15 May 2019 20:50:47 +0200
"Thomas Schmitt" <***@gmx.net> wrote:

(...)
Post by Thomas Schmitt
But why then is this not a widespread problem ?
Xfce uses GTK like Gnome does. Originall events are a matter of the X
Window system. But this knowledge is meanwhile subject to bit rot.
I don't know much about these things, I would have guessed that the WM is
somewhere in between X and Tk (or Gtk or any other toolkit). Btw., IceWm
uses Gtk, too. So it apparently has nothing to do with the WM using Gtk.
Post by Thomas Schmitt
So what do you get from programs like xev ?
With xev here using Xfce I get the expected behavior, no bogus Enter or
Leave events when clicking into the window. Does that point to Tk as the
culprit? But then, why doesn't it happen with IceWM or FVWM?

Regards

Michael

.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.

Intuition, however illogical, is recognized as a command prerogative.
-- Kirk, "Obsession", stardate 3620.7
Greg Wooledge
2019-05-15 20:30:02 UTC
Permalink
Post by Michael Lange
#############################################
frame .f -bg yellow -width 400 -height 300
pack .f -fill both -expand 1
bind .f <Button-1> {puts "Button-1 event"}
bind .f <Enter> {puts "Enter event"}
bind .f <Leave> {puts "Leave event"}
#############################################
As expected, it's the same as with Tkinter, when the mouse button is
pressed, Enter and Leave events are triggered [...]
I ran this in straight Tcl/Tk on buster under fvwm and pressing the mouse
button inside the yellow window only generates "Button-1 event", not the
other two.
Michael Lange
2019-05-15 22:20:02 UTC
Permalink
Hi,

On Wed, 15 May 2019 16:27:24 -0400
Post by Greg Wooledge
Post by Michael Lange
#############################################
frame .f -bg yellow -width 400 -height 300
pack .f -fill both -expand 1
bind .f <Button-1> {puts "Button-1 event"}
bind .f <Enter> {puts "Enter event"}
bind .f <Leave> {puts "Leave event"}
#############################################
As expected, it's the same as with Tkinter, when the mouse button is
pressed, Enter and Leave events are triggered [...]
I ran this in straight Tcl/Tk on buster under fvwm and pressing the
mouse button inside the yellow window only generates "Button-1 event",
not the other two.
ok, so now I'm at it I installed a few truckloads of KDE, Gnome and mate
packages and with these three the script works as expected, too.
Post by Greg Wooledge
From the lean and classic department I tried WindowMaker, and again
everything's fine.
Post by Greg Wooledge
From the lean and not so classic ones I tried awesome, and with this it
is worse: each ButtonPress triggers *two* Enter and Leave events :-)

I don't really know what to make of all this. A feeling in my guts
claims that cannot be Tk's fault, but who knows? I think for now I'll
call it a day and think about a bug report tomorrow.

Thanks again for the feedback, and best regards

Michael

.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.

Those who hate and fight must stop themselves -- otherwise it is not
stopped.
-- Spock, "Day of the Dove", stardate unknown
Michael Lange
2019-05-15 20:30:02 UTC
Permalink
Hi,

thanks for the feedback.

[...]

#############################################
frame .f -bg yellow -width 400 -height 300
pack .f -fill both -expand 1

bind .f <Button-1> {puts "Button-1 event"}
bind .f <Enter> {puts "Enter event"}
bind .f <Leave> {puts "Leave event"}
#############################################

As expected, it's the same as with Tkinter, when the mouse button is
pressed, Enter and Leave events are triggered [...]

No Enter or Leave on <Button-1> in my case -- but when entering or
leaving the window (as it is supposed to work). Tcl/Tk from Debian
stable, i.e. 8.6.0+9). No desktop environment, though -- just Fvwm.

Cheers
-- tomás
Jonas Smedegaard
2019-05-15 19:10:01 UTC
Permalink
Quoting Michael Lange (2019-05-15 10:53:14)
Post by Michael Lange
it has been observed that when using Tk on Xfce or LXDE for some
reason pressing a mouse button inside a Tk window "phony" <Leave> and
<Enter> events are being triggered. Since not only one DE is affected,
the question arises which package a bug report should be filed
against.
https://mail.python.org/pipermail/tkinter-discuss/2019-May/004082.html
and
https://mail.python.org/pipermail/tkinter-discuss/2019-May/004091.html
Does anyone know if both Xfce and LXDE share some library that might
be responsible for that presumably faulty behavior?
Please report the issue as a bug as best as you can - e.g. file it
against either of those involved packages (or both, comma-separated).

It is easy in Debian's bugtracker to reassign later to another package
as needed.


- Jonas
--
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136 Website: http://dr.jones.dk/

[x] quote me freely [ ] ask before reusing [ ] keep private
Michael Lange
2019-05-16 22:40:01 UTC
Permalink
Hi,

On Wed, 15 May 2019 21:03:40 +0200
Jonas Smedegaard <***@jones.dk> wrote:

(...)
Post by Jonas Smedegaard
Please report the issue as a bug as best as you can - e.g. file it
against either of those involved packages (or both, comma-separated).
It is easy in Debian's bugtracker to reassign later to another package
as needed.
fyi, I now filed a bug report here:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=929090

Regards

Michael

.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.

Military secrets are the most fleeting of all.
-- Spock, "The Enterprise Incident", stardate 5027.4
Jonas Smedegaard
2019-05-18 16:20:01 UTC
Permalink
Quoting Michael Lange (2019-05-17 00:28:34)
Post by Michael Lange
(...)
Post by Jonas Smedegaard
Please report the issue as a bug as best as you can - e.g. file it
against either of those involved packages (or both, comma-separated).
It is easy in Debian's bugtracker to reassign later to another package
as needed.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=929090
Thanks. Much appreciated!

I notice that others contributed here on this list about that issue.

Please consider re-posting such contributions to ***@bugs.debian.org
to help keep such information tied to the bugreport.

For future cases: Please consider filing bugreports early and encourage
posting followups (also) to the bugreport when seeking help here.


- Jonas
--
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136 Website: http://dr.jones.dk/

[x] quote me freely [ ] ask before reusing [ ] keep private
Michael Lange
2019-05-18 17:40:01 UTC
Permalink
Hi,

On Sat, 18 May 2019 18:18:14 +0200
Jonas Smedegaard <***@jones.dk> wrote:

(...)
Post by Jonas Smedegaard
I notice that others contributed here on this list about that issue.
to help keep such information tied to the bugreport.
I think for now I included all relevant information from this thread into
the bugreport.
Post by Jonas Smedegaard
For future cases: Please consider filing bugreports early and encourage
posting followups (also) to the bugreport when seeking help here.
Sure, I just followed the advice from reportbug which said something like
"if you are unsure which package the bug belongs to, ask on debian-user
for help" :)

Regards

Michael

.-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-.

I realize that command does have its fascination, even under
circumstances such as these, but I neither enjoy the idea of command
nor am I frightened of it. It simply exists, and I will do whatever
logically needs to be done.
-- Spock, "The Galileo Seven", stardate 2812.7
Jonas Smedegaard
2019-05-18 18:30:02 UTC
Permalink
Quoting Michael Lange (2019-05-18 19:31:22)
Post by Michael Lange
On Sat, 18 May 2019 18:18:14 +0200
(...)
Post by Jonas Smedegaard
I notice that others contributed here on this list about that issue.
Please consider re-posting such contributions to
bugreport.
I think for now I included all relevant information from this thread
into the bugreport.
Post by Jonas Smedegaard
For future cases: Please consider filing bugreports early and
encourage posting followups (also) to the bugreport when seeking
help here.
Sure, I just followed the advice from reportbug which said something
like "if you are unsure which package the bug belongs to, ask on
debian-user for help" :)
Ahh, then you are the expert here :-)

I am a long time Debian developer but new to hanging out in d-user :-)


- Jonas
--
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136 Website: http://dr.jones.dk/

[x] quote me freely [ ] ask before reusing [ ] keep private
Loading...