exwm icon indicating copy to clipboard operation
exwm copied to clipboard

Firefox (and Thunderbird) pop-up windows immediately disappear

Open setzer22 opened this issue 6 years ago • 9 comments

This is an issue that I've been dealing with for some time in exwm. I only experience this issue with Firefox and Thunderbird, no other program does this.

What happens is when I right click on a firefox buffer, the context menu that should pop up only appears for a fraction of a second, then disappears. I have recorded a short video to show exactly what I mean: issue

This is issue is happens intermitently. Usually, after some time using my computer, the issue resolves itself and context menus work again with firefox. I have not been able to determine what I do that makes this work.

I have also created a debug log for when the issue occurs. What I'm doing in the log is:

  • Focus the firefox window by clicking it.
  • Press right click only once. The issue occurs and the window is unmapped very fast (this starts on 00:05:45)
[00:05:43] exwm-input--update-focus:	focus-window=#<window 8 on Firefox/New Issue · ch11ng/exwm - Moz...> focus-buffer=Firefox/New Issue · ch11ng/exwm - Moz...
[00:05:43] exwm-input--update-focus:	Set focus on #x18000df
[00:05:43] exwm-input--set-focus:	id=#x18000df
[00:05:43] exwm-input--update-timestamp:	
[00:05:43] exwm--on-PropertyNotify:	atom=_NET_WM_USER_TIME(412)
[00:05:43] exwm-input--on-PropertyNotify:	
[00:05:43] exwm--on-PropertyNotify:	atom=_TIME(640)
[00:05:43] exwm-input--on-PropertyNotify:	
[00:05:43] exwm-input--set-active-window:	
[00:05:43] exwm-input--on-echo-area-dirty:	
[00:05:43] exwm--on-PropertyNotify:	atom=WM_HINTS(35)
[00:05:43] exwm--update-hints:	#x18000df
[00:05:43] exwm-input--on-PropertyNotify:	
[00:05:45] exwm-input--on-ButtonPress:	major-mode=exwm-mode buffer=Firefox/New Issue · ch11ng/exwm - Moz...
[00:05:45] exwm-input--on-ButtonPress-char-mode:	
[00:05:45] exwm--on-PropertyNotify:	atom=_NET_WM_USER_TIME(412)
[00:05:45] exwm-input--on-PropertyNotify:	
[00:05:45] exwm--on-ClientMessage:	atom=_NET_WM_STATE(403)
[00:05:45] exwm-manage--on-UnmapNotify:	id=#x1800111
[00:05:45] exwm-manage--unmanage-window:	Unmanage #x1800111 (buffer: nil, widthdraw: t)

setzer22 avatar Oct 06 '19 09:10 setzer22

This reminds me of #435. Clearly the input focus was correctly set or Firefox won't receive button & key events. There's no much interactions between Firefox and EXWM according to the logs. Which version of Firefox are you using?

ch11ng avatar Oct 06 '19 13:10 ch11ng

My package manager lists "Firefox 69.0.1-0".

As for "unusual" things in my system, I'm using EXWM inside a Plasma 5 session (I just replace Kwin), and additionally I'm using spacemacs and its unofficial exwm layer (https://github.com/timor/spacemacsOS). I don't know whether any of those things may be the culprit, but I thought it may be worth mentioning

setzer22 avatar Oct 06 '19 16:10 setzer22

Same version here.

Do you remember which combination was working (if any), so we can substitute what have been changed and narrow down a bit?

ch11ng avatar Oct 07 '19 12:10 ch11ng

The issue definitely resolves itself when I switch to another window manager (openbox, Kwin), so at least we can safely assume that this is a bad interaction between EXWM and firefox.

However, I haven't tested this outside of spacemacs and/or the Plasma session. Is this what you mean? If so, I will try to test this later on a clean emacs to see if I can reproduce, and gradually add things back until I hit the issue.

Thanks!

setzer22 avatar Oct 07 '19 12:10 setzer22

However, I haven't tested this outside of spacemacs and/or the Plasma session. Is this what you mean? If so, I will try to test this later on a clean emacs to see if I can reproduce, and gradually add things back until I hit the issue.

Yes, that'll help a lot.

ch11ng avatar Oct 07 '19 12:10 ch11ng

@setzer22 did you ever find a solution for this issue? I'm running into the same problem. Firefox right click and dropdown menus instantly close, but after using the computer normally for about an hour or two they'll suddenly start working and just be fine until the next time I reboot.

I've gone through a laundry list of behaviors trying to figure out what the trigger is that makes this suddenly start working:

  • hibernating and waking up doesn't change the behavior.
  • letting the monitor naturally go to sleep and waking it back up doesn't change the behavior.
  • playing a full screen video, launching a game, or trying to make the compositor do something "interesting" with window positioning/full-screen doesn't change the behavior.
  • moving buffers across monitors doesn't solve the issue.
  • reopening firefox or another GTK app on the primary/secondary display doesn't change the behavior.

I think that something I'm doing causes the behavior to switch and the issue to fix itself, if I boot up the computer and don't touch it, then the issue doesn't fix itself. But I can never catch it when its resolved, it's so inconsistent. At some point I'll just notice that right click has started working. Trying to do very targeted small actions and checking over and over hasn't yielded any success.


From what I can tell from logs, it's the same issue. When it's happening, the window is immediately unmapped. In the working logs, unmap doesn't happen until I left click to close the menu (~6 seconds later).

Not working:

[00:02:14] exwm-input--on-ButtonPress:	major-mode=exwm-mode buffer=firefoxdeveloperedition
[00:02:14] exwm-input--mimic-read-event:	
[00:02:14] exwm-input--on-ButtonPress-line-mode:	down-mouse-3
[00:02:14] exwm--on-PropertyNotify:	atom=_NET_WM_USER_TIME(407)
[00:02:14] exwm-input--on-PropertyNotify:	
[00:02:14] exwm--on-ClientMessage:	atom=_NET_WM_STATE(384)
[00:02:14] exwm-manage--on-UnmapNotify:	id=#x80004d
[00:02:14] exwm-manage--unmanage-window:	Unmanage #x80004d (buffer: nil, widthdraw: t)

Working:

[431:33:33] exwm-input--on-ButtonPress:	major-mode=exwm-mode buffer=firefoxdeveloperedition
[431:33:33] exwm-input--mimic-read-event:	
[431:33:33] exwm-input--on-ButtonPress-line-mode:	down-mouse-3
[431:33:33] exwm--on-PropertyNotify:	atom=_NET_WM_USER_TIME(407)
[431:33:33] exwm-input--on-PropertyNotify:	
[431:33:33] exwm--on-ClientMessage:	atom=_NET_WM_STATE(384)
[431:33:39] exwm--on-PropertyNotify:	atom=_NET_WM_USER_TIME(407)
[431:33:39] exwm-input--on-PropertyNotify:	
[431:33:39] exwm-manage--on-UnmapNotify:	id=#x8005c9
[431:33:39] exwm-manage--unmanage-window:	Unmanage #x8005c9 (buffer: nil, widthdraw: t)

My Emacs-foo is pretty bad (started on Spacemacs, I've only ever used vim bindings), but I generally need to clean up my Emacs install anyway, so I will try to see if I can narrow down the problem by paring my config, or possibly taking the plunge and trying to figure out a completely clean install.

I did wonder for a while if it was a compositing issue, but messing with Compton hasn't been particularly helpful. Running compton -CGb was suggested to me online, but does nothing except cause right-click to be inexplicably more broken (I think it moves the menus offscreen). And in any case, from the logs it seems somewhat clear to me that focus is getting lost, that it's not just a rendering/GPU bug.

Will try to start paring down my Emacs config to see what happens.

danShumway avatar Jan 17 '21 05:01 danShumway

I can see that this seems to happen when the exwm-manage--on-UnmapNotify: id=#x8005c9 event gets thrown.

My Emacs/Lisp foo is quite bad, so I apologize for the basic question, but I assume I could throw a stack trace into exwm-manage--on-UnmapNotify and see what's calling it, right? Or is all that code that triggers this stuff going to be mostly asynchronous?

It seems like if I could get a full list of everything Emacs is calling... the unfocus event isn't just magically happening on its own, there has to be a function that's triggering it.


Edit: Issue just fixed itself (until I reboot) just while normally browsing on Firefox after approx 50 minutes of uptime, as far as I can tell I haven't done anything interesting at all (though, again, I'm not sure what the exact time was). I've been running the exwm-debugger the entire session, so I'm going to troll through the full logs to see if anything jumps out.

danShumway avatar Jan 17 '21 05:01 danShumway

@danShumway I'm sorry, I left exwm a while ago. It's an awesome piece of software, but I needed something more stable for my day-to-day work :sweat_smile:.

I can tell, though, that this particular bug was very inconvenient and probably became one of my main motivators to leave for a more mainstream desktop experience. Hope you figure it out! :)

setzer22 avatar Jan 19 '21 17:01 setzer22

Also having this issue with Firefox and Zotero

workcomplete avatar Jul 14 '22 20:07 workcomplete