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 342123 - "On top" checkbox only drawn when selected
"On top" checkbox only drawn when selected
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
trunk
Other All
: Normal minor
: ---
Assigned To: Bruno Boaventura
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2006-05-17 14:15 UTC by Calum Benson
Modified: 2006-11-15 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Introduce MetaMenuItemType enum, change declaration of menu_item_new, fix 342123 + 343108 (13.58 KB, patch)
2006-06-08 14:50 UTC, Björn Lindqvist
needs-work Details | Review
menu.c with patch attached (14.07 KB, text/plain)
2006-06-08 14:51 UTC, Björn Lindqvist
  Details
menu.c with patch applied (14.07 KB, text/plain)
2006-06-08 14:51 UTC, Björn Lindqvist
  Details
Björn's patch reviewed (13.33 KB, patch)
2006-10-14 03:33 UTC, Bruno Boaventura
none Details | Review
patch (14.66 KB, patch)
2006-10-17 02:00 UTC, Bruno Boaventura
none Details | Review
patch (I forgot a detail in previous) (14.76 KB, patch)
2006-10-17 22:28 UTC, Bruno Boaventura
committed Details | Review

Description Calum Benson 2006-05-17 14:15:47 UTC
Select Glider theme (for example).

Open the window menu for any window.  Note that, unlike other unselected checkbox menu items in other applications, no empty checkbox is drawn beside the "on top" menu item.  The correct, gtk-themed checkbox is only drawn when "on top" is selected.
Comment 1 Björn Lindqvist 2006-06-08 14:48:26 UTC
Seems like Metacity badly assumes that if the checked attribute of MenuItem is FALSE it assumes it is a regular item and doesn't draw the checkbox. The way I have solved this problem is to add a MetaMenuItemType type attribute to MenuItem which declares what kind of MenuItem to draw. I then changed much code so that instead of tests like if (menuitems[i].stock_id) you compare it against the type: if (menuitem.type == MENU_ITEM_IMAGE). That makes the code easier to understand IMHO. 

The patch also includes a fix for #343108 since that was so easy and the bugs are related and some refactorings (like for loops instead of while loops). Attaching the new menu.c too because the patch is hard to read.
Comment 2 Björn Lindqvist 2006-06-08 14:50:35 UTC
Created attachment 66974 [details] [review]
Introduce MetaMenuItemType enum, change declaration of menu_item_new, fix 342123 + 343108
Comment 3 Björn Lindqvist 2006-06-08 14:51:35 UTC
Created attachment 66975 [details]
menu.c with patch attached
Comment 4 Björn Lindqvist 2006-06-08 14:51:42 UTC
Created attachment 66976 [details]
menu.c with patch applied
Comment 5 Elijah Newren 2006-07-24 18:23:20 UTC
I tried to look over it quickly.  General idea seems good.  Just a couple smaller issues:
  - You forgot to use -p when making your patch.  ;-)
  - I think it'd be a little easier to read if the MetaMenuOp came before the MetaMenuItemType in the MenuItem struct.
  - As per Calum's comments in bug 343108 comment 4, I don't think using a checkbox for the Always on visible workspace thing is a good idea.
Comment 6 Bruno Boaventura 2006-10-14 03:33:19 UTC
Created attachment 74675 [details] [review]
Björn's patch reviewed

also prepared to solve bug #343108 soonly (using radio buttons).
Comment 7 Bruno Boaventura 2006-10-17 02:00:29 UTC
Created attachment 74851 [details] [review]
patch

this patch fixes bug #342123 and bug #343108.
Comment 8 Bruno Boaventura 2006-10-17 22:28:01 UTC
Created attachment 74901 [details] [review]
patch (I forgot a detail in previous)

fixes this and the #343108
Comment 9 Thomas Thurman 2006-11-15 02:48:48 UTC
Looks good to me, and works fine. Can you commit this or shall I?
Comment 10 Bruno Boaventura 2006-11-15 04:55:34 UTC
I don't have a CVS account yet... you can commit.
Comment 11 Bruno Boaventura 2006-11-15 05:01:30 UTC
Can I close this and the bug #343108?
Comment 12 Bruno Boaventura 2006-11-15 05:37:37 UTC
I'll open a bug to insert these features in libwnck too.
Comment 13 Thomas Thurman 2006-11-15 13:16:59 UTC
Committed. Feel free to close these two bugs. Thank you!