Fix a runtime warning on startup.

Calling g_source_remove() on a saved source ID but not resetting the
source ID to zero.
This commit is contained in:
Matthew Barnes
2014-02-11 08:37:09 -05:00
parent 2759aaea71
commit 052bfc93fe

View File

@ -143,8 +143,10 @@ window_state_event_cb (GtkWindow *window,
{
gboolean window_was_unmaximized;
if (data->timeout_id > 0)
if (data->timeout_id > 0) {
g_source_remove (data->timeout_id);
data->timeout_id = 0;
}
window_was_unmaximized =
((event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) != 0) &&
@ -175,8 +177,10 @@ static gboolean
window_unmap_cb (GtkWindow *window,
WindowData *data)
{
if (data->timeout_id > 0)
if (data->timeout_id > 0) {
g_source_remove (data->timeout_id);
data->timeout_id = 0;
}
/* Reset the flags so the window position and size are not
* accidentally reverted to their default value at the next run. */