Extending the ways for modules to request information back

2006-08-09 Thread Viktor Griph
I've been wanting a way to have fvwm perform tests for modules and respond 
to the module for some time now. While it's possible to use SendToModule 
with an argument 6 alias, or the program name, that may lead to the reply 
being sent to more modules than the originating module. To allow this kind 
of talkback I want to have a way to send a M_STRING (or a new similar 
message) to the module in current execution context. This could be done 
with an option to SendToModule, but that would risk breaking some configs 
or modules using a name or alias matching the literal option. The other 
way would be to add a new command, only usable form modules (similar to 
Send_WindowList and Send_ConfigInfo). I think that Send_Reply is a 
suitable name.


Another similar thing that would be very useful is a Send_Rc prefix 
command with the following syntax:

Send_Rc token command

That should generate a package with the token and the return-code of 
the command along with the usual window context to the originating 
command. Another way to allow similar functionality for modules would be 
to the returncode preserved for each module, so that it's possible to send 
TestRc commands without having to define a function to do so.


What do you think? Which of these are useful, and which ways are the best.

/Viktor



Re: Tracking flag changes from modules

2006-08-09 Thread Dominik Vogt
On Wed, Aug 09, 2006 at 12:07:40AM +0200, Viktor Griph wrote:
[snip]
 But there is a soulution.  Extend the config win packet with a
 flag that indicated whether a window can be moved by the user,
 i.e. the return code of the function that determines whether the
 window can be moved or not.
 
 I'm afraid there is more to the issue than just that. The issue remains, 
 that if, for instance, the style FixedPosition is changed no updated 
 config info is sent to the module, so the flag would get outdated.

Of course.  Nobody said it would be this easy :-)  You have to
set the flag flags-do_update_modules_flags in
check_window_style_change() (styles.c) to 1.  The module message
will then be sent.

 Also, thinking about it: Aren't the pager window movements seen by fvwm as 
 application induced movements since toy use X rather than the fvwm Move 
 builtin?

Yes, you're right.  This isn't optimal since the action is clearly
triggered by the user, not an application.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]


signature.asc
Description: Digital signature


CVS domivogt: * Do not use TRUE/FALSE at all.

2006-08-09 Thread FVWM CVS
CVSROOT:/home/cvs/fvwm
Module name:fvwm
Changes by: domivogt06/08/09 03:31:50

Modified files:
.  : ChangeLog 
fvwm   : add_window.c fvwm.h move_resize.c read.c read.h 
 style.c 
libs   : Strings.h wild.c 
modules: ChangeLog 
modules/FvwmDragWell: fvwmDragWell.c xdndDragSource.c 
modules/FvwmM4 : FvwmM4.c 
modules/FvwmSaveDesk: FvwmSaveDesk.c 
modules/FvwmTaskBar: FvwmTaskBar.c Start.c 

Log message:
* Do not use TRUE/FALSE at all.
* Do not use True/False with int, only with Bool.
* Replaced Bool/True/False/TRUE/FALSE with int/1/0 in many places.




CVS griph: * reindent and respace pager window moving functions

2006-08-09 Thread FVWM CVS
CVSROOT:/home/cvs/fvwm
Module name:fvwm
Changes by: griph   06/08/09 06:50:48

Modified files:
modules: ChangeLog 
modules/FvwmPager: x_pager.c 

Log message:
* reindent and respace pager window moving functions




CVS griph: * make non-icon mode pager use fvwm command for moving icons

2006-08-09 Thread FVWM CVS
CVSROOT:/home/cvs/fvwm
Module name:fvwm
Changes by: griph   06/08/09 08:30:06

Modified files:
modules: ChangeLog 
modules/FvwmPager: x_pager.c 

Log message:
* make non-icon mode pager use fvwm command for moving icons
* don't add title height and border width to coordinates on pager move




Re: CVS griph: * make non-icon mode pager use fvwm command for moving

2006-08-09 Thread seventh guardian

On 8/9/06, Viktor Griph [EMAIL PROTECTED] wrote:

On Wed, 9 Aug 2006, FVWM CVS wrote:
 * don't add title height and border width to coordinates on pager move

I think that this chagen is correct. I did some tests without it, and is
seems as if high-title windows would slip down the screen without it. At
least it was definately wrong for TitleAtLeft/Right styles. I #if 0:ed the
code, so someone else can look at it and see if I'm correct in that it was
incorrect before.


I've noticed another problem with my icons. They are usually on the
bottom left corner of the screen, and in the pager they are a bit
lower (partialy in the screen bellow). This may mean the coordinates
sent from fvwm are not being correctly used by the pager. This may be
part of the problem above.

Cheers
 Renato



/Viktor






Re: CVS griph: * make non-icon mode pager use fvwm command for moving

2006-08-09 Thread Viktor Griph

On Wed, 9 Aug 2006, seventh guardian wrote:


On 8/9/06, Viktor Griph [EMAIL PROTECTED] wrote:

On Wed, 9 Aug 2006, FVWM CVS wrote:
 * don't add title height and border width to coordinates on pager move

I think that this chagen is correct. I did some tests without it, and is
seems as if high-title windows would slip down the screen without it. At
least it was definately wrong for TitleAtLeft/Right styles. I #if 0:ed the
code, so someone else can look at it and see if I'm correct in that it was
incorrect before.


I've noticed another problem with my icons. They are usually on the
bottom left corner of the screen, and in the pager they are a bit
lower (partialy in the screen bellow). This may mean the coordinates
sent from fvwm are not being correctly used by the pager. This may be
part of the problem above.



My icons seems to be at the right position in the pager, altough the 
scaling makes things tricky to test. If it were possible to make a 1:1 
scale pager testing would be easy. Maybe I should look into what limits 
the pager size to a quarter of a pager and remove it for debugging 
purpose.


/Viktor



moving icons across desks with Move breaks drawing

2006-08-09 Thread Viktor Griph

With a blank config the following produces some erractic behaviour:

Style * Icon SOME_ICON

AddToFunc BreakIcon
+ I Iconify on
+ I MoveToDesk 1
+ I Move 0 0

Next BreakIcon

results in a non-updated (icon match background and can be moved as such 
with Move, and icon title blank until the icon is highlighted) icon window 
at the top left corner.


I've no idea where the error is. I don't even know the expected result of 
the above function. (Are Move ever supposed to bring a window (or it's 
icons) to the active desk?


/Viktor



CVS griph: * if 0 (with comments) questionable code doing double work

2006-08-09 Thread FVWM CVS
CVSROOT:/home/cvs/fvwm
Module name:fvwm
Changes by: griph   06/08/09 15:36:12

Modified files:
modules: ChangeLog 
modules/FvwmPager: x_pager.c 

Log message:
* if 0 (with comments) questionable code doing double work
* all window moves use fvwm builtin
* temporary workaround erratic icon behaviour




CVS griph: * don't map picture icon windows on move

2006-08-09 Thread FVWM CVS
CVSROOT:/home/cvs/fvwm
Module name:fvwm
Changes by: griph   06/08/09 16:01:13

Modified files:
.  : ChangeLog 
fvwm   : move_resize.c 
modules: ChangeLog 
modules/FvwmPager: x_pager.c 

Log message:
* don't map picture icon windows on move
* remove invalid icon-bug workaroud




CVS domivogt: * Fixed icon move patch.

2006-08-09 Thread FVWM CVS
CVSROOT:/home/cvs/fvwm
Module name:fvwm
Changes by: domivogt06/08/09 16:47:59

Modified files:
.  : ChangeLog 
fvwm   : move_resize.c 

Log message:
* Fixed icon move patch.




Re: CVS griph: * don't map picture icon windows on move

2006-08-09 Thread Dominik Vogt
On Wed, Aug 09, 2006 at 04:01:13PM -0500, fvwm-workers wrote:
 CVSROOT:  /home/cvs/fvwm
 Module name:  fvwm
 Changes by:   griph   06/08/09 16:01:13
 
 Modified files:
   .  : ChangeLog 
   fvwm   : move_resize.c 
   modules: ChangeLog 
   modules/FvwmPager: x_pager.c 
 
 Log message:
 * don't map picture icon windows on move
 * remove invalid icon-bug workaroud

The patch is not good.  If an icon with a pixmap and a tiltle is
moved. the title is gone afterwards.  The correct fix is tomap
the pixmap/title only if the icon is on the current desk.  I've
committed a fix.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]


signature.asc
Description: Digital signature


Re: CVS griph: * if 0 (with comments) questionable code doing double work

2006-08-09 Thread Dominik Vogt
On Wed, Aug 09, 2006 at 03:36:12PM -0500, fvwm-workers wrote:
 CVSROOT:  /home/cvs/fvwm
 Module name:  fvwm
 Changes by:   griph   06/08/09 15:36:12
 
 Modified files:
   modules: ChangeLog 
   modules/FvwmPager: x_pager.c 
 
 Log message:
 * if 0 (with comments) questionable code doing double work
 * all window moves use fvwm builtin
 * temporary workaround erratic icon behaviour

From x_pager.c:

 /* griph: Why does it move the windows off screen if the
  * desk has been changed? */

I have no idea what this code was intended for.  It's not just
useless, it's even buggy:  if you move a window from a different
desk out of the pager and then cancel the move with the Escape
key, it ends up in the void.  With your patch it is sent back to
the original position when it was dragged out of the pager (which
isn't perfect, but much better than just vanishing).

 /* griph: isn't this almost what Move Pointer does later? */

The additional Move looks pretty useless to me.  The new position 
is overridden immediately by Silent Move Pointer.

 /* This used to move icon windows with
  * XMoveWindow, and non-icons with
  * Silent Move, negative coordinates
  * corrected by display width and
  * border width and title hight added.
  *
  * The if 0:ed code works as before but
  * with
  * fvwm moving the icons. I believe it's
  * incorrectly using at least the title
  * height /griph */

I don't know whether the new code is better.  I assume you have
tested it with titles on all four sides as well as windows without
a title.  The calculation in the old code is definitely incorrect
as it ignores the title direction.

 /* griph: is't this moving to almost where Move Pointer
  * will move the window next? */

See above.

I think all the code in the #if 0s should be removed.

Ciao

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]


signature.asc
Description: Digital signature


CVS domivogt: * Corrected some typos.

2006-08-09 Thread FVWM CVS
CVSROOT:/home/cvs/fvwm
Module name:fvwm
Changes by: domivogt06/08/09 17:19:36

Modified files:
.  : NEWS 
modules/FvwmPager: x_pager.c 

Log message:
* Corrected some typos.