-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vim/Gtk3 crashes with BadMatch after Alt-Tabbing to a different desktop #18
Comments
Can you provide me with a backtrace, please? I've tried to reproduce this, but cannot. |
Hm-m, that's strange - I have the same issue consistently on three workstations (all Slackware64-current). Among other things it means that my configuration (almost identical) may be to blame for this, so I need to review it first. And, of all the possible stack traces, which one would be the most useful? To my understanding, it could be that gVim receives a BadMatch event actually intended to something /under/ its window: like, root window trying to get focus back and not expecting this to fail. Sorry if it is utter heresy, I'm not a programmer. But if I am correct - the answer may lie in stack traces issued by gVim (and all underlying Gtk3 multi-threaded orchestra), main FVWM process, or FvwmPager. Posting all three would certainly be an overkill. |
If it's vim which is crashing, that'll definitely help me. Any/all strack traces which are coredumping will help, especially if it's FVWM. |
Sorry, did too much reading on the matter to post a proper bug report. Let's start from the way to reproduce. OS details:
Steps to reproduce:
Details gdb's
(just indicates Vim received an X error which triggered an unclean exit, no indication on what was the request that caused the error) I have tried using xscope to get the X11 exchange that led to the error - here's the event dump: (note an exchange at the end of file - SetInputFocus to parent and subsequent BadMatch - supposedly as the target is not visible) Must be some kind of race condition as with GDK_SYNCHRONIZE=1 the error doesn't happen, and sometimes (very rare - 5% of time) it takes more than one Alt-Tab to crash Vim. Here's xscope output taken with GDK_SYNCHRONIZE=1 in the same scenario: Also when the WindowList menu pops outside of gVim window - Alt-Tab doesn't crash gVim. Using mouse binding to show WindowList works the same as Alt-Tab: almost always a crash when it paints over gVim, works without a crash if outside gVim. To re-iterate, nothing I have seen so far indicates that the issue is isolated to Vim, looks more a general Gtk3 problem with FVWM. PS I have used Xephyr in a window to run the tests: PPS And, no, GDK_SYNCHRONIZE=1 is not a proper fix and not too good a workaround. |
Perfect. Thank you -- I'll try and get round to looking at this soon. I'm moving this to the |
Possibly related to fvwmorg/fvwm#59
I'm using Slackware64-current, FVWM 2.6.9 and Vim 8.2.0050 - both sufficiently recent though not the bleeding edge. FVWM configured with 4 desktops with 2x2 screens.
gVim is built with Gtk3 GUI and works as expected most of the time - until I try to Alt-Tab to another desktop and WindowList is drawn over gVim window. The xscope output is as follows:
As far as I understand, it happens as follows. WindowList steals the input focus and informs gVim of it by sending a PartiallyObscured NotifyEvent, and as gVim tries to get it back from it - it is no longer visible as another desktop is already shown, which is in line with X11 Proto spec .
According to gVim bug #1392, Gtk3 is already handling this scenario by guarding XSetInputFocus() invocation but somehow it is not enough for FVWM.
Alt-Tabbing over the same desktop works as expected, so I believe it is related to how FVWM implements multiple desktops. Though I don't see such problems with other Gtk3 applications - it looks quite generic so it may surface elsewhere as well, and a fix or a good workaround would certainly be nice: maybe guarding XSetInputFocus() in
fvwm/focus.c
same as Gtk3 does?PS Previous gVim version built against Gtk2 does not have this problem - most likely building current gVim against Gtk2 will also "fix" - or, rather, obscure it, but eventually Gtk2 will become obsolete.
The text was updated successfully, but these errors were encountered: