Browse Source

fix scale selector window not applying change on close

Fixes https://todo.sr.ht/~alextee/zrythm-bug/773.
polyline2d
parent
commit
2c18e4b8b2
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 4
      inc/plugins/plugin.h
  2. 2
      meson.build
  3. 2
      src/gui/widgets/port_connections_popover.c
  4. 13
      src/gui/widgets/scale_selector_window.c
  5. 21
      src/plugins/plugin_gtk.c

4
inc/plugins/plugin.h

@ -253,10 +253,10 @@ typedef struct Plugin @@ -253,10 +253,10 @@ typedef struct Plugin
* deactivate before freeing the plugin. */
gulong destroy_window_id;
/** ID of the delete-event signal for \ref
/** ID of the close-request signal for \ref
* Plugin.window so that we can
* deactivate before freeing the plugin. */
gulong delete_event_id;
gulong close_request_id;
int magic;

2
meson.build

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# Copyright (C) 2019-2021 Alexandros Theodotou <alex at zrythm dot org>
# Copyright (C) 2019-2022 Alexandros Theodotou <alex at zrythm dot org>
#
# This file is part of Zrythm
#

2
src/gui/widgets/port_connections_popover.c

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Alexandros Theodotou <alex at zrythm dot org>
* Copyright (C) 2019-2022 Alexandros Theodotou <alex at zrythm dot org>
*
* This file is part of Zrythm
*

13
src/gui/widgets/scale_selector_window.c

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2021 Alexandros Theodotou <alex at zrythm dot org>
* Copyright (C) 2019-2022 Alexandros Theodotou <alex at zrythm dot org>
*
* This file is part of Zrythm
*
@ -38,9 +38,8 @@ G_DEFINE_TYPE ( @@ -38,9 +38,8 @@ G_DEFINE_TYPE (
GTK_TYPE_WINDOW)
static gboolean
on_delete_event (
GtkWidget *widget,
GdkEvent *event,
on_close_request (
GtkWindow * window,
ScaleSelectorWindowWidget * self)
{
arranger_selections_clear (
@ -77,7 +76,7 @@ on_delete_event ( @@ -77,7 +76,7 @@ on_delete_event (
arranger_selections_free_full (before);
arranger_selections_free_full (after);
return FALSE;
return false;
}
static void
@ -303,7 +302,7 @@ scale_selector_window_widget_init ( @@ -303,7 +302,7 @@ scale_selector_window_widget_init (
/* set signals */
g_signal_connect (
G_OBJECT (self), "delete-event",
G_CALLBACK (on_delete_event), self);
G_OBJECT (self), "close-request",
G_CALLBACK (on_close_request), self);
}

21
src/plugins/plugin_gtk.c

@ -671,10 +671,9 @@ on_window_destroy ( @@ -671,10 +671,9 @@ on_window_destroy (
}
static gboolean
on_delete_event (
GtkWidget *widget,
GdkEvent *event,
Plugin * plugin)
on_close_request (
GtkWindow * window,
Plugin * plugin)
{
plugin->visible = 0;
plugin->window = NULL;
@ -687,7 +686,7 @@ on_delete_event ( @@ -687,7 +686,7 @@ on_delete_event (
"%s: deleted plugin [%s] window",
__func__, pl_str);
return FALSE;
return false;
}
/**
@ -758,10 +757,10 @@ plugin_gtk_create_window ( @@ -758,10 +757,10 @@ plugin_gtk_create_window (
g_signal_connect (
plugin->window, "destroy",
G_CALLBACK (on_window_destroy), plugin);
plugin->delete_event_id =
plugin->close_request_id =
g_signal_connect (
G_OBJECT (plugin->window), "delete-event",
G_CALLBACK (on_delete_event), plugin);
G_OBJECT (plugin->window), "close-request",
G_CALLBACK (on_close_request), plugin);
}
/**
@ -1882,11 +1881,11 @@ plugin_gtk_close_ui ( @@ -1882,11 +1881,11 @@ plugin_gtk_close_ui (
pl->window, pl->destroy_window_id);
pl->destroy_window_id = 0;
}
if (pl->delete_event_id)
if (pl->close_request_id)
{
g_signal_handler_disconnect (
pl->window, pl->delete_event_id);
pl->delete_event_id = 0;
pl->window, pl->close_request_id);
pl->close_request_id = 0;
}
gtk_widget_set_sensitive (
GTK_WIDGET (pl->window), 0);

Loading…
Cancel
Save