Closed wavexx closed 1 year ago
Issue is related to the mouse button1 grab used for the focus action. I also sometimes experience the issue in a few apps. Looking for a solution, but in the mean time you can workaround the issue by disabling the default bind: bind[] = ANYMOD+Button1
On Wed, Nov 07 2018, LordReg wrote:
Issue is related to the mouse button1 grab used for the focus action. I also sometimes experience the issue in a few apps. Looking for a solution, but in the mean time you can workaround the issue by disabling the default bind: bind[] = ANYMOD+Button1
This would explain some weird behavior which I had in some other apps from time to time. However, with slic3r it really breaks the program completely (and reliably).
Could I help diagnosing this? Any pointers to where this happens in the source?
On Wed, Nov 07 2018, LordReg wrote:
bind[] = ANYMOD+Button1
BTW, this definitely fixes/confirms the issue.
The issue is that button1 is passively grabbed on an ancestor of the application window (root in this case). When the grab is activated by pressing button1, the pointer effectively moves to another window, causing leavenotify with a mode of ungrab to be sent to the application window. Some programs, such as slic3r, treat this as a focus change to another window. I would consider that an issue with the program. Programs should be able to handle button presses being intercepted and replayed.
After giving this some thought, a solution/workaround would be to switch to grabbing the focus button bindings on each relevant window (including bar/region input windows) instead of root. When an application becomes focused, the focus button grab(s) can be released for the window. When the window loses focus, the binding(s) can be re-grabbed.
On Wed, Nov 07 2018, LordReg wrote:
Issue is related to the mouse button1 grab used for the focus action. I also sometimes experience the issue in a few apps. Looking for a solution, but in the mean time you can workaround the issue by disabling the default bind: bind[] = ANYMOD+Button1
I have to admit, I didn't have any time to look at this.
I ran without the default bind for a while, but well... you do notice its absence ;)
@LordReg did you produce a patch for this?
Sadly, I realized this particular issue also breaks all those "overlay" GTK3 scrollbars which are increasingly common.
@LordReg halp!!
@marcopeereboom on it
Bump
@LordReg any news?
@LordReg we know you're keeping the fix in your repo, c'mon ;)
@wavexx true ;) there is a focus issue complication I need to resolve before it is ready.
@wavexx fixed some input focus issues that may have solved this issue. would you please verify?
On Wed, Jun 17 2020, LordReg wrote:
@wavexx fixed some input focus issues that may have solved this issue. would you please verify?
Last commit is very crashy. I have this happening every time gpgagent pops up:
Core was generated by `./spectrwm'. Program terminated with signal SIGSEGV, Segmentation fault.
6719 tmpw->focus_redirect = w; (gdb) p tmpw $1 = (struct ws_win *) 0x0 (gdb) where
at ../spectrwm.c:11139
@wavexx fixed
On Wed, Jun 17 2020, LordReg wrote:
@wavexx fixed
Ok, crash fixed.
But the underlying issue still seem to be a problem. Gtk3 overlay scrollbars are still broken unless I unbind ANYMOD+Button1.
Quickest way to test this is by running any gtk3 program with a text edit widget with scrollbars. The "gtk3-widget-factory" demo is what I've used to test this.
Which version of gtk are you running? I just tried gtk3-widget-factory on gtk 3.24.20 and the scrollbars on the text edit widgets seem to work correctly for me.
On Wed, Jun 17 2020, LordReg wrote:
Which version of gtk are you running? I just tried gtk3-widget-factory on gtk 3.24.20 and the scrollbars on the text edit widgets seem to work correctly for me.
Running on debian unstable: 3.24.20. Does the widget-factory shows proper overlay scrollbars?
Go nearby the scrollbar to that it expands, but stay away far enough so that you're outside the "thin" collapsed form. The handle will highlight, but as soon as you click on it it will disappear and select the underlying text. This immediately goes away after unbinding Button1.
I could try to record a small video if you want to see this.
That explanation was helpful. I see no issue when I click and drag the overlay. I was able to reproduce the issue by clicking the overlay without moving the pointer. The overlay fades and disappears if ANYMOD+Button1 is bound.
FIY the behavior regarding the overlay scrollbars in gtk3 isn't gone even with cd55588.
I can still reproduce it on the gtk3-widget-factory.
The simplest program linking with gtk-3 on my system with overlay scrollbars seems to be "pavucontrol". Just go to the config tab, shrink the window until control don't fit then you get two overlay scrollbars that still doesn't play nicely.
gucharmap also has an overlay bar in the unicode block list.
Saying this because I'm not using slic3r-pe anymore to reproduce this issue: overlay scrollbars are more annoying (in every damn sense).
Behavior of the overlay scrollbar with gucharmap, ANYMOD+Button1 unbound:
notice how you can go to the very edge of the bar, stop, click and the handle will attach to the current position. Behavior as expected.
Now with ANYMOD+Button1 bound:
the same just makes the bar disappear. The working hit zone is the width of the collapsed bar.
You are only running cd555885? Most of the improvements come after. Current is 67e16a13 :)
cd555885 alone may not be sufficient to workaround the gtk3-widget-factory issue. I suspect GTK may have overlooked these issues since mutter ungrabs click-to-focus on focused windows.
This is where the 9a8989d0 comes in. Button bindings with the REPLAY
flag (e.g. default focus
binding) are handled passively, without grabs. The click passes directly to the program the same as being unbound.
Yes, I'm building on current master (67e16a1)
Hah, turns out I had a stale binary in my $PATH while I was testing this. Re-testing this now, again, I can't see any difference so it seems to work as intended :)
Good! Actually, cd55588 did fix this issue. 9a8989d is better. Should have asked you to verify spectrwm -v
;)
Your comment was enough to make me dubious. The issue here is that I sometimes used Xephyr as a test bench and ran ./spectrwm from the built path. Right now I was testing from my main config, but I was still getting the wrong binary. Sorry for the noise.
Ironically.. I was testing the xrandr reconfig issue, and for 5 times in a row I didn't have issues! Maagic :P
I discovered a case where spectrwm (latest build from master) seems to break the behavior of al wx-gtk program in a puzzling way.
Clicks with the 1st mouse button do not behave as expected with an empty spectrwm config, while they work with other WMs (awesome, i3). I tried the most obvious things (disable swmhack, quirks, focus mode), but no dice.
This is happening on slic3r-pe 1.41.1.
https://github.com/prusa3d/Slic3r/releases : get the latest tar.bz2, unpack, run directly with ./slic3r from the tarball.
Just dismiss the wizard with ESC, click "Add" on the toolbar and load something (https://www.thingiverse.com/download:1990663).
It will appear as bright green. Click immediately with the 3rd mouse button on the third icon on the side:
you will see it turns orange and triggers some rotation behavior.
Kill slic3r, re-run and use the 1st mouse button to do the same instead: it doesn't work. Somehow, slic3r sees some other pointer event that causes a deselection.
If you try with another wm (twm will do), it works as intended.
Is there anything that could affect the behavior of the pointer events?