![VNC 查看器上的“d”键可最小化所有窗口](https://linux22.com/image/1022/VNC%20%E6%9F%A5%E7%9C%8B%E5%99%A8%E4%B8%8A%E7%9A%84%E2%80%9Cd%E2%80%9D%E9%94%AE%E5%8F%AF%E6%9C%80%E5%B0%8F%E5%8C%96%E6%89%80%E6%9C%89%E7%AA%97%E5%8F%A3.png)
我在 Ubuntu 10.10 机器上运行 vnc4server,并使用 TightVNC Viewer 1.3.9 从 Ubuntu 8.04 机器连接到它。我无法d在 VNC 会话中输入任何带有字符的内容,因为这d会导致所有窗口最小化。
在许多在线论坛上报告了成功的解决方案后,我禁用了隐藏所有窗口的键盘快捷键,但问题仍然存在。
的输出xev
如下。它包括两次按下,d因为第一次按下最小化了所有窗口。我不知道要保留什么以及要删除什么,因此此输出包括从第一次按键到第二次按键时窗口恢复的所有内容:
FocusOut event, serial 29, synthetic NO, window 0xa00001,
mode NotifyGrab, detail NotifyAncestor
FocusOut event, serial 29, synthetic NO, window 0xa00001,
mode NotifyWhileGrabbed, detail NotifyNonlinear
FocusIn event, serial 29, synthetic NO, window 0xa00001,
mode NotifyWhileGrabbed, detail NotifyPointer
KeymapNotify event, serial 29, synthetic NO, window 0x0,
keys: 0 0 0 0 0 1 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
LeaveNotify event, serial 29, synthetic NO, window 0xa00001,
root 0x2e, subw 0x0, time 581275388, (100,64), root:(111,572),
mode NotifyNormal, detail NotifyAncestor, same_screen YES,
focus YES, state 0
UnmapNotify event, serial 29, synthetic NO, window 0xa00001,
event 0xa00001, window 0xa00001, from_configure NO
PropertyNotify event, serial 29, synthetic NO, window 0xa00001,
atom 0xc7 (WM_STATE), time 581275388, state PropertyNewValue
PropertyNotify event, serial 29, synthetic NO, window 0xa00001,
atom 0xae (_NET_WM_STATE), time 581275388, state PropertyNewValue
MapNotify event, serial 29, synthetic NO, window 0xa00001,
event 0xa00001, window 0xa00001, override NO
VisibilityNotify event, serial 29, synthetic NO, window 0xa00001,
state VisibilityUnobscured
Expose event, serial 29, synthetic NO, window 0xa00001,
(0,0), width 178, height 10, count 3
Expose event, serial 29, synthetic NO, window 0xa00001,
(0,10), width 10, height 58, count 2
Expose event, serial 29, synthetic NO, window 0xa00001,
(68,10), width 110, height 58, count 1
Expose event, serial 29, synthetic NO, window 0xa00001,
(0,68), width 178, height 110, count 0
EnterNotify event, serial 29, synthetic NO, window 0xa00001,
root 0x2e, subw 0x0, time 581276874, (100,64), root:(111,572),
mode NotifyNormal, detail NotifyAncestor, same_screen YES,
focus NO, state 0
KeymapNotify event, serial 29, synthetic NO, window 0x0,
keys: 4294967283 0 0 0 0 1 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
PropertyNotify event, serial 29, synthetic NO, window 0xa00001,
atom 0xc7 (WM_STATE), time 581276874, state PropertyNewValue
PropertyNotify event, serial 29, synthetic NO, window 0xa00001,
atom 0xae (_NET_WM_STATE), time 581276874, state PropertyNewValue
FocusIn event, serial 29, synthetic NO, window 0xa00001,
mode NotifyWhileGrabbed, detail NotifyNonlinear
KeymapNotify event, serial 29, synthetic NO, window 0x0,
keys: 68 0 0 0 0 1 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
FocusOut event, serial 29, synthetic NO, window 0xa00001,
mode NotifyUngrab, detail NotifyPointer
FocusIn event, serial 29, synthetic NO, window 0xa00001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 29, synthetic NO, window 0x0,
keys: 4294967214 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 0 0 0 0
答案1
现在问题已经解决了。我做出了一个愚蠢的假设,即键绑定是全局的,而事实上,它们是针对每个用户的。我更改了以 root 身份登录的键绑定,但登录的是另一个用户创建的 VNC 会话。该用户的“隐藏所有正常窗口...”快捷方式设置为Mod4+ 。D标准解决方案——将其更改为其他内容,例如Ctrl++ Alt——D解决了这个问题。
答案2
您还可以使用 openbox 作为窗口管理器,而不是用于 VNC 会话的 metacity。
Metacity 快捷方式将不起作用,并且Mod4+D不会破坏任何内容。
答案3
所以我在 5 个不同的 stackexchange 站点上看到了同样的问题,所有答案都说只需删除热键,这确实有效,但不是问题的根源(至少对我来说不是)。真正的问题是 Windows 超级键未正确映射,如下所述:
在 VNC 会话中,i3 忽略 mod4(Windows 密钥)
基本上只需运行这两个命令
xmodmap -e "clear mod4"
xmodmap -e "add Mod4 = Super_L"
应该可以做到这一点。现在,仅当您同时按住超级(Windows)键时才会显示桌面。 “d”键(以及其他具有超级快捷键的键)现在应该按预期工作。
您可能需要根据您的键盘将 Super_L 替换为其他内容,请查看上面的链接了解详细信息。