You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdedocker/HACKING

61 lines
2.5 KiB

12 years ago
Words of wisdom
1. Make sure all changes work on all desktop environments
12 years ago
2. The System tray protocol specification can be found at
https://freedesktop.org/wiki/Specifications/systemtray-spec
12 years ago
3. The site I use for Xlib reference
12 years ago
http://tronche.com/gui/x/xlib/function-index.html
4. TQt Documentation at https://www.trinitydesktop.org/docs/qt3
12 years ago
5. There's do or no do. There's no try.
12 years ago
TDEDocker Window Docking Strategy and a little bit of history
12 years ago
-----------------------------------------------------------
Couple of things that will help you if you are looking through the code.
I wanted a single instance of TDEDocker to be running all the time. So,
whenever a new instance of TDEDocker was created it would ask the previous
12 years ago
instance take over.
Two things to know about
1. Mapping from the PID (process id) to WID (window id)
2. How to let the previous instance know about app_to_launch
Lets deal with them one by one.
1. PID to WID mapping is easy if people followed rules. Just read _NET_WM_PID
for a window. If it matches the one app's PID we just created, that window is
the one we want to dock. Its not as simple as that. Programs have "splash"
screens. A nice thing is that these "splash" screen have the _WM_TRANSIENT_FOR
property set. So, we can skip those windows. There are these bunch of programs
(like gaim, xmms) that create windows and dont put this property on them. Arrgh.
What we do to counter these applications is to look for interesting windows
possibly created by the process until the process dies. Have a look at the code
for a better understanding.
2. Sending ClientMessages to previous instances with the program name and
arguments is painful and makes the code more complex. Before 1.0, I used to dump
all the program arguments in ~/tdedocker.<pid> and send the pid in a
12 years ago
ClientMessage. The file is then deleted after processing. As of 1.0, I set a
property _KDOCKER_<pid> on the TDEDocker initial instance's window which holds
12 years ago
the program arguments. (The correct way to transfer information is using
XSelections)
TRACING
-------
Add the following line in tdedocker.pro (in fact just uncomment it)
12 years ago
DEFINES += ENABLE_TRACING
Now do a "make clean" and "then make".
Launch TDEDocker. Try recreating the problem.
12 years ago
- Right Click on the tray icon.
- Choose "About TDEDocker"
12 years ago
- You should see a button called "Show Trace". Please note that this button
will appear only when compiled with tracing
- Try debugging yourself or send it to me
- If you send SIGUSR1 to the TDEDocker process, it will dump all the trace to
~/tdedocker.trace
12 years ago