Skip to content

Close if lose focus @ CommandPalette, not @ canvas

Daniel Boles requested to merge dboles/inkscape:djb_CommandPalette_focus into master
pbs 11:09 AM
Please do - there's also a hack used to make Canvas::on_button_pressed close the command palette because its signal_focus() doesn't fire. The command palette author asked about it here: https://stackoverflow.com/questions/62742786/how-to-make-gtk-focus-out-event-fire-based-on-child-widgets-recursively-or-how-t. The above changes might eliminate the need for that.

    dboles
    11:00 AM
    if you're not going to try that in the text tool, i can have a go. i used the above somewhere else before and it seems to have worked out fine (touch wood)

dboles 11:21 AM
anything that gets code out of canvas is probably good

pbs 11:29 AM
It's not super important to fix, if the gtk4 fix is cleaner then it can wait. The current situation is a bit of a layering violation though

Close if lose focus @ CommandPalette, not @ canvas

CommandPalette: Add TODO to revisit this in GTK4

CommandPalette: Some optimisations + clean-ups
It's really slow to open the first time. I don't think any of the
following fix that on their own, but every little helps...
* Report the Builder error if we get one
* Don't call/convert g_get_prgname() for every recent file
* Use string.append() instead of a slower stringstream
* Move, not copy, strings and RefPtr - in & out of get_action_ptr_name()
* Don't copy map elements while iterating if we don't need to
* Fix typo FIRST_LETTET_BONUS => LETTER
* Remove a fixed FIXME
* Don't do the same full_action_name.find('.') twice
* Use a string_view of the domain, no need to create string to compare
* Don't compare strings if we don't have the win or doc they depend upon
* Don't copy action_ptr_name when we don't need to
* Index into widget children w/ .at() so we fail loudly, not nefariously
* Iterating actions, don't copy strings twice (as iter & with operator+)
* Remove unused vector all_actions_info

ui/util: Let for_each() return the widget, recurse
Returning void is not too helpful when we could instead return the
widget that met the criteria. Add ability to recurse, default off.
Use it everywhere, instead of the duplicating sp_traverse_widget_tree().

spw-utilities: Move spw*() to one user StrokeStyle
now that the widget-traversing funcs got moved out.
sp_get_action_target() is still used in two places.
Edited by Daniel Boles

Merge request reports