diff --git a/debian/changelog b/debian/changelog index 7cd879b..c1bc3cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ gfxboot-theme-ubuntu (0.1.11) UNRELEASED; urgency=low impaired users to read the menu labels. * Reduce the width of the keymap menu a bit by removing some unnecessary text from the German option. + * Try to ensure that menus don't overflow the right-hand edge of the + screen, even when their panel entry is placed quite far to the right. -- Colin Watson Wed, 1 Feb 2006 17:44:27 +0000 diff --git a/xmenu.inc b/xmenu.inc index e214b01..e4917ef 100644 --- a/xmenu.inc +++ b/xmenu.inc @@ -39,7 +39,8 @@ small_layout { /.xm_panel_height 8 def % panel entry height /.xm_vspace 9 def % vspace per menu /.xm_title 10 def % xmenu title -/.xm_size 11 def % xmenu size +/.xm_columns 11 def % menu columns +/.xm_size 12 def % xmenu size % short hands @@ -47,6 +48,7 @@ small_layout { /xmenu.y { xmenu .xm_y get } def /xmenu.width { xmenu .xm_width get } def /xmenu.height { xmenu .xm_height get } def +/xmenu.columns { xmenu .xm_columns get } def /xmenu.vspace { xmenu .xm_vspace get dup .undef ne { } { pop xmenu.vspace.default } ifelse } def @@ -148,7 +150,9 @@ small_layout { /xmenu.sizes { /xmenu.lheight xmenu.font setfont fontheight xmenu.vspace dup add add def - /xmenu.columns xmenu .xm_list get length xmenu.maxlines add 1 sub xmenu.maxlines div def + xmenu .xm_columns + xmenu .xm_list get length xmenu.maxlines add 1 sub xmenu.maxlines div + put /xmenu.lastheight xmenu .xm_list get length xmenu.maxlines xmenu.columns 1 sub mul sub xmenu.lheight mul @@ -317,7 +321,11 @@ small_layout { panel.text.moveto xmenu .xm_panel_x currentpoint pop xmenu.hspace sub put - xmenu .xm_x xmenu .xm_panel_x get put + % try to ensure that the menu doesn't overflow the screen + xmenu .xm_x + xmenu .xm_panel_x get + screen.size pop xmenu.width 2 add xmenu.columns mul 10 add sub + min put pmenu.update } def