-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FvwmEvent event monitor_focus broken in FVWM3 1.0.4 #604
Comments
Hi @NsCDE Hmm -- this seems to be working for me... Here's an example:
Then in a separate terminal:
Then I start to shift focus between monitors, I see output such as this:
Can you provide more details so I can break it? |
Hi @ThomasAdam Strange. I tried this with nc on $FVWMMFL_SOCKET and it does not work for me. Last time, I was watching in log file opened (Watch Errors in NsCDE). This time I have opened FVWMMFL_SOCKET like this (nc on Linux Fedora 33 VM):
Put in /opt/NsCDE/config/NsCDE-Event.conf at the end:
Then shifted focus between monitors and nothing appears on output. Generally output works. If I make
To reproduce? Hm ... You probably have some NsCDE VM around. Try to fetch current master and update For me, it really does not do anything, while ordinary Echo from FvwmCommand, and the rest of events from FvwmEvent (same instance) works. EDIT: I was in per-monitor mode. |
Breaking news (tm): If I switch monitors by other means (for example Window list and click to window which is on another monitor from $[monitor.current] I get:
Even if my FvwmEvent line is:
I hope this gives some pointer further ... |
OK... Are you able to reproduce this by using a minimal config which isn't using NsCDE? I still can't reproduce this. |
Hi @ThomasAdam This is with default-config copied into ~/.fvwm and edited like this:
I had one xterm on Virtual-0 and one on Virtual-1. This is the sequence of commands:
This is the output on the socket during actions above:
As you can see, Only the first echo from FvwmCommand actually produced desired effect. Even add_window prints some hex address instead of text, which I didn't observed with NsCDE MainLoop FvwmEvent instance and finally, monitor_focus movement of mouse between monitors produces "-1". Another difference between this modified vanilla config and NsCDE is that monitor_focus in NsCDE often doesn't print event "-1" at all. Here, "-1" is printed every time. Fedora 33, FVWM3 1.0.4 in KVM |
Hi @NsCDE Is this still a problem? For me, the following works as I would expect:
|
Hi @ThomasAdam I have copy/pasted your example and "sourced it". Most of the time, nothing happens while moving pointer from one to another monitor. Sometimes it prints "-1", and only if I open Workspace Menu (3rd mouse button click on the root window) on Virtual-1 and then go back to Virtual-0, I SOMETIMES get command output. Let's say once in 15-20 attempts. After some time, it starts to work for Virtual-1 (but only if I open menu anc cancel it with 1st mouse button), but never for Virtual-0.
|
Hi @NsCDE That's odd -- I most definitely do not see this in my testing. I wonder what other setting(s) you have which could impact this? |
Hi @ThomasAdam I have tried now with vanilla fvwm config plus FvwmMFL and your neccessary FvwmEvent test. It behaves differently, but still erroneously.
|
Hi @NsCDE Your first point is correct -- as I've mentioned, focus events for monitors can only happen on windows which are focused, not the root window. I think the example I gave is wrong. Try this:
The reason you're seeing the current monitor at the end of the string, without any expansion placeholder is due to FvwmEvent sending it to the function. I'll remove that. I do not see any messages with:
Everything is working for me as it should. |
Hi @ThomasAdam Madness of inconsitencies what I have found ... First on vanilla fvwm3 session: It works as you described. Then I started to play a bit: I have removed Under NsCDE, situation is similar, except it produces any output in very rare situations: like clicking and moving mouse on monitor 2 to get root menu, then with opened root menu moving mouse to monitor 1 and clicking window (to dissapear opened menu on monitor 2 wil in ~30% cases produce some line of output. Usually with some delay. To be able to get this, I have reconfigured my MainLoop Event config to contain "Cmd Echo" like your FEn example and remove PassID. As you can see, under NsCDE
It looks to me like multiple (2-3) problems, not one. First, Lonely "Cmd" will escape string, second, PassID is the source of "-1", then on the top of all this, under NsCDE previous and current monitor are the same (when it prints anything at all), while hardcoded one after the string is always different from both - previous and current. I hope you can get some hints and pointers from this mess. :-\ EDIT: fvwm3 vanilla output when Echo is not in Cmd line, but after monitor_focus:
fvwm3 vanilla output when I add PassID to the FEn instance of FvwmEvent configuration:
Under vanilla fvwm3 at least it is triggered every time while focusing windows on different monitors, which is not the case under NsCDE. |
When handling focus between screens (which is predicated on windows receiving focus, rather than the root window), toggle the appropriate monitors so that the previous focused monitor is referenced correctly. While here, improve the matching of the previous monitor. Fixes #604
The monitor_* events used to be special-cased in that there would be an attempt to pass arguments to calling functions. Don't do this any longer, and treat these events the same as any other without a window context. Fixes #604
Hey @NsCDE, I still cannot get
|
Hi @ThomasAdam This works every time and as expected in vanilla fvwm3 even if after testing your example I add Cmd and PassID arguments in module configuration. However, when I add another event (which knows how to handle PassID) monitor_focus becomes non-functional. Similar as in NsCDE, it will be triggered very rarely and can be forced (sometimes) with open root window menus and moving mouse to another monitor, focusing window there and clicking. New enter_window event will normally work and produce expected output (echo 0x....) Here is the configuration:
|
Hi @NsCDE With your example, things continue to work exactly as they should -- I do not see any delays or missing events from either Very strange. |
Hi @NsCDE Can you try You should see lines starting with |
Hi @ThomasAdam With only monitor_focus, it prints this:
with enter_window AND monitor_focus, it is this:
As you can see, monitor_focus is totally absent. |
Hi @NsCDE Yes -- you'll see As for why you don't see any
What focus policy are you using? I'm using sloppyfocus. |
I'm using default fvwm config while trying to help with this. Above output was from ~/.xsession-errors and ~/.fvwm/fvwm3-output.log under vanilla fvwm - so as I see in ~/.fvwm/config it is also SloppyFocus. Sometimes, it spits from functions foo, but very rarely, and as you can see $[monitor.prev] is lost.
Then the second time (after a while trying for a minute or two):
... but I'm not sure I was passing from xterm on Virtual-1 to another xterm on Virtual-2, somehow it looks like something from the past. I'll try to put some PipeRead to print date. |
Hmm... $[monitor.prev] will be blank if you've never focused a window on a different monitor. Just focusing the root window doesn't count, remember. If I just use the default config, I get the same results as I've been posting -- so the behaviour for me doesn't change. |
Nope. date/time is correct whenever output from foo (monitor_focus) appears. Here are both: enter_window and monitor_focus. As you can see, $[monitor.prev] is sometimes empty, altrough it has been referenced before (not a fresh session).
|
Nop it appeared two times in a row, but then nothing for subsequent 20+ moving mouse from xterm Virtual-1 to xterm Virtual-2.
|
What fvwm3 version are you using? For me:
|
rjeremy@testbox10:~$ /opt/fvwm3-master/bin/fvwm3 --version -rwxr-xr-x 1 root root 5076392 Sep 21 13:38 /opt/fvwm3-master/bin/fvwm3 |
The problem is |
When handling focus between screens (which is predicated on windows receiving focus, rather than the root window), toggle the appropriate monitors so that the previous focused monitor is referenced correctly. While here, improve the matching of the previous monitor. Fixes #604
The monitor_* events used to be special-cased in that there would be an attempt to pass arguments to calling functions. Don't do this any longer, and treat these events the same as any other without a window context. Fixes #604
OK -- I've added a few things and rebased |
Hi @ThomasAdam Much better Under vanilla fvwm it works now as expected with "FEn" example configuration. But under NsCDE which has rich, real life FvwmEvent configuration, it works randomly. String in function is printed ok, but the whole thing sometimes misses to trigger, even if I work slowly. Sometimes it misses from Virtual-2 to Virtual-1, then after that there will be nothing in the next 3-4 moves between windows on different screens, then suddenly starts to work again and prints correctly for 3-4 times etc ... This happens even if I remove all events apart from new_desk and monitor_focus. |
You'll need to find me a config which breaks this, please. |
Hi @ThomasAdam Sorry, I'm a lot out of $HOME this days and cannot react frequently. I have adapted my "MainLoop" FvwmEvent from NsCDE for vanilla FVWM3 with simple f_foo* functions which echoes name of the event. If you comment out enter_window, leave_window and focus_change, it will work. Adding back focus_change it will work in ~90% cases, adding back enter_window and leave_window will strangle monitor_focus, and it will appear only in 40-55% cases.
|
Hi @NsCDE That's OK -- I appreciate your help. Despite your example configuration, and playing about with enabling and disabling {enter,leave}_window events, etc., everything works as I expect it to -- I am not seeing any missed events at all. It's working as it should. |
Hi @ThomasAdam I have tested this on Debian 11.3, kernel 5.10.0 and X.Org X Server 1.20.11. I will try this on fedora and some other test VMs that I have late on sunday when I'm back from trip. I'm too tired now. |
I was not able to sleep after all. :-) So the results on Fedora 35 are identical as on Debian. It works occasionally, and has one interesting "feature": if I put
Looks like some opportunity for online debugging meeting maybe. |
Can you update your config which shows this, and put it here, please? |
Hi @ThomasAdam Here is the complete .fvwm used in testing, together with FEn.conf inside and kill -USR2 $PPID to enable debug output. On Fedora 35, the same as on Debian 11.3, I get 50% chance that monitor_focus will be triggered while enter_window, leave_window and focus_change are uncommented/active in .fvwm/FEn.conf. EDIT: On Virtual-0 was mate-terminal, on Virtual-1 pcmanfm-qt. I was focusing them interchangebly moving mouse left-right/right-left. |
When handling focus between screens (which is predicated on windows receiving focus, rather than the root window), toggle the appropriate monitors so that the previous focused monitor is referenced correctly. While here, improve the matching of the previous monitor. Fixes #604
The monitor_* events used to be special-cased in that there would be an attempt to pass arguments to calling functions. Don't do this any longer, and treat these events the same as any other without a window context. Fixes #604
The monitor_* events used to be special-cased in that there would be an attempt to pass arguments to calling functions. Don't do this any longer, and treat these events the same as any other without a window context. Fixes #604
(One of the more significant changes is that locking issues with libX11 1.8.1 are fixed.) ## [1.0.5](https://github.com/fvwmorg/fvwm3/tree/1.0.5) (2022-09-28) [Full Changelog](fvwmorg/fvwm3@1.0.4...1.0.5) **Breaking changes:** - Function parser rewrite & Repeat command deprecation [\#642](fvwmorg/fvwm3#642) - MapRequest: don't fake map/unmap events [\#703](fvwmorg/fvwm3#703) ([ThomasAdam](https://github.com/ThomasAdam)) - Rewrite function parser and remove the Repeat command [\#643](fvwmorg/fvwm3#643) ([ThomasAdam](https://github.com/ThomasAdam)) - Update and cleanup SnapAttract code. [\#641](fvwmorg/fvwm3#641) ([somiaj](https://github.com/somiaj)) - Doc: split manpages into sections [\#637](fvwmorg/fvwm3#637) ([ThomasAdam](https://github.com/ThomasAdam)) - Remove Efence and Dmalloc support [\#635](fvwmorg/fvwm3#635) ([ThomasAdam](https://github.com/ThomasAdam)) **Implemented enhancements:** - A better ManualPlacement that allows drawing the geometry of the new window. [\#674](fvwmorg/fvwm3#674) - expand: add monitor.prev variable [\#699](fvwmorg/fvwm3#699) ([ThomasAdam](https://github.com/ThomasAdam)) - Add AnyScreen to conditional in IconManClick [\#696](fvwmorg/fvwm3#696) ([somiaj](https://github.com/somiaj)) - \_NET\_WM\_NAME: update to fvwm3 [\#609](fvwmorg/fvwm3#609) ([ThomasAdam](https://github.com/ThomasAdam)) **Fixed bugs:** - Style \* Icon cause Fvwm3 stuck in loading when restart. [\#681](fvwmorg/fvwm3#681) - Recaptured windows can have a negative offset away from the page they should be on [\#678](fvwmorg/fvwm3#678) - VLC still decorates its transient window even when explicitly given the NakedTransient style [\#673](fvwmorg/fvwm3#673) - configuring with `--disable-png` causes builds to fail [\#669](fvwmorg/fvwm3#669) - Emoji in window titles make FvwmIconMan stop showing window names. [\#654](fvwmorg/fvwm3#654) - Unable to initialize RandR [\#650](fvwmorg/fvwm3#650) - PipeRead when called from a function cannot grab pointer [\#610](fvwmorg/fvwm3#610) - Man Pages Cleanup [\#554](fvwmorg/fvwm3#554) - Windows from various pages are moved to page 0 0 on fvwm3 restart [\#694](fvwmorg/fvwm3#694) - Separator in menu gets focus [\#675](fvwmorg/fvwm3#675) - Unshading a window with WindowShade function sometimes makes the window lose "true input focus". [\#671](fvwmorg/fvwm3#671) - When configured with `--disable-xft` fvwm3 fails to build. [\#667](fvwmorg/fvwm3#667) - my fvwm config does not work with recent chromium [\#663](fvwmorg/fvwm3#663) - FvwmEvent event new\_desk gets triggered multiple times in multi-monitor shared setup [\#655](fvwmorg/fvwm3#655) - Windows with style "PositionPlacement Center" split between monitors [\#648](fvwmorg/fvwm3#648) - FVWM branch dv/pager-noaspect crashes with core dump [\#647](fvwmorg/fvwm3#647) - SnapAttraction prefers wrong window [\#631](fvwmorg/fvwm3#631) - FvwmPrompt is installed unstripped [\#618](fvwmorg/fvwm3#618) - DesktopName fails to set desktop name under described circumstances [\#606](fvwmorg/fvwm3#606) - FvwmEvent event monitor\_focus broken in FVWM3 1.0.4 [\#604](fvwmorg/fvwm3#604) - Building FvwmPrompt disables FvwmConsole, but still installs manual page. [\#597](fvwmorg/fvwm3#597) - Wait command in configuration file can cause unexpected issues with GeometryWindow. [\#590](fvwmorg/fvwm3#590) - "GeometryWindow Hide" doesn't work [\#589](fvwmorg/fvwm3#589) - Special characters \(umlauts\) are sometimes not displayed correctly in the window title [\#482](fvwmorg/fvwm3#482) - FvwmEvent: handle previous\_monitor and no longer passthrough ID [\#701](fvwmorg/fvwm3#701) ([ThomasAdam](https://github.com/ThomasAdam)) - doc: don't build FvwmConsole.1 if FvwmPrompt enabled [\#700](fvwmorg/fvwm3#700) ([ThomasAdam](https://github.com/ThomasAdam)) - DesktopConfiguration shared: keep windows in-situ [\#697](fvwmorg/fvwm3#697) ([ThomasAdam](https://github.com/ThomasAdam)) - desk\_add: fix starting desk/monitor [\#689](fvwmorg/fvwm3#689) ([ThomasAdam](https://github.com/ThomasAdam)) - shared: fix flagging of new\_desk [\#687](fvwmorg/fvwm3#687) ([ThomasAdam](https://github.com/ThomasAdam)) - Fix for lock recusion in handle\_all\_expose\(\) [\#683](fvwmorg/fvwm3#683) ([mherrb](https://github.com/mherrb)) - Asciidoc fixes [\#676](fvwmorg/fvwm3#676) ([topcat001](https://github.com/topcat001)) - grow: ignore transient windows [\#627](fvwmorg/fvwm3#627) ([ThomasAdam](https://github.com/ThomasAdam)) - MoveToScreen: fix NULL-dereference [\#605](fvwmorg/fvwm3#605) ([ThomasAdam](https://github.com/ThomasAdam)) - Bugfix: fvwm-menu-desktop --get-menus [\#593](fvwmorg/fvwm3#593) ([somiaj](https://github.com/somiaj)) **Closed issues:** - Code Cleanup: Codacy issues list [\#107](fvwmorg/fvwm3#107) **Merged pull requests:** - avoid sprintf\(%n\) [\#653](fvwmorg/fvwm3#653) ([omar-polo](https://github.com/omar-polo)) - FvwmPrompt: add GOFLAGS to build stripped [\#619](fvwmorg/fvwm3#619) ([Zirias](https://github.com/Zirias)) - Wait: don't run until windows are captured [\#592](fvwmorg/fvwm3#592) ([ThomasAdam](https://github.com/ThomasAdam)) - CMD\_GeometryWindow: Move NULL check. [\#591](fvwmorg/fvwm3#591) ([somiaj](https://github.com/somiaj)) - cleanup: address warnings [\#705](fvwmorg/fvwm3#705) ([ThomasAdam](https://github.com/ThomasAdam)) - modconf: disable debug [\#698](fvwmorg/fvwm3#698) ([ThomasAdam](https://github.com/ThomasAdam)) - GotoDesk: avoid over-eager matching [\#695](fvwmorg/fvwm3#695) ([ThomasAdam](https://github.com/ThomasAdam)) - update\_fvwm\_monitor: cosmetic change [\#692](fvwmorg/fvwm3#692) ([ThomasAdam](https://github.com/ThomasAdam)) - menuitem: set selectable when not a separator [\#690](fvwmorg/fvwm3#690) ([ThomasAdam](https://github.com/ThomasAdam)) - Windowshade: explicitly set input focus [\#672](fvwmorg/fvwm3#672) ([ThomasAdam](https://github.com/ThomasAdam)) - FvwmPrompt: update core modules [\#665](fvwmorg/fvwm3#665) ([ThomasAdam](https://github.com/ThomasAdam)) - FvwmPrompt: update vendor deps [\#664](fvwmorg/fvwm3#664) ([ThomasAdam](https://github.com/ThomasAdam)) - Fix selectable flag for the Resize window operation menu item [\#656](fvwmorg/fvwm3#656) ([topcat001](https://github.com/topcat001)) - Fix ExitFunction [\#651](fvwmorg/fvwm3#651) ([pghvlaans](https://github.com/pghvlaans)) - DisplayPosition: fix segfault [\#645](fvwmorg/fvwm3#645) ([ThomasAdam](https://github.com/ThomasAdam)) - convert UPDATE\_FVWM\_SCREEN from macro to function [\#644](fvwmorg/fvwm3#644) ([ThomasAdam](https://github.com/ThomasAdam)) - ta/dv logfile [\#640](fvwmorg/fvwm3#640) ([ThomasAdam](https://github.com/ThomasAdam)) - Resize: fix resize bounds [\#638](fvwmorg/fvwm3#638) ([ThomasAdam](https://github.com/ThomasAdam)) - ta/dv2 [\#636](fvwmorg/fvwm3#636) ([ThomasAdam](https://github.com/ThomasAdam)) - ta/dv misc [\#634](fvwmorg/fvwm3#634) ([ThomasAdam](https://github.com/ThomasAdam)) - Reject out of range windows for Move and Resize commands. [\#633](fvwmorg/fvwm3#633) ([ThomasAdam](https://github.com/ThomasAdam)) - FVWMMFL: ignore SIGPIPE [\#632](fvwmorg/fvwm3#632) ([ThomasAdam](https://github.com/ThomasAdam)) - ta/dv ifdev [\#630](fvwmorg/fvwm3#630) ([ThomasAdam](https://github.com/ThomasAdam)) - ta/from dv [\#629](fvwmorg/fvwm3#629) ([ThomasAdam](https://github.com/ThomasAdam)) - DesktopName: don't duplicate entries with same name [\#607](fvwmorg/fvwm3#607) ([ThomasAdam](https://github.com/ThomasAdam)) - Patches from Debian [\#599](fvwmorg/fvwm3#599) ([ThomasAdam](https://github.com/ThomasAdam))
Thanks for reporting your bug here! The following template will help with
giving as much information as possible so that it's easier to diagnose and
fix.
Upfront Information
FvwmEvent monitor_focus event does not get triggered when pointer crosses monitors.
fvwm3 --version
)FVWM3 1.0.4
Linux distribution or BSD name/version
Platform
Linux x86_64
Expected Behaviour
FvwmEvent emits monitor_focus event when needed. This can be checked with a simple Echo function.
Actual Behaviour
None.
N/A
Does Fvwm3 crash?
No.
The text was updated successfully, but these errors were encountered: