-
Notifications
You must be signed in to change notification settings - Fork 1
/
modify_xserver_and_gtk.txt
59 lines (46 loc) · 2.61 KB
/
modify_xserver_and_gtk.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
http://stackoverflow.com/questions/15270420/why-xgrabkey-generates-extra-focus-out-and-focus-in-events
https://gist.github.com/diyism/7442088
======================================
ubuntu下重新编译xorg-server:
sudo apt-get build-dep xorg-server
apt-get source xorg-server
cd xorg-server-*
#modify or patch it: comment "DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);" in ActivateKeyboardGrab() in dix/events.c, comment "DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab);" in DeactivateKeyboardGrab()
debuild -us -uc #"-us -uc" to avoid the signature step, maybe need: sudo apt-get install devscripts dwz
cd ..
sudo dpkg --install xserver-common_*.deb
sudo dpkg --install xserver-xorg-core_*.deb
#clear dependencies:
sudo apt-mark auto $(apt-cache showsrc xorg-server | grep Build-Depends | perl -p -e 's/(?:[\[(].+?[\])]|Build-Depends:|,|\|)//g')
sudo apt-get autoremove
#hold the lib:
sudo apt-mark hold xserver-common
sudo apt-mark hold xserver-xorg-core
sudo apt-mark showhold
==============================================
gtkmenu.c->popup_grab_on_window->gdk_keyboard_grab->gdk_x11_device_core_grab->XGrabKeyboard()
sudo apt-get build-dep gtk+2.0
apt-get source gtk+2.0
cd gtk+2.0-*
#modify or patch it: add "return TRUE;" in first line of popup_grab_on_window() of gtk/gtkmenu.c
dpkg-source --commit
debuild --prepend-path=/usr/lib/ccache -us -uc #"-us -uc" to avoid the signature step, maybe need: sudo apt-get install devscripts
cd ..
sudo dpkg --install libgtk2.0-0_*.deb
#clear dependencies:
sudo apt-mark auto $(apt-cache showsrc gtk+2.0 | grep Build-Depends | perl -p -e 's/(?:[\[(].+?[\])]|Build-Depends:|,|\|)//g')
sudo apt-get autoremove
#hold the lib:
sudo apt-mark hold libgtk2.0-0
sudo apt-mark showhold
=========================================================
注意要编译其他软件比如要先sudo apt-get install libgtk2.0-dev的时候会报依赖的libgtk2.0-0不是最新版本, 可以:
apt-get download libgtk2.0-dev
sudo dpkg --force-depends -i libgtk2.0-dev_*.deb
"debuild -us -uc"那一步容易碰到"'pkg-config --modversion glib-2.0' returned 2.58.3, but GLIB (2.56.0) was found!", 可以通过命令:
dpkg -l | grep glib | grep 2.56
找出来陈旧的包先进行升级
升级完似乎也没用, 最后找到旧的文件是/lib/x86_64-linux-gnu/libglib-2.0.so.0.5600.0
删掉旧文件并sudo apt-get --reinstall install libglib2.0-0 就好了
thunar和xfce-terminal本身代码里加了gdk_keyboard_grab(lxterminal没有), 没有直接用gtkmenu, 改gtk对其无效:
https://github.com/xfce-mirror/xfce4-terminal/blob/93973960c6958c63a1a79b20ba48cae53acca95a/terminal/terminal-window-dropdown.c#L583