GNOME Bugzilla – Bug 643194
patch: expose new meta_window_get_window_rect, since meta_window_rect crashing gnome-shell from lg/js
Last modified: 2011-02-28 19:06:25 UTC
to repro crash: from lg, enter into repl: Shell.WindowTracker.get_default().get_running_apps('')[0].get_windows()[0].get_rect() Looking at the src in mutter/src/core/window.c , it appears that meta_window_get_rect() is designed to be invoked from C code (I inferred this from comparing it to the impl/annotations for meta_window_get_outer_rect). I assume this the method-in-question is depended upon by C code so, instead of changing the signature/impl and possibly breaking stuff, I exposed a new version that acts, pretty much, just like meta_window_get_outer_rect that is called meta_window_get_window_rect. See attached patch.
Created attachment 181828 [details] [review] adding meta_window_get_window_rect() to return "inner" rectangle .. didn't fix meta_window_get_rect() because I assume that this is depended upon by other bits of C code, hence its relative brokeness, compared to meta_window_get_outer_rect which doesn't c
I think actually you could avoid the crash if get_rect was annotated (transfer none). This is probably a scanner bug where we still default to (transfer full) for boxed types.
Also, git commit messages are divided into an equivalent of email's "Subject" (the first line) and body (the rest). So don't put the entire message in the "subject" =) Use "git log" in mutter to see how other example commits are written.
Review of attachment 181828 [details] [review]: crash should be fixable with an (out caller-allocates) annotation, and if it isn't, then we need to fix gjs or gobject-introspection, not add new API to mutter
Created attachment 181998 [details] [review] properly expose meta_window_get_rect() for use from JavaScript