Subject: FVWM: [fvwm-2.0.45] Style bug?

From: Mark Borges <[email-masked]>
Date: 23 Jan 1997 10:29:01 -0700

I'm seeing some odd behavior with the new fvwm that I don't
understand, and which wasn't present in fvwm-2.0.43.

In brief, the title bar buttons that get placed on some of the FrameMaker
(version 5, if it matters) windows appears incorrect.

Normally, I have one button on the left and four buttons on the right
-- lower, minimize, maximize, delete (in left to right
order. The styles section of my .fvwmrc file is appended, in case it helps.

However, starting with fvwm-2.0.44 on some of the FrameMaker5
windows I only get two rightmost buttons -- lower and minimize, while
on others I get all four. It's not a real big deal, but I would like
to have the right-most buttons on all my windows be bound to a
close/delete action.

I've append the output of xwininfo(1) and xprop(1) below for two
FrameMaker windows. The first is one where the anomaly occurs, the
second is one where it behaves as I expect. I notice that in the first
window, `_MOTIF_WM_HINTS' is set. Could that possibly be interacting
with my styles to give the appearance I'm seeing?

Thanks for any help.

------------------------------------------------------------------------------
                             OPEN WINDOW
$ xwininfo
xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.
xwininfo: Window id: 0x4c0010a "FrameMaker - Open"
  Absolute upper-left X:  688
  Absolute upper-left Y:  254
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 288
  Height: 324
  Depth: 8
  Visual Class: PseudoColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x21 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: yes
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +688+254  -176+254  -176-322  +688-322
  -geometry 288x324+681+224

$ xprop
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
WM_TRANSIENT_FOR(WINDOW): window id # 0x4c00087
_MOTIF_WM_MESSAGES(ATOM) = _MOTIF_WM_OFFSET
WM_PROTOCOLS(ATOM): protocols  _MOTIF_WM_MESSAGES, WM_DELETE_WINDOW
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x5, 0x9, 0xffffffff, 0x3, 0x0
WM_CLASS(STRING) = "doc_open", "Maker"
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                Initial state is Normal State.
                window id # of group leader: 0x4c0010a
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                program specified location: 432, 288
                program specified size: 288 by 324
                program specified minimum size: 288 by 324
                window gravity: NorthWest
WM_CLIENT_MACHINE(STRING) = "charney"
WM_NAME(STRING) = "FrameMaker - Open"

------------------------------------------------------------------------------
                             MAIN BUTTON WINDOW
$ xwininfo
xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.
xwininfo: Window id: 0x4c000bf "FrameMaker"
  Absolute upper-left X:  411
  Absolute upper-left Y:  511
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 322
  Height: 66
  Depth: 8
  Visual Class: PseudoColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x21 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +411+511  -419+511  -419-323  +411-323
  -geometry 322x66+404+481
$ xprop
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
WM_COMMAND(STRING) = { "/usr/local/apps/frame5.1/bin/maker" }
_MOTIF_WM_MESSAGES(ATOM) = _MOTIF_WM_OFFSET
WM_PROTOCOLS(ATOM): protocols  _MOTIF_WM_MESSAGES, WM_SAVE_YOURSELF, WM_DELETE_WINDOW
WM_CLASS(STRING) = "makerkit", "Maker"
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                Initial state is Normal State.
                bitmap id # to use for icon: 0x4c000b2
                window id # of group leader: 0x4c000bf
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                program specified location: 0, 0
                program specified size: 322 by 66
                window gravity: NorthWest
WM_CLIENT_MACHINE(STRING) = "charney"
WM_ICON_NAME(STRING) = "FrameMaker"
WM_NAME(STRING) = "FrameMaker"
$

------------------------------------------------------------------------------
------------------------------------------------------------------------------
#if Y_RESOLUTION >= 3700
#define WINDOWFONT	-adobe-times-bold-r-*-*-18-*-*-*-*-*-*-*
#define ICONFONT	-adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
#else
#define WINDOWFONT	-adobe-times-bold-r-*-*-16-*-*-*-*-*-*-*
#define ICONFONT	-adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
#endif

GlobalOpts SmartPlacementIsReallySmart

/*
 Standard Window Configuration
 HilightColor  Black DeepSkyBlue
*/
AddToDecor Standard
+       HilightColor    black #32007D708A3C
+       WindowFont      WINDOWFONT
+	IconFont	ICONFONT
+       ButtonStyle 1   ActiveUp (Pixmap x-up.xpm) \
                        ActiveDown (Pixmap x-down.xpm) \
                        Inactive (Pixmap mini.destroy.xpm)
+       ButtonStyle 2   ActiveUp (Pixmap close-up.xpm) \
                        ActiveDown (Pixmap close-down.xpm) \
                        Inactive (Pixmap mini.destroy.xpm)
+       ButtonStyle 4   ActiveUp (Pixmap maximize-up.xpm) \
                        ActiveDown (Pixmap maximize-down.xpm) \
                        Inactive (Pixmap mini.destroy.xpm)
+       ButtonStyle 6   ActiveUp (Pixmap minimize-up.xpm) \
                        ActiveDown (Pixmap minimize-down.xpm) \
                        Inactive (Pixmap mini.destroy.xpm)
+       ButtonStyle 8   ActiveUp (Pixmap lower-up.xpm) \
                        ActiveDown (Pixmap lower-down.xpm) \
                        Inactive (Pixmap mini.destroy.xpm)
AddToDecor Transient
+       HilightColor    black #32007D708A3C
+       WindowFont      WINDOWFONT
+       ButtonStyle 1   ActiveUp (Pixmap x-up.xpm) \
                        ActiveDown (Pixmap x-down.xpm) \
                        Inactive (Pixmap mini.destroy.xpm)
+       ButtonStyle 2   ActiveUp (Pixmap close-up.xpm) \
                        ActiveDown (Pixmap close-down.xpm) \
                        Inactive (Pixmap mini.destroy.xpm)
+       ButtonStyle 4   ActiveUp (Pixmap lower-up.xpm) \
                        ActiveDown (Pixmap lower-down.xpm) \
                        Inactive (Pixmap mini.destroy.xpm)

Style Standard  UseDecor Standard, \
                BorderWidth 5, Color LightSkyBlue2/RoyalBlue4, \
                DecorateTransient, HintOverride, \
                StickyIcon, IconBox +950 +0 +1000 -1, \
                RandomPlacement, SmartPlacement, \
                MWMDecor, MWMFunctions

Style Transient UseDecor Transient, \
                BorderWidth 4, Color LightSkyBlue2/RoyalBlue4, \
                DecorateTransient, HintOverride, \
                SmartPlacement, RandomPlacement, \
		MWMDecor, MWMFunctions

Style Naked     WindowListSkip, Sticky, NoTitle, NoHandles, BorderWidth 0

/* Application-specific decoration styles and window options */

Style "*"           UseStyle Standard

/* FVWM Modules */

Style "Fvwm*"       UseStyle Naked
Style "FvwmPager"   ClickToFocus, BorderWidth 5
Style "FvwmTalk"    WindowListHit,  Slippery, Title, BorderWidth 5
Style "FvwmConsole" WindowListHit,  Slippery, Title, BorderWidth 5

/* Individual application styles & icons */

Style "*faces"      UseStyle Naked, StaysOnTop
Style "*lock"       UseStyle Naked, RandomPlacement

Style "matlab"	    Icon math4.xpm
Style "XMeter"	    Icon load.xbm
Style "XBuffy"	    UseStyle Naked, RandomPlacement
Style "XColormap"   Icon zippy2.xpm,SmartPlacement,Sticky,WindowListSkip

Style "XTerm"       StartsOnDesk 0, SloppyFocus, MWMBorder, Icon xterm.xpm
Style "ngplot"	    StartsOnDesk 0

Style "Emacs"	    StartsOnDesk 1, SkipMapping

Style "Maker"       StartsOnDesk 2, SkipMapping
Style "dockit"      UseStyle Transient, StartsOnDesk 2

Style "Netscape"    StartsOnDesk 2, SkipMapping

Style "Snm"	    StartsOnDesk 3, SkipMapping
Style "Segui"	    StartsOnDesk 3, SkipMapping

-- 
  -mb-
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Andrew Veliath <[email-masked]>
Date: Thu, 23 Jan 1997 12:44:16 -0500 (EST)

> to have the right-most buttons on all my windows be bound to a

I think you are using MWM* stuff (MWMDecor, etc.) and if you do so you
must setup your buttons in an MWM style (such as the standard fvwm2 look). 

--
Andrew Veliath <[email-masked]>        http://www.rpi.edu/~veliaa
One day, all forms of communication will be superseded by a FAQ.
Finger for PGP Public Key
Key fingerprint =  51 56 5D 3E 51 43 8B 74  7C B2 E4 B6 84 8E 8B 08

---

From: Andrew Veliath <[email-masked]>
Date: Thu, 23 Jan 1997 13:24:05 -0500 (EST)

> must setup your buttons in an MWM style (such as the standard fvwm2 look). 
~
To clarify, if the application gives MWM hints to not show a Minimize or
Maximize button such the window in question, fvwm2 simply omits either one
or two of the rightmost buttons.  Fvwm2 has done this WAY before 2.0.44
(i.e. it hasn't been touched).  This is why you lose those two rightmost
buttons, leaving only lower and minimize (even though fvwm2 ideally should
have left out minimize and maximize alone).

Since people are having many new button combinations nowdays, it might be
worth it to have fvwm2 listen to button hints and remove buttons according
to binding -- but this could be iffy since you might have it bound to a
custom function, etc.

A possible option would be to have MWMMaximize and MWMMinimize, and
MWMTitleMenu button flags so the user can explicitly set which buttons
denote MWM functions (this would really be the only sure shot way to do
this...).  

I can make a patch if you would like to try something like this.  Come to
think of it, an MWMMaximize flag would nullify the need for the current
MWMButton flag as well.

---

From: Mark Borges <[email-masked]>
Date: 23 Jan 1997 15:29:20 -0700

>> On Thu, 23 Jan 1997 13:24:05 -0500 (EST),
>> Andrew Veliath(a) wrote:
>> must setup your buttons in an MWM style (such as the standard fvwm2 look). 

Yes. I forget exactly why I was so fond of these MWM* things, so
I took them out (though I did leave MWMBorder in my Style
"XTerm"). Are these there because some apps don't work (or behave
badly), or is it mostly for appearance.

Anyway, as you predicted, that fixed the problem.

[ clarification elided ]

Thanks, that makes sense now.

a> I can make a patch if you would like to try something like this.
a> Come to think of it, an MWMMaximize flag would nullify the need for
a> the current MWMButton flag as well.

Since I asked in the first place, sure I'll test out anything you
want. But I'd also be happy with the status quo.

Thanks.

---

From: [email-masked] (Albrecht Kadlec)
Date: Mon, 27 Jan 97 18:27:28 +0100

>>>>> Andrew Veliath writes:

A> On Thu, 23 Jan 1997, Andrew Veliath wrote:

A> To clarify, if the application gives MWM hints to not show a Minimize or
A> Maximize button such the window in question, fvwm2 simply omits either one
A> or two of the rightmost buttons.  Fvwm2 has done this WAY before 2.0.44
A> (i.e. it hasn't been touched).  This is why you lose those two rightmost
A> buttons, leaving only lower and minimize (even though fvwm2 ideally should
A> have left out minimize and maximize alone).

BUG.

A> Since people are having many new button combinations nowdays, it might be
A> worth it to have fvwm2 listen to button hints and remove buttons according
A> to binding -- but this could be iffy since you might have it bound to a
A> custom function, etc.

I wouldn't remove them, but just dim them, like the menu entries (I haven't
see any dimmed menu entries lately, but I usually keep these back doors
wide open, anyway)

A> A possible option would be to have MWMMaximize and MWMMinimize, and
A> MWMTitleMenu button flags so the user can explicitly set which buttons
A> denote MWM functions (this would really be the only sure shot way to do
A> this...).  

A> I can make a patch if you would like to try something like this.  Come to
A> think of it, an MWMMaximize flag would nullify the need for the current
A> MWMButton flag as well. 

why not just have the actual maximize/minimize functions do nothing, if
maximize/minimize is forbidden in the MwmHints and the hints are to be
obeyed.

albrecht
-- 
In ten years, Apple Computer has gone from a company which talked
about how great their computers were to a company which talks
about how great their computers were 10 years ago.
							-- unknown
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: "Paul D. Smith" <[email-masked]>
Date: Mon, 27 Jan 97 12:49:21 EST

%% [email-masked] (Albrecht Kadlec) writes:

  a> why not just have the actual maximize/minimize functions do nothing, if
  a> maximize/minimize is forbidden in the MwmHints and the hints are to be
  a> obeyed.

Unless there is some visible indication that the buttons are disabled, I
think this is absolutely NOT the right thing to do.

If all windows have min/max buttons, but some work and some don't, the
user is just going to be mightily confused and bug reports on this will
pour in to both FVWM development and other software developers forever
more.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
     These are my opinions--Bay Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Albrecht Kadlec)
Date: Mon, 27 Jan 97 18:57:04 +0100

>>>>> Paul D Smith writes:

P> %% [email-masked] (Albrecht Kadlec) writes:
a> why not just have the actual maximize/minimize functions do nothing, if
a> maximize/minimize is forbidden in the MwmHints and the hints are to be
a> obeyed.

P> Unless there is some visible indication that the buttons are disabled, I
P> think this is absolutely NOT the right thing to do.

P> If all windows have min/max buttons, but some work and some don't, the
P> user is just going to be mightily confused and bug reports on this will
P> pour in to both FVWM development and other software developers forever
P> more.

yes, right. 
But as andrew said: dimming out a button is a BAD THING, if there's a
popup/menu behind.
And there can be n intermixed levels of popups & complex functions,
so finding the Maximize or Minimize action and dimming these - 
RIGHT THING (TM) - is impossible: O(n!^n!) (well almost).

albrecht
-- 
It may be legendary but the swordmakers of ancient times were said to
have quenched red hot blades by running them through the bodies of
slaves, which would certainly both raise the temper of the slaves and
also most likely quench them as well.			-- Alan Heldman
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].