GNOME Bugzilla – Bug 592567
Dereferencing NULL in mutter_window_get_workspace()
Last modified: 2009-10-09 15:53:15 UTC
The function assumes that the MetaWindow is always on a workspace, which is not the case. I will attach a patch with adding a NULL check.
Created attachment 141321 [details] [review] Patch not to derefence NULL per comment #0
Should that function just be removed? It's fundamentally confusing: window.get_meta_window().get_workspace(); Returns a MetaWorkspace. window.get_workspace(); returns the index. I think we should be getting rid of all the MutterWindow methods that are just propagating stuff from MetaWindow - a lot of that dates from past-history where override-redirect MutterWindow's didn't have a MetaWindow. Not a strong feeling that that has to happen immediately - if you want to go ahead and commit this patch, feel free to do so. My only suggestion would be to add a doc comment that describes a) that it can return -1 and b) gives some indication of the circumstances that can occur. Since if I was calling that function, I wouldn't expect it to return -1, and I would have no idea what it indicated when it did or what I should do.
Comment on attachment 141321 [details] [review] Patch not to derefence NULL per comment #0 I agree, we should at some point review the overlaps in the MutterWindow / MetaWindow API, and stream line it. For now, I have committed this patch with a doc comment noting that this function is deprecated.