After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711555 - dnd: Don't try to remove an invalid idle source
dnd: Don't try to remove an invalid idle source
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-11-06 15:40 UTC by Florian Müllner
Modified: 2013-11-06 17:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dnd: Don't try to remove an invalid idle source (1.02 KB, patch)
2013-11-06 15:40 UTC, Florian Müllner
committed Details | Review
dnd: Don't queue an idle handler if we already have one (1.01 KB, patch)
2013-11-06 17:26 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2013-11-06 15:40:48 UTC
See patch.
Comment 1 Florian Müllner 2013-11-06 15:40:51 UTC
Created attachment 259091 [details] [review]
dnd: Don't try to remove an invalid idle source

As the handler returns false, the corresponding source is removed
automatically and its id invalidated. Reset the id to 0 to reflect
this, otherwise newer versions of GLib will print a warning when
we later try to remove it explicitly.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-11-06 15:44:28 UTC
Review of attachment 259091 [details] [review]:

OK.

(We should also not remove the existing idle, and just quick-return when there's already an idle queued, but that would also require this fix)
Comment 3 Florian Müllner 2013-11-06 17:26:02 UTC
Created attachment 259121 [details] [review]
dnd: Don't queue an idle handler if we already have one

Removing an existing source before scheduling a new one is not wrong,
but slightly less effective than doing nothing and relying on the
previously created source to do the job.


(In reply to comment #2)
> (We should also not remove the existing idle, and just quick-return when
> there's already an idle queued, but that would also require this fix)

Sure.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-11-06 17:32:03 UTC
Review of attachment 259121 [details] [review]:

Yep.
Comment 5 Florian Müllner 2013-11-06 17:37:14 UTC
Attachment 259091 [details] pushed as 735f589 - dnd: Don't try to remove an invalid idle source
Attachment 259121 [details] pushed as fce2930 - dnd: Don't queue an idle handler if we already have one