Dropbox、通知发送和 OSD 干扰 Ctrl 快捷键

Dropbox、通知发送和 OSD 干扰 Ctrl 快捷键

我正在使用 Ubuntu 13.04 和 i3 4.5.1。当 i3wm 启动时,Ctrl-C/-D/-K 等工作正常。当我启动 Dropbox、通知发送或更改音量时,所有 Ctrl 快捷键都停止工作。

我可以重现这个问题:

  1. 重启X,登录i3wm
  2. 打开终端,验证 Ctrl-C、Ctrl-A、Ctrl-K 和 Ctrl-D 是否有效 => 有效
  3. 启动以下程序之一:
    • Dropbox 与/usr/bin/dropbox start
    • 触发 OSD 通知notify-send "Test"
    • 使用音量键更改音量
  4. 再次在终端中尝试 Ctrl-C、-A、-K 和 -D => 不再起作用

要恢复 Ctrl-something 快捷键,我必须重新启动 X。有趣的是,如果先按下 Shift,则使用 Shift-Ctrl-something 的命令仍然有效。

xev这是我按 Ctrl-C 时的输出。在执行上述步骤 3 之前:

    KeyPress event, serial 33, synthetic NO, window 0x1a00001,
        root 0x259, subw 0x0, time 7988829, (-219,177), root:(505,197),
        state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyPress event, serial 33, synthetic NO, window 0x1a00001,
        root 0x259, subw 0x0, time 7988878, (-219,177), root:(505,197),
        state 0x4, keycode 54 (keysym 0x63, c), same_screen YES,
        XLookupString gives 1 bytes: (03) "^C"
        XmbLookupString gives 1 bytes: (03) "^C"
        XFilterEvent returns: False

    KeyRelease event, serial 33, synthetic NO, window 0x1a00001,
        root 0x259, subw 0x0, time 7988949, (-219,177), root:(505,197),
        state 0x4, keycode 54 (keysym 0x63, c), same_screen YES,
        XLookupString gives 1 bytes: (03) "^C"
        XFilterEvent returns: False

    KeyRelease event, serial 33, synthetic NO, window 0x1a00001,
        root 0x259, subw 0x0, time 7988970, (-219,177), root:(505,197),
        state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False

上面第 3 步之后:

    KeyPress event, serial 33, synthetic NO, window 0x1e00001,
        root 0x259, subw 0x0, time 8064649, (-238,542), root:(486,562),
        state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False

    FocusOut event, serial 33, synthetic NO, window 0x1e00001,
        mode NotifyGrab, detail NotifyAncestor

    FocusIn event, serial 33, synthetic NO, window 0x1e00001,
        mode NotifyUngrab, detail NotifyAncestor

    KeymapNotify event, serial 33, synthetic NO, window 0x0,
        keys:  2   0   0   0   32  0   0   0   0   0   0   0   0   0   0   0
               0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

    KeyRelease event, serial 33, synthetic NO, window 0x1e00001,
        root 0x259, subw 0x0, time 8064926, (-238,542), root:(486,562),
        state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
        XLookupString gives 0 bytes:
        XFilterEvent returns: False

我不知道应该从哪里开始调试问题。你能给我一些如何找到这个问题的原因的指导吗?

谢谢!

贝内迪克特

答案1

好的,我设法找到了问题的原因。对于遇到此问题的其他人,以下是查找原因的方法

  1. 遵循以下建议http://mg.pov.lt/blog/xorg-snafu.html并终止gnome-settings-manager,然后检查 Ctrl 快捷键是否再次开始工作。如果是这种情况,您就遇到了 Marius 在他的页面上描述的错误,可能应该升级 X.org。
  2. 如果这不能解决问题,请使用xrestop获取所有 X 应用程序的列表。杀死其中一个,重新尝试 Ctrl 快捷键并重复。您可能会发现哪个 X 应用程序捕获了 Ctrl 键。
  3. 如果 Ctrl 快捷键仍然不起作用,请开始终止其他进程(通过 找到ps aux),重新尝试 Ctrl 快捷键并重复。其中一个过程将捕获 Ctrl 键。当然,当您随机终止进程时,您可能会丢失数据或者系统可能崩溃......

对我来说,1.和2.并没有解决问题。在第三步中,我发现dunst捕获了 Ctrl 键。dunst是一个通知守护进程,Dropbox 通知、通知发送和其他屏幕显示均由dunst我的系统处理。这就解释了为什么我一启动其中一个程序就会出现问题。我已经卸载了dunst,但是对于那些想要保留的人,您也可以更改其中的modifier密钥~/.config/dunst/dunst(不要将其设置为ctrl)。

相关内容