fvwmorg / fvwm3

FVWM version 3 -- the successor to fvwm2
Other
515 stars 78 forks source link

FvwmButtons window not showing, when 2 different sized screens, the wider screen above the smaller #913

Closed bymoz089 closed 1 week ago

bymoz089 commented 1 year ago

Upfront Information

what I was trying to do

Run fvwm with the below given minimal config file.

This config should

Expected Behaviour

FvwmButtons window should show up at the correct location (south west corner of lower screen).

FvwmButtons window should hide after a short period of time and it should be redisplayed if the mouse pointer is located at the lower (smaller) screen in the south east corner.

Actual Behaviour

FvwmButtons window is not visible at all.

The implemented autohide feature (redisplaying the FvwmButtons window, if pointer is located at south east corner of the smaller lower screen) does not redisplay the FvwmButtons window.

Workaround

Rewriting the config file, so that:

makes everything work. But of course on the wrong corner.

idea what causes the issue

Due to this workaround behavior, I suspect that this issue is caused by FvwmButtons (or fvwm3), calculating the position (of the south west corner of the lower smaller screen) wrong.

Steps to Reproduce

The problem is easily reproduceable, just start fvwm3 with the with following minimal configuration file:

EdgeScroll 0 0
DeskTopSize 2x2

Style "FvwmButtons" UseUSPosition,UsePPosition,NoHandles,NoTitle,Sticky,WindowListSkip,CirculateSkip,BorderWidth 0,NeverFocus,StaysOnTop,VariablePPosition

DestroyFunc InitFunction
AddToFunc InitFunction
+ I exec /usr/bin/xrandr --output eDP1 --mode 1280x1024 --primary --output DP2 --mode 1920x1080 --above eDP1 --output DP1 --off --output HDMI1 --off --output HDMI2 --off --output VGA1 --off --output VIRTUAL1 --off
+ I Module FvwmButtons
+ I Module FvwmAuto 1 -menter enter_handler

DestroyFunc RestartFunction
AddToFunc RestartFunction
+ I Module FvwmButtons
+ I Module FvwmAuto 1 -menter enter_handler

# ----------

*FvwmButtons: BoxSize smart
*FvwmButtons: Columns 1
*FvwmButtons: Rows 1
*FvwmButtons: Font None
*FvwmButtons: ButtonGeometry 62x62-0-0
#*FvwmButtons: ButtonGeometry 62x62+0-0  # works with 'Shade direction' on 'SW' in 'enter_handler'
*FvwmButtons: Frame 0
*FvwmButtons: Padding 0 0
*FvwmButtons: Pixmap none
*FvwmButtons: (Swallow(NoClose,NoKill,Respawn,UseOld) "FvwmPager" "FvwmPager *")

# ----------

# Autohide FvwmButtons, just show it if mouse pointer is on south east corner of screen
DestroyFunc autohide
AddToFunc autohide
+        I        ThisWindow ($0)  Deschedule $[w.id]
+        I        TestRc (!Match)  Deschedule -$[w.id]
+        I        ThisWindow ($0)  KeepRc ThisWindow (shaded) autohide_show $1 $3
+        I        TestRc (!Match)  All ($0, !shaded) autohide_hide $2 $3

DestroyFunc autohide_show
AddToFunc autohide_show
+        I        Schedule $0 -$[w.id]  WindowShade $1 off
+        I        Schedule $0 -$[w.id]  Deschedule $[w.id]
+        I        Schedule $0 -$[w.id]  Deschedule -$[w.id]

DestroyFunc autohide_hide
AddToFunc autohide_hide
+        I        Schedule $0 $[w.id]  WindowShade $1 on
+        I        Schedule $0 $[w.id]  Deschedule $[w.id]
+        I        Schedule $0 $[w.id]  Deschedule -$[w.id]

DestroyFunc enter_handler
AddToFunc enter_handler
+        I        autohide FvwmButtons 400 800 SE
#                          ^           ^   ^   ^
#                          |           |   |   |__  Shade direction (optional) (N E S W NE SE SW NW)
#                          |           |   |______  Hide delay (milliseconds)
#                          |           |__________  Show delay
#                          |______________________  Unique window name/resource

Does Fvwm3 crash?

no

Extra Information

fvwm2 is behaving correctly and does not show this issue.

Miscalculating screen positions in such cases is an issue because Laptops often have smaller builtin screens than its connected secondary external screens.

somiaj commented 2 weeks ago

I don't really see a bug here, but more a side affect of the difference in how fvwm2 vs fvwm3 treat monitors and RandR support. fvwm3 is a little more complicated because you often have to give positions relative to the monitor you want. You should tell FvwmButtons what monitor to open up. I'm assuming that the monitor you want to put the buttons on is the primary monitor, maybe try Geometry 62x62-0-0@p. Also use Geometry here instead of ButtonGeometry.

But this more looks like an issue with updating your configuration to place your FvwmButtons in the location you want it vs a bug in fvwm. That configuration also looks a bit overly complicated. I'm hoping specifying the monitor will help.

somiaj commented 1 week ago

Closing this issue, as I don't think there is an issue here. You just need to update your configuration to deal with how fvwm3 places windows with multiple monitors.