On Mon, 8 Aug 2005, Viktor Griph wrote:
On Sun, 7 Aug 2005, Dominik Vogt wrote:
On Sun, Aug 07, 2005 at 08:19:33PM +0200, Viktor Griph wrote:
On Sun, 7 Aug 2005, Dominik Vogt wrote:
On Sun, Aug 07, 2005 at 02:21:24PM +0200, Dominik Vogt wrote:
On Sun, Aug 07, 2005 at 12:44:26PM +0200, Viktor Griph wrote:
On Sun, 7 Aug 2005, Dominik Vogt wrote:
[snip]
Could someone with cvs wrilte-access apply this patch?
I'd first like to understand what the patch does exactly. Please
elaborate on how the new feature works.
This is a menufeel patch. It allows for selecting a menu item with a
mouse
wheel as follows:
When the Menustyle Scroll is not Off the use of button 4 and 5
(Mousewheel
up and down) no longer acts as clicks on the menu, but triggers menu
scrolling. Menu scrolling is done i three possible ways: On - Positive
order, menu moving; Inverted - Negative order, menu moving; Pointer
Positive order, Pointer moving.
When the menu is about to scroll it will find the next selectable item
in
the direction of the scroll, and if is On or Inverted (moving menu) the
Menu window will be moved vertically so that the the new item is
vertically centered under the pointer. If the scroll argument is
Pointer
the Pointer will wrap vertically to the center of the next item.
The special case where the menu would have been placed partly outside
of
the screen is treated differently depending on the value of
ScrollOffPage.
If ScrollOffPage is true the menu will be allowed to leave the screen.
If
not the menu will stop at the edge and Pointer scroll will be used.
Sounds interesting. I fear there may be many nasty side effects
with the existing menu code - not because the patch is bad but
because the menu code is very touchy. I need something to play
with (I don't have a mouse wheel).
I've mapped the scroll action to button 3 and shift + button 3 to
test the code. Some comments:
1) Scrolling the menu off page looks like a useable feature, but:
* Scroll the menu off the screen.
* Switch to using the cursor keys.
--> You can't get the menu back on screen
Using the keys should bring it back.
I've taken care of that in the current candidate
2) I'm not particularly fond of the "Scroll On" behaviour because
it is a mix of scrolling and warping the pointer. I'd remove
this part.
Are you sure that is "Scroll On" bahhaviour, and not "ScrollOffPage Off"
behaviour? I've changed ScrollOffPage to default to On as that probably is
the most useful way, and not combines pointer wrapping with menu
scrolling. (Unless trigged from the keyboard, where the pointer always
will wrap to the horizontal center of the menu)
Erm, whatever. You understood what I meant. :-)
3) I see this whole feature as an extension of the meneShortcuts()
function. Although it is triggered by the mouse, the behaviour
is very similar to the keyboard shortcuts. Merging the code
into menuShortcuts() should not be difficult.
I suggest to translate the button event to a keycode/modifier
at the start of the menuShortcuts() function.
Sounds logical. I created my functiion mainly based on menuShortcuts since
it seemed to do similar things, that I wanted to do. I've now merged the
code into menuShortcurs by adding the action SA_SCROLL. I've also in the
same time bound the scrolling to NumPad -/+ as Up/Down.
4) The "Scroll Pointer" behaviour should be the hard-coded default
for all menus.
done
5) I'm not happy about the naming of the "Scroll" argument. "on"
and "off" should also allow all aliases that the
parse_toggle_argument() function allows. But that can wait
until the patch is finalized because the syntax will probably
change a bit.
I was quite unsure on how to handle the styles when I started. Maybe it
would be better to follow the more common (for menu styles) way of having
more styles that override each others. The reason why I decided not to do
so was the fact that I ended up with two groups, and thought that would be
more confusing. I've left these as they are in this candidate.
I don't know yet either. Let's finish the feature first, then
worry about the interface.
New updated candidate-patch attached.
Yo're fast :-) I won't get around testing the new patch until
Thursday, though.
Then you should probably test candidate 3 instead. I've fixed a nasty bug
with tear off menus. I also did a first revision of the syntax:
* Scroll renamed to MouseWheel
* Off renamed to SelectsItem
* On renamed to ScrollsMenuBackwards
* Inverted reneamed to ScrollsMenu
* Pointer renamed to ScrollsPointer
* ScrollsOffPage changed to not have an argument, but can be disabled with !
prefixed. All according to your rules for new on/off options ;-).
/Viktor
I think I must have found all bugs in this soon. Here is just a minor
update for an issue with posted manus. I've also renamed "SelectsItem" to
"ActivatesItem" as that's the term used in the man page. I also added some
info in the Mose Navigation section of the man page. I think this patch is
fit now. Only thing left to do is really decide on syntax, and then update
the internal variable names to be something similar to the final names of
the feature.
/Viktor
Index: AUTHORS
===================================================================
RCS file: /home/cvs/fvwm/fvwm/AUTHORS,v
retrieving revision 1.103
diff -u -r1.103 AUTHORS
--- AUTHORS 29 Jun 2005 17:15:18 -0000 1.103
+++ AUTHORS 12 Aug 2005 22:33:30 -0000
@@ -4,6 +4,7 @@
Viktor Griph:
Patch for Perl modules on 64 bit machines.
+MouseWheel and ScrollOffPage menu style options.
Bjoern Steinbrink:
Patch for FvwmScript tasks running too often.
Index: ChangeLog
===================================================================
RCS file: /home/cvs/fvwm/fvwm/ChangeLog,v
retrieving revision 1.2612
diff -u -r1.2612 ChangeLog
--- ChangeLog 12 Aug 2005 15:50:38 -0000 1.2612
+++ ChangeLog 12 Aug 2005 22:33:32 -0000
@@ -1,3 +1,16 @@
+2005-08-12 Viktor Griph <[EMAIL PROTECTED]>
+
+ * fvwm/menustyle.h (enum, MenuFeel, ST_DO_SCROLL, MST_DO_SCROLL)
+ (ST_SCROLL_OFF_PAGE, MST_SCROLL_OFF_PAGE):
+ * fvwm/menustyle.c (menustyle_copy):
+ (menustyle_get_styleopt_index):
+ (menustyle_parse_style, CMD_MenuStyle):
+ * fvwm/menus.c (menuShortcuts, enum, __mloop_handle_event):
+ (menu_get_outer_geometry, move_any_menu):
+ * fvwm/fvwm.1.in:
+ added MouseWheel and ScrollOffPage menu styles
+
+
2005-08-12 Dominik Vogt <[EMAIL PROTECTED]>
* fvwm/virtual.c (raisePanFrames):
Index: NEWS
===================================================================
RCS file: /home/cvs/fvwm/fvwm/NEWS,v
retrieving revision 1.565
diff -u -r1.565 NEWS
--- NEWS 12 Aug 2005 16:12:54 -0000 1.565
+++ NEWS 12 Aug 2005 22:33:32 -0000
@@ -8,8 +8,9 @@
* New features:
- Fvwm now officially supports 64-bit architertures.
- New Test conditions IsEnvSet and MatchEnv.
+ - Added MouseWheel and ScrollOffPage menu style options.
* New module features:
Index: fvwm/fvwm.1.in
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/fvwm.1.in,v
retrieving revision 1.168
diff -u -r1.168 fvwm.1.in
--- fvwm/fvwm.1.in 12 Aug 2005 11:39:59 -0000 1.168
+++ fvwm/fvwm.1.in 12 Aug 2005 22:33:33 -0000
@@ -2136,6 +2136,12 @@
close to the triangle indicating the sub menu. This behaviour can
be tuned with menu styles.
+Scrolling a mouse wheel over a menu either wraps the pointer along the
+menu (default), scrolls the menu under the pointer or act as if the
+menu was clicked depending on the
+.I MouseWheel
+menu style.
+
Clicking on a selected item activates it - what happens exactly
depends on the type of the item.
@@ -2853,7 +2859,9 @@
ItemFormat,
VerticalItemSpacing,
VerticalTitleSpacing,
-AutomaticHotkeys / AutomaticHotkeysOff.
+AutomaticHotkeys / AutomaticHotkeysOff,
+MouseWheel,
+ScrollOffPage / !ScrollOffPage.
In the above list some options are listed as option pairs or
triples with a '/' in between. These options exclude each other.
@@ -3393,7 +3401,25 @@
.B AddToMenu
command.
+.IR MouseWheel
+controls the ability to scroll the menu using a mouse wheel. It takes
+one argument, that can be one of
+ScrollsPointer, ScrollsMenu, ScrollsMenuBackwards or ActivatesItem.
+ScrollsPointer makes the mouse wheel scroll the pointer over a menu.
+This is the default. ScrollsMenu and ScrollsMenuBackwards scroll the menu
+beneath the pointer. ActivatesItem disables scrolling by mouse wheel and
+makes the use of a mouse wheel act as if the menu was clicked.
+If no argument is supplied the default setting is restored.
+
+.IR ScrollOffPage
+allows a menu to be scrolled out of the visible area if
+.I MouseWheel
+is set to ScrollsMenu or ScrollsMenuBackwards. This is the default.
+The opposite,
+.I !ScrollOffPage
+disables this behaviour.
+
Examples:
.EX
MenuStyle * Mwm
Index: fvwm/menus.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/menus.c,v
retrieving revision 1.384
diff -u -r1.384 menus.c
--- fvwm/menus.c 7 Aug 2005 09:48:29 -0000 1.384
+++ fvwm/menus.c 12 Aug 2005 22:33:33 -0000
@@ -129,7 +129,8 @@
SA_WARPBACK,
SA_SELECT,
SA_TEAROFF,
- SA_ABORT
+ SA_ABORT,
+ SA_SCROLL
} shortcut_action;
/* ---------------------------- menu loop types ---------------------------- */
@@ -287,6 +288,27 @@
return brc;
}
+static Bool menu_get_outer_geometry(
+ MenuRoot *mr, MenuParameters *pmp,
+ Window *root_return, int *x_return, int *y_return,
+ unsigned int *width_return, unsigned int *height_return,
+ unsigned int *border_width_return, unsigned int *depth_return)
+{
+ if (MR_IS_TEAR_OFF_MENU(mr))
+ {
+ return XGetGeometry(dpy,
+ FW_W_FRAME(pmp->tear_off_root_menu_window),
+ root_return,x_return,y_return, width_return,
+ height_return, border_width_return, depth_return );
+ }
+ else
+ {
+ return menu_get_geometry(mr,root_return,x_return,y_return,
+ width_return, height_return, border_width_return,
+ depth_return );
+ }
+}
+
static Bool pointer_in_active_item_area(int x_offset, MenuRoot *mr)
{
float ratio = (float)MST_ACTIVE_AREA_PERCENT(mr) / 100.0;
@@ -423,6 +445,35 @@
return;
}
+/* move a menu or a tear-off menu preserving transparncy.
+ * tear-off menus are moved with their frame coordinates. */
+static void move_any_menu(
+ MenuRoot *mr, MenuParameters *pmp, int endX, int endY
+)
+{
+ if (MR_IS_TEAR_OFF_MENU(mr))
+ {
+ float fFull = 1.0;
+ AnimatedMoveFvwmWindow(
+ pmp->tear_off_root_menu_window,
+ FW_W_FRAME(pmp->tear_off_root_menu_window),
+ -1, -1, endX, endY, False, 0, &fFull);
+ }
+ else
+ {
+ XMoveWindow(dpy, MR_WINDOW(mr), endX, endY);
+ if (ST_HAS_MENU_CSET(MR_STYLE(mr)) &&
+ CSET_IS_TRANSPARENT(ST_CSET_MENU(MR_STYLE(mr))))
+ {
+ MenuRepaintTransparentParameters mrtp;
+ get_menu_repaint_transparent_parameters(
+ &mrtp, mr, (*pmp->pexc)->w.fw);
+ repaint_transparent_menu(
+ &mrtp,False, endX,endY, endX, endY);
+ }
+ }
+}
+
/* ---------------------------- submenu function --------------------------- */
/* Search for a submenu that was popped up by the given item in the given
@@ -776,9 +827,9 @@
MenuRoot *mr, MenuParameters *pmp, MenuReturn *pmret, XEvent *event,
MenuItem **pmiCurrent, double_keypress *pdkp)
{
- int fControlKey = event->xkey.state & ControlMask? True : False;
- int fShiftedKey = event->xkey.state & ShiftMask? True: False;
- int fMetaKey = event->xkey.state & Mod1Mask? True: False;
+ int fControlKey;
+ int fShiftedKey;
+ int fMetaKey;
KeySym keysym;
char ckeychar = 0;
int ikeychar;
@@ -792,6 +843,7 @@
unsigned int menu_width;
unsigned int menu_height;
int items_to_move;
+ int direction = 0;
Bool fSkipSection = False;
shortcut_action saction = SA_NONE;
@@ -802,28 +854,58 @@
pmret->rc = MENU_SELECTED;
return;
}
-
- /*** handle double-keypress ***/
-
- if (pdkp->timestamp &&
- fev_get_evtime() - pdkp->timestamp <
- MST_DOUBLE_CLICK_TIME(pmp->menu) &&
- event->xkey.state == pdkp->keystate &&
- event->xkey.keycode == pdkp->keycode)
+ /*** map mouse events to keysymb ***/
+ if (event->type == ButtonRelease)
{
- *pmiCurrent = NULL;
- pmret->rc = MENU_DOUBLE_CLICKED;
- return;
+ /*** Read the control keys stats ***/
+ fControlKey = event->xbutton.state & ControlMask? True : False;
+ fShiftedKey = event->xbutton.state & ShiftMask? True: False;
+ fMetaKey = event->xbutton.state & Mod1Mask? True: False;
+ switch (event->xbutton.button)
+ {
+ case 4: /* ScrollUp -- Translate to NumPad - */
+ keysym = XK_KP_Subtract;
+ break;
+ case 5: /* ScrollDown -- Translate to NumPad + */
+ keysym = XK_KP_Add;
+ break;
+ default:
+ /* No mapped button */
+ pmret->rc = MENU_NOP;
+ return;
+ }
+ index = 0;
}
- pdkp->timestamp = 0;
-
- /*** find out the key ***/
+ else /* Should be KeyPressed */
+ {
+ /*** Read the control keys stats ***/
+ fControlKey = event->xkey.state & ControlMask? True : False;
+ fShiftedKey = event->xkey.state & ShiftMask? True: False;
+ fMetaKey = event->xkey.state & Mod1Mask? True: False;
+
+ /*** handle double-keypress ***/
+
+ if (pdkp->timestamp &&
+ fev_get_evtime() - pdkp->timestamp <
+ MST_DOUBLE_CLICK_TIME(pmp->menu) &&
+ event->xkey.state == pdkp->keystate &&
+ event->xkey.keycode == pdkp->keycode)
+ {
+ *pmiCurrent = NULL;
+ pmret->rc = MENU_DOUBLE_CLICKED;
+ return;
+ }
+ pdkp->timestamp = 0;
- /* Is it okay to treat keysym-s as Ascii?
- * No, because the keypad numbers don't work. Use XlookupString */
- index = XLookupString(&(event->xkey), &ckeychar, 1, &keysym, NULL);
- ikeychar = (int)ckeychar;
+ /*** find out the key ***/
+ /* Is it okay to treat keysym-s as Ascii?
+ * No, because the keypad numbers don't work.
+ * Use XlookupString */
+ index = XLookupString(&(event->xkey), &ckeychar, 1, &keysym,
+ NULL);
+ ikeychar = (int)ckeychar;
+ }
/*** Try to match hot keys ***/
/* Need isascii here - isgraph might coredump! */
@@ -1061,13 +1143,22 @@
saction = SA_TEAROFF;
break;
+ /* menu-scroll */
+ case XK_KP_Add: /* ScrollUp */
+ saction = SA_SCROLL;
+ direction = 1;
+ break;
+ case XK_KP_Subtract: /* ScrollDown */
+ saction = SA_SCROLL;
+ direction = -1;
+ break;
default:
break;
}
if (!miCurrent &&
(saction == SA_ENTER || saction == SA_MOVE_ITEMS ||
- saction == SA_SELECT))
+ saction == SA_SELECT || saction == SA_SCROLL))
{
if (menu_get_geometry(
mr, &JunkRoot, &menu_x, &menu_y, &menu_width,
@@ -1256,12 +1347,113 @@
(MR_IS_TEAR_OFF_MENU(mr)) ? MENU_NOP : MENU_TEAR_OFF;
return;
+ case SA_SCROLL:
+ if (MST_DO_SCROLL(mr) == MDS_INVERTED)
+ {
+ direction *= -1;
+ }
+ if (!menu_get_outer_geometry(
+ mr, pmp, &JunkRoot, &menu_x, &menu_y,
+ &JunkWidth, &menu_height,
+ &JunkBW, &JunkDepth))
+ {
+ fvwm_msg(ERR, "menuShortcuts",
+ "can't get geometry of menu %s", MR_NAME(mr));
+ return;
+ }
+ for (newItem = miCurrent; newItem &&
+ ( !MI_IS_SELECTABLE(newItem) || newItem == miCurrent );
+ newItem = (direction == 1) ?
+ MI_NEXT_ITEM(newItem) : MI_PREV_ITEM(newItem))
+ ; /* maybe use while insted... */
+
+ if (newItem)
+ {
+ *pmiCurrent = newItem;
+ pmret->rc = MENU_NEWITEM;
+ /* Have to work with relative positions or tear off
+ * menus will be hard to reposition */
+ if (FQueryPointer( dpy, MR_WINDOW(mr), &JunkRoot,
+ &JunkChild, &JunkX, &JunkY, &mx, &my, &JunkMask)
+ == False)
+ {
+ /* This should not happen */
+ mx = 0;
+ my = 0;
+ }
+
+ if (MST_DO_SCROLL(mr) == MDS_POINTER)
+ {
+ if (event->type == ButtonRelease)
+ {
+
+ FWarpPointer(dpy, 0, 0, 0, 0, 0, 0, 0,
+ - my + menuitem_middle_y_offset(
+ newItem,
+ MR_STYLE(mr)));
+
+ }
+ /* pointer wrapped elsewhere for key events */
+ }
+ else
+ {
+
+ menu_y += my - menuitem_middle_y_offset(
+ newItem,
+ MR_STYLE(mr));
+
+ if (!MST_SCROLL_OFF_PAGE(mr) &&
+ menu_height < MR_SCREEN_HEIGHT(mr))
+ {
+ if (menu_y < 0)
+ {
+ FWarpPointer(dpy, 0, 0, 0, 0,
+ 0, 0, 0,-menu_y);
+ menu_y=0;
+ }
+
+ if (menu_y + menu_height >
+ MR_SCREEN_HEIGHT(mr))
+ {
+ FWarpPointer(dpy, 0, 0, 0, 0, 0,
+ 0, 0,
+ MR_SCREEN_HEIGHT(mr)
+ - menu_y - menu_height);
+ menu_y = MR_SCREEN_HEIGHT(mr) -
+ menu_height;
+ }
+ }
+ move_any_menu(mr,pmp,menu_x,menu_y);
+ }
+ }
+ else
+ {
+ pmret->rc = MENU_NOP;
+ }
+ break;
case SA_NONE:
default:
pmret->rc = MENU_NOP;
break;
}
-
+ if (saction != SA_SCROLL && pmret->rc == MENU_NEWITEM)
+ {
+ if (!menu_get_outer_geometry(
+ mr, pmp, &JunkRoot, &menu_x, &menu_y,
+ &JunkWidth, &menu_height,
+ &JunkBW, &JunkDepth))
+ {
+ fvwm_msg(ERR, "menuShortcuts",
+ "can't get geometry of menu %s", MR_NAME(mr));
+ return;
+ }
+ if (menu_y < 0 || menu_y + menu_height > MR_SCREEN_HEIGHT(mr))
+ {
+ menu_y =
+ (menu_y < 0) ? 0 : MR_SCREEN_HEIGHT(mr) - menu_height;
+ move_any_menu(mr,pmp,menu_x,menu_y);
+ }
+ }
return;
}
@@ -4673,6 +4865,25 @@
pmret->rc = MENU_TEAR_OFF;
return MENU_MLOOP_RET_END;
}
+ else if ( med->mrMi != NULL &&
+ MST_DO_SCROLL(med->mrMi) != MDS_OFF &&
+ ((*pmp->pexc)->x.elast->xbutton.button == 4 ||
+ (*pmp->pexc)->x.elast->xbutton.button == 5))
+ {
+ menuShortcuts(med->mrMi, pmp, pmret,
+ (*pmp->pexc)->x.elast,
+ &med->mi,pdkp);
+ if (pmret->rc == MENU_NOP)
+ {
+ return MENU_MLOOP_RET_LOOP;
+ }
+ else if (pmret->rc == MENU_NEWITEM)
+ {
+ /* umpost the menu if posted */
+ pmret->flags.is_menu_posted = 0;
+ }
+ break;
+ }
}
in->mif.was_item_unposted = 0;
if (pmret->flags.is_menu_posted && med->mrMi != NULL)
Index: fvwm/menustyle.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/menustyle.c,v
retrieving revision 1.30
diff -u -r1.30 menustyle.c
--- fvwm/menustyle.c 7 Aug 2005 09:48:29 -0000 1.30
+++ fvwm/menustyle.c 12 Aug 2005 22:33:33 -0000
@@ -348,6 +348,7 @@
"PopdownDelay",
"PopupActiveArea",
"PopupIgnore", "PopupClose",
+ "MouseWheel", "ScrollOffPage",
NULL
};
@@ -629,10 +630,12 @@
{
char *name;
char *option = NULL;
+ char *poption = NULL;
char *optstring = NULL;
char *nextarg;
char *args = NULL;
char *arg1;
+ int on;
MenuStyle *ms;
MenuStyle *tmpms;
Bool is_initialised = True;
@@ -681,6 +684,7 @@
/* Parse the options. */
while (!is_initialised || (action && *action))
{
+ on = 1;
if (!is_initialised)
{
/* some default configuration goes here for the new
@@ -698,6 +702,8 @@
ST_DOUBLE_CLICK_TIME(tmpms) = DEFAULT_MENU_CLICKTIME;
ST_POPUP_DELAY(tmpms) = DEFAULT_POPUP_DELAY;
ST_POPDOWN_DELAY(tmpms) = DEFAULT_POPDOWN_DELAY;
+ ST_DO_SCROLL(tmpms) = MDS_POINTER;
+ ST_SCROLL_OFF_PAGE(tmpms) = 1;
has_gc_changed = True;
option = "fvwm";
}
@@ -720,8 +726,13 @@
}
nextarg = GetNextToken(args, &arg1);
}
-
- switch((i = menustyle_get_styleopt_index(option)))
+ poption = option;
+ while (poption[0] == '!')
+ {
+ on ^= 1;
+ poption++;
+ }
+ switch((i = menustyle_get_styleopt_index(poption)))
{
case 0: /* fvwm */
case 1: /* mwm */
@@ -1287,6 +1298,43 @@
ST_DO_POPUP_AS(tmpms) = MDP_CLOSE;
break;
+ case 56: /* MouseWheel */
+ if (arg1)
+ {
+ if (StrEquals(arg1, "ActivatesItem"))
+ {
+ ST_DO_SCROLL(tmpms) = MDS_OFF;
+ }
+ else if (StrEquals(arg1,
+ "ScrollsMenuBackwards"))
+ {
+ ST_DO_SCROLL(tmpms) = MDS_ON;
+ }
+ else if (StrEquals(arg1, "ScrollsMenu"))
+ {
+ ST_DO_SCROLL(tmpms) = MDS_INVERTED;
+ }
+ else if (StrEquals(arg1, "ScrollsPointer"))
+ {
+ ST_DO_SCROLL(tmpms) = MDS_POINTER;
+ }
+ else
+ {
+ fvwm_msg(ERR, "NewMenuStyle",
+ "unknown argument to MouseWheel '%s'",
+ arg1);
+ ST_DO_SCROLL(tmpms) = MDS_POINTER;
+ }
+ }
+ else
+ {
+ ST_DO_SCROLL(tmpms) =
+ (on) ? MDS_POINTER : MDS_OFF;
+ }
+ break;
+ case 57: /* ScrollOffPage */
+ ST_SCROLL_OFF_PAGE(tmpms) = on;
+ break;
#if 0
case 99: /* PositionHints */
/* to be implemented */
@@ -1295,7 +1343,7 @@
default:
fvwm_msg(ERR, "NewMenuStyle", "unknown option '%s'",
- option);
+ poption);
break;
} /* switch */
@@ -1542,6 +1590,10 @@
ST_DO_POPDOWN_IMMEDIATELY(destms) = ST_DO_POPDOWN_IMMEDIATELY(origms);
/* PopdownDelay */
ST_POPDOWN_DELAY(destms) = ST_POPDOWN_DELAY(origms);
+ /* Scroll */
+ ST_DO_SCROLL(destms) = ST_DO_SCROLL(origms);
+ /* ScrollOffPage */
+ ST_SCROLL_OFF_PAGE(destms) = ST_SCROLL_OFF_PAGE(origms);
menustyle_update(destms);
@@ -1634,10 +1686,16 @@
void CMD_MenuStyle(F_CMD_ARGS)
{
char *option;
+ char *poption;
MenuStyle *dummy;
GetNextSimpleOption(SkipNTokens(action, 1), &option);
- if (option == NULL || menustyle_get_styleopt_index(option) != -1)
+ poption = option;
+ while (poption && poption[0] == '!')
+ {
+ poption++;
+ }
+ if (option == NULL || menustyle_get_styleopt_index(poption) != -1)
{
dummy = menustyle_parse_style(F_PASS_ARGS);
}
Index: fvwm/menustyle.h
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/menustyle.h,v
retrieving revision 1.14
diff -u -r1.14 menustyle.h
--- fvwm/menustyle.h 3 Nov 2003 17:41:20 -0000 1.14
+++ fvwm/menustyle.h 12 Aug 2005 22:33:33 -0000
@@ -121,6 +121,10 @@
#define ST_USE_AUTOMATIC_HOTKEYS(s) ((s)->feel.flags.use_automatic_hotkeys)
#define MST_USE_AUTOMATIC_HOTKEYS(m) \
((m)->s->ms->feel.flags.use_automatic_hotkeys)
+#define ST_DO_SCROLL(s) ((s)->feel.flags.do_scroll)
+#define MST_DO_SCROLL(m) ((m)->s->ms->feel.flags.do_scroll)
+#define ST_SCROLL_OFF_PAGE(s) ((s)->feel.flags.scroll_off_page)
+#define MST_SCROLL_OFF_PAGE(m) ((m)->s->ms->feel.flags.scroll_off_page)
#define ST_FLAGS(s) ((s)->feel.flags)
#define MST_FLAGS(m) ((m)->s->ms->feel.flags)
#define ST_POPUP_OFFSET_PERCENT(s) ((s)->feel.PopupOffsetPercent)
@@ -163,6 +167,14 @@
MDP_CLOSE = 3
} ms_do_popup_as_t;
+typedef enum
+{
+ MDS_OFF = 0,
+ MDS_ON = 1,
+ MDS_INVERTED = 2,
+ MDS_POINTER = 3
+} ms_do_scroll_t;
+
typedef struct MenuFeel
{
struct
@@ -175,6 +187,8 @@
unsigned do_unmap_submenu_on_popdown : 1;
unsigned use_left_submenus : 1;
unsigned use_automatic_hotkeys : 1;
+ unsigned do_scroll : 2;
+ unsigned scroll_off_page : 1;
} flags;
int PopdownDelay10ms;
int PopupOffsetPercent;