Bug in EdgeCommand

2004-05-19 Thread Jochen Klenner
Fvwm version: 2.5.11 (from cvs)

I think I found a bug in EdgeCommand. To reproduce start Fvwm with this
config:

DestroyFunc NorthFunc
AddToFunc NorthFunc
+ I Echo "North"

EdgeCommand North Function NorthFunc

While the mouse pointer rests over the top edge, the Echo command is
executed over and over, with a CPU load of 100%. This only occurs when the
command to EdgeCommand is a complex function, a normal command is executed
just once, as it should.

Best regards

Jochen
--
Visit the official FVWM web page at http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


PATCH: WindowList tracker (perllib)

2004-05-19 Thread Scott Smedley

An updated version of the WindowList tracker. This version fixes clobbering
of fields.

SCoTT. :)
Index: WindowList.pm
===
RCS file: /home/cvs/fvwm/fvwm/perllib/FVWM/Tracker/WindowList.pm,v
retrieving revision 1.4
diff -u -r1.4 WindowList.pm
--- WindowList.pm   25 Oct 2003 03:00:01 -  1.4
+++ WindowList.pm   19 May 2004 14:56:32 -
@@ -1,4 +1,4 @@
-# Copyright (c) 2003 Mikhael Goikhman
+# Copyright (c) 2004 Mikhael Goikhman, Scott Smedley
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,11 +20,21 @@
 
 use FVWM::Tracker qw(base);
 
+my $windowEvents = M_ADD_WINDOW | M_CONFIGURE_WINDOW | M_DESTROY_WINDOW;
+my $nameEvents = M_RES_NAME | M_RES_CLASS | M_WINDOW_NAME | M_VISIBLE_NAME | 
M_ICON_NAME;
+my $stackEvents = M_RESTACK | M_RAISE_WINDOW | M_LOWER_WINDOW;
+my $iconEvents = M_ICON_LOCATION | M_ICON_FILE | M_DEFAULTICON | M_MINI_ICON;
+
 sub observables ($) {
return [
"window added",
"window deleted",
"window properties updated",
+   "window moved",
+   "window resized",
+   "window name updated",
+   "window stack updated",
+   "window icon updated",
];
 }
 
@@ -36,41 +46,36 @@
my $self = $class->FVWM::Tracker::new($module);
 
$self->{options} = [ @options ];
-
return $self;
 }
 
-sub addRequestedInfoHandlers () {
+sub addRequestedInfoHandlers ($$) {
my $self = shift;
-   my $handlerC = shift;
-   my $handlerD = shift;
-   my $handlerP = shift;
+   my $handler = shift;
 
my $useWInfo = 1;
my $useNames = 1;
my $useStack = 0;
my $useIcons = 0;
-   foreach my $option (@{$self->{options}}) {  
+   foreach (@{$self->{options}}) {  
/^(\!?)winfo$/ and $useWInfo = $1 ne '!';
/^(\!?)names$/ and $useNames = $1 ne '!';
/^(\!?)stack$/ and $useStack = $1 ne '!';
/^(\!?)icons$/ and $useIcons = $1 ne '!';
}
-   my $mask1  = 0;
-   my $mask2  = 0;
-   my $xmask2 = 0;
-   $mask1 |= M_ADD_WINDOW | M_CONFIGURE_WINDOW if $useWInfo;
-   $mask2 |= M_RES_NAME | M_RES_CLASS | M_WINDOW_NAME | M_VISIBLE_NAME | 
M_ICON_NAME
-   if $useNames;
-   $mask2 |= M_RESTACK | M_RAISE_WINDOW | M_LOWER_WINDOW if $useStack;  
-   $mask2 |= M_ICON_LOCATION | M_ICON_FILE | M_DEFAULTICON | M_MINI_ICON
-   if $useIcons;
-   $xmask2 |= MX_VISIBLE_ICON_NAME if $useNames;
-
-   $self->addHandler($mask1, $handlerC) if $mask1;
-   $self->addHandler(M_DESTROY_WINDOW, $handlerD);
-   $self->addHandler($mask2, $handlerP) if $mask2;
-   $self->addHandler($xmask2, $handlerP) if $xmask2;
+   my $mask  = 0;
+   $mask |= $windowEvents if $useWInfo;
+   $mask |= $nameEvents if $useNames;
+   $mask |= $stackEvents if $useStack;  
+   $mask |= $iconEvents if $useIcons;
+
+   # Adding MX_VISIBLE_ICON_NAME to $nameEvents does not work.
+   my $xmask = 0;
+   $xmask |= MX_VISIBLE_ICON_NAME if $useNames;
+
+   $self->addHandler($mask, $handler) if $mask;
+   $self->addHandler($xmask, $handler) if $xmask;
+   $self->addHandler(M_NEW_PAGE, sub { $self->handlerNewPage($_[1]); });
 }
 
 sub start ($) {
@@ -78,37 +83,62 @@
 
$self->{data} = {};
 
-   ### TODO
$self->addRequestedInfoHandlers(sub {
my $event = $_[1];
-   $self->calculateInternals($event->args);
-   }, sub {
-   my $event = $_[1];
-   $self->calculateInternals($event->args);
-   }, sub {
-   my $event = $_[1];
-   $self->calculateInternals($event->args);
+   $self->calculateInternals($event);
});
 
$self->requestWindowListEvents;
-
-   ### temporary
-   $self->deleteHandlers;
-
my $result = $self->SUPER::start;
-
$self->deleteHandlers;
 
-   ### TODO
$self->addRequestedInfoHandlers(sub {
my $event = $_[1];
-   $self->calculateInternals($event->args);
-   }, sub {
-   my $event = $_[1];
-   $self->calculateInternals($event->args);
-   }, sub {
-   my $event = $_[1];
-   $self->calculateInternals($event->args);
+   my ($winId, $oldHash) = $self->calculateInternals($event);
+   return unless defined $winId;
+   my $type = $event->type();
+   if ($type & M_ADD_WINDOW)
+   {
+   $self->notify("window added", $winId);
+   }
+   elsif ($type & M_CONFIGURE_WINDOW)
+   {
+   $self->notify("window properties updated", $winId, 
$oldHash);
+

Federal Provincial Subsidies

2004-05-19 Thread cadfredxdfy
Canada Books
26 Bellevue
St-Anne-des-Lacs
Qc, Canada
J0R 1B0
450-224-9275

Legal Deposit-National Library of Canada
ISBN 2-922870-05-7

The Canadian Subsidy Directory 2004 edition is available.
This publication contains more than 2600 listings of grants
and loans offered by government departments, foundations
and associations.

The publication is sold for $69.95 
To obtain a copy please call: 450-224-9275


--
Visit the official FVWM web page at http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: query mini icon for window (using perllib?)

2004-05-19 Thread Mikhael Goikhman
On 19 May 2004 09:01:42 +1000, Scott Smedley wrote:
> 
> : Is not this the last (name) field of M_MINI_ICON event?
> 
> Ah, of course.
> 
> : Of course you clo[b]ber all names in your WindowList patch as far as I
> : understand it.
> : I had some idea about how to fix this.
> 
> Do tell.
> 
> Would you like me to fix it?

You may submit an updated patch if you have one. But this is optional, I
planned to improve it anyway before commiting. Maybe in a week.

Regards,
Mikhael.
--
Visit the official FVWM web page at http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]