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 643194 - patch: expose new meta_window_get_window_rect, since meta_window_rect crashing gnome-shell from lg/js
patch: expose new meta_window_get_window_rect, since meta_window_rect crashin...
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2011-02-24 14:29 UTC by Jeffery Olson (pfox)
Modified: 2011-02-28 19:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
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 (2.05 KB, patch)
2011-02-24 14:30 UTC, Jeffery Olson (pfox)
rejected Details | Review
properly expose meta_window_get_rect() for use from JavaScript (900 bytes, patch)
2011-02-26 17:53 UTC, Jeffery Olson (pfox)
none Details | Review

Description Jeffery Olson (pfox) 2011-02-24 14:29:21 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.
Comment 1 Jeffery Olson (pfox) 2011-02-24 14:30:34 UTC
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
Comment 2 Colin Walters 2011-02-24 14:32:03 UTC
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.
Comment 3 Colin Walters 2011-02-24 14:33:01 UTC
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.
Comment 4 Owen Taylor 2011-02-24 14:35:31 UTC
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
Comment 5 Jeffery Olson (pfox) 2011-02-26 17:53:11 UTC
Created attachment 181998 [details] [review]
properly expose meta_window_get_rect() for use from JavaScript