display: prevent a crash if the screen being dragged is removed
https://bugzilla.gnome.org/show_bug.cgi?id=704389
This commit is contained in:
parent
724279c06b
commit
0a938e815d
1 changed files with 9 additions and 0 deletions
|
@ -1741,6 +1741,13 @@ set_primary_output (CcDisplayPanel *self,
|
||||||
gnome_rr_output_info_set_primary (outputs[i], outputs[i] == output);
|
gnome_rr_output_info_set_primary (outputs[i], outputs[i] == output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
grab_weak_ref_notify (gpointer area,
|
||||||
|
GObject *object)
|
||||||
|
{
|
||||||
|
foo_scroll_area_end_grab (area, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_output_event (FooScrollArea *area,
|
on_output_event (FooScrollArea *area,
|
||||||
FooScrollAreaEvent *event,
|
FooScrollAreaEvent *event,
|
||||||
|
@ -1783,6 +1790,7 @@ on_output_event (FooScrollArea *area,
|
||||||
gnome_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL);
|
gnome_rr_output_info_get_geometry (output, &output_x, &output_y, NULL, NULL);
|
||||||
|
|
||||||
foo_scroll_area_begin_grab (area, on_output_event, data);
|
foo_scroll_area_begin_grab (area, on_output_event, data);
|
||||||
|
g_object_weak_ref (data, grab_weak_ref_notify, area);
|
||||||
|
|
||||||
info = g_new0 (GrabInfo, 1);
|
info = g_new0 (GrabInfo, 1);
|
||||||
info->grab_x = event->x;
|
info->grab_x = event->x;
|
||||||
|
@ -1855,6 +1863,7 @@ on_output_event (FooScrollArea *area,
|
||||||
|
|
||||||
g_free (g_object_get_data (G_OBJECT (output), "grab-info"));
|
g_free (g_object_get_data (G_OBJECT (output), "grab-info"));
|
||||||
g_object_set_data (G_OBJECT (output), "grab-info", NULL);
|
g_object_set_data (G_OBJECT (output), "grab-info", NULL);
|
||||||
|
g_object_weak_unref (data, grab_weak_ref_notify, area);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
g_debug ("new position: %d %d %d %d", output->x, output->y, output->width, output->height);
|
g_debug ("new position: %d %d %d %d", output->x, output->y, output->width, output->height);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue