gtk3/gtk3-Dont-crash-if-invisible-files-are-deleted.patch
Bjørn Lie 6736d0602e Accepting request 265041 from home:Zaitor:branches:GNOME:Factory
- Update to version 3.14.6:
  + Redraw problems with cairo 1.14.
  + Avoid excessive redraws due to CSD shadows.
  + Bugs fixed: bgo#364566, bgo#461249, bgo#721939, bgo#722781,
    bgo#730232, bgo#739453, bgo#739885, bgo#739977, bgo#740287,
    bgo#740374, bgo#740612, bgo#740613, bgo#740642, bgo#740742,
    bgo#740770, bgo#740896, bgo#741249, bgo#741250, bgo#741251,
    bgo#741252, bgo#741254, bgo#741314.
  + Updated translations.
- Add gtk3-Dont-crash-if-invisible-files-are-deleted.patch: Do not
  crash application using gtk file chooser when deleting file via
  an other app (patch from upstream git).

OBS-URL: https://build.opensuse.org/request/show/265041
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gtk3?expand=0&rev=171
2014-12-16 10:15:41 +00:00

54 lines
1.7 KiB
Diff

From 23eeb44beb72cc1027dc6ede3e0b7347b465a727 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Thu, 11 Dec 2014 22:52:59 -0500
Subject: GtkFileChooser: Don't crash if invisible files are deleted
This is a crash that has been around for a long time, as
can be seen here:
https://bugzilla.redhat.com/show_bug.cgi?id=1048388
https://bugzilla.redhat.com/show_bug.cgi?id=984375
https://bugzilla.redhat.com/show_bug.cgi?id=1159015
https://bugzilla.redhat.com/show_bug.cgi?id=1059187
https://bugzilla.redhat.com/show_bug.cgi?id=1122172
https://bugzilla.redhat.com/show_bug.cgi?id=1016895
https://bugzilla.redhat.com/show_bug.cgi?id=1133235
https://bugzilla.redhat.com/show_bug.cgi?id=1077500
https://bugzilla.redhat.com/show_bug.cgi?id=1054378
https://bugzilla.redhat.com/show_bug.cgi?id=1173212
Fix suggested by Benjamin Otte.
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 909359a..5a5fc7f 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -1886,6 +1886,7 @@ remove_file (GtkFileSystemModel *model,
GFile *file)
{
FileModelNode *node;
+ gboolean was_visible;
guint id;
guint row;
@@ -1897,6 +1898,7 @@ remove_file (GtkFileSystemModel *model,
return;
node = get_node (model, id);
+ was_visible = node->visible;
row = node_get_tree_row (model, id);
node_invalidate_index (model, id);
@@ -1912,7 +1914,8 @@ remove_file (GtkFileSystemModel *model,
/* We don't need to resort, as removing a row doesn't change the sorting order of the other rows */
- emit_row_deleted_for_row (model, row);
+ if (was_visible)
+ emit_row_deleted_for_row (model, row);
}
/**
--
cgit v0.10.1