You are not logged in.

#1 2020-04-20 03:41:03

Shapeshifter
Member
Registered: 2008-03-11
Posts: 230

[SOLVED] Touchpad and/or X stop working after hitting certain FN keys

Hi.

I'm using i3 on a Dell XPS 2-in-1 7390 in quite a standard configuration. I start it manually from TTY1 by typing startx after boot.

My problem is that when hitting certain FN keys, X misbehaves in a very strange and irrecoverable fashion. The problem does NOT occur if I start X and i3 via gdm!

Let's say I'm using a minimal test case:

  • Just exec dbus-launch --exit-with-session i3 in .xinitrc, nothing else. Minimum default config for i3.

  • I open urxvt and from there, I run xev, so they're side-by-side.

  • I focus xev.

Everything's fine, i.e. keyboard and mouse move/click events register in xev and are printed in the terminal. Now I hit one of the faulty FN keys (play/pause, screen-brightness-up, screen-brightness-down, among others).

Here's what happens:

  • I can see the FN key event got registered in the terminal. I can hit all of them and they seem to register normally.

  • I cannot use any i3 keyboard shortcuts anymore (to switch workspaces, spawn terminals, kill windows etc.)

  • I can still move the mouse cursor.

  • The mouse cursor still changes depending on the underlying window (pointer for xev, caret for urxvt) if I move it back and forth.

  • But window focus doesn't change anymore when moving back and forth between windows. xev remains focused.

  • I can still type into xev, and events are still printed in the terminal.

  • If I move the cursor over xev, mouse-move events are still printed in the terminal.

  • However, at this point, as soon as I click or tap the mouse just once anywhere, mouse events (including move events) are no longer printed in the terminal! Yet, I can still move it and the cursor still changes, but xev only registers keyboard events from this point on.

  • I can still do Ctrl-Alt-F2 to escape to TTY2 and kill X.

If I focus urxvt instead of xev before hitting an FN key, I can prompt some more, different symptoms:

  • Same as above, I cannot switch focus, use i3 keys or anything like that

  • I can still type into urxvt. I can even Ctrl-C xev. If I do that, the right-hand window, xev, disappears, but the left-hand window, urxvt, doesn't expand into the available space. It's just stuck like that.

  • If I now run xev again from the terminal, I don't see it - it's not drawn on screen - but I can see its terminal output, apparently it's running somewhere. Same for any other application I run from the terminal.

Some FN keys, like Volume up/down are fine and cause no problems.

Logs:
Unfortunately, there aren't any! There are no log messages generated in journald, .local/share/xorg/Xorg.0.log or dmesg. Where else could I look?

I already tried:

  • Using openbox instead of i3. Same exact symptoms.

  • Using the modesetting driver instead of xf86-video-intel. Same exact symptoms.

  • Disabling all configs in /etc/X11/xorg.conf.d/* (I have one for using libinput on the touchpad). Makes no difference. Tapping doesn't work anymore, but the same symptoms happen when clicking using the clickpad.

  • Using Wayland: no problems! In sway, hitting the FN keys has no effect. In gnome, they work exactly as intended out of the box! I can control screen brightness using the FN keys which cause problems in X! None of the FN keys cause any problem.

  • Unfortunately I have no external mouse available to check if it's a touchpad-only problem.

  • Also, I normally use picom, but disabled it for this test case. If I use it, I get some extra symptoms: Once I hit the FN key, I can still move the mouse, and the cursor still changes depending on the underlying window, but there are no more changes on-screen, i.e. terminal output is not printed. I tried running scrot in a 5 second loop, and when examining the screenshots post-mortem, I see that even though the windows still appear frozen on-screen, once I pressed the FN-key, all windows disappeared from the screenshots. Only i3bar remained.

By the way, strangely enough, I already used to have this problem on a Dell XPS 13 9343, also with the same FN keys. I seem to remember that the problem was independent of the touchpad and an external mouse made no difference. I never bothered to fix it. But I don't want to live with the constant threat of hitting the wrong FN-combo and losing my session anymore...

So what gives? This is insane. I can't even find anyone with the same problems, yet I've had it on two different machines.

  • It doesn't seem to be a kernel/firmware problem, because things are splendid in Wayland.

  • It's probably not a driver problem because it happens with both intel and modesetting.

  • It's unlikely to be a problem with i3, because the same problems occur in openbox.

  • Likewise, I can't find anything wrong with my configs because the problem happens even on minimal defaults in i3 and openbox.

  • It must be some sort of problem with X, or the WM-X interaction, but I can't get any debugging information out of either.

  • And what does it mean that i3 doesn't resize the window anymore when killing xev? And why are all windows gone from the buffer when using picom? ...

This is very frustrating. And I don't know what logs/configs to share with you because they're all trivial and at default. I have this problem out of the box on a fresh install.

Any ideas? Any help appreciated, thanks.

Last edited by Shapeshifter (2020-04-20 06:04:19)

Offline

#2 2020-04-20 03:49:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Touchpad and/or X stop working after hitting certain FN keys


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2020-04-20 04:05:07

Shapeshifter
Member
Registered: 2008-03-11
Posts: 230

Re: [SOLVED] Touchpad and/or X stop working after hitting certain FN keys

jasonwryan wrote:

Indeed I normally have this at the top of my .xinitrc, just removed for this test. Tried again now with that block + just exec and it's the same problem.

Offline

#4 2020-04-20 04:36:44

Shapeshifter
Member
Registered: 2008-03-11
Posts: 230

Re: [SOLVED] Touchpad and/or X stop working after hitting certain FN keys

PS: I finally had the presence of mind to try using GDM to start X and an i3 session. Here, the FN keys are causing no trouble at all. I'll try to see if I can determine the root cause for why startx/xinit fails, while it's fine using a display manager... Or I'll just end up using a DM in the end...

edit
PPS: Even more interestingly, running

startx /usr/bin/i3

also has no problems with the FN keys. It's really only when launching via startx that all this mess happens...

So, it turns out that

startx /usr/bin/i3

has no problems. Same goes for putting

exec i3

into .xinitrc and just using startx. No problem.

However...

startx /usr/bin/dbus-launch --exit-with-session i3

gives me the aforementioned problems. Just like the original

exec dbus-launch --exit-with-session i3

in .xinitrc.

So it's down to dbus-launch?!

>.>

Well... I guess that isn't needed anymore. I put that there years ago since the wiki advised so. Apparently that is no longer necessary. Removing dbus-launch and running i3 directly solved the problem. (wtf?)

Last edited by Shapeshifter (2020-04-20 06:04:44)

Offline

#5 2020-04-20 06:21:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [SOLVED] Touchpad and/or X stop working after hitting certain FN keys

See https://wiki.archlinux.org/index.php/Xinit#xinitrc (note the blue note boxes) for how it's supposed to look like.

Offline

Board footer

Powered by FluxBB