diff options
Diffstat (limited to '14-Hover.patch')
-rw-r--r-- | 14-Hover.patch | 294 |
1 files changed, 294 insertions, 0 deletions
diff --git a/14-Hover.patch b/14-Hover.patch new file mode 100644 index 000000000000..39db38e1b9b4 --- /dev/null +++ b/14-Hover.patch @@ -0,0 +1,294 @@ +diff -U3 -r fvwm/borders.c fvwm/borders.c +--- fvwm/borders.c 2011-12-09 21:47:16.004017302 +0100 ++++ fvwm/borders.c 2011-12-09 21:49:27.363961242 +0100 +@@ -67,6 +67,7 @@ + /* ---------------------------- imports ------------------------------------ */ + + extern Window PressedW; ++extern Window HoverW; + + /* ---------------------------- included code files ------------------------ */ + +@@ -244,6 +245,7 @@ + unsigned clear_bmask : NUMBER_OF_TITLE_BUTTONS; + unsigned draw_bmask : NUMBER_OF_TITLE_BUTTONS; + unsigned max_bmask : NUMBER_OF_TITLE_BUTTONS; ++ unsigned hover_bmask : NUMBER_OF_TITLE_BUTTONS; + ButtonState bstate[NUMBER_OF_TITLE_BUTTONS]; + unsigned is_title_pressed : 1; + unsigned is_title_lit : 1; +@@ -349,8 +351,12 @@ + + /* rules to get button state */ + static ButtonState border_flags_to_button_state( +- int is_pressed, int is_lit, int is_toggled) ++ int is_pressed, int is_lit, int is_toggled, int is_hover) + { ++ if (is_lit && is_hover && Scr.gs.use_hover_buttons) ++ { ++ return BS_ActiveHover; ++ } + if (!is_lit && Scr.gs.use_inactive_buttons) + { + if (is_pressed && Scr.gs.use_inactive_down_buttons) +@@ -871,7 +877,7 @@ + /* check if state changed */ + old_state = border_flags_to_button_state( + (fw->decor_state.parts_inverted & PART_TITLE), +- (fw->decor_state.parts_lit & PART_TITLE), 0); ++ (fw->decor_state.parts_lit & PART_TITLE), 0, 0); + if (old_state != td->tbstate.tstate) + { + draw_parts |= PART_TITLE; +@@ -895,7 +901,8 @@ + old_state = border_flags_to_button_state( + (fw->decor_state.buttons_inverted & mask), + (fw->decor_state.buttons_lit & mask), +- (fw->decor_state.buttons_toggled & mask)); ++ (fw->decor_state.buttons_toggled & mask), ++ (fw->decor_state.buttons_hover & mask)); + if (old_state != td->tbstate.bstate[i]) + { + draw_parts |= PART_BUTTONS; +@@ -4401,6 +4408,7 @@ + fw->decor_state.buttons_inverted = td->tbstate.pressed_bmask; + fw->decor_state.buttons_lit = td->tbstate.lit_bmask; + fw->decor_state.buttons_toggled = td->tbstate.toggled_bmask; ++ fw->decor_state.buttons_hover = td->tbstate.hover_bmask; + + return; + } +@@ -4669,13 +4677,18 @@ + { + tbstate->toggled_bmask |= mask; + } ++ if (FW_W_BUTTON(fw, i) == HoverW) ++ { ++ tbstate->hover_bmask |= mask; ++ } + tbstate->bstate[i] = border_flags_to_button_state( + tbstate->pressed_bmask & mask, + tbstate->lit_bmask & mask, +- tbstate->toggled_bmask & mask); ++ tbstate->toggled_bmask & mask, ++ tbstate->hover_bmask & mask); + } + tbstate->tstate = border_flags_to_button_state( +- tbstate->is_title_pressed, tbstate->is_title_lit, 0); ++ tbstate->is_title_pressed, tbstate->is_title_lit, 0, 0); + } + + static window_parts border_get_titlebar_descr( +@@ -4940,6 +4953,7 @@ + fw->decor_state.buttons_lit = 0; + fw->decor_state.buttons_inverted = 0; + fw->decor_state.buttons_toggled = 0; ++ fw->decor_state.buttons_hover = 0; + return; + } + memset(&td, 0, sizeof(td)); +@@ -4991,6 +5005,7 @@ + fw->decor_state.buttons_toggled = + (fw->decor_state.buttons_toggled & + ~td.tbstate.max_bmask) | td.tbstate.toggled_bmask; ++ fw->decor_state.buttons_hover &= td.tbstate.hover_bmask; + } + + return; +@@ -5081,11 +5096,12 @@ + ButtonState bs; + int is_pressed; + int is_toggled; ++ int is_hover; + int i; + + /* title */ + is_pressed = (FW_W_TITLE(fw) == PressedW); +- bs = border_flags_to_button_state(is_pressed, has_focus, 0); ++ bs = border_flags_to_button_state(is_pressed, has_focus, 0, 0); + if (DFS_USE_BORDER_STYLE(TB_STATE(GetDecor(fw, titlebar))[bs].style)) + { + return 1; +@@ -5098,8 +5114,9 @@ + } + is_pressed = (FW_W_BUTTON(fw, i) == PressedW); + is_toggled = (is_button_toggled(fw, i) == True); ++ is_hover = (FW_W_BUTTON(fw, i) == HoverW); + bs = border_flags_to_button_state( +- is_pressed, (has_focus == True), is_toggled); ++ is_pressed, (has_focus == True), is_toggled, is_hover); + if (DFS_USE_BORDER_STYLE( + TB_STATE(GetDecor(fw, buttons[i]))[bs].style)) + { +@@ -5560,6 +5577,7 @@ + DEFAULT_USE_INACTIVE_BUTTONS; + Scr.gs.use_inactive_down_buttons = + DEFAULT_USE_INACTIVE_DOWN_BUTTONS; ++ Scr.gs.use_hover_buttons = 0; + return; + } + first = False; +@@ -5581,6 +5599,12 @@ + action, &action, + DEFAULT_USE_INACTIVE_DOWN_BUTTONS, True); + } ++ else if (StrEquals("hover", token)) ++ { ++ Scr.gs.use_hover_buttons = ParseToggleArgument( ++ action, &action, ++ 0, True); ++ } + else + { + Scr.gs.use_active_down_buttons = +@@ -5589,6 +5613,7 @@ + DEFAULT_USE_INACTIVE_BUTTONS; + Scr.gs.use_inactive_down_buttons = + DEFAULT_USE_INACTIVE_DOWN_BUTTONS; ++ Scr.gs.use_hover_buttons = 0; + fvwm_msg(ERR, "cmd_button_state", + "Unknown button state %s", token); + return; +diff -U3 -r fvwm/builtins.c fvwm/builtins.c +--- fvwm/builtins.c 2011-12-09 21:47:16.007350549 +0100 ++++ fvwm/builtins.c 2011-12-09 21:49:27.360627994 +0100 +@@ -102,12 +102,16 @@ + { + "ActiveUp", + "ActiveDown", ++ "ActiveHover", + "InactiveUp", + "InactiveDown", ++ "InactiveHover", + "ToggledActiveUp", + "ToggledActiveDown", ++ "ToggledActiveHover", + "ToggledInactiveUp", + "ToggledInactiveDown", ++ "ToggledInactiveHover", + "Active", + "Inactive", + "ToggledActive", +@@ -118,10 +122,13 @@ + "AllInactive", + "AllUp", + "AllDown", ++ "AllHover", + "AllActiveUp", + "AllActiveDown", ++ "AllActiveHover", + "AllInactiveUp", + "AllInactiveDown", ++ "AllInactiveHover", + NULL + }; + +diff -U3 -r fvwm/events.c fvwm/events.c +--- fvwm/events.c 2011-09-27 23:03:34.000000000 +0200 ++++ fvwm/events.c 2011-12-09 21:49:27.360627994 +0100 +@@ -163,6 +163,7 @@ + + int last_event_type = 0; + Window PressedW = None; ++Window HoverW = None; + + /* ---------------------------- local functions ---------------------------- */ + +@@ -1727,6 +1728,23 @@ + return; + } + ++static void redraw_hover(FvwmWindow* fw, Window w) ++{ ++ if (fw) ++ { ++ int i; ++ for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) ++ { ++ if (w == FW_W_BUTTON(fw, i)) ++ { ++ HoverW = FW_W_BUTTON(fw, i); ++ } ++ } ++ border_redraw_decorations(fw); ++ HoverW = None; ++ } ++} ++ + /* ---------------------------- event handlers ----------------------------- */ + + void HandleButtonPress(const evh_args_t *ea) +@@ -1938,6 +1956,8 @@ + ewp = &te->xcrossing; + ENTER_DBG((stderr, "++++++++ en (%d): fw 0x%08x w 0x%08x sw 0x%08xmode 0x%x detail 0x%x '%s'\n", ++ecount, (int)fw, (int)ewp->window, (int)ewp->subwindow, ewp->mode, ewp->detail, fw?fw->visible_name:"(none)")); + ++ redraw_hover(fw, ewp->window); ++ + if ( + ewp->window == Scr.Root && + ewp->detail == NotifyInferior && ewp->mode == NotifyNormal) +@@ -2615,6 +2635,8 @@ + + DBUG("HandleLeaveNotify", "Routine Entered"); + ++ redraw_hover(fw, te->xcrossing.window); ++ + ENTER_DBG((stderr, "-------- ln (%d): fw 0x%08x w 0x%08x sw 0x%08x mode 0x%x detail 0x%x '%s'\n", ++ecount, (int)fw, (int)te->xcrossing.window, (int)te->xcrossing.subwindow, te->xcrossing.mode, te->xcrossing.detail, fw?fw->visible_name:"(none)")); + lwp = &te->xcrossing; + if ( +diff -U3 -r fvwm/fvwm.h fvwm/fvwm.h +--- fvwm/fvwm.h 2011-12-09 21:47:15.997350808 +0100 ++++ fvwm/fvwm.h 2011-12-09 21:49:27.360627994 +0100 +@@ -827,6 +827,7 @@ + unsigned buttons_lit : NUMBER_OF_TITLE_BUTTONS; + unsigned buttons_inverted : NUMBER_OF_TITLE_BUTTONS; + unsigned buttons_toggled : NUMBER_OF_TITLE_BUTTONS; ++ unsigned buttons_hover : NUMBER_OF_TITLE_BUTTONS; + unsigned parts_drawn : 12; + unsigned parts_lit : 12; + unsigned parts_inverted : 12; +diff -U3 -r fvwm/screen.h fvwm/screen.h +--- fvwm/screen.h 2011-12-09 21:47:16.007350549 +0100 ++++ fvwm/screen.h 2011-12-09 21:49:27.360627994 +0100 +@@ -202,12 +202,16 @@ + BS_All = -1, + BS_ActiveUp, + BS_ActiveDown, ++ BS_ActiveHover, + BS_InactiveUp, + BS_InactiveDown, ++ BS_InactiveHover, + BS_ToggledActiveUp, + BS_ToggledActiveDown, ++ BS_ToggledActiveHover, + BS_ToggledInactiveUp, + BS_ToggledInactiveDown, ++ BS_ToggledInactiveHover, + BS_MaxButtonState, + BS_MaxButtonStateMask = BS_MaxButtonState - 1, + BS_Active, +@@ -220,10 +224,13 @@ + BS_AllInactive, + BS_AllUp, + BS_AllDown, ++ BS_AllHover, + BS_AllActiveUp, + BS_AllActiveDown, ++ BS_AllActiveHover, + BS_AllInactiveUp, + BS_AllInactiveDown, ++ BS_AllInactiveHover, + BS_MaxButtonStateName + } ButtonState; + +@@ -513,6 +520,7 @@ + unsigned use_active_down_buttons : 1; + unsigned use_inactive_buttons : 1; + unsigned use_inactive_down_buttons : 1; ++ unsigned use_hover_buttons : 1; + } gs; /* global style structure */ + struct + { +Seulement dans modules/FvwmIconMan: FvwmIconMan.h.orig +Seulement dans modules/FvwmIconMan: readconfig.c.orig +Seulement dans modules/FvwmIconMan: xmanager.c.orig |