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 689263 - Make MetaButtonLayout usable from introspection
Make MetaButtonLayout usable from introspection
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2012-11-29 11:02 UTC by Florian Müllner
Modified: 2013-01-09 23:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
prefs: Do not leave junk values in unused button_layout fields (2.86 KB, patch)
2012-11-29 11:02 UTC, Florian Müllner
committed Details | Review
common: Annotate MetaButtonLayout (942 bytes, patch)
2012-11-29 11:02 UTC, Florian Müllner
committed Details | Review
prefs: Annotate meta_prefs_get_button_layout() (771 bytes, patch)
2012-11-29 11:02 UTC, Florian Müllner
committed Details | Review
workspace: Use MetaButtonLayout to get side of close button (1.83 KB, patch)
2012-11-29 11:02 UTC, Florian Müllner
none Details | Review
workspace: Use MetaButtonLayout to get side of close button (1.97 KB, patch)
2012-11-30 13:32 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2012-11-29 11:02:02 UTC
The annotations are not pretty, but given that we have a single consumer outside of mutter, I'd rather not waste time on refactoring this.
Comment 1 Florian Müllner 2012-11-29 11:02:05 UTC
Created attachment 230168 [details] [review]
prefs: Do not leave junk values in unused button_layout fields

MetaButtonLayout is extremely unfriendly for introspection: its fields
are arrays of a fixed length, but the actual length is determined by
a custom stop value (e.g. not NULL / 0).
Without API changes this will never work nicely in introspection, but
we can at least make it work; start by filling up unused fields with
the stop value rather than leaving it at random values.
Comment 2 Florian Müllner 2012-11-29 11:02:09 UTC
Created attachment 230169 [details] [review]
common: Annotate MetaButtonLayout
Comment 3 Florian Müllner 2012-11-29 11:02:12 UTC
Created attachment 230170 [details] [review]
prefs: Annotate meta_prefs_get_button_layout()
Comment 4 Florian Müllner 2012-11-29 11:02:30 UTC
Created attachment 230171 [details] [review]
workspace: Use MetaButtonLayout to get side of close button

The current code parses the button-layout setting because MetaButtonLayout
was not usable from introspection. With that fixed, we can switch to
using meta_prefs_get_button_layout().
Comment 5 Florian Müllner 2012-11-30 13:32:50 UTC
Created attachment 230275 [details] [review]
workspace: Use MetaButtonLayout to get side of close button

Remove special-casing for RTL - the layout has already been adjusted according to the text direction.
Comment 6 Owen Taylor 2013-01-09 19:59:16 UTC
Review of attachment 230168 [details] [review]:

Well, it's not like it doesn't work without this - you just would have to look for the stop value in a loop in Javascript rather than using indexOf. But sure.
Comment 7 Owen Taylor 2013-01-09 20:00:24 UTC
Review of attachment 230169 [details] [review]:

Sure
Comment 8 Owen Taylor 2013-01-09 20:00:42 UTC
Review of attachment 230170 [details] [review]:

Sure
Comment 9 Owen Taylor 2013-01-09 20:01:10 UTC
Review of attachment 230275 [details] [review]:

Looks fine to me
Comment 10 Florian Müllner 2013-01-09 23:21:07 UTC
(In reply to comment #6)
> Well, it's not like it doesn't work without this - you just would have to look
> for the stop value in a loop in Javascript rather than using indexOf.

If I remember correctly, gjs fails to wrap the return value when any element is outside the range of the array type, so the problem was actually meta_prefs_get_button_layout() itself.
Comment 11 Florian Müllner 2013-01-09 23:22:04 UTC
Attachment 230168 [details] pushed as 5a8473e - prefs: Do not leave junk values in unused button_layout fields
Attachment 230169 [details] pushed as 54a3847 - common: Annotate MetaButtonLayout
Attachment 230170 [details] pushed as a6c51ad - prefs: Annotate meta_prefs_get_button_layout()
Comment 12 Florian Müllner 2013-01-09 23:23:07 UTC
Attachment 230275 [details] pushed as 3f29680 - workspace: Use MetaButtonLayout to get side of close button