gEDA-dev: New patch for bug #1553544,
New pages inadvertantly created when adding nets in gschem
Peter Clifton
pcjc2 at cam.ac.uk
Thu Sep 7 12:03:13 EDT 2006
This patch fixes the behaviour where pressing the "Up" key after my
previous patch was applied, re-focusses away from the gtk_drawing_area
and onto the toolbar.
It is a more general patch which should fix mis-directed keypress events
which conflict between widgets' default signal handlers and any gschem
keybindings.
By returning TRUE from x_event_key_press(), we can prevent the
propogation of a key press to higher-level handers (such as those which
cause the keyboard focus to move on the "Up" and "Down" keys.)
A small modification to gschem.scm allows the (press-key ..) function to
return #f if no match is found for a given key. g_keys_execute() now
returns 0 for not matched, or 1 for matched, and hence
x_event_key_press() can return TRUE and absorb the keypress.
(The one line, two non-whitespace character scheme modification took me
more time than the rest of the patch!)
The patch re-applies the partial roll-back which Ales committed earlier,
so the key-press event is once again attached to the gtk_drawing_area.
The "Tab" key will still transfer focus between the gtk_drawing_area and
the toolbar, and no gschem key bindings work when the toolbar has focus.
I think this is the correct behaviour. (Certainly bindings like pan, add
net etc... must be disabled.)
If there is to be a sub-set of key-bindings active when the toolbar is
focused, a keypress event ought to be attached to the toolbar. (Or its
nearest parent with a gdk_window, perhaps the main window.)
The gtk_drawing_area handler should still get first "refusal" to the
key-press events if is focused.
Unless there is any objection to the new behaviour (or other errors
people spot in the patch), I intend to apply this to the CUED CD
release.
Regards
Peter Clifton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cvs_geda.key_press.patch
Type: text/x-patch
Size: 5429 bytes
Desc: not available
Url : http://www.seul.org/pipermail/geda-dev/attachments/20060907/84775c58/cvs_geda.key_press.bin
More information about the geda-dev
mailing list