Patchfile is attached that fixes the bugs listed below except for the
last one. See notes below. It was done at 9pm EST (02:00 GMT, I think).
Ben Mathews
Dominik Vogt wrote:
I have applied the patch to the latest CVS code. Can you please
make another patch for the NEWS file and modules/ChangeLog?
Done
* When the tip window pops up over such a button, it contains the
text "Click here to start" as if the pointer was over the Start
button. The position isn't correct either. I guess there
should be no tip window at all by default but you can specify a
text to display in the button definition, e.g.
Fixed
* A bug: press a mouse button over one of these sub buttons.
It is then drawn pressed in. Now drag the pointer a bit with
the button still down ==> all parts of the extended start
buttons are drawn pressed in.
Fixed
* The action is invoked when the button is released, not when
it's pressed as in most other parts of fvwm, e.g. window
titles and FvwmButtons.
Fixed
* When I use
*FvwmTaskBar: AutoStick
and press the Start button, the task bar vanishes. It's on
neither of my four pages, but it's still in the process list.
Still awaiting a fvwmrc file and/or explicit directions to replicate
this. I can't get this behavior. Works fine for me.
? patchfile
? modules/FvwmTaskBar.bu
Index: NEWS
===================================================================
RCS file: /home/cvs/fvwm/fvwm/NEWS,v
retrieving revision 1.413
diff -u -r1.413 NEWS
--- NEWS 2002/09/15 20:26:25 1.413
+++ NEWS 2002/09/16 00:53:09
@@ -5,6 +5,11 @@
Changes in *unstable* development release 2.5.4 (not released yet)
+* FvwmTaskBar may now include mini launchbuttons using the Button
+ command. Also has new options for spacing the buttons:
+ WindowButtonsLeftMargin, WindowButtonsRightMargin, and
+ StartButtonRightMargin. See man page for details.
+
* Style switches can be prefixed with '!' to inverse their meaning.
For example, "Style * Sticky" is the same as "Style * !Slippery".
This works *only* for pairs of styles that take no arguments and
Index: modules/ChangeLog
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/ChangeLog,v
retrieving revision 1.930
diff -u -r1.930 ChangeLog
--- modules/ChangeLog 2002/09/15 20:27:10 1.930
+++ modules/ChangeLog 2002/09/16 00:53:24
@@ -1,3 +1,16 @@
+2002-09-15 Ben Mathews <[EMAIL PROTECTED]>
+
+ * AUTHORS:
+ * FvwmTaskBar/Start.h:
+ * FvwmTaskBar/Start.c:
+ * FvwmTaskBar/FvwmTaskBar.c:
+ * FvwmTaskBar/ButtonArray.c:
+ * FvwmTaskBar/FvwmTaskBar.1:
+ FvwmTaskBar may now include shortcut minibuttons using the Button
+ command. Also has new options for spacing the buttons:
+ WindowButtonsLeftMargin, WindowButtonsRightMargin, and
+ StartButtonRightMargin.
+
2002-09-15 olicha <[EMAIL PROTECTED]>
* FvwmPager/x_pager.c (update_pr_transparent_subwindows):
Index: modules/FvwmTaskBar/ButtonArray.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmTaskBar/ButtonArray.c,v
retrieving revision 1.32
diff -u -r1.32 ButtonArray.c
--- modules/FvwmTaskBar/ButtonArray.c 2002/09/12 20:26:28 1.32
+++ modules/FvwmTaskBar/ButtonArray.c 2002/09/16 00:53:27
@@ -680,7 +680,7 @@
/* -------------------------------------------------------------------------
ButtonCoordinates - Compute the coordinates of a button (animation)
------------------------------------------------------------------------- */
-extern int StartAndMiniButtonsWidth;
+extern int StartAndLaunchButtonsWidth;
void ButtonCoordinates(ButtonArray *array, int numbut, int *xc, int *yc)
{
Button *temp;
@@ -702,7 +702,7 @@
}
}
- *xc = x+ StartAndMiniButtonsWidth+3;
+ *xc = x+ StartAndLaunchButtonsWidth+3;
*yc = y;
}
Index: modules/FvwmTaskBar/FvwmTaskBar.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmTaskBar/FvwmTaskBar.c,v
retrieving revision 1.103
diff -u -r1.103 FvwmTaskBar.c
--- modules/FvwmTaskBar/FvwmTaskBar.c 2002/09/12 20:26:28 1.103
+++ modules/FvwmTaskBar/FvwmTaskBar.c 2002/09/16 00:53:31
@@ -218,6 +218,7 @@
rectangle global_scr_g;
int NRows, RowHeight, Midline;
+int ButtonPressed;
#define COUNT_LIMIT 10000
long DeskNumber; /* Added by Balaji R */
@@ -229,9 +230,9 @@
extern TipStruct Tip;
/* Imported from Start */
-extern int StartAndMiniButtonsWidth, StartAndMiniButtonsHeight;
-extern StartAndMiniButtonItem *First_Start_Button;
-extern StartAndMiniButtonItem *Last_Start_Button;
+extern int StartAndLaunchButtonsWidth, StartAndLaunchButtonsHeight;
+extern StartAndLaunchButtonItem *First_Start_Button;
+extern StartAndLaunchButtonItem *Last_Start_Button;
extern int WindowButtonsLeftMargin;
extern int WindowButtonsRightMargin;
char *ImagePath = NULL;
@@ -364,8 +365,8 @@
StartButtonInit(RowHeight);
/* init the array of buttons */
- InitArray(&buttons, StartAndMiniButtonsWidth + WindowButtonsLeftMargin, 0,
- win_width - stwin_width - StartAndMiniButtonsWidth -
WindowButtonsLeftMargin
+ InitArray(&buttons, StartAndLaunchButtonsWidth + WindowButtonsLeftMargin, 0,
+ win_width - stwin_width - StartAndLaunchButtonsWidth -
WindowButtonsLeftMargin
- WindowButtonsRightMargin, RowHeight, button_width);
InitList(&windows);
@@ -563,7 +564,7 @@
XResizeWindow(dpy, win, win_width, win_height);
UpdateArray(&buttons, -1, -1,
- win_width - stwin_width - StartAndMiniButtonsWidth
+ win_width - stwin_width - StartAndLaunchButtonsWidth
- WindowButtonsLeftMargin - WindowButtonsRightMargin,
-1, -1);
ArrangeButtonArray (&buttons);
@@ -1281,8 +1282,13 @@
char *name;
if (MouseInStartButton(x, y, &whichButton, &startButtonPressed)) {
- if (Tip.type != START_TIP) PopupTipWindow(3, 0, "Click here to start");
- Tip.type = START_TIP;
+ if((!whichButton) && (First_Start_Button->isStartButton))
+ {
+ if (Tip.type != START_TIP) PopupTipWindow(3, 0, "Click here to start");
+ Tip.type = START_TIP;
+ }
+ else
+ Tip.type = NO_TIP;
}
else if (MouseInMail(x, y)) {
if (Tip.type != MAIL_TIP) CreateMailTipWindow();
@@ -1345,10 +1351,46 @@
NewTimestamp = Event.xbutton.time;
num = WhichButton(&buttons, Event.xbutton.x, Event.xbutton.y);
StartButtonUpdate(NULL, -1, BUTTON_UP);
- if (num == -1) {
+ if (num == -1)
+ {
if (MouseInStartButton(Event.xbutton.x, Event.xbutton.y, &whichButton,
&startButtonPressed))
+ {
StartButtonUpdate(NULL, whichButton, BUTTON_UP);
- } else {
+
+ if (whichButton == ButtonPressed)
+ {
+ if ((First_Start_Button->buttonStartCommand != NULL) &&
(startButtonPressed))
+ {
+ rectangle r;
+ Window tmpw;
+ r.x = 0;
+ r.y = 0;
+ r.width = StartAndLaunchButtonsWidth;
+ r.height = StartAndLaunchButtonsHeight;
+ XTranslateCoordinates(dpy, win, Root, r.x, r.y, &r.x, &r.y,
&tmpw);
+ tmp = module_expand_action(dpy, screen,
First_Start_Button->buttonStartCommand, &r, NULL, NULL);
+ if (tmp)
+ {
+ SendText(Fvwm_fd, tmp, 0);
+ free(tmp);
+ }
+ else
+ {
+ SendText(Fvwm_fd, First_Start_Button->buttonStartCommand, 0);
+ }
+ }
+ else
+ {
+ tmp = (char *)safemalloc(100 * sizeof(char)); // fix this later
+ getButtonCommand(whichButton, tmp);
+ SendText(Fvwm_fd, tmp, 0);
+ free(tmp);
+ }
+ }
+ }
+ }
+ else
+ {
ButReleased = ButPressed; /* Avoid race fvwm pipe */
if (Event.xbutton.button >= 1 &&
Event.xbutton.button <= NUMBER_OF_MOUSE_BUTTONS)
@@ -1394,8 +1436,10 @@
case ButtonPress:
NewTimestamp = Event.xbutton.time;
RadioButton(&buttons, -1, BUTTON_UP); /* no windows focused anymore */
- if (MouseInStartButton(Event.xbutton.x, Event.xbutton.y, &whichButton,
&startButtonPressed)) {
+ if (MouseInStartButton(Event.xbutton.x, Event.xbutton.y, &whichButton,
&startButtonPressed))
+ {
StartButtonUpdate(NULL, whichButton, BUTTON_DOWN);
+ ButtonPressed = whichButton;
x = win_x;
if (win_y < Midline) {
/* bar in top half of the screen */
@@ -1404,34 +1448,6 @@
/* bar in bottom of the screen */
y = win_y - screen_g.height;
}
- if ((First_Start_Button->buttonStartCommand != NULL) &&
(startButtonPressed))
- {
- rectangle r;
- Window tmpw;
- r.x = 0;
- r.y = 0;
- r.width = StartAndMiniButtonsWidth;
- r.height = StartAndMiniButtonsHeight;
- XTranslateCoordinates(dpy, win, Root, r.x, r.y, &r.x, &r.y, &tmpw);
- tmp = module_expand_action(dpy, screen,
First_Start_Button->buttonStartCommand, &r, NULL, NULL);
- if (tmp)
- {
- SendText(Fvwm_fd, tmp, 0);
- free(tmp);
- }
- else
- {
- SendText(Fvwm_fd, First_Start_Button->buttonStartCommand, 0);
- }
- }
- else
- {
- tmp = (char *)safemalloc(50 * sizeof(char)); // fix this later
- getButtonCommand(whichButton, tmp);
- SendText(Fvwm_fd, tmp, 0);
- free(tmp);
- }
-
} else {
StartButtonUpdate(NULL, whichButton, BUTTON_UP);
if (MouseInMail(Event.xbutton.x, Event.xbutton.y)) {
@@ -1526,12 +1542,12 @@
case MotionNotify:
NewTimestamp = Event.xmotion.time;
if (MouseInStartButton(Event.xmotion.x, Event.xbutton.y, &whichButton,
&startButtonPressed)) {
- if (SomeButtonDown(Event.xmotion.state))
- redraw = StartButtonUpdate(NULL, -1, BUTTON_DOWN) ? 0 : -1;
+ //if (SomeButtonDown(Event.xmotion.state))
+ //redraw = StartButtonUpdate(NULL, -1, BUTTON_DOWN) ? 0 : -1;
CheckForTip(Event.xmotion.x, Event.xmotion.y);
break;
}
- redraw = StartButtonUpdate(NULL, -1, BUTTON_UP) ? 0 : -1;
+ //redraw = StartButtonUpdate(NULL, buttonPressed, BUTTON_UP) ? 0 : -1;
num = WhichButton(&buttons, Event.xmotion.x, Event.xmotion.y);
if (!HighlightFocus) {
if (SomeButtonDown(Event.xmotion.state) && num != ButPressed) {
Index: modules/FvwmTaskBar/Start.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmTaskBar/Start.c,v
retrieving revision 1.17
diff -u -r1.17 Start.c
--- modules/FvwmTaskBar/Start.c 2002/09/12 20:26:28 1.17
+++ modules/FvwmTaskBar/Start.c 2002/09/16 00:53:32
@@ -33,8 +33,8 @@
extern int ColorLimit;
Button *StartButton;
-int StartAndMiniButtonsWidth = 0;
-int StartAndMiniButtonsHeight = 0;
+int StartAndLaunchButtonsWidth = 0;
+int StartAndLaunchButtonsHeight = 0;
int WindowButtonsLeftMargin = 4; // default value is 4
int WindowButtonsRightMargin = 2; // default value is 2
int StartButtonRightMargin = 0; // default value is 0
@@ -44,8 +44,8 @@
*StartPopup = NULL,
*StartIconName = NULL;
-StartAndMiniButtonItem *First_Start_Button = NULL;
-StartAndMiniButtonItem *Last_Start_Button = NULL;
+StartAndLaunchButtonItem *First_Start_Button = NULL;
+StartAndLaunchButtonItem *Last_Start_Button = NULL;
static char *startopts[] =
{
@@ -68,7 +68,7 @@
int titleRecorded = 0, iconRecorded = 0, actionRecorded = 0;
char *tokens[100]; // This seems really big
char *strtok_ptr;
- StartAndMiniButtonItem *tempPtr;
+ StartAndLaunchButtonItem *tempPtr;
option = tline + Clength;
i = GetTokenIndex(option, startopts, -1, &rest);
@@ -79,16 +79,16 @@
case 0: /* StartName */
if (First_Start_Button == NULL)
{
- First_Start_Button = Last_Start_Button = (StartAndMiniButtonItem*)
safemalloc(sizeof(StartAndMiniButtonItem));
- StartAndMiniButtonItemInit(First_Start_Button);
+ First_Start_Button = Last_Start_Button = (StartAndLaunchButtonItem*)
safemalloc(sizeof(StartAndLaunchButtonItem));
+ StartAndLaunchButtonItemInit(First_Start_Button);
First_Start_Button->isStartButton = TRUE;
}
else if (First_Start_Button->isStartButton == FALSE) // shortcut button
has been declared before start button
{
- tempPtr = (StartAndMiniButtonItem*)
safemalloc(sizeof(StartAndMiniButtonItem));
+ tempPtr = (StartAndLaunchButtonItem*)
safemalloc(sizeof(StartAndLaunchButtonItem));
tempPtr->tail = First_Start_Button;
First_Start_Button = tempPtr;
- StartAndMiniButtonItemInit(First_Start_Button);
+ StartAndLaunchButtonItemInit(First_Start_Button);
First_Start_Button->isStartButton = TRUE;
}
else if (First_Start_Button->buttonCaption != NULL) // declarin caption
twice, ignore
@@ -99,16 +99,16 @@
case 1: /* StartMenu */
if (First_Start_Button == NULL)
{
- First_Start_Button = Last_Start_Button = (StartAndMiniButtonItem*)
safemalloc(sizeof(StartAndMiniButtonItem));
- StartAndMiniButtonItemInit(First_Start_Button);
+ First_Start_Button = Last_Start_Button = (StartAndLaunchButtonItem*)
safemalloc(sizeof(StartAndLaunchButtonItem));
+ StartAndLaunchButtonItemInit(First_Start_Button);
First_Start_Button->isStartButton = TRUE;
}
else if (First_Start_Button->isStartButton == FALSE) // shortcut button
has been declared before start button
{
- tempPtr = (StartAndMiniButtonItem*)
safemalloc(sizeof(StartAndMiniButtonItem));
+ tempPtr = (StartAndLaunchButtonItem*)
safemalloc(sizeof(StartAndLaunchButtonItem));
tempPtr->tail = First_Start_Button;
First_Start_Button = tempPtr;
- StartAndMiniButtonItemInit(First_Start_Button);
+ StartAndLaunchButtonItemInit(First_Start_Button);
First_Start_Button->isStartButton = TRUE;
}
else if (First_Start_Button->buttonCommand != NULL) // declaring command
twice, ignore
@@ -119,16 +119,16 @@
case 2: /* StartIcon */
if (First_Start_Button == NULL)
{
- First_Start_Button = Last_Start_Button = (StartAndMiniButtonItem*)
safemalloc(sizeof(StartAndMiniButtonItem));
- StartAndMiniButtonItemInit(First_Start_Button);
+ First_Start_Button = Last_Start_Button = (StartAndLaunchButtonItem*)
safemalloc(sizeof(StartAndLaunchButtonItem));
+ StartAndLaunchButtonItemInit(First_Start_Button);
First_Start_Button->isStartButton = TRUE;
}
else if (First_Start_Button->isStartButton == FALSE) // shortcut button
has been declared before start button
{
- tempPtr = (StartAndMiniButtonItem*)
safemalloc(sizeof(StartAndMiniButtonItem));
+ tempPtr = (StartAndLaunchButtonItem*)
safemalloc(sizeof(StartAndLaunchButtonItem));
tempPtr->tail = First_Start_Button;
First_Start_Button = tempPtr;
- StartAndMiniButtonItemInit(First_Start_Button);
+ StartAndLaunchButtonItemInit(First_Start_Button);
First_Start_Button->isStartButton = TRUE;
}
else if (First_Start_Button->buttonIconFileName != NULL) // declaring
icon twice, ignore
@@ -139,16 +139,16 @@
case 3: /* StartCommand */
if (First_Start_Button == NULL)
{
- First_Start_Button = Last_Start_Button = (StartAndMiniButtonItem*)
safemalloc(sizeof(StartAndMiniButtonItem));
- StartAndMiniButtonItemInit(First_Start_Button);
+ First_Start_Button = Last_Start_Button = (StartAndLaunchButtonItem*)
safemalloc(sizeof(StartAndLaunchButtonItem));
+ StartAndLaunchButtonItemInit(First_Start_Button);
First_Start_Button->isStartButton = TRUE;
}
else if (First_Start_Button->isStartButton == FALSE) // shortcut button
has been declared before start button
{
- tempPtr = (StartAndMiniButtonItem*)
safemalloc(sizeof(StartAndMiniButtonItem));
+ tempPtr = (StartAndLaunchButtonItem*)
safemalloc(sizeof(StartAndLaunchButtonItem));
tempPtr->tail = First_Start_Button;
First_Start_Button = tempPtr;
- StartAndMiniButtonItemInit(First_Start_Button);
+ StartAndLaunchButtonItemInit(First_Start_Button);
First_Start_Button->isStartButton = TRUE;
}
else if (First_Start_Button->buttonIconFileName != NULL) // declaring
icon twice, ignore
@@ -158,14 +158,14 @@
break;
case 4:
if (Last_Start_Button == NULL)
- First_Start_Button = Last_Start_Button = (StartAndMiniButtonItem*)
safemalloc(sizeof(StartAndMiniButtonItem));
+ First_Start_Button = Last_Start_Button = (StartAndLaunchButtonItem*)
safemalloc(sizeof(StartAndLaunchButtonItem));
else
{
- Last_Start_Button->tail = (StartAndMiniButtonItem*)
safemalloc(sizeof(StartAndMiniButtonItem));
+ Last_Start_Button->tail = (StartAndLaunchButtonItem*)
safemalloc(sizeof(StartAndLaunchButtonItem));
Last_Start_Button = Last_Start_Button->tail;
}
- StartAndMiniButtonItemInit(Last_Start_Button);
+ StartAndLaunchButtonItemInit(Last_Start_Button);
j=0;
titleRecorded = iconRecorded = actionRecorded = 0;
tokens[j++] = strtok_r(rest, ",", &strtok_ptr);
@@ -237,7 +237,7 @@
FvwmPicture *p = NULL;
int pw;
FvwmPictureAttributes fpa;
- StartAndMiniButtonItem *tempPtr;
+ StartAndLaunchButtonItem *tempPtr;
fpa.mask = FPAM_NO_ALLOC_PIXELS;
/* some defaults */
@@ -265,19 +265,19 @@
tempPtr->buttonItem = (Button *)ButtonNew(tempPtr->buttonCaption, p,
BUTTON_UP,0);
tempPtr->width = FlocaleTextWidth(FButtonFont, tempPtr->buttonCaption,
strlen(tempPtr->buttonCaption)) + pw;
tempPtr->height = height;
- StartAndMiniButtonsWidth += tempPtr->width;
- StartAndMiniButtonsWidth += StartButtonRightMargin;
+ StartAndLaunchButtonsWidth += tempPtr->width;
+ StartAndLaunchButtonsWidth += StartButtonRightMargin;
tempPtr=tempPtr->tail;
}
First_Start_Button->height = height;
- StartAndMiniButtonsHeight = First_Start_Button->height;
+ StartAndLaunchButtonsHeight = First_Start_Button->height;
}
int StartButtonUpdate(const char *title, int index, int state)
{
int i=0;
- StartAndMiniButtonItem *tempPtr = First_Start_Button;
+ StartAndLaunchButtonItem *tempPtr = First_Start_Button;
#if 0
if (title != NULL)
ConsoleMessage("Updating StartTitle not supported yet...\n");
@@ -323,8 +323,8 @@
void StartButtonDraw(int force)
{
int tempsum, j, i = 0;
- StartAndMiniButtonItem *tempPtr = First_Start_Button;
- StartAndMiniButtonItem *tempPtr2 = First_Start_Button;
+ StartAndLaunchButtonItem *tempPtr = First_Start_Button;
+ StartAndLaunchButtonItem *tempPtr2 = First_Start_Button;
while(tempPtr != NULL)
{
@@ -355,8 +355,8 @@
int i=0, j=0;
int tempsum = 0;
- StartAndMiniButtonItem *tempPtr = First_Start_Button;
- StartAndMiniButtonItem *tempPtr2 = First_Start_Button;
+ StartAndLaunchButtonItem *tempPtr = First_Start_Button;
+ StartAndLaunchButtonItem *tempPtr2 = First_Start_Button;
*startButtonPressed = FALSE;
while(tempPtr != NULL)
@@ -387,7 +387,7 @@
void getButtonCommand(int whichButton, char *tmp)
{
int i=0;
- StartAndMiniButtonItem *tempPtr = First_Start_Button;
+ StartAndLaunchButtonItem *tempPtr = First_Start_Button;
for(i=0; i<whichButton; i++)
tempPtr = tempPtr->tail;
@@ -400,10 +400,10 @@
else
sprintf(tmp,"Popup StarMenu");
else
- sprintf(tmp,"%s", tempPtr->buttonCommand);
+ sprintf(tmp,"%s", tempPtr->buttonCommand);
}
-void StartAndMiniButtonItemInit(StartAndMiniButtonItem *item)
+void StartAndLaunchButtonItemInit(StartAndLaunchButtonItem *item)
{
item->head = NULL;
item->tail = NULL;
@@ -416,4 +416,5 @@
item->buttonStartCommand = NULL;
item->buttonCaption = NULL;
item->buttonIconFileName = NULL;
+ item->buttonToolTip = NULL;
}
Index: modules/FvwmTaskBar/Start.h
===================================================================
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmTaskBar/Start.h,v
retrieving revision 1.9
diff -u -r1.9 Start.h
--- modules/FvwmTaskBar/Start.h 2002/09/12 20:26:28 1.9
+++ modules/FvwmTaskBar/Start.h 2002/09/16 00:53:32
@@ -20,8 +20,8 @@
#ifndef START_H
#define START_H
-typedef struct startAndMiniButtonItem {
- struct startAndMiniButtonItem *head, *tail;
+typedef struct startAndLaunchButtonItem {
+ struct startAndLaunchButtonItem *head, *tail;
int index;
Button *buttonItem;
int width, height;
@@ -30,12 +30,13 @@
char *buttonStartCommand;
char *buttonCaption;
char *buttonIconFileName;
-} StartAndMiniButtonItem;
+ char *buttonToolTip;
+} StartAndLaunchButtonItem;
extern Bool StartButtonParseConfig(char *tline);
extern void StartButtonInit(int height);
-extern void StartAndMiniButtonItemInit(StartAndMiniButtonItem *item);
-extern void AddStartAndMiniButtonItem(StartAndMiniButtonItem *item);
+extern void StartAndLaunchButtonItemInit(StartAndLaunchButtonItem *item);
+extern void AddStartAndLaunchButtonItem(StartAndLaunchButtonItem *item);
extern int StartButtonUpdate(const char *title, int index, int state);
extern void StartButtonDraw(int force);
extern int MouseInStartButton(int x, int y, int *whichButton, Bool
*startButtonPressed);