Add all accel groups when enabling window mods

Previously, enabling window modifiers would only add accel groups that
had presumably been disabled to the window in question. This was fragile
and caused bad behavior in cases when the criteria for whether or not an
accel group should be enabled changed between the time the groups were
disabled and re-enabled, potentially leading to certain groups never
being re-added. There is no harm in adding accel groups that are already
added to a window, so this change simply eliminates the unnecessary
check.

Signed-off-by: Shawn M. Chapla <schapla@codeweavers.com>
This commit is contained in:
Shawn M. Chapla 2020-09-23 22:26:50 -04:00 committed by Daniel P. Berrangé
parent 6af952adb9
commit cfcac9fb9d

View File

@ -896,9 +896,6 @@ virt_viewer_window_enable_modifiers(VirtViewerWindow *self)
/* This allows global accelerators like Ctrl+Q == Quit */
for (accels = priv->accel_list ; accels ; accels = accels->next) {
if (virt_viewer_app_get_enable_accel(priv->app) &&
priv->accel_group == accels->data)
continue;
gtk_window_add_accel_group(GTK_WINDOW(priv->window), accels->data);
}