Merge branch 'alxsa-fs-select-none' into 'master'

Draft: UX Issue 206: Merge floating selection with Select None

See merge request GNOME/gimp!2167
This commit is contained in:
Alx Sa 2025-06-29 17:34:16 +00:00
commit 38be17ce95
2 changed files with 7 additions and 1 deletions

View file

@ -186,7 +186,7 @@ select_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL) gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
SET_SENSITIVE ("select-all", image && ! sel_all); SET_SENSITIVE ("select-all", image && ! sel_all);
SET_SENSITIVE ("select-none", image && sel); SET_SENSITIVE ("select-none", image && (sel || fs));
SET_SENSITIVE ("select-invert", image); SET_SENSITIVE ("select-invert", image);
SET_SENSITIVE ("select-cut-float", g_list_length (drawables) == 1 && sel && SET_SENSITIVE ("select-cut-float", g_list_length (drawables) == 1 && sel &&

View file

@ -30,6 +30,7 @@
#include "core/gimp.h" #include "core/gimp.h"
#include "core/gimpchannel.h" #include "core/gimpchannel.h"
#include "core/gimplayer-floating-selection.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpselection.h" #include "core/gimpselection.h"
@ -97,6 +98,11 @@ select_none_cmd_callback (GimpAction *action,
return_if_no_image (image, data); return_if_no_image (image, data);
gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE); gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE);
/* Commit floating selection (if any) */
if (gimp_image_get_floating_selection (image))
floating_sel_anchor (gimp_image_get_floating_selection (image));
gimp_image_flush (image); gimp_image_flush (image);
} }