Place display: don't use a StIcon for DND

DND code assumes it can query the size of the actor before parenting,
while StWidget asserts that get_preferred_size() is only called
after the actor is on stage. This fixes a crash while dragging
"Connect to..."

https://bugzilla.gnome.org/show_bug.cgi?id=633028
This commit is contained in:
Giovanni Campagna 2012-01-09 16:33:36 +01:00
parent 6cdb1bd60c
commit 7da39031e1

View File

@ -155,9 +155,12 @@ const PlacesManager = new Lang.Class({
this._connect = new PlaceInfo('special:connect', _("Connect to..."),
function (size) {
return new St.Icon({ icon_name: 'applications-internet',
icon_type: St.IconType.FULLCOLOR,
icon_size: size });
// do NOT use St.Icon here, it crashes the shell
// see wanda.js for details
return St.TextureCache.get_default().load_icon_name('applications-internet',
null,
St.IconType.FULLCOLOR,
size);
},
function (params) {
// BUG: nautilus-connect-server doesn't have a desktop file, so we can't