G drags a corner, and the result is usually 2 segments which each have a non uniform angle.
D behaves differently depending on where you drag.
When dragging from near the middle of a segment, it puts that segment on a multiple of 45 degrees and then keeps it parallel to that orientation.
when you Drag a corner, then that corner follows the mouse cursor and an extra track segment may be inserted.
When drawing new tracks with X then holding [Ctrl] limits to horizontal and vertical tracks.
The way this works is also different depending if you use the “modern toolset”, or the old “legacy toolset”.
The “legacy toolset” has already disappeared on my Linux box, and I think it’s being phased out also on other OS-es.