Re: FVWM: FvwmIdent disappears very often

2012-01-05 Thread Thomas Adam
On Thu, Jan 05, 2012 at 12:10:14PM +0100, Michael Großer wrote:
 Does anyone know about this behaviour of FvwmIdent?
 Is the reason known why FvwmIdent is that much damageable?

It's designed to work this way.

Look at the code:

case KeyRelease:
if (is_key_pressed)
{
exit(0);
}
break;

If you press a key, and FvwmIdent is focused, we exit.

case ButtonRelease:
if (is_button_pressed)
{
if (is_button_pressed == 2 
Event.xbutton.button == 2)
{
/* select a new window when
 * button 2 is pressed */
SetMessageMask(
fd, M_CONFIGURE_WINDOW   |
M_WINDOW_NAME|
M_ICON_NAME  |
M_RES_CLASS  |
M_RES_NAME   |
M_END_WINDOWLIST |
M_CONFIG_INFO|
M_END_CONFIG_INFO|
M_SENDCONFIG);
SendText(fd, Send_WindowList, 0);
XDestroyWindow(dpy, main_win);


If button two is pressed, we destroy the top-level window, and prompt for a new 
window to select.

DestroyList();
fvwmlib_get_target_window(
dpy, screen, module-name,
 (module-window), True);
found = 0;
return 1;
}
else
{
exit(0);

Otherwise, all other button processes close FvwmIdent.

-- Thomas Adam



Re: FVWM: FvwmIdent disappears very often

2012-01-05 Thread Michael Großer
Thomas Adam wrote:
 On Thu, Jan 05, 2012 at 12:10:14PM +0100, Michael Großer wrote:
 Does anyone know about this behaviour of FvwmIdent?
 Is the reason known why FvwmIdent is that much damageable?
 
 It's designed to work this way.
 
 Look at the code:
 
   case KeyRelease:
   if (is_key_pressed)
   {
   exit(0);
   }
   break;
 
 If you press a key, and FvwmIdent is focused, we exit.
 
   case ButtonRelease:
   if (is_button_pressed)
   {
   if (is_button_pressed == 2 
   Event.xbutton.button == 2)
   {
   /* select a new window when
* button 2 is pressed */
   SetMessageMask(
   fd, M_CONFIGURE_WINDOW   |
   M_WINDOW_NAME|
   M_ICON_NAME  |
   M_RES_CLASS  |
   M_RES_NAME   |
   M_END_WINDOWLIST |
   M_CONFIG_INFO|
   M_END_CONFIG_INFO|
   M_SENDCONFIG);
   SendText(fd, Send_WindowList, 0);
   XDestroyWindow(dpy, main_win);
 
 
 If button two is pressed, we destroy the top-level window, and prompt for a 
 new window to select.
 
   DestroyList();
   fvwmlib_get_target_window(
   dpy, screen, module-name,
(module-window), True);
   found = 0;
   return 1;
   }
   else
   {
   exit(0);
 
 Otherwise, all other button processes close FvwmIdent.
 
 -- Thomas Adam

Hi!

This was very nice that you showed me the right piece of code.
Thank you for this.

If I were the initial author of FvwmIdent, I would have designed it so
that it would ignore all key presses and mouse button presses but
only a few:

- button 2 to destroy the top-level window and prompt for a new one
- button 3 to exit

What exactly is the advantage to exit when the user turns the mouse wheel
(button number something larger than 3) or when the user hits a Shift
key on the keyboard?

Anyway, if you want, then you can introduce a new option DoNotExit
to let FvwmIdent stay alive when the user hits another key or button
than mouse button 2 or 3 and DoNotExit is true.

The keyboard code could look like this:
 case KeyRelease:
 if (is_key_pressed)
 {
   if (DoNotExit)
   {
 break;  /* or return or something else */
   }
   else
   {
 exit(0);
   }
 }
 break;

Since now I understand why FvwmIdent disappears, I set a NeverFocus style
to prevent that keyboard events will be passed to FvwmIdent. This makes
FvwmIdent's behaviour acceptable for me for now.

At this point, this e-mail would end.

.
.
.
.
.
.

But another thing caused me to strike out a bit more and change something
more than I originally wanted.

When I additionally I set a StaysOnTop style to bring FvwmIdent on top,
I noticed that this does only work when I apply FvwmIdent on
xterms, but not on nedit, Iceweasel, FvwmIdent or some other instances.

So, I tried a lot of things, until I finally got a working solution:

- I called DestroyStyle FvwmIdent before I call Style FvwmIdent
  StaysOnTop, NeverFocus
  - no result
- I wrote a function raiseFvwmIdent (see attachments) to bring
  FvwmIdent on top
  - this only works when:
- I use Schedule
- I make FvwmIdent sticky and unsticky thereafter

The sticky and unsticky solution is a trick I found out in the year 2010.
But all these tricks show: If you look for things that could be improved
on FVWM, here are some:

- examine why a StaysOnTop style is not enough to bring FvwmIdent
  on top

- examine why I need a Stick Stick solution to bring any window
  on top

Since I found workarounds for all these problems, the priority
of these things is not so much high. But it shows that there are
at least some sites that have to be tackled to make even FVWM
(the best window manager worldwide) perfect.



Attachments:
- 0012_FvwmIdent
  - my FvwmIdent code, which successfully makes FvwmIdent
unfocusable and successfully brings it on top

- 0010_task_bar
  - my primary task bar from wich I call FvwmIdent

- 0011_emergency_tool
   - my second task bar for emergency purposes from wich
 I call FvwmIdent



Environment:
- still my old productive system based on Debian Lenny with
  fvwm 2.5.26



Best regards,
Michael
# define the styles for FvwmIdent
DestroyStyle FvwmIdent
Style FvwmIdent StaysOnTop, NeverFocus



# run FvwmIdent and put it on top
DestroyFunc run_FvwmIdent
AddToFunc run_FvwmIdent
+ I Module FvwmIdent FvwmIdent
+ I Schedule 200 Next (FvwmIdent) raiseFvwmIdent
+ I Schedule 1000 Next (FvwmIdent) raiseFvwmIdent

DestroyFunc raiseFvwmIdent
AddToFunc raiseFvwmIdent
+ I Layer 0 6

Re: FVWM: FvwmIdent disappears very often

2012-01-05 Thread Thomas Adam
On Thu, Jan 05, 2012 at 10:43:23PM +0100, Michael Großer wrote:
 When I additionally I set a StaysOnTop style to bring FvwmIdent on top,
 I noticed that this does only work when I apply FvwmIdent on
 xterms, but not on nedit, Iceweasel, FvwmIdent or some other instances.

Look at the MinimalLayer option in man FvwmIdent.  Everything else
you've tried can be got rid of with this option.

Can you also stop sending through all of these config snippets?  Or if you
must, at least trim them down to just the relevant parts?

-- Thomas Adam

-- 
Deep in my heart I wish I was wrong.  But deep in my heart I know I am
not. -- Morrissey (Girl Least Likely To -- off of Viva Hate.)



Re: FVWM: FvwmIdent disappears very often

2012-01-05 Thread Michael Großer
Thomas Adam wrote:
 On Thu, Jan 05, 2012 at 10:43:23PM +0100, Michael Großer wrote:
 When I additionally I set a StaysOnTop style to bring FvwmIdent on top,
 I noticed that this does only work when I apply FvwmIdent on
 xterms, but not on nedit, Iceweasel, FvwmIdent or some other instances.
 
 Look at the MinimalLayer option in man FvwmIdent.  Everything else
 you've tried can be got rid of with this option.

I tried it just now, and it does not reliably work. Not with my
productive system (fvwm 2.5.26). I could try it again later when
I migrate to something newer.


 Can you also stop sending through all of these config snippets?  Or if you
 must, at least trim them down to just the relevant parts?

If they disrupt your reading flow, I can omit them and post links
when I really can't do without config snippets (links will not cause you to
scroll to be able to read the core e-mail message text).


Michael



Re: FVWM: FvwmIdent disappears very often

2012-01-05 Thread Thomas Adam
On Fri, Jan 06, 2012 at 12:02:47AM +0100, Michael Großer wrote:
 Thomas Adam wrote:
  On Thu, Jan 05, 2012 at 10:43:23PM +0100, Michael Großer wrote:
  When I additionally I set a StaysOnTop style to bring FvwmIdent on top,
  I noticed that this does only work when I apply FvwmIdent on
  xterms, but not on nedit, Iceweasel, FvwmIdent or some other instances.
  
  Look at the MinimalLayer option in man FvwmIdent.  Everything else
  you've tried can be got rid of with this option.
 
 I tried it just now, and it does not reliably work. Not with my
 productive system (fvwm 2.5.26). I could try it again later when
 I migrate to something newer.

Not reliably how?  Here:

*FvwmIdent: minimal_layer 10

Always puts FvwmIdent in layer 10 which is high enough to ensure it's not
obscured by any other applications.

What else in your productive system isn't working?

-- Thomas Adam

-- 
Deep in my heart I wish I was wrong.  But deep in my heart I know I am
not. -- Morrissey (Girl Least Likely To -- off of Viva Hate.)



Re: FVWM: FvwmIdent disappears very often

2012-01-05 Thread Thomas Adam
On Thu, Jan 05, 2012 at 11:17:18PM +, Thomas Adam wrote:
 On Fri, Jan 06, 2012 at 12:02:47AM +0100, Michael Großer wrote:
  Thomas Adam wrote:
   On Thu, Jan 05, 2012 at 10:43:23PM +0100, Michael Großer wrote:
   When I additionally I set a StaysOnTop style to bring FvwmIdent on top,
   I noticed that this does only work when I apply FvwmIdent on
   xterms, but not on nedit, Iceweasel, FvwmIdent or some other instances.
   
   Look at the MinimalLayer option in man FvwmIdent.  Everything else
   you've tried can be got rid of with this option.
  
  I tried it just now, and it does not reliably work. Not with my
  productive system (fvwm 2.5.26). I could try it again later when
  I migrate to something newer.
 
 Not reliably how?  Here:
 
 *FvwmIdent: minimal_layer 10

s/minimal_layer/MinimalLayer/

-- Thomas Adam

-- 
Deep in my heart I wish I was wrong.  But deep in my heart I know I am
not. -- Morrissey (Girl Least Likely To -- off of Viva Hate.)