[compiz] [PATCH] button_layout support for gtk-window-decorator

Martin Szulecki compiz at sukimashita.com
Mon Apr 2 09:08:38 PDT 2007


I noticed there have been some older posts about a work in progress
patch which never made it to the ML due to some issues.

I am attaching three patches here in an effort to bring the
button_layout support into gtk-window-decorator which allows you to
define the titlebar button placements with a string (e.g.
"menu:minimize,maximize,close") in /apps/metacity/general/button_layout.

# 00-gwd-add-button_layout-support.patch:

Adds initial parsing and general gconf key support based on work from 
http://lists.freedesktop.org/archives/compiz/2007-January/001249.html

This quickly revealed issues that are handled by the next two patches.

# 01-gwd-position_action_menu-at-menu-button.patch:

Get's the action menu to popup where the menu button will be.

# 02-gwd-metacity-button_layout-width-calc-fix-1.patch:

Certain stretching calculations got wrong due to the new possibility for
arbitrary button placements and caused wrong redraw behaviour (white
titlebars etc.). Main issue is the button_width which does not fit into
the concept of left and right button groups on the titlebar.

Attempts to use the correct button extends did fail for me as
meta_get_button_position() (even the metacity theme exports) for some
unknown reason returned wrong x positions when using a non-default
button_layout. Anyone knows why?

Therefore this patch fixes the redraw issues by just calculating a sum
of all button width's in meta_calc_button_size() which "works"(tm).

While everything seems to work ok with these patches, it is not the best
and most accurate solution and should probably not get applied.

I hope someone might actually make use of these patches and look into
correctly extending the interfaces to support button_layout placement in
their calculations unless I beat myself to do it one day.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 00-gwd-add-button_layout-support.patch
Type: text/x-patch
Size: 5835 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/compiz/attachments/20070402/5e77b74b/00-gwd-add-button_layout-support.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-gwd-position_action_menu-at-menu-button.patch
Type: text/x-patch
Size: 650 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/compiz/attachments/20070402/5e77b74b/01-gwd-position_action_menu-at-menu-button.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02-gwd-metacity-button_layout-width-calc-fix-1.patch
Type: text/x-patch
Size: 1520 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/compiz/attachments/20070402/5e77b74b/02-gwd-metacity-button_layout-width-calc-fix-1.bin


More information about the compiz mailing list